public ActionResult ActiveFlag(int id) { if ((Request.IsAuthenticated)) { Roles role = RolesBL.Details(id); if (role.ActiveFlag == true) { role.ActiveFlag = false; } else { role.ActiveFlag = true; } string InsertUser = User.Identity.GetUserName(); var r = RolesBL.Update("MS", role, InsertUser); if (!r) { ViewBag.Mensaje = "Ha ocurrido un error inesperado."; return(View("~/Views/Shared/Error.cshtml")); } else { return(RedirectToAction("Index", new { id = role.ApplicationID })); } } else { return(this.RedirectToAction("Login", "Account")); } }
public ActionResult Edit(RolesViewModel model) { try { obj.Update(model, out outmodel); if (!outmodel.Error) { // TODO: Add update logic here return(RedirectToAction("Index")); } else { return(View(model)); } } catch (Exception ex) { ex.Message.ToString(); return(View()); } }