Ejemplo n.º 1
0
        public PageSetting SelPage(int cpage, int psize, Com_Filter filter)
        {
            PageSetting setting = PageSetting.Single(cpage, psize, TbName, PK, "");

            DBCenter.SelPage(setting);
            return(setting);
        }
Ejemplo n.º 2
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.status) && filter.status != "-100")
            {
                where += " AND Status=" + DataConvert.CLng(filter.status);
            }
            if (!string.IsNullOrEmpty(filter.skey))
            {
                where += " AND A.Tittle LIKE @key";
                sp.Add(new SqlParameter("key", "%" + filter.skey + "%"));
            }
            if (!string.IsNullOrEmpty(filter.uids))
            {
                SafeSC.CheckIDSEx(filter.uids);
                where += " AND UserID IN (" + filter.uids + ")";
            }
            if (!string.IsNullOrEmpty(filter.type))
            {
                where += " AND btype LIKE @btype"; sp.Add(new SqlParameter("btype", "%" + filter.type + "%"));
            }
            if (!string.IsNullOrEmpty(filter.nids))
            {
                where += " ANd bkclass=@bkclass"; sp.Add(new SqlParameter("bkclass", filter.nids));
            }
            //if (!string.IsNullOrEmpty(btype)) { where += " AND btype LIKE @btype"; sp.Add(new SqlParameter("btype", "%" + btype + "%")); }
            //if (!string.IsNullOrEmpty(bkclass)) { where += " ANd bkclass=@bkclass"; sp.Add(new SqlParameter("bkclass", bkclass)); }
            string      fields  = "A.*,B.GradeName";
            PageSetting setting = PageSetting.Double(cpage, psize, TbName, "ZL_Grade", "A." + PK, "A.BType=B.GradeName", where, "A." + PK + " DESC", sp, fields);

            DBCenter.SelPage(setting);
            return(setting);
        }
Ejemplo n.º 3
0
        //----------------------------------------------------------------------------------------------------------
        public PageSetting SelPage(int cpage, int psize, Com_Filter filter)
        {
            string where = " 1=1";
            List <SqlParameter> sp = new List <SqlParameter>();

            if (filter.type != "-100")
            {
                where += " AND A.QueType=" + DataConvert.CLng(filter.type);
            }
            if (!string.IsNullOrEmpty(filter.status))
            {
                SafeSC.CheckIDSEx(filter.status); where += " AND A.Status IN (" + filter.status + ")";
            }
            if (!string.IsNullOrEmpty(filter.uids))
            {
                SafeSC.CheckIDSEx(filter.uids); where += " AND A.UserID IN (" + filter.uids + ")";
            }
            if (!string.IsNullOrEmpty(filter.skey))
            {
                where += " AND A.Qcontent LIKE @skey"; sp.Add(new SqlParameter("skey", "%" + filter.skey + "%"));
            }
            if (!string.IsNullOrEmpty(filter.ids))
            {
                SafeSC.CheckIDSEx(filter.ids); where += " AND A.ID IN (" + filter.ids + ")";
            }
            PageSetting setting = PageSetting.Double(cpage, psize, strTableName, "ZL_Grade", "A.ID", "A.QueType=B.GradeID",
                                                     where, "ID DESC", sp, "A.*,B.GradeName");

            DBCenter.SelPage(setting);
            return(setting);
        }
Ejemplo n.º 4
0
        public PageSetting SelPage(int cpage, int psize, Com_Filter filter)
        {
            string fields = "*";

            string where = "1=1";
            List <SqlParameter> sp = new List <SqlParameter>();

            if (filter.storeId != -100)
            {
                where += " AND SpecCate=" + filter.storeId;
            }
            if (filter.pid != -100)
            {
                where += " AND Pid=" + filter.pid;
            }
            if (!string.IsNullOrEmpty(filter.skey))
            {
                where += " AND SpecName LIKE @name";
                sp.Add(new SqlParameter("name", "%" + filter.skey + "%"));
            }
            if (filter.type != "-100")
            {
                where += " AND SpecCate=" + DataConvert.CLng(filter.type);
            }
            if (filter.mode == "list")
            {
                fields = "A.*,(Select Count(*) From ZL_Special Where Pid=A.SpecID) as ChildCount";
            }
            PageSetting setting = PageSetting.Single(cpage, psize, strTableName, PK, where, "OrderID", sp, fields);

            DBCenter.SelPage(setting);
            return(setting);
        }
