I have a class that has 4 properties: employee number, logintime, last delivery time, and position.
I need to assign position first by log in time, then by last delivery time. (so whoever logged in first is first, but whoever took the last delivery is last regardless of log in times)
Please help, it is of type List<>.
Loading
patrickPosted Aug 18, 2009, 1:35 PM
patrickPosted Aug 18, 2009, 1:31 PM
Kirtan PatelPosted Aug 18, 2009, 1:27 PM
patrickPosted Aug 18, 2009, 1:20 PM
patrickPosted Aug 18, 2009, 1:19 PM
private static int CompareDrivers(DriverQueuePosition x, DriverQueuePosition y)
{
if (x.LoggedIn == y.LoggedIn)
{
return 0;
}
else if (x.LoggedIn < y.LoggedIn)
{
if (x.LastDelTime < y.LastDelTime)
{
return -1;
}
else
{
return 1;
}
}
else
{
if (x.LastDelTime > y.LastDelTime)
{
return 1;
}
else
{
return -1;
}
}
}
Kirtan PatelPosted Aug 18, 2009, 1:19 PM
where the Fields Are Deliver time Etc ??in database ?