Example #1
0
        /// <summary>
        /// 用户列表
        /// </summary>
        public ActionResult List(string userName, string email, string mobile, int userRid = 0, int adminGid = 0,
                                 int pageNumber = 1, int pageSize = 15)
        {
            string condition = AdminUsers.AdminGetUserListCondition(userName, email, mobile, userRid, adminGid);
            string sort      = AdminUsers.AdminGetUserListSort("", "");

            PageModel pageModel = new PageModel(pageSize, pageNumber, AdminUsers.AdminGetUserCount(condition));

            UserListModel model = new UserListModel()
            {
                UserList  = AdminUsers.AdminGetUserList(pageModel.PageSize, pageModel.PageNumber, condition, sort),
                PageModel = pageModel,
                UserName  = userName,
                Email     = email,
                Mobile    = mobile,
                UserRid   = userRid,
                AdminGid  = adminGid
            };
            List <SelectListItem> userRankList = new List <SelectListItem>();

            userRankList.Add(new SelectListItem()
            {
                Text = "全部等级", Value = "0"
            });
            foreach (UserRankInfo info in AdminUserRanks.GetUserRankList())
            {
                userRankList.Add(new SelectListItem()
                {
                    Text = info.Title, Value = info.UserRid.ToString()
                });
            }
            ViewData["userRankList"] = userRankList;

            List <SelectListItem> adminGroupList = new List <SelectListItem>();

            adminGroupList.Add(new SelectListItem()
            {
                Text = "全部组", Value = "0"
            });
            foreach (AdminGroupInfo info in AdminGroups.GetAdminGroupList())
            {
                adminGroupList.Add(new SelectListItem()
                {
                    Text = info.Title, Value = info.AdminGid.ToString()
                });
            }
            ViewData["adminGroupList"] = adminGroupList;

            ShopUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&userName={3}&email={4}&mobile={5}&userRid={6}&adminGid={7}",
                                                          Url.Action("list"), pageModel.PageNumber, pageModel.PageSize,
                                                          userName, email, mobile, userRid, adminGid));
            return(View(model));
        }