Make sorting take agency times as more important into account if they are set
This commit is contained in:
parent
004908e9c0
commit
d25eea2f92
@ -710,7 +710,13 @@ namespace BreCalClient
|
|||||||
if (x.Shipcall == null) return 0;
|
if (x.Shipcall == null) return 0;
|
||||||
if (y.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;
|
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;
|
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);
|
return DateTime.Compare(xDate, yDate);
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user