Esempio n. 1
0
 //Update the records for selected order
 public int UpdateOrder(CarOrder order)
 {
     try
     {
         db.Entry(order).State = EntityState.Modified;
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
Esempio n. 2
0
 //Delete order
 public int DeleteOrder(int id)
 {
     try
     {
         CarOrder order = db.CarOrder.Find(id);
         db.CarOrder.Remove(order);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
Esempio n. 3
0
 //Add new order record
 public int AddOrder(CarOrder order)
 {
     try
     {
         db.CarOrder.Add(order);
         db.SaveChanges();
         int orderID = order.CarOrderId;
         return(orderID);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }