Ejemplo n.º 1
0
        public ActionResult LowerList(string userName = "", string mobile = "", int usertype = -1, int pageNumber = 1, int pageSize = 15)
        {
            HashSet <string> actionlist = AdminGroups.GetAdminGroupActionHashSetNoCache(WorkContext.AdminGid);

            ShopUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&userName={3}&mobile={4}&usertype={5}",
                                                          Url.Action("list"), pageNumber, pageSize,
                                                          userName, mobile, usertype));

            StringBuilder strb = new StringBuilder();

            strb.Append(" where 1=1");
            if (userName != "")
            {
                strb.Append(" and a.nickname like '%" + userName + "%'");
            }

            if (mobile != "")
            {
                strb.Append(" and a.parentid=(select top 1 uid from owzx_users where rtrim(mobile)=' " + mobile + "' ) ");
            }
            if (usertype > -1)
            {
                strb.Append(" and a.usertype=" + usertype + " ");
            }
            strb.Append(" order by a.uid desc");


            DataTable dt = AdminUsers.GetUserParentList(pageSize, pageNumber, strb.ToString());

            if (dt.Columns[0].ColumnName == "error")
            {
                return(PromptView("用户获取失败"));
            }

            UserListModel model = new UserListModel()
            {
                PageModel = new PageModel(pageSize, pageNumber, (dt != null && dt.Rows != null && dt.Rows.Count > 0 ? Convert.ToInt32(dt.Rows[0]["TotalCount"]) : 0)),
                UserList  = dt,
                UserName  = userName,
                Mobile    = mobile
            };


            return(View(model));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 用户列表
        /// </summary>
        public ActionResult List(string userName = "", string mobile = "", int userrid = -1, int pageNumber = 1, int pageSize = 15)
        {
            HashSet <string> actionlist = AdminGroups.GetAdminGroupActionHashSetNoCache(WorkContext.AdminGid);

            ShopUtils.SetAdminRefererCookie(string.Format("{0}?pageNumber={1}&pageSize={2}&userName={3}&mobile={4}&userrid={5}",
                                                          Url.Action("list"), pageNumber, pageSize,
                                                          userName, mobile, userrid));

            StringBuilder strb = new StringBuilder();

            strb.Append(" where 1=1");
            if (userName != "")
            {
                strb.Append(" and a.nickname like '%" + userName + "%'");
            }

            if (mobile != "")
            {
                strb.Append(" and a.mobile='" + mobile + "'");
            }

            strb.Append("order by a.uid desc");


            DataTable dt = AdminUsers.GetUserList(pageSize, pageNumber, strb.ToString());

            if (dt.Columns[0].ColumnName == "error")
            {
                return(PromptView("用户获取失败"));
            }

            UserListModel model = new UserListModel()
            {
                PageModel = new PageModel(pageSize, pageNumber, dt.Rows.Count > 0 ? int.Parse(dt.Rows[0]["TotalCount"].ToString()) : 0),
                UserList  = dt,
                UserName  = userName,
                Mobile    = mobile,
                UserRid   = userrid
            };


            return(View(model));
        }