public ActionResult SaveEditGuest(Guest updateGuest) { ShahPartyDBEntities Orm = new ShahPartyDBEntities(); Guest oldGuest = Orm.Guests.Find(updateGuest.GuestID); oldGuest.FirstName = updateGuest.FirstName; oldGuest.LastName = updateGuest.LastName; oldGuest.AttendanceDate = updateGuest.AttendanceDate; oldGuest.EmailAddress = updateGuest.EmailAddress; oldGuest.Guest1 = updateGuest.Guest1; Orm.Entry(oldGuest).State = EntityState.Modified; Orm.SaveChanges(); return(RedirectToAction("GuestIndex")); }
public ActionResult SaveEditDish(Dish updateDish) { ShahPartyDBEntities Orm = new ShahPartyDBEntities(); Dish oldDish = Orm.Dishes.Find(updateDish.DishID); oldDish.PersonName = updateDish.PersonName; oldDish.PhoneNumber = updateDish.PhoneNumber; oldDish.DishName = updateDish.DishName; oldDish.DishDescription = updateDish.DishDescription; oldDish.Option = updateDish.Option; Orm.Entry(oldDish).State = EntityState.Modified; Orm.SaveChanges(); return(RedirectToAction("Index")); }