Compare commits
7 Commits
8502afdc9a
...
v0.6.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 42bf01656e | |||
| 51293baaae | |||
| 1d1398a9cd | |||
| 7d199282d0 | |||
| b56a5ed5c6 | |||
| 201b63c2f1 | |||
| b2bd0c9a21 |
+11
-6
@@ -65,22 +65,27 @@ namespace Elwig {
|
|||||||
MainDispatcher = Dispatcher;
|
MainDispatcher = Dispatcher;
|
||||||
Scales = Array.Empty<IScale>();
|
Scales = Array.Empty<IScale>();
|
||||||
CurrentApp = this;
|
CurrentApp = this;
|
||||||
|
OverrideCulture();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async void OnStartup(StartupEventArgs evt) {
|
private static void OverrideCulture() {
|
||||||
var locale = new CultureInfo("de-AT");
|
var locale = new CultureInfo("de-AT", false);
|
||||||
locale.NumberFormat.CurrencyGroupSeparator = "\u202f";
|
locale.NumberFormat.CurrencyGroupSeparator = Utils.GroupSeparator;
|
||||||
locale.NumberFormat.NumberGroupSeparator = "\u202f";
|
locale.NumberFormat.NumberGroupSeparator = Utils.GroupSeparator;
|
||||||
locale.NumberFormat.PercentGroupSeparator = "\u202f";
|
locale.NumberFormat.PercentGroupSeparator = Utils.GroupSeparator;
|
||||||
|
CultureInfo.CurrentCulture = locale;
|
||||||
|
CultureInfo.CurrentUICulture = locale;
|
||||||
Thread.CurrentThread.CurrentCulture = locale;
|
Thread.CurrentThread.CurrentCulture = locale;
|
||||||
Thread.CurrentThread.CurrentUICulture = locale;
|
Thread.CurrentThread.CurrentUICulture = locale;
|
||||||
CultureInfo.DefaultThreadCurrentCulture = locale;
|
CultureInfo.DefaultThreadCurrentCulture = locale;
|
||||||
CultureInfo.DefaultThreadCurrentUICulture = locale;
|
CultureInfo.DefaultThreadCurrentUICulture = locale;
|
||||||
FrameworkElement.LanguageProperty.OverrideMetadata(
|
FrameworkElement.LanguageProperty.OverrideMetadata(
|
||||||
typeof(FrameworkElement),
|
typeof(FrameworkElement),
|
||||||
new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag))
|
new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.Name))
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override async void OnStartup(StartupEventArgs evt) {
|
||||||
Version = typeof(App).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion.Split("+")[0] ?? "0.0.0";
|
Version = typeof(App).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion.Split("+")[0] ?? "0.0.0";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace Elwig.Dialogs {
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
TextLsNr.Text = lsnr;
|
TextLsNr.Text = lsnr;
|
||||||
TextMember.Text = name;
|
TextMember.Text = name;
|
||||||
TextWeight.Text = $"{weight:N0}\u202fkg";
|
TextWeight.Text = $"{weight:N0}{Utils.UnitSeparator}kg";
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ConfirmButton_Click(object sender, RoutedEventArgs evt) {
|
private void ConfirmButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Elwig.Helpers;
|
using Elwig.Helpers;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
@@ -14,7 +13,7 @@ namespace Elwig.Dialogs {
|
|||||||
|
|
||||||
private void ConfirmButton_Click(object sender, RoutedEventArgs evt) {
|
private void ConfirmButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
DialogResult = true;
|
DialogResult = true;
|
||||||
Price = double.Parse(PriceInput.Text.Replace("\u202f", ""));
|
Price = double.Parse(PriceInput.Text.Replace(Utils.GroupSeparator, ""));
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ namespace Elwig.Helpers {
|
|||||||
public void Read() {
|
public void Read() {
|
||||||
var config = new ConfigurationBuilder().AddIniFile(FileName).Build();
|
var config = new ConfigurationBuilder().AddIniFile(FileName).Build();
|
||||||
|
|
||||||
DatabaseFile = Utils.GetAbsolutePath(config["database:file"] ?? "database.sqlite3", App.DataPath);
|
DatabaseFile = Path.Combine(App.DataPath, config["database:file"] ?? "database.sqlite3");
|
||||||
var log = config["database:log"];
|
var log = config["database:log"];
|
||||||
DatabaseLog = log != null ? Utils.GetAbsolutePath(log, App.DataPath) : null;
|
DatabaseLog = log != null ? Path.Combine(App.DataPath, log) : null;
|
||||||
Branch = config["general:branch"];
|
Branch = config["general:branch"];
|
||||||
Debug = trueValues.Contains(config["general:debug"]?.ToLower());
|
Debug = trueValues.Contains(config["general:debug"]?.ToLower());
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ namespace Elwig.Helpers {
|
|||||||
Scales = ScaleList;
|
Scales = ScaleList;
|
||||||
foreach (var s in scales) {
|
foreach (var s in scales) {
|
||||||
string? scaleLog = config[$"scale.{s}:log"];
|
string? scaleLog = config[$"scale.{s}:log"];
|
||||||
if (scaleLog != null) scaleLog = Utils.GetAbsolutePath(scaleLog, App.DataPath);
|
if (scaleLog != null) scaleLog = Path.Combine(App.DataPath, scaleLog);
|
||||||
ScaleList.Add([
|
ScaleList.Add([
|
||||||
s, config[$"scale.{s}:type"], config[$"scale.{s}:model"], config[$"scale.{s}:connection"],
|
s, config[$"scale.{s}:type"], config[$"scale.{s}:model"], config[$"scale.{s}:connection"],
|
||||||
config[$"scale.{s}:empty"], config[$"scale.{s}:filling"], config[$"scale.{s}:limit"], scaleLog
|
config[$"scale.{s}:empty"], config[$"scale.{s}:filling"], config[$"scale.{s}:limit"], scaleLog
|
||||||
|
|||||||
@@ -48,6 +48,9 @@ namespace Elwig.Helpers {
|
|||||||
[GeneratedRegex(@"^(.*?) +([0-9].*)$", RegexOptions.Compiled)]
|
[GeneratedRegex(@"^(.*?) +([0-9].*)$", RegexOptions.Compiled)]
|
||||||
private static partial Regex GeneratedAddressRegex();
|
private static partial Regex GeneratedAddressRegex();
|
||||||
|
|
||||||
|
public static readonly string GroupSeparator = "\u202F";
|
||||||
|
public static readonly string UnitSeparator = "\u00A0";
|
||||||
|
|
||||||
public static readonly KeyValuePair<string, string>[] PhoneNrTypes = [
|
public static readonly KeyValuePair<string, string>[] PhoneNrTypes = [
|
||||||
new("landline", "Tel.-Nr. (Festnetz)"),
|
new("landline", "Tel.-Nr. (Festnetz)"),
|
||||||
new("mobile", "Tel.-Nr. (mobil)"),
|
new("mobile", "Tel.-Nr. (mobil)"),
|
||||||
@@ -356,9 +359,5 @@ namespace Elwig.Helpers {
|
|||||||
}
|
}
|
||||||
return output.OrderByDescending(l => l.Count());
|
return output.OrderByDescending(l => l.Count());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetAbsolutePath(string path, string basePath) {
|
|
||||||
return (path.Length > 1 && (path[1] == ':' || path[0] == '/' || path[0] == '\\')) ? Path.Combine(basePath, path) : path;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,10 @@ namespace Elwig.Models.Dtos {
|
|||||||
MgNr = m.MgNr;
|
MgNr = m.MgNr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static DeliveryConfirmationData CreateEmpty(int year, Member m) {
|
||||||
|
return new([], year, m);
|
||||||
|
}
|
||||||
|
|
||||||
public static async Task<IDictionary<int, DeliveryConfirmationData>> ForSeason(DbSet<DeliveryPart> table, int year) {
|
public static async Task<IDictionary<int, DeliveryConfirmationData>> ForSeason(DbSet<DeliveryPart> table, int year) {
|
||||||
return (await FromDbSet(table, year))
|
return (await FromDbSet(table, year))
|
||||||
.GroupBy(
|
.GroupBy(
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
|||||||
<PublishDir>bin\Publish</PublishDir>
|
<PublishDir>bin\Publish</PublishDir>
|
||||||
<PublishProtocol>FileSystem</PublishProtocol>
|
<PublishProtocol>FileSystem</PublishProtocol>
|
||||||
<_TargetId>Folder</_TargetId>
|
<_TargetId>Folder</_TargetId>
|
||||||
<TargetFramework>net7.0-windows</TargetFramework>
|
<TargetFramework>net8.0-windows</TargetFramework>
|
||||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||||
<SelfContained>true</SelfContained>
|
<SelfContained>true</SelfContained>
|
||||||
<PublishSingleFile>false</PublishSingleFile>
|
<PublishSingleFile>false</PublishSingleFile>
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ namespace Elwig.Windows {
|
|||||||
if (old != null) _branches[old] = id;
|
if (old != null) _branches[old] = id;
|
||||||
branch.ZwstId = id;
|
branch.ZwstId = id;
|
||||||
branch.Name = BranchNameInput.Text;
|
branch.Name = BranchNameInput.Text;
|
||||||
|
branch.CountryNum = 40;
|
||||||
branch.PostalDestId = (BranchOrtInput.SelectedItem as AT_PlzDest)?.Id;
|
branch.PostalDestId = (BranchOrtInput.SelectedItem as AT_PlzDest)?.Id;
|
||||||
branch.Address = BranchAddressInput.Text;
|
branch.Address = BranchAddressInput.Text;
|
||||||
branch.PhoneNr = BranchPhoneNrInput.Text;
|
branch.PhoneNr = BranchPhoneNrInput.Text;
|
||||||
|
|||||||
@@ -52,13 +52,13 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
var year = (SeasonList.SelectedItem as Season)?.Year;
|
var year = (SeasonList.SelectedItem as Season)?.Year;
|
||||||
foreach (var (modid, _) in _mods.Where(m => m.Value == null)) {
|
foreach (var (modid, _) in _mods.Where(m => m.Value == null)) {
|
||||||
Context.Remove(Context.Modifiers.Find(new object?[] { year, modid }));
|
Context.Remove(Context.Modifiers.Find(year, modid));
|
||||||
}
|
}
|
||||||
foreach (var (mod, old) in _modIds) {
|
foreach (var (mod, old) in _modIds) {
|
||||||
mod.ModId = old;
|
mod.ModId = old;
|
||||||
}
|
}
|
||||||
foreach (var (old, modid) in _mods.Where(m => m.Value != null)) {
|
foreach (var (old, modid) in _mods.Where(m => m.Value != null)) {
|
||||||
Context.Update(Context.Modifiers.Find(new object?[] { year, old }));
|
Context.Update(Context.Modifiers.Find(year, old));
|
||||||
}
|
}
|
||||||
await Context.SaveChangesAsync();
|
await Context.SaveChangesAsync();
|
||||||
|
|
||||||
@@ -102,8 +102,9 @@ namespace Elwig.Windows {
|
|||||||
if (_modList == null || SeasonList.SelectedItem is not Season s) return;
|
if (_modList == null || SeasonList.SelectedItem is not Season s) return;
|
||||||
_modChanged = true;
|
_modChanged = true;
|
||||||
var idx = (SeasonModifierList.SelectedIndex != -1) ? SeasonModifierList.SelectedIndex + 1 : _modList.Count;
|
var idx = (SeasonModifierList.SelectedIndex != -1) ? SeasonModifierList.SelectedIndex + 1 : _modList.Count;
|
||||||
var item = Context.CreateProxy<Modifier>();
|
var item = new Modifier {
|
||||||
item.Year = s.Year;
|
Year = s.Year
|
||||||
|
};
|
||||||
_modList.Insert(idx, item);
|
_modList.Insert(idx, item);
|
||||||
SeasonModifierList.SelectedIndex = idx;
|
SeasonModifierList.SelectedIndex = idx;
|
||||||
UpdateButtons();
|
UpdateButtons();
|
||||||
|
|||||||
@@ -264,6 +264,8 @@ namespace Elwig.Windows {
|
|||||||
ClearInputStates();
|
ClearInputStates();
|
||||||
FillInputs(App.Client);
|
FillInputs(App.Client);
|
||||||
LockInputs();
|
LockInputs();
|
||||||
|
|
||||||
|
await HintContextChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FillInputs(ClientParameters p) {
|
private void FillInputs(ClientParameters p) {
|
||||||
|
|||||||
@@ -889,7 +889,7 @@ namespace Elwig.Windows {
|
|||||||
p.Acid = (AcidInput.Text == "") ? null : double.Parse(AcidInput.Text);
|
p.Acid = (AcidInput.Text == "") ? null : double.Parse(AcidInput.Text);
|
||||||
p.Comment = (PartCommentInput.Text == "") ? null : PartCommentInput.Text;
|
p.Comment = (PartCommentInput.Text == "") ? null : PartCommentInput.Text;
|
||||||
|
|
||||||
p.Weight = int.Parse(WeightInput.Text.Replace("\u202f", ""));
|
p.Weight = int.Parse(WeightInput.Text.Replace(Utils.GroupSeparator, ""));
|
||||||
p.ManualWeighing = ManualWeighingInput.IsChecked ?? false;
|
p.ManualWeighing = ManualWeighingInput.IsChecked ?? false;
|
||||||
p.ScaleId = ScaleId;
|
p.ScaleId = ScaleId;
|
||||||
p.WeighingId = WeighingId;
|
p.WeighingId = WeighingId;
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace Elwig.Dialogs {
|
|||||||
IEnumerable<Member> list = await members.ToListAsync();
|
IEnumerable<Member> list = await members.ToListAsync();
|
||||||
var data = await DeliveryConfirmationData.ForSeason(Context.DeliveryParts, Year);
|
var data = await DeliveryConfirmationData.ForSeason(Context.DeliveryParts, Year);
|
||||||
using var doc = Document.Merge(list.Select(m =>
|
using var doc = Document.Merge(list.Select(m =>
|
||||||
new DeliveryConfirmation(Context, Year, m, data[m.MgNr]) {
|
new DeliveryConfirmation(Context, Year, m, data.TryGetValue(m.MgNr, out var d) ? d : DeliveryConfirmationData.CreateEmpty(Year, m)) {
|
||||||
//DoubleSided = true
|
//DoubleSided = true
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -259,8 +259,12 @@ namespace Elwig.Windows {
|
|||||||
return;
|
return;
|
||||||
CommitButton.IsEnabled = false;
|
CommitButton.IsEnabled = false;
|
||||||
Mouse.OverrideCursor = Cursors.AppStarting;
|
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||||
var b = new BillingVariant(v.Year, v.AvNr);
|
try {
|
||||||
await b.Commit();
|
var b = new BillingVariant(v.Year, v.AvNr);
|
||||||
|
await b.Commit();
|
||||||
|
} catch (Exception exc) {
|
||||||
|
MessageBox.Show(exc.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
Mouse.OverrideCursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
RevertButton.IsEnabled = true;
|
RevertButton.IsEnabled = true;
|
||||||
await App.HintContextChange();
|
await App.HintContextChange();
|
||||||
|
|||||||
@@ -60,6 +60,6 @@
|
|||||||
<None Include="Files\config.ini" />
|
<None Include="Files\config.ini" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="WixToolset.Heat" Version="4.0.1" />
|
<PackageReference Include="WixToolset.Heat" Version="4.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
+3
-3
@@ -13,7 +13,7 @@
|
|||||||
</Target>
|
</Target>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Installer\Installer.wixproj" />
|
<ProjectReference Include="..\Installer\Installer.wixproj" />
|
||||||
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.1" />
|
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.3" />
|
||||||
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.1" />
|
<PackageReference Include="WixToolset.Util.wixext" Version="4.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
+11
-5
@@ -18,11 +18,17 @@
|
|||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
<PackageReference Include="NUnit" Version="4.0.1" />
|
||||||
<PackageReference Include="NUnit3TestAdapter" Version="4.3.0" />
|
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
|
||||||
<PackageReference Include="NUnit.Analyzers" Version="3.5.0" />
|
<PackageReference Include="NUnit.Analyzers" Version="3.10.0">
|
||||||
<PackageReference Include="coverlet.collector" Version="3.1.2" />
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
|
<PackageReference Include="coverlet.collector" Version="6.0.0">
|
||||||
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user