Ejemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "Id,UserName,Password")] AdministratorViewModel avm)
 {
     if (ModelState.IsValid)
     {
         try
         {
             IBL bl            = new BLImplement();
             var administrator = new Administrator()
             {
                 Id       = avm.Id,
                 UserName = avm.UserName,
                 Password = avm.Password
             };
             bl.updateAdministrator(administrator);
             ViewBag.Message = String.Format("Your details are successfully updated");
         }
         catch (Exception ex)
         {
             ViewBag.Message = String.Format(ex.Message);
             return(RedirectToAction("AdministratorEntrance"));
         }
         return(RedirectToAction("AdministratorEntrance"));
     }
     return(RedirectToAction("AdministratorEntrance"));
 }