public static DriverCarList getInstance() { if (uniqueInstance == null) { uniqueInstance = new DriverCarList(); } return(uniqueInstance); }
private DataTable ToDataTableActual() { List <Car> cars; if (User.GetRole() == RolesList.Employee) { DriverCarList driverCarList = DriverCarList.getInstance(); Car myCar = driverCarList.GetCar(User.GetDriver()); cars = list.Where(car => car == myCar).ToList(); } else { cars = list.Where(car => car.IsGet && !car.info.IsSale).ToList(); } return(createTable(cars)); }