public ActionResult Create(AccessPoolContextModel model) { if (ValidateAndExecute(model.Insert, string.Format("Access Pool {0} Created Successfully", model.AccessPoolName))) return RedirectToAction("Details", "AccessPool", new { accesspoolId = model.AccessPoolId }); return View(model); }
public ActionResult Remove(int accesspoolId, int userId) { ValidateAndExecute(() => { var model = new AccessPoolContextModel { AccessPoolId = accesspoolId }; model.RemoveUserFromPool(userId); }, "User has been removed from the Access Pool successfully."); return RedirectToAction("Details", "AccessPool", new { accesspoolId }); }
public ActionResult SetAccessPoolUserFromUser(int userId, int accessPoolId) { try { var model = new AccessPoolContextModel { AccessPoolId = accessPoolId }; model.AddUserToPool(userId); ShowSuccessMessage("Access Pool has been successfully added for the user."); } catch (Exception ex) { ShowErrorMessage(ex.Message); } return RedirectToAction("Details", "User", new { userId }); }
public ActionResult Create() { var model = new AccessPoolContextModel(); model.CreateNew(); return View(model); }
public ActionResult Details(int accesspoolId) { var model = new AccessPoolContextModel { AccessPoolId = accesspoolId }; return View(model); }
public ActionResult Modify(AccessPoolContextModel model) { ValidateAndExecute(model.Modify, string.Format("Access Pool {0} updated successfully", model.AccessPoolName)); return View(model); }