Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "UserID,FirstName,Surname,DOB,FirstLineAddress,SecondLineAddress,PostCode,Active")] User user)
 {
     if (ModelState.IsValid)
     {
         db.UpdateUser(user);
         db.Save();
         return(RedirectToAction("Index"));
     }
     return(View(user));
 }
 // [Authorize]
   public ActionResult Edit([Bind(Include = "UserID,FirstName,Surname,DOB,FirstLineAddress,SecondLineAddress,PostCode,Active,Deleted")] User user)
   {
       if (ModelState.IsValid)
       {
           try
           {
               db.UpdateUser(user);
               db.Save();
               return RedirectToAction("Index");
           }
           catch (Exception ex) // catches all exceptions
           {
               return View(ex.Message);
           }
       }
           return View(user);
   }