예제 #1
0
        public DataTable Sel(Com_Filter filter)
        {
            List <SqlParameter> sp = new List <SqlParameter>();

            string where = "1=1 ";
            if (filter.storeId != -100)
            {
                where += " AND StoreId=" + filter.storeId;
            }
            if (!string.IsNullOrEmpty(filter.status))
            {
                where += " AND ZStatus IN (" + filter.status + ")";
            }
            //根据姓名或号码搜索
            if (!string.IsNullOrEmpty(filter.uname))
            {
                sp.Add(new SqlParameter("uname", "%" + filter.uname + "%"));
                where += " AND (ClientName LIKE @uname  OR ClientMobile LIKE @uname)";
            }
            if (!string.IsNullOrEmpty(filter.addon))
            {
                sp.Add(new SqlParameter("addon", "%" + filter.addon + "%"));
                where += " AND EmployName LIKE @addon";
            }
            return(DBCenter.Sel(TbName, where, PK + " DESC", sp));
        }
예제 #2
0
        public DataTable Sel(Com_Filter filter)
        {
            List <SqlParameter> sp = new List <SqlParameter>();

            string where = "1=1 ";
            if (filter.storeId != -100)
            {
                where += " AND StoreId=" + filter.storeId;
            }
            return(null);
        }
예제 #3
0
        public PageSetting SelPage(int cpage, int psize, Com_Filter filter)
        {
            List <SqlParameter> sp = new List <SqlParameter>();

            string where = "1=1 ";
            if (!string.IsNullOrEmpty(filter.uname))
            {
                sp.Add(new SqlParameter("uname", "%" + filter.uname + "%"));
                where += " AND (HoneyName LIKE @uname OR Mobile LIKE @uname)";
            }
            //用户标签,支持空格
            if (!string.IsNullOrEmpty(filter.skey))
            {
                string   sql    = "";
                string[] labels = filter.skey.Split(" ".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                for (int i = 0; i < labels.Length; i++)
                {
                    string label = labels[i];
                    sp.Add(new SqlParameter("label" + i, "%" + label + "%"));
                    if (i == 0)
                    {
                        sql += " UserLabel LIKE @label" + i + " ";
                    }
                    else
                    {
                        sql += " OR UserLabel LIKE @label" + i;
                    }
                }
                where += " AND (" + sql + ")";
            }
            if (filter.storeId != -100)
            {
                where += " AND StoreID=" + filter.storeId;
            }
            switch (filter.addon)
            {
            case "wechat":    //绑定了微信的用户
                where += " AND OpenID IS NOT NULL";
                break;

            default:
                break;
            }
            PageSetting setting = PageSetting.Single(cpage, psize, TbView, "UserID", where, "UserID DESC", sp);

            DBCenter.SelPage(setting);
            return(setting);
        }
예제 #4
0
        public DataTable Sel(Com_Filter filter)
        {
            List <SqlParameter> sp = new List <SqlParameter>();

            string where = "1=1";
            if (filter.storeId != -100)
            {
                where += " AND StoreID=" + filter.storeId;
            }
            if (!string.IsNullOrEmpty(filter.skey))
            {
                sp.Add(new SqlParameter("skey", "%" + filter.skey + "%"));
                where += " AND RoleName LIKE @skey";
            }
            return(DBCenter.Sel(TbName, where, "ID DESC"));
        }