Beispiel #1
0
        private DataTable MyBind(int pageSize, int pageIndex)
        {
            F_Unbrealla filter = new F_Unbrealla()
            {
                status = 0
            };

            filter.type   = Type_DP.SelectedValue;
            filter.status = DataConvert.CLng(Status_DP.SelectedValue);
            filter.uname  = UName_T.Text.Trim();
            PageSetting config = SelPage(pageIndex, pageSize, filter);

            RPT.ItemCount = config.itemCount;
            return(config.dt);
        }
Beispiel #2
0
        public PageSetting SelPage(int cpage, int psize, F_Unbrealla filter)
        {
            string tbview = "ZL_Ex_OrderView";

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

            switch (filter.type)
            {
            case "user":
                where += " AND Promoter>0";
                break;

            case "store":
                where += " AND Promoter=0";
                break;

            case "all":
            default:
                break;
            }
            if (filter.status != -100)
            {
                where += " AND OrderStatus=" + filter.status;
            }
            if (!string.IsNullOrEmpty(filter.uname))
            {
                where += " AND (HoneyName LIKE @uname OR [Permissions] LIKE @uname) ";
                sp.Add(new SqlParameter("uname", "%" + filter.uname + "%"));
            }
            if (filter.storeID != -100)
            {
                where += " AND StoreID=" + filter.storeID;
            }
            PageSetting config = PageSetting.Single(cpage, psize, tbview, "ID", where, "ID DESC", sp);

            DBCenter.SelPage(config);
            return(config);
        }