Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b1075d1e69 | |||
| cc018ded10 | |||
| 0aefab5d63 |
@@ -120,8 +120,8 @@ namespace Elwig.Documents {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (i == p.Buckets.Length - 1) {
|
if (i == p.Buckets.Length - 1) {
|
||||||
sub.AddCell(NewTd($"{p.Weight:N0}"));
|
sub.AddCell(NewTd($"{p.Weight:N0}", right: true));
|
||||||
sub.AddCell(NewTd(p.IsNetWeight ? "\u2611" : "\u2610", 7, center: true).SetFont(SF).SetPadding(0));
|
sub.AddCell(NewTd(p.IsNetWeight ? "\u2611" : "\u2610", 7, right: true).SetFont(SF).SetPadding(0));
|
||||||
} else {
|
} else {
|
||||||
sub.AddCell(NewCell(colspan: 2));
|
sub.AddCell(NewCell(colspan: 2));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -297,7 +297,7 @@ namespace Elwig.Documents {
|
|||||||
|
|
||||||
protected Cell NewTh(string? text, float fontSize = 8, int rowspan = 1, int colspan = 1, bool left = false, bool rotated = false) {
|
protected Cell NewTh(string? text, float fontSize = 8, int rowspan = 1, int colspan = 1, bool left = false, bool rotated = false) {
|
||||||
var p = new KernedParagraph(text ?? "", fontSize);
|
var p = new KernedParagraph(text ?? "", fontSize);
|
||||||
if (rotated) p.SetRotationAngle(rotated ? 0.5 * Math.PI : 0);
|
if (rotated) p.SetRotationAngle(0.5 * Math.PI);
|
||||||
var cell = NewCell(p, rowspan: rowspan, colspan: colspan)
|
var cell = NewCell(p, rowspan: rowspan, colspan: colspan)
|
||||||
.SetTextAlignment(left ? TextAlignment.LEFT : TextAlignment.CENTER)
|
.SetTextAlignment(left ? TextAlignment.LEFT : TextAlignment.CENTER)
|
||||||
.SetVerticalAlignment(VerticalAlignment.MIDDLE)
|
.SetVerticalAlignment(VerticalAlignment.MIDDLE)
|
||||||
|
|||||||
@@ -287,8 +287,7 @@ namespace Elwig.Windows {
|
|||||||
LockInputs();
|
LockInputs();
|
||||||
UnlockSearchInputs();
|
UnlockSearchInputs();
|
||||||
FinishInputFilling();
|
FinishInputFilling();
|
||||||
await RefreshList();
|
await EnsureContextRenewed();
|
||||||
RefreshInputs();
|
|
||||||
Mouse.OverrideCursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
ViewModel.SearchQuery = "";
|
ViewModel.SearchQuery = "";
|
||||||
ControlUtils.SelectItem(AreaCommitmentList, AreaCommitmentList.ItemsSource.Cast<AreaCom>().Where(a => a.FbNr == fbnr).FirstOrDefault());
|
ControlUtils.SelectItem(AreaCommitmentList, AreaCommitmentList.ItemsSource.Cast<AreaCom>().Where(a => a.FbNr == fbnr).FirstOrDefault());
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Elwig.Windows {
|
|||||||
set {
|
set {
|
||||||
_lockContext = value;
|
_lockContext = value;
|
||||||
if (!_lockContext && _renewPending) {
|
if (!_lockContext && _renewPending) {
|
||||||
Dispatcher.BeginInvoke(async () => await RenewContext());
|
Dispatcher.BeginInvoke(async () => await EnsureContextRenewed());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ namespace Elwig.Windows {
|
|||||||
public async Task HintContextChange() {
|
public async Task HintContextChange() {
|
||||||
_renewPending = true;
|
_renewPending = true;
|
||||||
if (LockContext) return;
|
if (LockContext) return;
|
||||||
await RenewContext();
|
await EnsureContextRenewed();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async void OnLoaded(object? sender, RoutedEventArgs? evt) {
|
protected async void OnLoaded(object? sender, RoutedEventArgs? evt) {
|
||||||
@@ -44,7 +44,7 @@ namespace Elwig.Windows {
|
|||||||
await OnRenewContext(ctx);
|
await OnRenewContext(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async Task RenewContext() {
|
protected async Task EnsureContextRenewed() {
|
||||||
if (!_renewPending) return;
|
if (!_renewPending) return;
|
||||||
using var ctx = new AppDbContext();
|
using var ctx = new AppDbContext();
|
||||||
await OnRenewContext(ctx);
|
await OnRenewContext(ctx);
|
||||||
|
|||||||
@@ -285,17 +285,17 @@ namespace Elwig.Windows {
|
|||||||
await ViewModel.GenerateDeliveryDataList(DeliveryService.ExportSubject.FromFilters, ExportMode.SaveList);
|
await ViewModel.GenerateDeliveryDataList(DeliveryService.ExportSubject.FromFilters, ExportMode.SaveList);
|
||||||
|
|
||||||
private async void Menu_BulkAction_SetAttribute_Click(object sender, RoutedEventArgs evt) {
|
private async void Menu_BulkAction_SetAttribute_Click(object sender, RoutedEventArgs evt) {
|
||||||
if (sender is not MenuItem item) return;
|
if (IsEditing || IsCreating || sender is not MenuItem item) return;
|
||||||
await ViewModel.BulkSetAttribute(item.Header as string);
|
await ViewModel.BulkSetAttribute(item.Header as string);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void Menu_BulkAction_AddModifier_Click(object sender, RoutedEventArgs evt) {
|
private async void Menu_BulkAction_AddModifier_Click(object sender, RoutedEventArgs evt) {
|
||||||
if (sender is not MenuItem item || item.Header is not string name) return;
|
if (IsEditing || IsCreating || sender is not MenuItem item || item.Header is not string name) return;
|
||||||
await ViewModel.BulkAddModifier(name);
|
await ViewModel.BulkAddModifier(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void Menu_BulkAction_RemoveModifier_Click(object sender, RoutedEventArgs evt) {
|
private async void Menu_BulkAction_RemoveModifier_Click(object sender, RoutedEventArgs evt) {
|
||||||
if (sender is not MenuItem item || item.Header is not string name) return;
|
if (IsEditing || IsCreating || sender is not MenuItem item || item.Header is not string name) return;
|
||||||
await ViewModel.BulkRemoveModifier(name);
|
await ViewModel.BulkRemoveModifier(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -812,13 +812,11 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EmptyScale();
|
EmptyScale();
|
||||||
await RefreshList();
|
await EnsureContextRenewed();
|
||||||
await RefreshDeliveryParts();
|
|
||||||
Mouse.OverrideCursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
ControlUtils.SelectItem(DeliveryList, p?.Delivery);
|
ControlUtils.SelectItem(DeliveryList, p?.Delivery);
|
||||||
DeliveryPartList.SelectedItem = null;
|
DeliveryPartList.SelectedItem = null;
|
||||||
DeliveryPartList.ScrollIntoView(DeliveryPartList.ItemsSource.Cast<object>().Last());
|
DeliveryPartList.ScrollIntoView(DeliveryPartList.ItemsSource.Cast<object>().Last());
|
||||||
RefreshInputs();
|
|
||||||
InitialInputs();
|
InitialInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -851,8 +849,7 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
EmptyScale();
|
EmptyScale();
|
||||||
await RefreshList();
|
await EnsureContextRenewed();
|
||||||
await RefreshDeliveryParts();
|
|
||||||
if (p?.Delivery != null) {
|
if (p?.Delivery != null) {
|
||||||
try {
|
try {
|
||||||
using var ctx = new AppDbContext();
|
using var ctx = new AppDbContext();
|
||||||
@@ -870,8 +867,7 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
Mouse.OverrideCursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
DeliveryList.SelectedItem = null;
|
DeliveryList.SelectedItem = null;
|
||||||
await RenewContext();
|
await EnsureContextRenewed();
|
||||||
RefreshInputs();
|
|
||||||
InitInputs();
|
InitInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -902,7 +898,7 @@ namespace Elwig.Windows {
|
|||||||
DisableWeighingButtons();
|
DisableWeighingButtons();
|
||||||
HideFinishNewPartDeliveryCancelButtons();
|
HideFinishNewPartDeliveryCancelButtons();
|
||||||
ShowNewEditDeleteButtons();
|
ShowNewEditDeleteButtons();
|
||||||
await RenewContext();
|
await EnsureContextRenewed();
|
||||||
RefreshInputs();
|
RefreshInputs();
|
||||||
ClearInputStates();
|
ClearInputStates();
|
||||||
LockInputs();
|
LockInputs();
|
||||||
@@ -1082,9 +1078,7 @@ namespace Elwig.Windows {
|
|||||||
LockInputs();
|
LockInputs();
|
||||||
UnlockSearchInputs();
|
UnlockSearchInputs();
|
||||||
FinishInputFilling();
|
FinishInputFilling();
|
||||||
await RefreshList();
|
await EnsureContextRenewed();
|
||||||
await RefreshDeliveryParts();
|
|
||||||
RefreshInputs();
|
|
||||||
|
|
||||||
Mouse.OverrideCursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
DepreciateButton.IsEnabled = true;
|
DepreciateButton.IsEnabled = true;
|
||||||
@@ -1184,6 +1178,9 @@ namespace Elwig.Windows {
|
|||||||
SeasonInput.IsEnabled = false;
|
SeasonInput.IsEnabled = false;
|
||||||
TodayOnlyInput.IsEnabled = false;
|
TodayOnlyInput.IsEnabled = false;
|
||||||
AllSeasonsInput.IsEnabled = false;
|
AllSeasonsInput.IsEnabled = false;
|
||||||
|
Menu_BulkAction_SetAttribute.IsEnabled = false;
|
||||||
|
Menu_BulkAction_AddModifier.IsEnabled = false;
|
||||||
|
Menu_BulkAction_RemoveModifier.IsEnabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UnlockSearchInputs() {
|
private void UnlockSearchInputs() {
|
||||||
@@ -1191,6 +1188,9 @@ namespace Elwig.Windows {
|
|||||||
SeasonInput.IsEnabled = true;
|
SeasonInput.IsEnabled = true;
|
||||||
TodayOnlyInput.IsEnabled = true;
|
TodayOnlyInput.IsEnabled = true;
|
||||||
AllSeasonsInput.IsEnabled = (ViewModel.FilterMember != null);
|
AllSeasonsInput.IsEnabled = (ViewModel.FilterMember != null);
|
||||||
|
Menu_BulkAction_SetAttribute.IsEnabled = true;
|
||||||
|
Menu_BulkAction_AddModifier.IsEnabled = true;
|
||||||
|
Menu_BulkAction_RemoveModifier.IsEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
new protected void UnlockInputs() {
|
new protected void UnlockInputs() {
|
||||||
|
|||||||
@@ -374,8 +374,7 @@ namespace Elwig.Windows {
|
|||||||
LockInputs();
|
LockInputs();
|
||||||
ViewModel.EnableSearchInputs = true;
|
ViewModel.EnableSearchInputs = true;
|
||||||
FinishInputFilling();
|
FinishInputFilling();
|
||||||
await RefreshList();
|
await EnsureContextRenewed();
|
||||||
RefreshInputs();
|
|
||||||
ViewModel.SearchQuery = "";
|
ViewModel.SearchQuery = "";
|
||||||
ControlUtils.SelectItemWithPk(DeliveryScheduleList, year, dsnr);
|
ControlUtils.SelectItemWithPk(DeliveryScheduleList, year, dsnr);
|
||||||
if (sortid != null)
|
if (sortid != null)
|
||||||
|
|||||||
@@ -225,8 +225,7 @@ namespace Elwig.Windows {
|
|||||||
LockInputs();
|
LockInputs();
|
||||||
ViewModel.EnableSearchInputs = true;
|
ViewModel.EnableSearchInputs = true;
|
||||||
FinishInputFilling();
|
FinishInputFilling();
|
||||||
await RefreshList();
|
await EnsureContextRenewed();
|
||||||
RefreshInputs();
|
|
||||||
ViewModel.SearchQuery = "";
|
ViewModel.SearchQuery = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -436,8 +436,7 @@ namespace Elwig.Windows {
|
|||||||
UpdateContactInfoVisibility();
|
UpdateContactInfoVisibility();
|
||||||
ViewModel.EnableSearchInputs = true;
|
ViewModel.EnableSearchInputs = true;
|
||||||
FinishInputFilling();
|
FinishInputFilling();
|
||||||
await RefreshList();
|
await EnsureContextRenewed();
|
||||||
RefreshInputs();
|
|
||||||
ViewModel.SearchQuery = "";
|
ViewModel.SearchQuery = "";
|
||||||
Mouse.OverrideCursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
if (mgnr is int m)
|
if (mgnr is int m)
|
||||||
|
|||||||
Reference in New Issue
Block a user