Compare commits
	
		
			4 Commits
		
	
	
		
			77cee53f2d
			...
			v0.2.0
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| b2a78907cf | |||
| 7bcf532b26 | |||
| 595f9a049c | |||
| 80ed90941d | 
| @@ -26,7 +26,7 @@ namespace Elwig.Dialogs { | |||||||
|         } |         } | ||||||
|  |  | ||||||
|         private void UpdateButtons() { |         private void UpdateButtons() { | ||||||
|             ConfirmButton.IsEnabled = WeightInput.Text.Length > 0 && ReasonInput.Text.Trim().Length > 0; |             ConfirmButton.IsEnabled = WeightInput.Text.Length > 0; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         private void WeightInput_TextChanged(object sender, TextChangedEventArgs evt) { |         private void WeightInput_TextChanged(object sender, TextChangedEventArgs evt) { | ||||||
|   | |||||||
| @@ -7,7 +7,7 @@ | |||||||
|     <UseWPF>true</UseWPF> |     <UseWPF>true</UseWPF> | ||||||
|     <PreserveCompilationContext>true</PreserveCompilationContext> |     <PreserveCompilationContext>true</PreserveCompilationContext> | ||||||
|     <ApplicationIcon>elwig.ico</ApplicationIcon> |     <ApplicationIcon>elwig.ico</ApplicationIcon> | ||||||
|     <Version>0.1.0</Version> |     <Version>0.2.0</Version> | ||||||
|     <SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages> |     <SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|  |  | ||||||
|   | |||||||
| @@ -179,8 +179,8 @@ namespace Elwig.Windows { | |||||||
|             bool ch = HasChanged, v = IsValid; |             bool ch = HasChanged, v = IsValid; | ||||||
|             ResetButton.IsEnabled = ch; |             ResetButton.IsEnabled = ch; | ||||||
|             SaveButton.IsEnabled = v && ch; |             SaveButton.IsEnabled = v && ch; | ||||||
|             FinishButton.IsEnabled = v || !ch; |             FinishButton.IsEnabled = v && ch; | ||||||
|             NewDeliveryPartButton.IsEnabled = v; |             NewDeliveryPartButton.IsEnabled = v && ch; | ||||||
|             CancelCreatingButton.IsEnabled = DeliveryList.SelectedItem == null || DeliveryPartList.SelectedItem == null; |             CancelCreatingButton.IsEnabled = DeliveryList.SelectedItem == null || DeliveryPartList.SelectedItem == null; | ||||||
|         } |         } | ||||||
|  |  | ||||||
| @@ -331,7 +331,7 @@ namespace Elwig.Windows { | |||||||
|                     .ToList(); |                     .ToList(); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|             ControlUtils.RenewItemsSource(DeliveryList, deliveries, d => ((d as Delivery)?.Year, (d as Delivery)?.DId), DeliveryList_SelectionChanged, ControlUtils.RenewSourceDefault.IfOnly, !updateSort); |             ControlUtils.RenewItemsSource(DeliveryList, deliveries, d => ((d as Delivery)?.Year, (d as Delivery)?.DId), DeliveryList_SelectionChanged, IsCreating ? ControlUtils.RenewSourceDefault.None : ControlUtils.RenewSourceDefault.IfOnly, !updateSort); | ||||||
|  |  | ||||||
|             var members = deliveries.Select(d => d.Member).DistinctBy(m => m.MgNr).ToList(); |             var members = deliveries.Select(d => d.Member).DistinctBy(m => m.MgNr).ToList(); | ||||||
|             StatusMembers.Text = $"Mitglieder: {members.Count}" + (members.Count > 0 && members.Count <= 4 ? $" ({string.Join(", ", members.Select(m => m.AdministrativeName))})" : ""); |             StatusMembers.Text = $"Mitglieder: {members.Count}" + (members.Count > 0 && members.Count <= 4 ? $" ({string.Join(", ", members.Select(m => m.AdministrativeName))})" : ""); | ||||||
| @@ -423,10 +423,11 @@ namespace Elwig.Windows { | |||||||
|                 Menu_Export_Bki.Items.Add(i); |                 Menu_Export_Bki.Items.Add(i); | ||||||
|             } |             } | ||||||
|  |  | ||||||
|  |             // FIXME on "only one" delivery, RenewContext doees not work | ||||||
|             await RefreshDeliveryList(); |             await RefreshDeliveryList(); | ||||||
|             var d = DeliveryList.SelectedItem as Delivery; |             var d = DeliveryList.SelectedItem as Delivery; | ||||||
|             var y = d?.Year ?? Utils.CurrentLastSeason; |             var y = d?.Year ?? Utils.CurrentLastSeason; | ||||||
|             ControlUtils.RenewItemsSource(MemberInput, await Context.Members.Where(m => m.IsActive || !IsReceipt).OrderBy(m => m.FamilyName).ThenBy(m => m.GivenName).ToListAsync(), i => (i as Member)?.MgNr); |             ControlUtils.RenewItemsSource(MemberInput, await Context.Members.Where(m => m.IsActive || !IsCreating).OrderBy(m => m.FamilyName).ThenBy(m => m.GivenName).ToListAsync(), i => (i as Member)?.MgNr); | ||||||
|             ControlUtils.RenewItemsSource(BranchInput, await Context.Branches.OrderBy(b => b.Name).ToListAsync(), i => (i as Branch)?.ZwstId); |             ControlUtils.RenewItemsSource(BranchInput, await Context.Branches.OrderBy(b => b.Name).ToListAsync(), i => (i as Branch)?.ZwstId); | ||||||
|             ControlUtils.RenewItemsSource(WineVarietyInput, await Context.WineVarieties.OrderBy(v => v.Name).ToListAsync(), i => (i as WineVar)?.SortId); |             ControlUtils.RenewItemsSource(WineVarietyInput, await Context.WineVarieties.OrderBy(v => v.Name).ToListAsync(), i => (i as WineVar)?.SortId); | ||||||
|             ControlUtils.RenewItemsSource(AttributesInput, await Context.WineAttributes.Where(a => IsCreating || a.IsActive).OrderBy(a => a.Name).ToListAsync(), i => (i as WineAttr)?.AttrId); |             ControlUtils.RenewItemsSource(AttributesInput, await Context.WineAttributes.Where(a => IsCreating || a.IsActive).OrderBy(a => a.Name).ToListAsync(), i => (i as WineAttr)?.AttrId); | ||||||
| @@ -729,7 +730,7 @@ namespace Elwig.Windows { | |||||||
|             MemberInput.SelectedItem = valid ? Context.Members.Find(int.Parse(MgNrInput.Text)) : null; |             MemberInput.SelectedItem = valid ? Context.Members.Find(int.Parse(MgNrInput.Text)) : null; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         private void MemberInput_SelectionChanged(object sender, SelectionChangedEventArgs evt) { |         private void MemberInput_SelectionChanged(object? sender, SelectionChangedEventArgs? evt) { | ||||||
|             var m = MemberInput.SelectedItem as Member; |             var m = MemberInput.SelectedItem as Member; | ||||||
|             if (m != null) MgNrInput.Text = m.MgNr.ToString(); |             if (m != null) MgNrInput.Text = m.MgNr.ToString(); | ||||||
|             MemberAddressField.Text = m?.FullAddress; |             MemberAddressField.Text = m?.FullAddress; | ||||||
| @@ -753,6 +754,7 @@ namespace Elwig.Windows { | |||||||
|             NewDeliveryPartButton.Cursor = null; |             NewDeliveryPartButton.Cursor = null; | ||||||
|             DeliveryList.SelectedItem = p?.Delivery; |             DeliveryList.SelectedItem = p?.Delivery; | ||||||
|             DeliveryPartList.SelectedItem = null; |             DeliveryPartList.SelectedItem = null; | ||||||
|  |             RefreshInputs(); | ||||||
|             InitialInputs(); |             InitialInputs(); | ||||||
|         } |         } | ||||||
|  |  | ||||||
| @@ -768,12 +770,13 @@ namespace Elwig.Windows { | |||||||
|                 Mouse.OverrideCursor = Cursors.Wait; |                 Mouse.OverrideCursor = Cursors.Wait; | ||||||
|                 using var doc = new DeliveryNote(p.Delivery, Context); |                 using var doc = new DeliveryNote(p.Delivery, Context); | ||||||
|                 await doc.Generate(); |                 await doc.Generate(); | ||||||
|                 Mouse.OverrideCursor = Cursors.Wait; |                 Mouse.OverrideCursor = null; | ||||||
|                 doc.Show(); |                 doc.Show(); | ||||||
|                 //await doc.Print(2); |                 //await doc.Print(2); | ||||||
|             } |             } | ||||||
|             FinishButton.Cursor = null; |             FinishButton.Cursor = null; | ||||||
|             DeliveryList.SelectedItem = null; |             DeliveryList.SelectedItem = null; | ||||||
|  |             RefreshInputs(); | ||||||
|             InitInputs(); |             InitInputs(); | ||||||
|         } |         } | ||||||
|  |  | ||||||
| @@ -1099,8 +1102,8 @@ namespace Elwig.Windows { | |||||||
|         } |         } | ||||||
|  |  | ||||||
|         private void ShowFinishNewPartDeliveryCancelButtons() { |         private void ShowFinishNewPartDeliveryCancelButtons() { | ||||||
|             FinishButton.IsEnabled = IsCreating && IsValid; |             FinishButton.IsEnabled = false; | ||||||
|             NewDeliveryPartButton.IsEnabled = IsCreating && IsValid; |             NewDeliveryPartButton.IsEnabled = false; | ||||||
|             CancelCreatingButton.IsEnabled = true; |             CancelCreatingButton.IsEnabled = true; | ||||||
|             FinishButton.Visibility = Visibility.Visible; |             FinishButton.Visibility = Visibility.Visible; | ||||||
|             NewDeliveryPartButton.Visibility = Visibility.Visible; |             NewDeliveryPartButton.Visibility = Visibility.Visible; | ||||||
|   | |||||||
| @@ -1,12 +0,0 @@ | |||||||
| <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |  | ||||||
| 	<Fragment> |  | ||||||
| 		<ComponentGroup Id="DocumentTemplateComponents" Directory="ConfigFolderResources"> |  | ||||||
| 			<Component> |  | ||||||
| 				<File Source="$(TargetDir)\paged.polyfill.js" /> |  | ||||||
| 			</Component> |  | ||||||
| 			<Component> |  | ||||||
| 				<File Source="$(var.ElwigProjectDir)\Documents\style.css" /> |  | ||||||
| 			</Component> |  | ||||||
| 		</ComponentGroup> |  | ||||||
| 	</Fragment> |  | ||||||
| </Wix> |  | ||||||
| @@ -23,10 +23,10 @@ | |||||||
|     --> |     --> | ||||||
| 	<xsl:key | 	<xsl:key | ||||||
|         name="FileToRemove" |         name="FileToRemove" | ||||||
|         match="wix:Component[ substring( wix:File/@Source, string-length( wix:File/@Source ) - 6 ) != '.cshtml' ]" |         match="wix:Component[ substring( wix:File/@Source, string-length( wix:File/@Source ) - 2 ) = '.cs' ]" | ||||||
|         use="@Id" |         use="@Id" | ||||||
|     /> |     /> | ||||||
| 	<!-- Get the last 4 characters of a string using `substring( s, len(s) - 3 )`, it uses -3 and not -4 because XSLT uses 1-based indexes, not 0-based indexes. --> | 	<!-- Get the last 3 characters of a string using `substring( s, len(s) - 2 )`, it uses -2 and not -3 because XSLT uses 1-based indexes, not 0-based indexes. --> | ||||||
| 
 | 
 | ||||||
| 	<!-- By default, copy all elements and nodes into the output... --> | 	<!-- By default, copy all elements and nodes into the output... --> | ||||||
| 	<xsl:template match="@*|node()"> | 	<xsl:template match="@*|node()"> | ||||||
| @@ -25,14 +25,13 @@ | |||||||
|     </Task> |     </Task> | ||||||
|   </UsingTask> |   </UsingTask> | ||||||
|   <Target Name="CustomBeforeBuild" BeforeTargets="BeforeBuild"> |   <Target Name="CustomBeforeBuild" BeforeTargets="BeforeBuild"> | ||||||
|     <Exec Command="curl -s -L "https://unpkg.com/pagedjs/dist/paged.polyfill.js" -o "$(TargetDir)paged.polyfill.js"" /> |  | ||||||
|     <Exec Command="curl -s "http://www.columbia.edu/~em36/PDFtoPrinter.exe" -z "$(TargetDir)PDFtoPrinter.exe" -o "$(TargetDir)PDFtoPrinter.exe"" /> |     <Exec Command="curl -s "http://www.columbia.edu/~em36/PDFtoPrinter.exe" -z "$(TargetDir)PDFtoPrinter.exe" -o "$(TargetDir)PDFtoPrinter.exe"" /> | ||||||
|     <Exec Command="dotnet publish "$(SolutionDir)Elwig\Elwig.csproj" "/p:PublishProfile=$(SolutionDir)\Elwig\Properties\PublishProfiles\FolderProfile.pubxml"" /> |     <Exec Command="dotnet publish "$(SolutionDir)Elwig\Elwig.csproj" "/p:PublishProfile=$(SolutionDir)\Elwig\Properties\PublishProfiles\FolderProfile.pubxml"" /> | ||||||
|     <GetFileVersion AssemblyPath="..\Elwig\bin\Publish\Elwig.exe"> |     <GetFileVersion AssemblyPath="..\Elwig\bin\Publish\Elwig.exe"> | ||||||
|       <Output TaskParameter="Version" PropertyName="ElwigFileVersion" /> |       <Output TaskParameter="Version" PropertyName="ElwigFileVersion" /> | ||||||
|     </GetFileVersion> |     </GetFileVersion> | ||||||
|     <PropertyGroup> |     <PropertyGroup> | ||||||
|       <DefineConstants>ProductVersion=$(ElwigFileVersion);BuildPath=..\Elwig\bin\Publish;DocumentTemplatesPath=..\Elwig\Documents;ElwigProjectDir=..\Elwig</DefineConstants> |       <DefineConstants>ProductVersion=$(ElwigFileVersion);BuildPath=..\Elwig\bin\Publish;DocumentPath=..\Elwig\Documents;ElwigProjectDir=..\Elwig</DefineConstants> | ||||||
|     </PropertyGroup> |     </PropertyGroup> | ||||||
|   </Target> |   </Target> | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
| @@ -50,13 +49,13 @@ | |||||||
|       <ComponentGroupName>DocumentTemplates</ComponentGroupName> |       <ComponentGroupName>DocumentTemplates</ComponentGroupName> | ||||||
|       <DirectoryRefId>ConfigFolderResources</DirectoryRefId> |       <DirectoryRefId>ConfigFolderResources</DirectoryRefId> | ||||||
|       <SuppressRootDirectory>true</SuppressRootDirectory> |       <SuppressRootDirectory>true</SuppressRootDirectory> | ||||||
|       <PreprocessorVariable>DocumentTemplatesPath</PreprocessorVariable> |       <PreprocessorVariable>DocumentPath</PreprocessorVariable> | ||||||
|       <Transforms>DocumentTemplatesTransform.xslt</Transforms> |       <Transforms>DocumentTransform.xslt</Transforms> | ||||||
|     </HarvestDirectory> |     </HarvestDirectory> | ||||||
|     <BindPath BindName="DocumentTemplateBindPath" Include="../Elwig/Documents" /> |     <BindPath BindName="DocumentTemplateBindPath" Include="../Elwig/Documents" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <None Include="DocumentTemplatesTransform.xslt" /> |     <None Include="DocumentTransform.xslt" /> | ||||||
|     <None Include="BuildFilesTransform.xslt" /> |     <None Include="BuildFilesTransform.xslt" /> | ||||||
|     <None Include="Files\config.ini" /> |     <None Include="Files\config.ini" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|   | |||||||
| @@ -11,7 +11,6 @@ | |||||||
|       <ComponentGroupRef Id="MainComponents"/> |       <ComponentGroupRef Id="MainComponents"/> | ||||||
|       <ComponentGroupRef Id="BuildFiles"/> |       <ComponentGroupRef Id="BuildFiles"/> | ||||||
|       <ComponentGroupRef Id="DocumentTemplates"/> |       <ComponentGroupRef Id="DocumentTemplates"/> | ||||||
|       <ComponentGroupRef Id="DocumentTemplateComponents"/> |  | ||||||
|     </Feature> |     </Feature> | ||||||
|   </Package> |   </Package> | ||||||
| </Wix> | </Wix> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user