Some Bugfixes
This commit is contained in:
@ -12,7 +12,7 @@ namespace Elwig.Dialogs {
|
||||
InitializeComponent();
|
||||
TextLsNr.Text = lsnr;
|
||||
TextMember.Text = name;
|
||||
TextWeight.Text = $"{weight:N0}{Utils.GroupSeparator}kg";
|
||||
TextWeight.Text = $"{weight:N0}{Utils.UnitSeparator}kg";
|
||||
}
|
||||
|
||||
private void ConfirmButton_Click(object sender, RoutedEventArgs evt) {
|
||||
|
@ -26,6 +26,10 @@ namespace Elwig.Models.Dtos {
|
||||
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) {
|
||||
return (await FromDbSet(table, year))
|
||||
.GroupBy(
|
||||
|
@ -125,6 +125,7 @@ namespace Elwig.Windows {
|
||||
if (old != null) _branches[old] = id;
|
||||
branch.ZwstId = id;
|
||||
branch.Name = BranchNameInput.Text;
|
||||
branch.CountryNum = 40;
|
||||
branch.PostalDestId = (BranchOrtInput.SelectedItem as AT_PlzDest)?.Id;
|
||||
branch.Address = BranchAddressInput.Text;
|
||||
branch.PhoneNr = BranchPhoneNrInput.Text;
|
||||
|
@ -52,13 +52,13 @@ namespace Elwig.Windows {
|
||||
|
||||
var year = (SeasonList.SelectedItem as Season)?.Year;
|
||||
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) {
|
||||
mod.ModId = old;
|
||||
}
|
||||
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();
|
||||
|
||||
@ -102,8 +102,9 @@ namespace Elwig.Windows {
|
||||
if (_modList == null || SeasonList.SelectedItem is not Season s) return;
|
||||
_modChanged = true;
|
||||
var idx = (SeasonModifierList.SelectedIndex != -1) ? SeasonModifierList.SelectedIndex + 1 : _modList.Count;
|
||||
var item = Context.CreateProxy<Modifier>();
|
||||
item.Year = s.Year;
|
||||
var item = new Modifier {
|
||||
Year = s.Year
|
||||
};
|
||||
_modList.Insert(idx, item);
|
||||
SeasonModifierList.SelectedIndex = idx;
|
||||
UpdateButtons();
|
||||
|
@ -264,6 +264,8 @@ namespace Elwig.Windows {
|
||||
ClearInputStates();
|
||||
FillInputs(App.Client);
|
||||
LockInputs();
|
||||
|
||||
await HintContextChange();
|
||||
}
|
||||
|
||||
private void FillInputs(ClientParameters p) {
|
||||
|
@ -76,7 +76,7 @@ namespace Elwig.Dialogs {
|
||||
IEnumerable<Member> list = await members.ToListAsync();
|
||||
var data = await DeliveryConfirmationData.ForSeason(Context.DeliveryParts, Year);
|
||||
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
|
||||
}
|
||||
));
|
||||
|
@ -259,8 +259,12 @@ namespace Elwig.Windows {
|
||||
return;
|
||||
CommitButton.IsEnabled = false;
|
||||
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||
var b = new BillingVariant(v.Year, v.AvNr);
|
||||
await b.Commit();
|
||||
try {
|
||||
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;
|
||||
RevertButton.IsEnabled = true;
|
||||
await App.HintContextChange();
|
||||
|
Reference in New Issue
Block a user