Ejemplo n.º 1
0
        public void ConvertGift()
        {
            int flag = 0;

            try
            {
                string MemWeiXinCard    = this.Request["MemWeiXinCard"];
                int    GiftID           = int.Parse(this.Request["GiftID"]);
                int    Num              = int.Parse(this.Request["Num"]);
                string memAddress       = this.Request["memAddress"];
                string telNumber        = this.Request["telNumber"];
                int    SumExchangePoint = int.Parse(this.Request["SumExchangePoint"]);
                Chain.Model.GiftExchange giftExchange = new Chain.Model.GiftExchange();
                Chain.Model.Mem          mem          = new Chain.BLL.Mem().GetMemByWeiXinCard(MemWeiXinCard);
                giftExchange.MemID             = mem.MemID;
                giftExchange.ExchangeTelePhone = telNumber;
                giftExchange.ExchangeAddress   = memAddress;
                giftExchange.ExchangeAccount   = DateTime.Now.ToString("yyMMddhhmmssffff");
                giftExchange.ExchangeAllNumber = Num;
                giftExchange.ExchangeAllPoint  = SumExchangePoint;
                giftExchange.ApplicationTime   = DateTime.Now;
                giftExchange.ApplicationRemark = "";
                giftExchange.ExchangeType      = 3;
                giftExchange.ExchangeStatus    = 1;
                flag = new Chain.BLL.GiftExchange().Add(giftExchange);
                if (flag > 0)
                {
                    Chain.Model.GiftExchangeDetail giftExchangeDetailModel = new Chain.Model.GiftExchangeDetail();
                    giftExchangeDetailModel.ExchangeID     = flag;
                    giftExchangeDetailModel.ExchangeGiftID = GiftID;
                    giftExchangeDetailModel.ExchangeNumber = Num;
                    giftExchangeDetailModel.ExchangePoint  = new Chain.BLL.PointGift().GetModel(GiftID).GiftExchangePoint *Num;
                    flag = new Chain.BLL.GiftExchangeDetail().Add(giftExchangeDetailModel);
                }
            }
            catch
            {
                flag = 0;
            }
            this.Response.Write(flag);
        }
Ejemplo n.º 2
0
        public List <Chain.Model.GiftExchange> DataTableToList(DataTable dt)
        {
            List <Chain.Model.GiftExchange> modelList = new List <Chain.Model.GiftExchange>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                for (int i = 0; i < rowsCount; i++)
                {
                    Chain.Model.GiftExchange model = new Chain.Model.GiftExchange();
                    if (dt.Rows[i]["ExchangeID"] != null && dt.Rows[i]["ExchangeID"].ToString() != "")
                    {
                        model.ExchangeID = int.Parse(dt.Rows[i]["ExchangeID"].ToString());
                    }
                    if (dt.Rows[i]["MemID"] != null && dt.Rows[i]["MemID"].ToString() != "")
                    {
                        model.MemID = int.Parse(dt.Rows[i]["MemID"].ToString());
                    }
                    if (dt.Rows[i]["ExchangeTelePhone"] != null && dt.Rows[i]["ExchangeTelePhone"].ToString() != "")
                    {
                        model.ExchangeTelePhone = dt.Rows[i]["ExchangeTelePhone"].ToString();
                    }
                    if (dt.Rows[i]["ExchangeAddress"] != null && dt.Rows[i]["ExchangeAddress"].ToString() != "")
                    {
                        model.ExchangeAddress = dt.Rows[i]["ExchangeAddress"].ToString();
                    }
                    if (dt.Rows[i]["ExchangeAccount"] != null && dt.Rows[i]["ExchangeAccount"].ToString() != "")
                    {
                        model.ExchangeAccount = dt.Rows[i]["ExchangeAccount"].ToString();
                    }
                    if (dt.Rows[i]["ExchangeAllNumber"] != null && dt.Rows[i]["ExchangeAllNumber"].ToString() != "")
                    {
                        model.ExchangeAllNumber = int.Parse(dt.Rows[i]["ExchangeAllNumber"].ToString());
                    }
                    if (dt.Rows[i]["ExchangeAllPoint"] != null && dt.Rows[i]["ExchangeAllPoint"].ToString() != "")
                    {
                        model.ExchangeAllPoint = int.Parse(dt.Rows[i]["ExchangeAllPoint"].ToString());
                    }
                    if (dt.Rows[i]["ApplicationTime"] != null && dt.Rows[i]["ApplicationTime"].ToString() != "")
                    {
                        model.ApplicationTime = DateTime.Parse(dt.Rows[i]["ApplicationTime"].ToString());
                    }
                    if (dt.Rows[i]["ApplicationRemark"] != null && dt.Rows[i]["ApplicationRemark"].ToString() != "")
                    {
                        model.ApplicationRemark = dt.Rows[i]["ApplicationRemark"].ToString();
                    }
                    if (dt.Rows[i]["ExchangeStatus"] != null && dt.Rows[i]["ExchangeStatus"].ToString() != "")
                    {
                        model.ExchangeStatus = int.Parse(dt.Rows[i]["ExchangeStatus"].ToString());
                    }
                    if (dt.Rows[i]["ExchangeTime"] != null && dt.Rows[i]["ExchangeTime"].ToString() != "")
                    {
                        model.ExchangeTime = DateTime.Parse(dt.Rows[i]["ExchangeTime"].ToString());
                    }
                    if (dt.Rows[i]["ExchangeUserID"] != null && dt.Rows[i]["ExchangeUserID"].ToString() != "")
                    {
                        model.ExchangeUserID = int.Parse(dt.Rows[i]["ExchangeUserID"].ToString());
                    }
                    if (dt.Rows[i]["ExchangeRemark"] != null && dt.Rows[i]["ExchangeRemark"].ToString() != "")
                    {
                        model.ExchangeRemark = dt.Rows[i]["ExchangeRemark"].ToString();
                    }
                    if (dt.Rows[i]["ExchangeType"] != null && dt.Rows[i]["ExchangeType"].ToString() != "")
                    {
                        model.ExchangeType = int.Parse(dt.Rows[i]["ExchangeType"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 3
0
 public bool Update(Chain.Model.GiftExchange model)
 {
     return(this.dal.Update(model));
 }
Ejemplo n.º 4
0
 public int MainSystemAdd(Chain.Model.GiftExchange model)
 {
     return(this.dal.MainSystemAdd(model));
 }
Ejemplo n.º 5
0
 public int Add(Chain.Model.GiftExchange model)
 {
     return(this.dal.Add(model));
 }