Example #1
0
        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);
        }
Example #2
0
        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 });
        }
Example #3
0
        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 });
        }
Example #4
0
 public ActionResult Create()
 {
     var model = new AccessPoolContextModel();
     model.CreateNew();
     return View(model);
 }
Example #5
0
 public ActionResult Details(int accesspoolId)
 {
     var model = new AccessPoolContextModel { AccessPoolId = accesspoolId };
     return View(model);
 }
Example #6
0
 public ActionResult Modify(AccessPoolContextModel model)
 {
     ValidateAndExecute(model.Modify, string.Format("Access Pool {0} updated successfully", model.AccessPoolName));
     return View(model);
 }