Exemple #1
0
        // DELETE: api/CarType/5
        public void Delete(int id)
        {
            CarTypeTable T = YRentDB.CarTypeTables.FirstOrDefault(t1 => t1.Car_Type_ID == id);

            if (T != null)
            {
                YRentDB.CarTypeTables.Remove(T);
                YRentDB.SaveChanges();
            }
        }
Exemple #2
0
        public void Put(int id, [FromBody] CarTypeTable u1)
        {
            CarTypeTable u = YRentDB.CarTypeTables.FirstOrDefault(f => f.Car_Type_ID == id);

            if (u != null)
            {
                u.Manufactor_Name = u1.Manufactor_Name;
                u.Model           = u1.Model;
                u.Price_PerDay    = u1.Price_PerDay;
                u.Price_Delay     = u1.Price_Delay;
                u.Production_Year = u1.Production_Year;
                u.Gear            = u1.Gear;
                YRentDB.SaveChanges();
            }
        }
Exemple #3
0
 // POST: api/CarType
 public void Post([FromBody] CarTypeTable s1)
 {
     YRentDB.CarTypeTables.Add(s1);
     YRentDB.SaveChanges();
 }