Ejemplo n.º 5
0
        public PageSetting SelPage(int cpage, int psize, Com_Filter filter)
        {
            List <SqlParameter> sp = new List <SqlParameter>();

            string where = " 1=1";
            //if (group != -100) { where += " AND [Group]=" + group; }
            //if (status != -100) { where += " AND Status=" + status; }
            if (!string.IsNullOrEmpty(filter.skey))
            {
                sp.Add(new SqlParameter("name", "%" + filter.skey + "%"));
                where += " AND Name LIKE @name";
            }
            if (filter.pid > 0)
            {
                where += " And ParentID=" + filter.pid;
            }
            else
            {
                where += " And ParentID=0";
            }
            //不倒序
            PageSetting setting = PageSetting.Single(cpage, psize, TbName, PK, where, "", sp);

            DBCenter.SelPage(setting);
            return(setting);
        }
Ejemplo n.º 6
0
        public PageSetting SelPage(int cpage, int psize, Com_Filter filter)
        {
            string where = "1=1";
            if (filter.storeId > 0)
            {
                where += " AND AppId=" + filter.storeId;
            }

            PageSetting setting = PageSetting.Single(cpage, psize, TbName, PK, where);

            DBCenter.SelPage(setting);
            return(setting);
        }
Ejemplo n.º 7
0
        //--------------
        public PageSetting SelPage(int cpage, int psize, Com_Filter filter)
        {
            string where = "1=1 ";
            List <SqlParameter> sp = new List <SqlParameter>();

            if (filter.storeId != -100)
            {
                where += " AND DicCate=" + filter.storeId;
            }
            if (!string.IsNullOrEmpty(filter.skey))
            {
                where += "DicCateName LIKE @skey"; sp.Add(new SqlParameter("skey", "%" + filter.skey + "%"));
            }
            PageSetting setting = PageSetting.Single(cpage, psize, TbName, PK, where, PK + " DESC", sp);

            DBCenter.SelPage(setting);
            return(setting);
        }
Ejemplo n.º 8
0
        public PageSetting SelPage(int cpage, int psize, Com_Filter filter)
        {
            //, int taskType = -100, string taskName = ""
            string where = "1=1 ";
            List <SqlParameter> sp = new List <SqlParameter>();

            if (!string.IsNullOrEmpty(filter.type) && !filter.type.Equals("-100"))
            {
                where += " AND TaskType=" + DataConvert.CLng(filter.type);
            }
            if (!string.IsNullOrEmpty(filter.skey))
            {
                where += " AND TaskName LIKE @TaskName"; sp.Add(new SqlParameter("TaskName", "%" + filter.skey + "%"));
            }
            PageSetting setting = PageSetting.Single(cpage, psize, TbName, PK, where, PK + " DESC", sp);

            DBCenter.SelPage(setting);
            return(setting);
        }
Ejemplo n.º 9
0
        //public DataTable SelByAppId(int appid, string name = "")
        //{
        //    return SelPage(1, int.MaxValue, new Com_Filter()
        //    {
        //        storeId = appid,
        //        uname = name
        //    }).dt;
        //}
        public PageSetting SelPage(int cpage, int psize, Com_Filter filter)
        {
            List <SqlParameter> sp = new List <SqlParameter>();

            string where = "1=1";
            string stable = "(SELECT A.UserID,A.OpenID,B.UserName FROM ZL_UserApp A LEFT JOIN ZL_User B ON A.UserID=B.UserID WHERE A.SourcePlat='wechat')";

            if (filter.storeId > 0)
            {
                where += " AND A.AppID=" + filter.storeId;
            }
            if (!string.IsNullOrEmpty(filter.uname))
            {
                where += " AND A.Name LIKE @name"; sp.Add(new SqlParameter("name", "%" + filter.uname + "%"));
            }

            PageSetting setting = PageSetting.Double(cpage, psize, "ZL_WX_User", stable, "A.ID", "A.OpenID=B.OpenID", where, "ID DESC", sp, "A.*,B.UserID,B.UserName");

            DBCenter.SelPage(setting);
            return(setting);
        }
Ejemplo n.º 10
0
 public DataTable SelPage(Com_Filter filter)
 {
     return(SelPage(1, int.MaxValue, filter).dt);
 }