private Driver getDriver(List <DriverCar> driverCars) { if (driverCars.Count() > 0) { DriverCar driverCar = driverCars.First() as DriverCar; DriverList driverList = DriverList.getInstance(); return(driverList.getItem(driverCar.Driver.ID)); } else { return(null); } }
public List <INotification> ToList() { DriverList driverList = DriverList.getInstance(); List <DriverLicense> listNew = _list.Where(item => !driverList.getItem(item.Driver.ID).Fired&& !driverList.getItem(item.Driver.ID).Decret&& driverList.getItem(item.Driver.ID).IsDriver).ToList(); List <INotification> listNotification = new List <INotification>(); foreach (INotification item in listNew) { listNotification.Add(item); } return(listNotification); }
public List <INotification> ToList() { DriverList driverList = DriverList.getInstance(); IEnumerable <MedicalCert> listNew = list.Where(item => !driverList.getItem(item.Driver.ID).Fired&& !driverList.getItem(item.Driver.ID).Decret&& driverList.getItem(item.Driver.ID).IsDriver); var listNotification = new List <INotification>(); foreach (INotification item in listNew) { listNotification.Add(item); } return(listNotification); }
public Driver GetDriver(Car car) { var driverCars = from driverCar in list where driverCar.Car.ID == car.ID orderby driverCar.dateEnd descending, driverCar.Number descending select driverCar; if ((driverCars.ToList().Count == 0) && (!car.IsGet)) { DriverList driverList = DriverList.getInstance(); return(driverList.getItem(Convert.ToInt32(car.driverID))); } else { return(getDriver(driverCars.ToList())); } }