Beispiel #1
0
        private List <Model.SystemMaint.Module.ModuleItem> GetMoudlePermission(int?roleId)
        {
            BL.RoleInfo       empBL       = new BL.RoleInfo();
            BL.Module         moduleBL    = new BL.Module();
            List <ModuleItem> moduleItems = null;

            if (roleId.HasValue)
            {
                moduleItems      = moduleBL.GetHierarchyModuleItem(empBL.GetRolePermission(roleId.Value));
                ViewBag.RoleName = empBL.GetItemById(roleId.Value).Name;
            }
            else
            {
                moduleItems = moduleBL.GetHierarchyModuleItem();
            }
            empBL.Dispose();
            moduleBL.Dispose();

            ModuleItem ModulePermissionList = CreateModulePermission(moduleItems);

            //if(!roleId.HasValue && ModulePermissionList!=null && ModulePermissionList.ModulePermissions!=null)
            //{
            //    ModulePermissionList.ModulePermissions.ForEach(p =>
            //    {
            //        if (p.Value == 1)
            //        {
            //            p.IsSelected = true;
            //        }
            //    });
            //}
            ViewData["ModulePermission"] = ModulePermissionList;
            return(moduleItems);
        }
Beispiel #2
0
        // GET: SystemMaint/Role/Details/5
        public ActionResult GetDetail(int id)
        {
            BL.RoleInfo empBL = new BL.RoleInfo();
            if (empBL.GetItemByIdForDelete(id) != null)
            {
                return(Redirect(Url.Action("HttpError", "Error", new { area = "" })));
            }
            var model = empBL.GetItemById(id);

            return(PartialView("_Detail", model));
        }
Beispiel #3
0
        // GET: SystemMaint/Role/Edit/5
        public ActionResult Edit(int id)
        {
            ViewBag.RoleId = id;
            BL.RoleInfo empBL = new BL.RoleInfo();
            var         model = empBL.GetItemById(id);

            if (model == null)
            {
                return(Redirect(Url.Action("HttpError", "Error", new { area = "" })));
            }
            return(View(model));
        }