예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.MemWeiXinCard = base.Request["MemWeiXinCard"];
     this.GiftID        = int.Parse(base.Request["GiftID"]);
     this.Num           = int.Parse(base.Request["Num"]);
     this.mem           = new Chain.BLL.Mem().GetMemByWeiXinCard(this.MemWeiXinCard);
     this.giftModel     = new Chain.BLL.PointGift().GetModel(this.GiftID);
 }
예제 #2
0
        public List <Chain.Model.PointGift> DataTableToList(DataTable dt)
        {
            List <Chain.Model.PointGift> modelList = new List <Chain.Model.PointGift>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                for (int i = 0; i < rowsCount; i++)
                {
                    Chain.Model.PointGift model = new Chain.Model.PointGift();
                    if (dt.Rows[i]["GiftID"] != null && dt.Rows[i]["GiftID"].ToString() != "")
                    {
                        model.GiftID = int.Parse(dt.Rows[i]["GiftID"].ToString());
                    }
                    if (dt.Rows[i]["GiftName"] != null && dt.Rows[i]["GiftName"].ToString() != "")
                    {
                        model.GiftName = dt.Rows[i]["GiftName"].ToString();
                    }
                    if (dt.Rows[i]["GiftCode"] != null && dt.Rows[i]["GiftCode"].ToString() != "")
                    {
                        model.GiftCode = dt.Rows[i]["GiftCode"].ToString();
                    }
                    if (dt.Rows[i]["GiftClassID"] != null && dt.Rows[i]["GiftClassID"].ToString() != "")
                    {
                        model.GiftClassID = int.Parse(dt.Rows[i]["GiftClassID"].ToString());
                    }
                    if (dt.Rows[i]["GiftPhoto"] != null && dt.Rows[i]["GiftPhoto"].ToString() != "")
                    {
                        model.GiftPhoto = dt.Rows[i]["GiftPhoto"].ToString();
                    }
                    if (dt.Rows[i]["GiftExchangePoint"] != null && dt.Rows[i]["GiftExchangePoint"].ToString() != "")
                    {
                        model.GiftExchangePoint = int.Parse(dt.Rows[i]["GiftExchangePoint"].ToString());
                    }
                    if (dt.Rows[i]["GiftStockNumber"] != null && dt.Rows[i]["GiftStockNumber"].ToString() != "")
                    {
                        model.GiftStockNumber = int.Parse(dt.Rows[i]["GiftStockNumber"].ToString());
                    }
                    if (dt.Rows[i]["GiftExchangeNumber"] != null && dt.Rows[i]["GiftExchangeNumber"].ToString() != "")
                    {
                        model.GiftExchangeNumber = int.Parse(dt.Rows[i]["GiftExchangeNumber"].ToString());
                    }
                    if (dt.Rows[i]["GiftShopID"] != null && dt.Rows[i]["GiftShopID"].ToString() != "")
                    {
                        model.GiftShopID = int.Parse(dt.Rows[i]["GiftShopID"].ToString());
                    }
                    if (dt.Rows[i]["GiftRemark"] != null && dt.Rows[i]["GiftRemark"].ToString() != "")
                    {
                        model.GiftRemark = dt.Rows[i]["GiftRemark"].ToString();
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
예제 #3
0
        public int Update(Chain.Model.PointGift model)
        {
            int result;

            if (this.Exists(model.GiftName, model.GiftID, model.GiftShopID))
            {
                result = -1;
            }
            else
            {
                result = this.dal.Update(model);
            }
            return(result);
        }
예제 #4
0
        public int Add(Chain.Model.PointGift model)
        {
            int result;

            if (this.ExistsAdd(model.GiftName, model.GiftShopID))
            {
                result = -1;
            }
            else
            {
                result = this.dal.Add(model);
            }
            return(result);
        }
예제 #5
0
 public void Set_GiftInfo()
 {
     if (this.HidGiftID.Value != "")
     {
         this.modelPg = this.bllPg.GetModel(int.Parse(this.HidGiftID.Value));
         Chain.Model.SysShop modelShop = new Chain.BLL.SysShop().GetModel(this.modelPg.GiftShopID);
         this.lblFrmTitle.Text            = this.lblFrmTitle.Text + "--" + this.modelPg.GiftName + "  礼品编辑";
         this.txtGiftID.Value             = this.modelPg.GiftID.ToString();
         this.txtGiftName.Value           = this.modelPg.GiftName;
         this.txtGiftCode.Value           = this.modelPg.GiftCode;
         this.txtGiftStockNumber.Value    = this.modelPg.GiftStockNumber.ToString();
         this.txtGiftExchangePoint.Value  = this.modelPg.GiftExchangePoint.ToString();
         this.txtGiftExchangeNumber.Value = this.modelPg.GiftExchangeNumber.ToString();
         this.txtGiftRemark.Value         = this.modelPg.GiftRemark;
     }
     else
     {
         this.lblFrmTitle.Text = this.lblFrmTitle.Text + "--  礼品新增";
     }
 }
예제 #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.MemWeiXinCard = base.Request["MemWeiXinCard"];
     this.GiftID        = base.Request["GiftID"];
     this.giftModel     = new Chain.BLL.PointGift().GetModel(int.Parse(this.GiftID));
 }