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()); } }
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())); } }