Filter shipcalls that have ata set and ata is more than 2 hours in the past
This commit is contained in:
parent
30c8069a9b
commit
c1b4affb20
@ -745,6 +745,33 @@ namespace BreCalClient
|
||||
_ = this._visibleControlModels.RemoveAll(x => x.Shipcall?.Canceled ?? false);
|
||||
}
|
||||
|
||||
// special Basti case: Wenn das ATA / ATD eingetragen ist und schon 2 Stunden in der Vergangenheit liegt
|
||||
if (searchPastDays <= 3)
|
||||
{
|
||||
_ = this._visibleControlModels.RemoveAll(x =>
|
||||
{
|
||||
Times? mooringTimes = x.GetTimesForParticipantType(ParticipantType.MOORING);
|
||||
if (mooringTimes != null)
|
||||
{
|
||||
switch (x.Shipcall?.Type)
|
||||
{
|
||||
case ShipcallType.Arrival:
|
||||
if (mooringTimes.Ata.HasValue && ((DateTime.Now - mooringTimes.Ata.Value).TotalHours > 2))
|
||||
return true;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (mooringTimes.Atd.HasValue && ((DateTime.Now - mooringTimes.Atd.Value).TotalHours > 2))
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
switch (this._sortOrder)
|
||||
{
|
||||
case Extensions.SortOrder.SHIP_NAME:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user