Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 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);
     }
 }
Esempio n. 4
0
        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()));
            }
        }