public static List <Car> getList() { CarTableGateway DataGateway = new CarTableGateway(); DataTable TableData = DataGateway.Find(); List <Car> tmp = new List <Car>(); foreach (DataRow row in TableData.Rows) { tmp.Add(map(row)); } return(tmp); }
public static Car getCarByID(int id) { try { CarTableGateway DataGateway = new CarTableGateway(); DataTable TableData = DataGateway.FindByID(id); DataRow row = TableData.Rows[0]; return(map(row)); } catch { return(null); } }
public void Insert() { CarTableGateway DataGateway = new CarTableGateway(); DataGateway.Insert(Name, Type, Consumption, Price, IsOnMarket, YearOfManufacture, Tachometer, Fuel, user.ID); }
public static void Delete(int ID) { CarTableGateway DataGateway = new CarTableGateway(); DataGateway.Delete(ID); }