Make sorting take agency times as more important into account if they are set
This commit is contained in:
parent
cdcba3909e
commit
a9f80b8f86
@ -710,7 +710,13 @@ namespace BreCalClient
|
||||
if (x.Shipcall == null) return 0;
|
||||
if (y.Shipcall == null) return 0;
|
||||
DateTime xDate = (x.Shipcall.Type == ShipcallType.Arrival) ? x.Eta ?? DateTime.Now : x.Etd ?? DateTime.Now;
|
||||
Times? xTimes = x.GetTimesForParticipantType(ParticipantType.AGENCY);
|
||||
if(xTimes != null)
|
||||
xDate = (x.Shipcall.Type == ShipcallType.Arrival) ? xTimes.EtaBerth ?? DateTime.Now : xTimes.EtdBerth ?? DateTime.Now;
|
||||
DateTime yDate = (y.Shipcall.Type == ShipcallType.Arrival) ? y.Eta ?? DateTime.Now : y.Etd ?? DateTime.Now;
|
||||
Times? yTimes = y.GetTimesForParticipantType(ParticipantType.AGENCY);
|
||||
if (yTimes != null)
|
||||
yDate = (y.Shipcall.Type == ShipcallType.Arrival) ? yTimes.EtaBerth ?? DateTime.Now : yTimes.EtdBerth ?? DateTime.Now;
|
||||
return DateTime.Compare(xDate, yDate);
|
||||
});
|
||||
break;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user