public ActionResult Edit(BookingsModel.Staff staff)
 {
     try
     {
         if (ModelState.IsValid)
         {
             staff.Active = true;
         }
         db.Entry(staff).State = System.Data.Entity.EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View(staff));
     }
 }
Пример #2
0
 public ActionResult Edit(Customer customer)
 {
     try
     {
         if (ModelState.IsValid)
         {
             customer.Active = true;
         }
         db.Entry(customer).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View(customer));
     }
 }