Esempio n. 1
0
 public static void Update(InventDose inventDose)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.Entry(inventDose).State = EntityState.Modified;
         db.SaveChanges();
     }
 }
Esempio n. 2
0
 //delete
 public static void Delete(InventDose inventDose)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         db.InventDose.Remove(inventDose);
         db.SaveChanges();
     }
 }
Esempio n. 3
0
 public static void Addfeedback(InventDose inventDose)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         var dose = db.InventDose.FirstOrDefault(d => d.Id == inventDose.Id);
         dose.Feedback = inventDose.Feedback;
         db.SaveChanges();
     }
 }
Esempio n. 4
0
 //update
 public static void UpdateIdStatus(InventDose inventDose)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         var dose = db.InventDose.FirstOrDefault(d => d.Id == inventDose.Id);
         if (dose.IdStatusDose == 3)
         {
             dose.IdStatusDose = 1;
         }
         else
         {
             dose.IdStatusDose = 2;
         }
         db.SaveChanges();
     }
 }
Esempio n. 5
0
 //add
 public static InventDose Add(InventDose inventDose)
 {
     using (restaurantEntities db = new restaurantEntities())
     {
         inventDose.DateInvent = DateTime.Now;
         var inventDose1 = db.InventDose.Add(inventDose);
         db.SaveChanges();
         //foreach (var item in inventDose.InventDetails)
         //{
         //    item.InventDose = null;
         //    item.IdDose = inventDose1.Id;
         //    db.InventDetails.Add(item);
         //    db.SaveChanges();
         //}
         //db.InventDetails.AddRange(db.InventDetails);
         return(inventDose);
     }
 }