Improve DeliveryAdminWindow
This commit is contained in:
@ -100,5 +100,13 @@ namespace Elwig.Helpers {
|
||||
.ForEach(a => { if (a <= c + 100) c = a; });
|
||||
return c + 1;
|
||||
}
|
||||
|
||||
public async Task<int> NextLNr(DateOnly date) {
|
||||
var dateStr = date.ToString("yyyy-MM-dd");
|
||||
int c = 0;
|
||||
(await Deliveries.Where(d => d.DateString == dateStr).Select(d => d.LNr).ToListAsync())
|
||||
.ForEach(a => { if (a <= c + 10) c = a; });
|
||||
return c + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ namespace Elwig.Helpers {
|
||||
private readonly string FileName;
|
||||
public string DatabaseFile = App.DataPath + "database.sqlite3";
|
||||
public string? DatabaseLog = null;
|
||||
public string? ZwstId = null;
|
||||
public IEnumerable<string[]> Scales;
|
||||
private readonly LinkedList<string[]> ScaleList = new();
|
||||
|
||||
@ -43,6 +44,12 @@ namespace Elwig.Helpers {
|
||||
DatabaseLog = App.DataPath + log;
|
||||
}
|
||||
|
||||
if (ini == null || !ini.TryGetKey("general.branch", out string branch)) {
|
||||
ZwstId = null;
|
||||
} else {
|
||||
ZwstId = branch;
|
||||
}
|
||||
|
||||
ScaleList.Clear();
|
||||
Scales = ScaleList;
|
||||
if (ini != null) {
|
||||
|
5
Elwig/Helpers/NullItem.cs
Normal file
5
Elwig/Helpers/NullItem.cs
Normal file
@ -0,0 +1,5 @@
|
||||
namespace Elwig.Helpers {
|
||||
public class NullItem {
|
||||
public static string Name => "- Keine Angabe -";
|
||||
}
|
||||
}
|
@ -9,7 +9,6 @@ using System.Diagnostics;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO.Ports;
|
||||
using PdfSharp.Charting;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace Elwig.Helpers {
|
||||
|
Reference in New Issue
Block a user