Пример #1
0
 public ActionResult SearchRole(SM_Role mdl)
 {
     if (string.IsNullOrEmpty(mdl.RoleName))
     {
         mdl.RoleID = 0;
     }
     return(RedirectToAction("RoleList", mdl));
 }
Пример #2
0
        public List <Role> GetRoles_Filters(SM_Role searchData)
        {
            List <Role> list = this.GetAllRoles();

            list = list.Where(a => (searchData.RoleID > 0) ? a.ID == searchData.RoleID : true).ToList();
            list = list.ToPagedList(searchData.CurrentPage++, CommonClass.PageSize).ToList();
            return(list);
        }
Пример #3
0
        public int GetAllRoleCount(SM_Role searchData)
        {
            int         Count = 0;
            List <Role> list  = this.GetAllRoles();

            list  = list.Where(a => (searchData.RoleID > 0) ? a.ID == searchData.RoleID : true).ToList();
            Count = list.Count;
            return(Count);
        }
Пример #4
0
        // GET: Role
        public ActionResult RoleList(SM_Role data)
        {
            if (Session["UserInfo"] != null)
            {
                SystemUser userInfo = (SystemUser)Session["UserInfo"];
                ViewBag.SystemUserType = userInfo.SystemUserType;


                data.TotalPage   = cs.TotalPage(da.GetAllRoleCount(data));
                data.TotalCount  = da.GetAllRoleCount(data);
                data.CurrentPage = 1;

                ViewBag.ActivePageID = "PageRole";
                return(View("RoleList", data));
            }
            else
            {
                return(RedirectToAction("SessionTimeOut", "Error"));
            }
        }