public ActionResult UserList()
        {
            List <JMP.MDL.jmp_user> list = new List <JMP.MDL.jmp_user>();

            JMP.BLL.jmp_user bll = new JMP.BLL.jmp_user();
            #region 初始化
            //获取请求参数
            int    pageCount  = 0;
            int    pageIndexs = string.IsNullOrEmpty(Request["curr"]) ? 1 : Int32.Parse(Request["curr"]);     //当前页
            int    PageSize   = string.IsNullOrEmpty(Request["psize"]) ? 20 : Int32.Parse(Request["psize"]);  //每页显示数量
            string type       = string.IsNullOrEmpty(Request["stype"]) ? "0" : Request["stype"];              //查询条件类型
            string sea_name   = string.IsNullOrEmpty(Request["skeys"]) ? "" : Request["skeys"];               //查询条件值
            string category   = string.IsNullOrEmpty(Request["scategory"]) ? "" : Request["scategory"];       //认证类型
            int    px         = string.IsNullOrEmpty(Request["s_sort"]) ? 0 : Int32.Parse(Request["s_sort"]); //排序
            //获取用户列表
            string where = " where 1=1 and u_auditstate='1' and u_state='1' ";
            if (!string.IsNullOrEmpty(type.ToString()))
            {
                if (!string.IsNullOrEmpty(sea_name))
                {
                    if (type == "0")
                    {
                        where += string.Format(" and u_email like '%{0}%'", sea_name);
                    }
                    else if (type == "1")
                    {
                        where += string.Format(" and u_phone like '%{0}%'", sea_name);
                    }
                    else if (type == "3")
                    {
                        where += string.Format(" and u_idnumber like '%{0}%'", sea_name);
                    }
                    else if (type == "6")
                    {
                        where += string.Format(" and u_blicensenumber like '%{0}%'", sea_name);
                    }
                }
            }
            if (!string.IsNullOrEmpty(category))
            {
                where += string.Format(" and u_category={0}", category);
            }
            string Order = " order by u_id " + (px == 0 ? "" : " desc ") + " ";
            string query = "select * from jmp_user" + where;
            list = bll.GetLists(query, Order, pageIndexs, PageSize, out pageCount);
            //返回
            ViewBag.CurrPage  = pageIndexs;
            ViewBag.PageSize  = PageSize;
            ViewBag.PageCount = pageCount;
            ViewBag.stype     = type;
            ViewBag.skeys     = sea_name;
            ViewBag.scategory = category;
            ViewBag.s_sort    = px;
            ViewBag.list      = list;
            #endregion
            return(View());
        }
Beispiel #2
0
        /// <summary>
        /// 开发者直客管理
        /// </summary>
        /// <returns></returns>
        public ActionResult userList()
        {
            #region 初始化
            //获取请求参数
            int pageCount  = 0;
            int pageIndexs = string.IsNullOrEmpty(Request["curr"]) ? 1 : Int32.Parse(Request["curr"]);      //当前页
            int PageSize   = string.IsNullOrEmpty(Request["psize"]) ? 20 : Int32.Parse(Request["psize"]);   //每页显示数量

            string type     = string.IsNullOrEmpty(Request["stype"]) ? "5" : Request["stype"];              //查询条件类型
            string sea_name = string.IsNullOrEmpty(Request["skeys"]) ? "" : Request["skeys"];               //查询条件值
            string category = string.IsNullOrEmpty(Request["scategory"]) ? "" : Request["scategory"];       //认证类型
            int    px       = string.IsNullOrEmpty(Request["s_sort"]) ? 0 : Int32.Parse(Request["s_sort"]); //排序
            //获取用户列表

            //查询已通过审核,账户状态正常,所属关系为商务的直客开发者
            string where = " where 1=1 and u_auditstate='1' and u_state='1' and relation_type='1' ";

            //关联人的ID,比如商务ID,代理商ID
            //where += " and relation_person_id='"+id+"'";

            if (!string.IsNullOrEmpty(type.ToString()))
            {
                if (!string.IsNullOrEmpty(sea_name))
                {
                    switch (type)
                    {
                    case "0":
                        where += string.Format(" and u_email like '%{0}%'", sea_name);
                        break;

                    case "1":
                        where += string.Format(" and u_phone like '%{0}%'", sea_name);
                        break;

                    case "3":
                        where += string.Format(" and u_idnumber like '%{0}%'", sea_name);
                        break;

                    case "6":
                        where += string.Format(" and u_blicensenumber like '%{0}%'", sea_name);
                        break;

                    case "5":
                        where += string.Format(" and u_realname like '%{0}%'", sea_name);
                        break;
                    }
                }
            }
            if (!string.IsNullOrEmpty(category))
            {
                where += string.Format(" and u_category={0}", category);
            }
            string Order = " order by u_id " + (px == 0 ? "" : " desc ") + " ";
            string query = "select a.*,b.DisplayName,c.[Name] from jmp_user a left join CoBusinessPersonnel b on a.relation_person_id = b.Id left join CoServiceFeeRatioGrade c on a.ServiceFeeRatioGradeId = c.Id" + where;
            listUser = bllUser.GetLists(query, Order, pageIndexs, PageSize, out pageCount);
            //返回
            ViewBag.CurrPage  = pageIndexs;
            ViewBag.PageSize  = PageSize;
            ViewBag.PageCount = pageCount;
            ViewBag.stype     = type;
            ViewBag.skeys     = sea_name;
            ViewBag.scategory = category;
            ViewBag.s_sort    = px;
            ViewBag.list      = listUser;
            #endregion

            return(View());
        }