Exemple #1
0
        private void BindGiftList()
        {
            Chain.BLL.PointGift PointGiftBll = new Chain.BLL.PointGift();

            int    Counts = this.NetPagerParameter.RecordCount;
            string strSql = string.Empty;

            if (PubFunction.curParameter.bolGiftShare)
            {
                strSql = "PointGift.GiftClassID=GiftClass.GiftClassID and PointGift.GiftShopID=SysShop.ShopID ";
            }
            else
            {
                strSql = "PointGift.GiftShopID=SysShop.ShopID and PointGift.GiftClassID=GiftClass.GiftClassID and GiftShopID=" + this._UserShopID;
            }
            DataTable db = PointGiftBll.GetListSP(this.NetPagerParameter.PageSize, this.NetPagerParameter.CurrentPageIndex, true, out Counts, new string[]
            {
                strSql
            }).Tables[0];

            this.NetPagerParameter.RecordCount    = Counts;
            this.NetPagerParameter.CustomInfoHTML = string.Format("<div class=\"results\"><span>当前第{0}/{1}页 共{2}条记录 每页{3}条</span></div>", new object[]
            {
                this.NetPagerParameter.CurrentPageIndex,
                this.NetPagerParameter.PageCount,
                this.NetPagerParameter.RecordCount,
                this.NetPagerParameter.PageSize
            });
            this.gvwGiftList.DataSource = db;
            this.gvwGiftList.DataBind();
            PageBase.BindSerialRepeater(this.gvwGiftList, this.NetPagerParameter.PageSize * (this.NetPagerParameter.CurrentPageIndex - 1));
        }
Exemple #2
0
        private void rptGiftBind()
        {
            Chain.BLL.PointGift bllGift = new Chain.BLL.PointGift();
            string sql = " GiftStockNumber>0 ";

            if (base.Request.QueryString["ClassID"] != null)
            {
                sql = sql + " and GiftClassID=" + base.Request.QueryString["ClassID"];
            }
            if (base.Request.QueryString["Key"] != null)
            {
                sql = sql + " and GiftName like '%" + base.Request.QueryString["Key"] + "%'";
                this.txtKey.Value = base.Request.QueryString["Key"].ToString();
            }
            DataTable dt;

            if (base.Request.QueryString["type"] == "all")
            {
                dt = bllGift.GetList(sql).Tables[0];
            }
            else
            {
                dt = bllGift.GetList(10, sql, "GiftID").Tables[0];
            }
            this.rptGift.DataSource = dt;
            this.rptGift.DataBind();
            if (dt.Rows.Count < 10 || base.Request.QueryString["type"] == "all")
            {
                this.moreGift.Attributes.Add("style", "display:none");
            }
        }
Exemple #3
0
        public void GetListForPointGift()
        {
            string flag = "";

            try
            {
                int    pageIndex = (this.Request["pageIndex"] == null) ? 2 : int.Parse(this.Request["pageIndex"]);
                int    pageSize  = (this.Request["pageSize"] == null) ? 5 : int.Parse(this.Request["pageSize"]);
                string strWhere  = string.Empty;
                if (PubFunction.curParameter.bolGiftShare)
                {
                    strWhere = "PointGift.GiftClassID=GiftClass.GiftClassID and PointGift.GiftShopID=SysShop.ShopID";
                }
                else
                {
                    strWhere = "PointGift.GiftClassID=GiftClass.GiftClassID and PointGift.GiftShopID=SysShop.ShopID and SysShop.ShopID=1";
                }
                int       count;
                DataTable dt = new Chain.BLL.PointGift().GetListSP(pageSize, pageIndex, false, out count, new string[]
                {
                    strWhere
                }).Tables[0];
                flag = JsonPlus.ToJson(dt, "GiftID,GiftPhoto,GiftName,GiftExchangePoint");
            }
            catch
            {
            }
            this.Response.Write(flag);
        }