Example #1
0
        public static DriverList getInstance()
        {
            if (uniqueInstance == null)
            {
                uniqueInstance = new DriverList();
            }

            return(uniqueInstance);
        }
Example #2
0
        public DataTable ToDataTable(Status status)
        {
            switch (status)
            {
            case Status.Buy:
                return(ToDataTableBuy());

            case Status.Actual:
                return(ToDataTableActual());

            case Status.Repair:
                return(RepairList.getInstance().ToDataTable());

            case Status.Sale:
                return(CarSaleList.getInstance().ToDataTable());

            case Status.Invoice:
                return(InvoiceList.getInstance().ToDataTable());

            case Status.Policy:
                return(PolicyList.getInstance().ToDataTable());

            case Status.DTP:
                return(DTPList.getInstance().ToDataTable());

            case Status.Violation:
                return(ViolationList.getInstance().ToDataTable());

            case Status.DiagCard:
                return(DiagCardList.getInstance().ToDataTable());

            case Status.TempMove:
                return(TempMoveList.getInstance().ToDataTable());

            case Status.ShipPart:
                return(ShipPartList.getInstance().ToDataTable());

            case Status.Account:
                return(AccountList.GetInstance().ToDataTable());

            case Status.AccountViolation:
                return(ViolationList.getInstance().ToDataTableAccount());

            case Status.FuelCard:
                return(FuelCardList.getInstance().ToDataTable());

            case Status.Driver:
                return(DriverList.getInstance().ToDataTable());

            default:
                return(ToDataTable());
            }
        }
Example #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);
     }
 }
Example #4
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);
        }
        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);
        }
Example #6
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()));
            }
        }