예제 #1
0
        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);
        }
예제 #2
0
 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);
     }
 }
예제 #3
0
        public void Insert()
        {
            CarTableGateway DataGateway = new CarTableGateway();

            DataGateway.Insert(Name, Type, Consumption, Price, IsOnMarket, YearOfManufacture, Tachometer, Fuel, user.ID);
        }
예제 #4
0
        public static void Delete(int ID)
        {
            CarTableGateway DataGateway = new CarTableGateway();

            DataGateway.Delete(ID);
        }