Exemple #1
0
 public ActionResult Delete(string id)
 {
     if (MenuRestrictionBusinessLogic.getInstance().DeleteMenuRestriction(id) == -1)
     {
         TempData["Success"] = "Menu Restriction was successfully deleted";
     }
     else
     {
         TempData["Error"] = "Menu Restriction was unsuccessfully deleted";
     }
     return(RedirectToAction("Index"));
 }
Exemple #2
0
 public ActionResult Edit(sp_MenuRestrictionSelect_Result model)
 {
     if (MenuRestrictionBusinessLogic.getInstance().UpdateMenuRestriction(model) == -1)
     {
         TempData["Success"] = "Menu Restriction was successfully updated";
     }
     else
     {
         TempData["Error"] = "Menu Restriction was unsuccessfully updated";
     }
     return(RedirectToAction("Index"));
 }
Exemple #3
0
        public ActionResult Edit(string id)
        {
            sp_MenuRestrictionSelect_Result model = new sp_MenuRestrictionSelect_Result();
            var menuData = MenuRestrictionBusinessLogic.getInstance().getMenuById(id);

            model.RestrictionId = menuData.RestrictionId;
            model.MenuId        = menuData.MenuId;
            model.RoleId        = menuData.RoleId;

            ViewBag.RoleList = common.ToSelectList(RoleBusinessLogic.getInstance().getRoleDDL(), "ID", "NAME", model.RoleId);
            ViewBag.MenuList = common.ToSelectList(MenuRestrictionBusinessLogic.getInstance().getMenuDDL(model.RoleId), "ID", "NAME", model.MenuId);
            return(View(model));
        }
Exemple #4
0
        public JsonResult MenuDDL(string roleId)
        {
            var menuList = common.ToSelectList(MenuRestrictionBusinessLogic.getInstance().getMenuDDL(roleId), "ID", "NAME", "");

            return(Json(menuList, JsonRequestBehavior.AllowGet));
        }
Exemple #5
0
 public ActionResult Create()
 {
     ViewBag.RoleList = common.ToSelectList(RoleBusinessLogic.getInstance().getRoleDDL(), "ID", "NAME", string.Empty);
     ViewBag.MenuList = common.ToSelectList(MenuRestrictionBusinessLogic.getInstance().getMenuDDL(""), "ID", "NAME", string.Empty);
     return(View());
 }
Exemple #6
0
 //[CheckAuthorize(Roles = "Menu Restriction")]
 public ActionResult Index()
 {
     return(View(MenuRestrictionBusinessLogic.getInstance().ListMenuRestriction()));
 }