Extra Korrekturen durch Anmerkungen von Basti

This commit is contained in:
Daniel Schick 2023-03-02 11:02:16 +01:00
parent 97bad2fbc0
commit 7e23f5a98a
5 changed files with 13 additions and 10 deletions

View File

@ -46,7 +46,7 @@
<Button x:Name="buttonLoad" Grid.Column="4" Content="Load" Margin="2" Click="buttonLoad_Click" /> <Button x:Name="buttonLoad" Grid.Column="4" Content="Load" Margin="2" Click="buttonLoad_Click" />
<!--Button x:Name="buttonSave" Grid.Column="5" Content="Save" Margin="2" Click="buttonSave_Click" /--> <!--Button x:Name="buttonSave" Grid.Column="5" Content="Save" Margin="2" Click="buttonSave_Click" /-->
<Button x:Name="buttonRequestIds" Grid.Column="6" Content="Request marked Ids" Margin="2" Click="buttonRequestIds_Click" /> <Button x:Name="buttonRequestIds" Grid.Column="6" Content="Request marked Ids" Margin="2" Click="buttonRequestIds_Click" />
<Button x:Name="buttonRequestPlus3" Grid.Column="7" Content="Request +3" Margin="2" Click="buttonRequestIds_Click" /> <Button x:Name="buttonRequestPlus3" Grid.Column="7" Content="Request +4" Margin="2" Click="buttonRequestIds_Click" />
<Button x:Name="buttonImport" Grid.Column="9" Margin="2" Content="Import" Click="buttonImport_Click" /> <Button x:Name="buttonImport" Grid.Column="9" Margin="2" Content="Import" Click="buttonImport_Click" />
<Button x:Name="buttonExport" Grid.Column="10" Margin="2" Content="Export" Click="buttonExport_Click" /> <Button x:Name="buttonExport" Grid.Column="10" Margin="2" Content="Export" Click="buttonExport_Click" />
<local:BusyControl x:Name="busyControl" Grid.Column="5" /> <local:BusyControl x:Name="busyControl" Grid.Column="5" />

View File

@ -214,7 +214,7 @@ namespace ENI2.Controls
} }
else else
{ {
if(md.ETA.Value.IsNextXDays(3)) if(md.ETA.Value.IsNextXDays(4))
{ {
md.Status = MaerskData.MDStatus.NO_ID_AND_DUE; md.Status = MaerskData.MDStatus.NO_ID_AND_DUE;
} }
@ -271,7 +271,7 @@ namespace ENI2.Controls
} }
} }
this.TimeFilterItemSource(); this.TimeFilterItemSource();
this.SortItemSource(); // this.SortItemSource();
this.dataGridPOCores.SelectedItem = null; this.dataGridPOCores.SelectedItem = null;
busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL; busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL;
} }
@ -404,6 +404,8 @@ namespace ENI2.Controls
throw new InvalidOperationException($"{md.ColI} found in import to {PortLocode}, this is probably an error. Aborting import"); throw new InvalidOperationException($"{md.ColI} found in import to {PortLocode}, this is probably an error. Aborting import");
} }
if (!reader.IsDBNull(9)) md.ColJ = ReadFieldAsString(reader, 9); if (!reader.IsDBNull(9)) md.ColJ = ReadFieldAsString(reader, 9);
if (md.ColJ == null) continue;
if (!(md.ColJ.Equals("msk", StringComparison.OrdinalIgnoreCase) || md.ColJ.Equals("sgl", StringComparison.OrdinalIgnoreCase))) continue; // skip operator we are not interested in
if (!reader.IsDBNull(10)) md.ColK = ReadFieldAsString(reader, 10); if (!reader.IsDBNull(10)) md.ColK = ReadFieldAsString(reader, 10);
if (!reader.IsDBNull(11)) md.ColL = ReadFieldAsString(reader, 11); if (!reader.IsDBNull(11)) md.ColL = ReadFieldAsString(reader, 11);
if (!reader.IsDBNull(12)) md.ColM = ReadFieldAsString(reader, 12); if (!reader.IsDBNull(12)) md.ColM = ReadFieldAsString(reader, 12);
@ -449,7 +451,7 @@ namespace ENI2.Controls
} }
} }
this.TimeFilterItemSource(); this.TimeFilterItemSource();
this.SortItemSource(); // this.SortItemSource();
busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL; busyControl.BusyState = Util.UIHelper.BusyStateEnum.NEUTRAL;
} }
@ -508,7 +510,7 @@ namespace ENI2.Controls
private async void buttonRequestIds_Click(object sender, RoutedEventArgs e) private async void buttonRequestIds_Click(object sender, RoutedEventArgs e)
{ {
// find all entries from now until 3 days into the future and track parallel requests // find all entries from now until 4 days into the future and track parallel requests
List<MaerskData> requestList = new List<MaerskData>(); List<MaerskData> requestList = new List<MaerskData>();
if (sender == this.buttonRequestIds) if (sender == this.buttonRequestIds)
{ {
@ -526,7 +528,7 @@ namespace ENI2.Controls
if(((md.MessageCore == null) && md.ColM.IsNullOrEmpty()) || if(((md.MessageCore == null) && md.ColM.IsNullOrEmpty()) ||
((md.MessageCore != null) && md.MessageCore.VisitId.IsNullOrEmpty())) ((md.MessageCore != null) && md.MessageCore.VisitId.IsNullOrEmpty()))
{ {
if (md.ETA.HasValue && md.ETA.Value.IsNextXDays(3)) if (md.ETA.HasValue && md.ETA.Value.IsNextXDays(4))
requestList.Add(md); requestList.Add(md);
} }
} }

View File

@ -36,7 +36,7 @@
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion> <MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage> <WebPage>publish.html</WebPage>
<ApplicationRevision>10</ApplicationRevision> <ApplicationRevision>12</ApplicationRevision>
<ApplicationVersion>7.9.0.%2a</ApplicationVersion> <ApplicationVersion>7.9.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>

View File

@ -56,7 +56,7 @@ namespace ENI2.Excel
ws.Cells[i + 2, 11] = md.ColK; ws.Cells[i + 2, 11] = md.ColK;
ws.Cells[i + 2, 12] = md.ColL; ws.Cells[i + 2, 12] = md.ColL;
ws.Cells[i + 2, 13] = md.ColM ; ws.Cells[i + 2, 13] = md.ColM ;
ws.Cells[i + 2, 14] = md.Remark; // ws.Cells[i + 2, 14] = md.Remark;
} }
wb.SaveAs(filename, XlFileFormat.xlOpenXMLWorkbook, Type.Missing, Type.Missing, Type.Missing, wb.SaveAs(filename, XlFileFormat.xlOpenXMLWorkbook, Type.Missing, Type.Missing, Type.Missing,

View File

@ -126,11 +126,12 @@ namespace bsmd.database
/// <summary> /// <summary>
/// Returns true if the date is between now and numDays in the future (or past, if numDays is negative) /// Returns true if the date is between now and numDays in the future (or past, if numDays is negative)
/// (regarding full days, ignoring time component
/// </summary> /// </summary>
public static bool IsNextXDays(this DateTime datetime, int numDays) public static bool IsNextXDays(this DateTime datetime, int numDays)
{ {
double diff = (datetime - DateTime.Now).TotalDays; double diff = (datetime.Date - DateTime.Now.Date).TotalDays;
if (numDays >= 0) return diff < numDays && diff > 0; if (numDays >= 0) return diff <= numDays && diff >= 0;
else return diff < numDays && diff < 0; else return diff < numDays && diff < 0;
} }