Ejemplo n.º 1
0
        /// <summary>
        /// 用户列表
        /// </summary>
        private 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);
            //管理员可以在后台修改自己的密码
            //if (condition != "")
            //    condition += " and owzx_users.uid<>" + WorkContext.Uid;
            //else
            //    condition = " owzx_users.uid<>" + WorkContext.Uid;

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

            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()
                });
            }

            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()
                });
            }

            UserListModel model = new UserListModel()
            {
                PageModel      = pageModel,
                UserList       = AdminUsers.AdminGetUserList(pageModel.PageSize, pageModel.PageNumber, condition),
                UserName       = userName,
                Email          = email,
                Mobile         = mobile,
                UserRid        = userRid,
                UserRankList   = userRankList,
                AdminGid       = adminGid,
                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));
        }
Ejemplo n.º 2
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));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 用户列表
        /// </summary>
        public ActionResult List(string userName, string email, string mobile, int userRid = 0, int mallAGid = 0, int pageNumber = 1, int pageSize = 15)
        {
            string condition = AdminUsers.AdminGetUserListCondition(userName, email, mobile, userRid, mallAGid);

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

            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()
                });
            }

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

            mallAdminGroupList.Add(new SelectListItem()
            {
                Text = "全部组", Value = "0"
            });
            foreach (MallAdminGroupInfo info in MallAdminGroups.GetMallAdminGroupList())
            {
                mallAdminGroupList.Add(new SelectListItem()
                {
                    Text = info.Title, Value = info.MallAGid.ToString()
                });
            }

            UserListModel model = new UserListModel()
            {
                PageModel          = pageModel,
                UserList           = AdminUsers.AdminGetUserList(pageModel.PageSize, pageModel.PageNumber, condition),
                UserName           = userName,
                Email              = email,
                Mobile             = mobile,
                UserRid            = userRid,
                UserRankList       = userRankList,
                MallAGid           = mallAGid,
                MallAdminGroupList = mallAdminGroupList
            };

            MallUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&userName={3}&email={4}&mobile={5}&userRid={6}&mallAGid={7}",
                                                          Url.Action("list"), pageModel.PageNumber, pageModel.PageSize,
                                                          userName, email, mobile, userRid, mallAGid));
            return(View(model));
        }
Ejemplo n.º 4
0
        private void Load(int regionId)
        {
            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;

            RegionInfo regionInfo = Regions.GetRegionById(regionId);

            if (regionInfo != null)
            {
                ViewData["provinceId"] = regionInfo.ProvinceId;
                ViewData["cityId"]     = regionInfo.CityId;
                ViewData["countyId"]   = regionInfo.RegionId;
            }
            else
            {
                ViewData["provinceId"] = -1;
                ViewData["cityId"]     = -1;
                ViewData["countyId"]   = -1;
            }

            ViewData["referer"] = ShopUtils.GetAdminRefererCookie();
        }