Exemple #1
0
        private void GetMemBillList(int MemID)
        {
            Chain.BLL.Mem        bllMem     = new Chain.BLL.Mem();
            Chain.Model.Mem      modelMem   = bllMem.GetModel(MemID);
            Chain.BLL.MemAddress bllAddress = new Chain.BLL.MemAddress();
            DataTable            dt;

            if (base.Request.QueryString["AddressID"] == null)
            {
                dt = bllAddress.GetList(" MemID=" + MemID + " and IsDefault=1 ").Tables[0];
            }
            else
            {
                dt = bllAddress.GetList(string.Concat(new object[]
                {
                    " MemID=",
                    MemID,
                    " and ID=",
                    base.Request.QueryString["AddressID"]
                })).Tables[0];
            }
            if (dt.Rows.Count == 0)
            {
                this.addNewAddress.Visible = true;
            }
            else
            {
                this.txtAddressID.Value    = dt.Rows[0]["ID"].ToString();
                this.addNewAddress.Visible = false;
                this.memname.InnerHtml     = dt.Rows[0]["MemName"].ToString();
                this.mobile.InnerHtml      = dt.Rows[0]["MemMobile"].ToString();
                this.address.InnerHtml     = this.GetMemAddress(dt.Rows[0]["MemProvince"], dt.Rows[0]["MemCity"], dt.Rows[0]["MemCounty"], dt.Rows[0]["MemVillage"], dt.Rows[0]["MemDetailAddress"]);
            }
        }
Exemple #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         int    MemID = 0;
         string MemCard;
         if (this.Session["MemID"] != null)
         {
             MemID = int.Parse(this.Session["MemID"].ToString());
             Chain.Model.Mem modelMem = new Chain.BLL.Mem().GetModel(MemID);
             MemCard = modelMem.MemCard;
         }
         else if (this.Session["MemCard"] != null)
         {
             MemCard = this.Session["MemCard"].ToString();
         }
         else
         {
             MemCard = "wxid_" + onlineAsk.GenerateRandom(10);
             this.Session["MemCard"] = MemCard;
         }
         this.txtMemID.Value   = MemID.ToString();
         this.txtMemCard.Value = MemCard;
         this.rptOnlinAskBind(MemCard);
         this.bllProposal.UpdateShowStatus(MemCard);
     }
 }
Exemple #3
0
        public void UpdateMemInfo()
        {
            int flag = 0;

            try
            {
                string   MemWeiXinCard   = this.Request["MemWeiXinCard"];
                string   MemName         = this.Request["MemName"];
                bool     MemSex          = !(this.Request["MemSex"] == "0");
                string   tempMemBirthday = this.Request["MemBirthday"];
                string   MemCard         = this.Request["MemCard"];
                DateTime MemBirthday;
                if (DateTime.TryParse(tempMemBirthday, out MemBirthday))
                {
                    Chain.BLL.Mem   memBll   = new Chain.BLL.Mem();
                    Chain.Model.Mem memModel = memBll.GetModelByMemCard(MemCard);
                    memModel.MemName     = MemName;
                    memModel.MemSex      = MemSex;
                    memModel.MemBirthday = MemBirthday;
                    flag = memBll.Update(memModel);
                }
                else
                {
                    flag = -1;
                }
            }
            catch
            {
                flag = 0;
            }
            this.Response.Write(flag);
        }
Exemple #4
0
        private void GetSysRemind()
        {
            int count = 5;

            Chain.BLL.Mem bllMem     = new Chain.BLL.Mem();
            DataTable     dtBirhtday = bllMem.GetBirthdayList(0, this.shopID, count).Tables[0];

            this.gvMemBirthday.DataSource = dtBirhtday;
            this.gvMemBirthday.DataBind();
            StartPage.RepeaterBindSerial(this.gvMemBirthday, 0);
            DataTable dtMemPastTime = bllMem.GetMemPastTime(" and DATEDIFF(day,getdate(),MemPastTime) = 0 ", this.shopID, count).Tables[0];

            this.gvMemPastTime.DataSource = dtMemPastTime;
            this.gvMemPastTime.DataBind();
            StartPage.RepeaterBindSerial(this.gvMemPastTime, 0);
            DataTable dtMemPointRest = bllMem.GetMemPointReset(string.Format("MemPoint>0 and DATEDIFF(day,isnull(MemConsumeLastTime,MemCreateTime),getdate()) >= '{0}' and MemShopID = '{1}' ", PubFunction.curParameter.intPointPeriod, this.shopID), 0, count).Tables[0];

            this.gvdMemPontReset.DataSource = dtMemPointRest;
            this.gvdMemPontReset.DataBind();
            StartPage.RepeaterBindSerial(this.gvdMemPontReset, 0);
            DataTable dtGoods = new Chain.BLL.Goods().GetStockRemind(string.Format("Number < = '{0}' and GoodsType = '0' and ShopID = '{1}'", PubFunction.curParameter.intStockCount, this.shopID), count).Tables[0];

            this.gvGoods.DataSource = dtGoods;
            this.gvGoods.DataBind();
            StartPage.RepeaterBindSerial(this.gvGoods, 0);
            DataTable dtCustomRemind = new Chain.BLL.SysCustomRemind().GetList("CustomReminder like '%" + PubFunction.UserIDTOName(this.userid) + "%' and DATEDIFF(day,CustomRemindTime,getdate())<=0 ", count).Tables[0];

            this.gvCustomRemind.DataSource = dtCustomRemind;
            this.gvCustomRemind.DataBind();
            StartPage.RepeaterBindSerial(this.gvCustomRemind, 0);
        }
Exemple #5
0
        private void BindMemInfo(int MemID)
        {
            Chain.BLL.Mem   bllMem        = new Chain.BLL.Mem();
            Chain.Model.Mem modelMem      = bllMem.GetModel(MemID);
            int             exchangePoint = new Chain.BLL.GiftExchange().GetMemExchangePoint("MemID=" + MemID + " and ExchangeStatus=1");

            this.spMemPointTotal.InnerHtml = (modelMem.MemPoint - exchangePoint).ToString();
        }
Exemple #6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (this.Session["MemID"] != null)
         {
             int memID = int.Parse(this.Session["MemID"].ToString());
             this.txtMemID.Value = memID.ToString();
             if (base.Request["MoneyID"] != null)
             {
                 string moneyID = base.Request["MoneyID"].ToString();
                 this.BindWeiXinMoney(int.Parse(base.Request["MoneyID"]));
                 this.txtGetMoneyID.Value = base.Request["MoneyID"];
             }
             string openid = new Chain.BLL.Mem().GetWeiXinMemCardbyMemID(memID);
             this.OpenID.Value = openid;
             if (base.Request["Win"] != null)
             {
                 Chain.BLL.WeiXinMoney   bllWeiXinMoney   = new Chain.BLL.WeiXinMoney();
                 Chain.Model.WeiXinMoney modelWeiXinMoney = bllWeiXinMoney.GetModel(int.Parse(this.txtGetMoneyID.Value));
                 decimal givemoney  = new Chain.BLL.WeiXinGiveMoney().GetMoneySum(" MoneyID=" + modelWeiXinMoney.MoneyID);
                 decimal totalmoney = modelWeiXinMoney.TotalMoney;
                 if (totalmoney - givemoney < 1m)
                 {
                     this.IsWin.Value  = "-1";
                     this.txtMsg.Value = "红包已抢完!";
                 }
                 else
                 {
                     int intWin = this.isWin(decimal.Parse(this.MoneyRate.Value), int.Parse(this.MemtotalCount.Value));
                     this.IsWin.Value = intWin.ToString();
                     if (intWin == 0)
                     {
                         Chain.BLL.WeiXinGiveMoney bllWeiXinGiveMoney = new Chain.BLL.WeiXinGiveMoney();
                         bllWeiXinGiveMoney.Add(new Chain.Model.WeiXinGiveMoney
                         {
                             MemID     = int.Parse(this.txtMemID.Value),
                             MoneyID   = int.Parse(this.txtGetMoneyID.Value),
                             GiveMoney = 0m,
                             GiveTime  = DateTime.Now,
                             IsWin     = 0
                         });
                     }
                 }
             }
             if (base.Request["IsSuccess"] != null)
             {
                 this.IsSuccess.Value = base.Request["IsSuccess"];
             }
             this.rptWinListBind();
         }
         else
         {
             base.Response.Redirect("login.aspx");
         }
     }
 }
Exemple #7
0
        private void BindWeiXinMoney(int moneyID)
        {
            Chain.BLL.WeiXinMoney   bllWeiXinMoney   = new Chain.BLL.WeiXinMoney();
            Chain.Model.WeiXinMoney modelWeiXinMoney = bllWeiXinMoney.GetModel(moneyID);
            this.spEndTime.InnerHtml   = modelWeiXinMoney.EndTime.ToString("yyyy.MM.dd HH:mm");
            this.spStartTime.InnerHtml = modelWeiXinMoney.StartTime.ToString("yyyy.MM.dd HH:mm");
            int count = new Chain.BLL.WeiXinMoneyMem().GetRecordCount("MoneyID=" + modelWeiXinMoney.MoneyID);

            this.MemtotalCount.Value = count.ToString();
            DataTable dt;

            if (modelWeiXinMoney.QuerySql != null)
            {
                dt = new Chain.BLL.Mem().GetList(modelWeiXinMoney.QuerySql).Tables[0];
            }
            else
            {
                dt = new Chain.BLL.Mem().GetList("").Tables[0];
            }
            this.IsOwn.Value = "0";
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                if (this.txtMemID.Value == dt.Rows[i]["MemID"].ToString())
                {
                    this.IsOwn.Value = "1";
                    break;
                }
            }
            int maxcount = modelWeiXinMoney.MaxCount;
            int memcount = new Chain.BLL.WeiXinGiveMoney().GetRecordCount(string.Concat(new object[]
            {
                " MemID=",
                int.Parse(this.txtMemID.Value),
                " and MoneyID=",
                modelWeiXinMoney.MoneyID
            }));

            this.MemCount.Value         = (maxcount - memcount).ToString();
            this.spNoUseCount.InnerHtml = this.MemCount.Value;
            this.MaxCount.Value         = modelWeiXinMoney.MaxCount.ToString();
            this.MoneyRate.Value        = modelWeiXinMoney.MoneyRate.ToString();
            this.TotalMoney.Value       = modelWeiXinMoney.TotalMoney.ToString();
            this.StartMoney.Value       = modelWeiXinMoney.StartMoney.ToString();
            this.EndMoney.Value         = modelWeiXinMoney.EndMoney.ToString();
            this.MoneyType.Value        = modelWeiXinMoney.MoneyType.ToString();
            this.FixedMoney.Value       = modelWeiXinMoney.FixedMoney.ToString();
            this.txtImageUrl.Value      = modelWeiXinMoney.ImageUrl.ToString();
            this.spDesc.InnerHtml       = modelWeiXinMoney.MoneyDesc.ToString();
            decimal money = new Chain.BLL.WeiXinGiveMoney().GetMoneySum(" MoneyID=" + modelWeiXinMoney.MoneyID);

            this.GiveMoney.Value = money.ToString();
        }
Exemple #8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (this.Session["MemID"] != null)
         {
             int MemID = int.Parse(this.Session["MemID"].ToString());
             this.txtMemID.Value = MemID.ToString();
             Chain.BLL.Mem   bllMem   = new Chain.BLL.Mem();
             Chain.Model.Mem modelMem = bllMem.GetModel(MemID);
             this.spMemName.InnerHtml      = modelMem.MemName;
             this.spMemCard.InnerHtml      = modelMem.MemCard;
             this.spOrderAccount.InnerHtml = "wxcz" + DateTime.Now.ToString("yyyyMMddHHmmssffff");
             if (base.Request["money"] != null)
             {
                 this.spMoney.InnerHtml = base.Request["money"].ToString();
             }
             if (base.Request["givemoney"] != null)
             {
                 this.spGiveMoney.InnerHtml = base.Request["givemoney"].ToString();
             }
             if (base.Request["point"] != null)
             {
                 this.spPoint.InnerHtml = base.Request["point"].ToString();
             }
             decimal amount    = decimal.Parse(this.spMoney.InnerHtml) + decimal.Parse(this.spGiveMoney.InnerHtml);
             string  total_fee = double.Parse((amount * 100m).ToString("#0")).ToString();
             string  url       = string.Concat(new string[]
             {
                 "http://",
                 PubFunction.curParameter.strDoMain,
                 "/mobile/member/RechargeJsApiPayPage.aspx?MemID=",
                 this.txtMemID.Value,
                 "&OrderAccount=",
                 this.spOrderAccount.InnerHtml,
                 "&money=",
                 this.spMoney.InnerHtml,
                 "&givemoney=",
                 this.spGiveMoney.InnerHtml,
                 "&point=",
                 this.spPoint.InnerHtml
             });
             string lineLinkurl = string.Format("https://open.weixin.qq.com/connect/oauth2/authorize?appid={0}&redirect_uri={1}&response_type=code&scope=snsapi_base&state={2}#wechat_redirect", PubFunction.curParameter.strWeiXinAppID, rechargeOnlineSure.UrlEncode(url), total_fee);
             this.txtUrl.Value = lineLinkurl;
         }
         else
         {
             base.Response.Redirect("login.aspx");
         }
     }
 }
Exemple #9
0
        private void GetMemList(string strSql)
        {
            Chain.BLL.Mem member = new Chain.BLL.Mem();
            int           Counts = this.NetPagerParameter.RecordCount;

            strSql += " and Mem.MemShopID = SysShop.ShopID and Mem.MemLevelID = MemLevel.LevelID and Mem.MemUserID = SysUser.UserID ";
            strSql += " and Mem.MemShopID =SysShopMemLevel.ShopID and SysShopMemLevel.MemLevelID=MemLevel.LevelID ";
            DataTable dtMem = member.GetListSP(this.NetPagerParameter.PageSize, this.NetPagerParameter.CurrentPageIndex, out Counts, new string[]
            {
                PubFunction.GetMemListShopAuthority(this._UserShopID, "MemShopID", 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.gvMemList.DataSource = dtMem;
            this.gvMemList.DataBind();
            PageBase.BindSerialRepeater(this.gvMemList, this.NetPagerParameter.PageSize * (this.NetPagerParameter.CurrentPageIndex - 1));
            Chain.BLL.MemCustomField          bllCustom = new Chain.BLL.MemCustomField();
            List <Chain.Model.MemCustomField> fieldlist = bllCustom.GetModelList("CustomType=1 and CustomFieldIsShow=1");

            if (fieldlist.Count > 0)
            {
                StringBuilder strHeader = new StringBuilder();
                StringBuilder strHtml   = new StringBuilder();
                for (int i = 0; i < this.gvMemList.Items.Count; i++)
                {
                    Literal   ltlMemID = (Literal)this.gvMemList.Items[i].FindControl("ltlMemID");
                    Literal   ltlHtml  = (Literal)this.gvMemList.Items[i].FindControl("ltlHtml");
                    int       MemID    = Convert.ToInt32(ltlMemID.Text);
                    DataRow[] drMem    = dtMem.Select(string.Format(" MemID = {0}", MemID));
                    strHtml.Length = 0;
                    foreach (Chain.Model.MemCustomField mdCustomField in fieldlist)
                    {
                        if (i == 0)
                        {
                            strHeader.AppendFormat("<th>{0}</th>", mdCustomField.CustomFieldName);
                        }
                        strHtml.AppendFormat("<td>{0}</td>", drMem[0][mdCustomField.CustomField]);
                    }
                    ltlHtml.Text = strHtml.ToString();
                }
                this.ltlHeader.Text = strHeader.ToString();
            }
        }
Exemple #10
0
        private void BindMemInfo(int MemID)
        {
            Chain.Model.Mem modelMem = new Chain.BLL.Mem().GetModel(MemID);
            decimal         maxmoney = 0m;

            if (modelMem.MemMoney > 0m)
            {
                maxmoney = modelMem.MemMoney * decimal.Parse(0.99.ToString());
            }
            this.spMaxMoney.InnerHtml = maxmoney.ToString("#0.00");
            this.txtRate.Value        = "0.01";
            this.spRate.InnerHtml     = PubFunction.curParameter.dclGiveMemMoneyRate.ToString() + "%";
            this.txtRate.Value        = (PubFunction.curParameter.dclGiveMemMoneyRate / 100m).ToString();
        }
Exemple #11
0
        protected void BtnMemExcel_Click(object sender, EventArgs e)
        {
            Chain.BLL.Mem bllMember = new Chain.BLL.Mem();
            int           Counts    = this.NetPagerParameter.RecordCount;
            string        strSql    = this.QueryCondition();

            strSql += "and Mem.MemShopID = SysShop.ShopID and Mem.MemLevelID = MemLevel.LevelID and Mem.MemUserID = SysUser.UserID";
            strSql += " and Mem.MemShopID =SysShopMemLevel.ShopID and SysShopMemLevel.MemLevelID=MemLevel.LevelID ";
            DataTable db = bllMember.GetListSP(100000, 1, out Counts, new string[]
            {
                PubFunction.GetMemListShopAuthority(this._UserShopID, "MemShopID", strSql)
            }).Tables[0];

            DataExcelInfo.MemReportExcel(db, this._UserName);
        }
Exemple #12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (base.Request["MemID"] != "")
     {
         this.intMemID = int.Parse(base.Request["MemID"]);
         Chain.BLL.Mem   bllMem   = new Chain.BLL.Mem();
         Chain.Model.Mem modelMem = new Chain.Model.Mem();
         modelMem = bllMem.GetModel(this.intMemID);
         if (modelMem.MemName != "")
         {
             Label expr_75 = this.lblFrmTitle;
             expr_75.Text = expr_75.Text + "---" + modelMem.MemName;
         }
     }
     this.BindMemCountList();
 }
        private void BindData(int MoneyID)
        {
            Chain.BLL.WeiXinMoney   bllWeiXinMoney   = new Chain.BLL.WeiXinMoney();
            Chain.Model.WeiXinMoney modelWeiXinMoney = bllWeiXinMoney.GetModel(MoneyID);
            this.txtMoneyTitle.Value = modelWeiXinMoney.MoneyTitle;
            this.txtMoneyDesc.Value  = modelWeiXinMoney.MoneyDesc;
            this.txtMoneyWish.Value  = modelWeiXinMoney.MoneyWish;
            this.imgMoneyPhoto.Src   = modelWeiXinMoney.ImageUrl;
            this.txtMoneyPhoto.Value = modelWeiXinMoney.ImageUrl;
            this.txtEndTime.Value    = modelWeiXinMoney.EndTime.ToString("yyyy-MM-dd HH:mm");
            this.txtStartTime.Value  = modelWeiXinMoney.StartTime.ToString("yyyy-MM-dd HH:mm");
            this.txtTotalMoney.Value = modelWeiXinMoney.TotalMoney.ToString();
            if (modelWeiXinMoney.MoneyType == 1)
            {
                this.radMoneyTypeOne.Checked = true;
                this.radMoneyTypeTwo.Checked = false;
                this.txtStartMoney.Value     = modelWeiXinMoney.StartMoney.ToString();
                this.txtEndMoney.Value       = modelWeiXinMoney.EndMoney.ToString();
            }
            else
            {
                this.radMoneyTypeOne.Checked = false;
                this.radMoneyTypeTwo.Checked = true;
                this.txtFixedMoney.Value     = modelWeiXinMoney.FixedMoney.ToString();
            }
            this.txtMaxCount.Value    = modelWeiXinMoney.MaxCount.ToString();
            this.txtMoneyRate.Value   = modelWeiXinMoney.MoneyRate.ToString();
            this.txtMoneyRegion.Value = modelWeiXinMoney.MoneyRegion;
            this.txtQuerySql.Value    = modelWeiXinMoney.QuerySql;
            DataTable dt = new Chain.BLL.Mem().GetList(this.txtQuerySql.Value).Tables[0];

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                HtmlTextArea expr_1EA = this.txtMemList;
                string       value    = expr_1EA.Value;
                expr_1EA.Value = string.Concat(new string[]
                {
                    value,
                    dt.Rows[i]["MemCard"].ToString(),
                    "[",
                    dt.Rows[i]["MemName"].ToString(),
                    "];"
                });
                this.txtMemIDList.Value = dt.Rows[i]["MemID"].ToString();
            }
            this.lblStartTime.Visible = false;
        }
 public void GetMemInfoByMobile(string mobile)
 {
     Chain.Model.Mem modelMem = new Chain.BLL.Mem().GetMemInfoByMobile(mobile);
     if (modelMem != null)
     {
         this.txtFMemID.Value           = modelMem.MemID.ToString();
         this.txtFMemCard.Value         = modelMem.MemCard;
         this.txtFMemName.Value         = modelMem.MemName;
         this.txtFMemMoney.Value        = modelMem.MemMoney.ToString();
         this.txtFMemPoint.Value        = modelMem.MemPoint.ToString();
         this.txtFMemLevelName.Value    = PubFunction.LevelIDToName(modelMem.MemLevelID);
         this.txtFMemShopName.Value     = PubFunction.ShopIDToName(modelMem.MemShopID);
         this.txtFMemMobile.Value       = modelMem.MemMobile;
         this.txtFMemState.Value        = PubFunction.StateToName(modelMem.MemState);
         this.txtFMemBirthday.Value     = modelMem.MemBirthday.ToShortDateString();
         this.txtFMemSex.Value          = PubFunction.SexToName(modelMem.MemSex);
         this.txtFMemIdentityCard.Value = modelMem.MemIdentityCard;
         this.txtFMemPastTime.Value     = modelMem.MemPastTime.ToShortDateString();
         this.txtFMemEmail.Value        = modelMem.MemEmail;
         string address = "";
         if (!string.IsNullOrEmpty(modelMem.MemVillage))
         {
             this.GetAddressName(modelMem.MemVillage, ref address);
         }
         else if (!string.IsNullOrEmpty(modelMem.MemCounty))
         {
             this.GetAddressName(modelMem.MemCounty, ref address);
         }
         else if (!string.IsNullOrEmpty(modelMem.MemCity))
         {
             this.GetAddressName(modelMem.MemCity, ref address);
         }
         else if (!string.IsNullOrEmpty(modelMem.MemProvince))
         {
             this.GetAddressName(modelMem.MemProvince, ref address);
         }
         if (string.IsNullOrEmpty(modelMem.MemAddress))
         {
             modelMem.MemAddress = "无";
         }
         this.txtFMemAddress.Value    = address + modelMem.MemAddress;
         this.txtFMemCreateTime.Value = modelMem.MemCreateTime.ToShortDateString();
         this.txtFMemUserName.Value   = PubFunction.UserIDTOName(modelMem.MemUserID);
     }
 }
Exemple #15
0
        public string GetMemName(object memid)
        {
            string memname = "";
            string result;

            if (memid != null)
            {
                if (memid.ToString() != "0")
                {
                    Chain.Model.Mem modelMem = new Chain.BLL.Mem().GetModel(int.Parse(memid.ToString()));
                    result = modelMem.MemName;
                    return(result);
                }
                memname = "散客";
            }
            result = memname;
            return(result);
        }
Exemple #16
0
        public string GetMemName(object memid)
        {
            string result = "";
            int    MemID  = int.Parse(memid.ToString());

            if (MemID == 0)
            {
                result = "游客";
            }
            else
            {
                Chain.Model.Mem modelMem = new Chain.BLL.Mem().GetModel(MemID);
                if (modelMem != null)
                {
                    result = modelMem.MemName;
                }
            }
            return(result);
        }
Exemple #17
0
        private void BindMemInfo(int MemID)
        {
            Chain.Model.Mem modelMem = new Chain.BLL.Mem().GetModel(MemID);
            this.spMemCard.InnerHtml = modelMem.MemCard;
            this.spMemName.InnerHtml = modelMem.MemName.ToString();
            List <Chain.Model.SysShopMemLevel> list = new Chain.BLL.SysShopMemLevel().GetModelList(string.Format(" ShopID=1 and MemLeveLID={0} ", modelMem.MemLevelID));

            if (list.Count > 0)
            {
                Chain.Model.MemLevel mdlMemLevel = new Chain.BLL.MemLevel().GetModel(modelMem.MemLevelID);
                if (list[0].ClassRechargePointRate > 0m)
                {
                    this.txtPointRate.Value = list[0].ClassRechargePointRate.ToString();
                }
                else
                {
                    this.txtPointRate.Value = "0";
                }
            }
        }
Exemple #18
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);
        }
Exemple #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string MemWeiXinCard = base.Request["MemWeiXinCard"];

            if (!string.IsNullOrEmpty(MemWeiXinCard))
            {
                Chain.Model.Mem mem = new Chain.BLL.Mem().GetMemByWeiXinCard(MemWeiXinCard);
                if (mem != null)
                {
                    this.weixinRecharge.HRef       = "WeiXinRecharge.aspx?MemWeiXinCard=" + MemWeiXinCard + "&rc=" + PubFunction.GetDataTimeString();
                    this.weixinCardImg.Src         = "../Upload/WeiXin/Images/" + MemWeiXinCard + ".jpg?rc=" + PubFunction.GetDataTimeString();
                    this.weixinExpense.HRef        = "WeiXinExpense.aspx?MemWeiXinCard=" + MemWeiXinCard + "&rc=" + PubFunction.GetDataTimeString();
                    this.weixinPointChange.HRef    = "WeiXinPointChange.aspx?MemWeiXinCard=" + MemWeiXinCard + "&rc=" + PubFunction.GetDataTimeString();
                    this.weixinUpdateInfo.HRef     = "WeiXinUpdateInfo.aspx?MemWeiXinCard=" + MemWeiXinCard + "&rc=" + PubFunction.GetDataTimeString();
                    this.weixinPointExchange.HRef  = "WeiXinPointExchange.aspx?MemWeiXinCard=" + MemWeiXinCard + "&rc=" + PubFunction.GetDataTimeString();
                    this.weixinConvertHistory.HRef = "WeiXinConvertHistory.aspx?MemWeiXinCard=" + MemWeiXinCard + "&rc=" + PubFunction.GetDataTimeString();
                    this.weixinLookCoupon.HRef     = "WeiXinCoupon.aspx?MemWeiXinCard=" + MemWeiXinCard + "&rc=" + PubFunction.GetDataTimeString();
                    this.DrawImage(mem, MemWeiXinCard);
                }
            }
        }
Exemple #20
0
        private int GetSysRemind(int shopID, int userid)
        {
            int sumCount = 0;
            int count    = 100000;

            Chain.BLL.Mem bllMem     = new Chain.BLL.Mem();
            DataTable     dtBirhtday = bllMem.GetBirthdayList(0, shopID, count).Tables[0];

            sumCount += dtBirhtday.Rows.Count;
            DataTable dtMemPastTime = bllMem.GetMemPastTime(" and DATEDIFF(day,getdate(),MemPastTime) = 0 ", shopID, count).Tables[0];

            sumCount += dtMemPastTime.Rows.Count;
            DataTable dtMemPointRest = bllMem.GetMemPointReset(string.Format("MemPoint>0 and DATEDIFF(day,isnull(MemConsumeLastTime,MemCreateTime),getdate()) >= '{0}' and MemShopID = '{1}' ", PubFunction.curParameter.intPointPeriod, shopID), 0, count).Tables[0];

            sumCount += dtMemPointRest.Rows.Count;
            DataTable dtGoods = new Chain.BLL.Goods().GetStockRemind(string.Format("Number < = '{0}' and GoodsType = '0' and ShopID = '{1}'", PubFunction.curParameter.intStockCount, shopID), count).Tables[0];

            sumCount += dtGoods.Rows.Count;
            DataTable dtCustomRemind = new Chain.BLL.SysCustomRemind().GetList("CustomReminder like '%" + PubFunction.UserIDTOName(userid) + "%' and DATEDIFF(day,CustomRemindTime,getdate())<=0 ", count).Tables[0];

            return(sumCount + dtCustomRemind.Rows.Count);
        }
Exemple #21
0
        public void GetExpense()
        {
            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    MemWeiXinCard = this.Request["MemWeiXinCard"];
                string    strWhere      = "MemWeiXinCard='" + MemWeiXinCard + "'";
                int       count;
                DataTable dt = new Chain.BLL.Mem().GetMemExpenseToWeiXin(pageSize, pageIndex, out count, new string[]
                {
                    strWhere
                }).Tables[0];
                flag = JsonPlus.ToJson(dt, "OrderAccount,OrderTotalMoney,OrderDiscountMoney,OrderPayCoupon,OrderPoint,OrderCreateTime");
            }
            catch
            {
            }
            this.Response.Write(flag);
        }
Exemple #22
0
        private void BindMemInfo(int MemID)
        {
            Chain.BLL.Mem bllMem = new Chain.BLL.Mem();
            int           counts = 0;
            string        strSql = " Mem.MemShopID = SysShop.ShopID and Mem.MemLevelID = MemLevel.LevelID and Mem.MemUserID=SysUser.UserID and Mem.MemID=" + MemID;
            DataTable     dtMem  = bllMem.GetListSP(1, 1, out counts, new string[]
            {
                strSql.ToString()
            }).Tables[0];

            if (dtMem.Rows.Count > 0)
            {
                this.spMemCard.InnerHtml       = dtMem.Rows[0]["MemCard"].ToString();
                this.spMemMoney.InnerHtml      = decimal.Parse(dtMem.Rows[0]["MemMoney"].ToString()).ToString("#0.00");
                this.spMemPoint.InnerHtml      = decimal.Parse(dtMem.Rows[0]["MemPoint"].ToString()).ToString("#0");
                this.spLevelName.InnerHtml     = dtMem.Rows[0]["LevelName"].ToString();
                this.spMemName.InnerHtml       = ((dtMem.Rows[0]["MemName"].ToString() == "") ? "&nbsp;" : dtMem.Rows[0]["MemName"].ToString());
                this.spMemStatus.InnerHtml     = this.GetMemState(int.Parse(dtMem.Rows[0]["MemState"].ToString()));
                this.spShopName.InnerHtml      = dtMem.Rows[0]["ShopName"].ToString();
                this.spIdentityCard.InnerHtml  = ((dtMem.Rows[0]["MemIdentityCard"].ToString() == "") ? "无" : dtMem.Rows[0]["MemIdentityCard"].ToString());
                this.spEmail.InnerHtml         = ((dtMem.Rows[0]["MemEmail"].ToString() == "") ? "无" : dtMem.Rows[0]["MemEmail"].ToString());
                this.spAddress.InnerHtml       = this.GetMemAddress(dtMem.Rows[0]["MemProvinceName"].ToString(), dtMem.Rows[0]["MemCityName"].ToString(), dtMem.Rows[0]["MemCountyName"].ToString(), dtMem.Rows[0]["MemVillageName"].ToString(), dtMem.Rows[0]["MemAddress"].ToString());
                this.spMobile.InnerHtml        = dtMem.Rows[0]["MemMobile"].ToString();
                this.spBirthday.InnerHtml      = DateTime.Parse(dtMem.Rows[0]["MemBirthday"].ToString()).ToString("yyyy-MM-dd");
                this.spCardNumber.InnerHtml    = ((dtMem.Rows[0]["MemCardNumber"].ToString() == "") ? "无" : dtMem.Rows[0]["MemCardNumber"].ToString());
                this.spUserName.InnerHtml      = dtMem.Rows[0]["UserName"].ToString();
                this.spRecommendCard.InnerHtml = ((dtMem.Rows[0]["MemRecommendID"].ToString() != "0") ? this.GetRecommendCard(int.Parse(dtMem.Rows[0]["MemRecommendID"].ToString())) : "无");
                this.spCreateTime.InnerHtml    = DateTime.Parse(dtMem.Rows[0]["MemCreateTime"].ToString()).ToString("yyyy-MM-dd");
                this.spPastTime.InnerHtml      = DateTime.Parse(dtMem.Rows[0]["MemPastTime"].ToString()).ToString("yyyy-MM-dd");
                if (dtMem.Rows[0]["MemPhoto"].ToString() != "")
                {
                    this.imgPhoto.Src = dtMem.Rows[0]["MemPhoto"].ToString();
                }
                else
                {
                    this.imgPhoto.Src = "images/headimg.jpg";
                }
            }
        }
 private void BindData()
 {
     if (this.Session["QuerySql"] != null)
     {
         this.txtQuerySql.Value = this.Session["QuerySql"].ToString();
         DataTable dt = new Chain.BLL.Mem().GetList(this.txtQuerySql.Value).Tables[0];
         for (int i = 0; i < dt.Rows.Count; i++)
         {
             HtmlTextArea expr_6C = this.txtMemList;
             string       value   = expr_6C.Value;
             expr_6C.Value = string.Concat(new string[]
             {
                 value,
                 dt.Rows[i]["MemCard"].ToString(),
                 "[",
                 dt.Rows[i]["MemName"].ToString(),
                 "];"
             });
             HtmlTextArea expr_E3 = this.txtMemIDList;
             expr_E3.Value = expr_E3.Value + dt.Rows[i]["MemID"].ToString() + ",";
         }
     }
 }
Exemple #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (this.Session["MemID"] != null)
         {
             int             MemID    = int.Parse(this.Session["MemID"].ToString());
             Chain.Model.Mem modelMem = new Chain.BLL.Mem().GetModel(MemID);
             if (modelMem.MemPhoto != null && modelMem.MemPhoto != "")
             {
                 this.imgShow.Src = modelMem.MemPhoto.ToString();
             }
             else
             {
                 this.imgShow.Src = "images/headimg.jpg";
             }
         }
         else
         {
             base.Response.Redirect("login.aspx");
         }
     }
 }
Exemple #25
0
        private void BindMemInfo(int MemID)
        {
            Chain.Model.Mem modelMem = new Chain.BLL.Mem().GetModel(MemID);
            this.spMemCard.InnerHtml  = modelMem.MemCard;
            this.spMemMoney.InnerHtml = modelMem.MemMoney.ToString("#0.00");
            this.spMemPoint.InnerHtml = modelMem.MemPoint.ToString("#0");
            this.spMemName.InnerHtml  = ((modelMem.MemName.ToString() == "") ? "&nbsp;" : modelMem.MemName.ToString());
            if (modelMem.MemPhoto != null && modelMem.MemPhoto != "")
            {
                this.imgPhoto.Src = modelMem.MemPhoto.ToString();
            }
            else
            {
                this.imgPhoto.Src = "images/headimg.jpg";
            }
            this.spLevelName.InnerHtml = new Chain.BLL.MemLevel().GetNameByID(modelMem.MemLevelID);
            this.spMemState.InnerHtml  = this.GetMemState(modelMem.MemState);
            string url = string.Format("https://open.weixin.qq.com/connect/oauth2/authorize?appid={0}&redirect_uri=http://{1}/mobile/member/binding.aspx&response_type=code&scope=snsapi_userinfo&state=0#wechat_redirect", PubFunction.curParameter.strWeiXinAppID, PubFunction.curParameter.strDoMain);

            this.txtUrl.Value = url;
            string RechargeUrl = string.Format("https://open.weixin.qq.com/connect/oauth2/authorize?appid={0}&redirect_uri=http://{1}/mobile/member/rechargeOnline.aspx&response_type=code&scope=snsapi_base&state=0#wechat_redirect", PubFunction.curParameter.strWeiXinAppID, PubFunction.curParameter.strDoMain);

            this.txtRechargeUrl.Value = RechargeUrl;
        }
Exemple #26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         if (this.Session["MemID"] != null)
         {
             int memID = int.Parse(this.Session["MemID"].ToString());
             this.txtMemID.Value = memID.ToString();
             if (base.Request.QueryString["MoneyID"] != null)
             {
                 this.txtMoneyID.Value = base.Request.QueryString["MoneyID"].ToString();
                 this.BindWeiXinMoney(int.Parse(this.txtMoneyID.Value));
             }
             if (int.Parse(this.MemCount.Value) > 0)
             {
                 string openid = new Chain.BLL.Mem().GetModel(memID).MemWeiXinCard;
                 if (string.IsNullOrEmpty(openid))
                 {
                     base.Response.Write("<span style='color:#FF0000;font-size:20px'>页面传参出错,请返回重试</span>");
                 }
                 else
                 {
                     double getmoney = double.Parse(this.txtgetmoney.Value);
                     Chain.BLL.WeiXinMoney   bllWeiXinMoney   = new Chain.BLL.WeiXinMoney();
                     Chain.Model.WeiXinMoney modelWeiXinMoney = bllWeiXinMoney.GetModel(int.Parse(this.txtMoneyID.Value));
                     string    mch_billno   = DateTime.Now.ToString("yyMMddHHmmssffff");
                     int       total_amount = int.Parse((getmoney * 100.0).ToString(""));
                     string    wishing      = modelWeiXinMoney.MoneyWish;
                     string    remark       = modelWeiXinMoney.MoneyDesc;
                     string    act_name     = modelWeiXinMoney.MoneyTitle;
                     string    re_openid    = openid;
                     WxPayData data         = new WxPayData();
                     data.SetValue("mch_billno", mch_billno);
                     data.SetValue("mch_id", PubFunction.curParameter.strMchid);
                     data.SetValue("wxappid", PubFunction.curParameter.strWeiXinAppID);
                     data.SetValue("send_name", "智络");
                     data.SetValue("re_openid", re_openid);
                     data.SetValue("total_amount", total_amount);
                     data.SetValue("total_num", 1);
                     data.SetValue("wishing", wishing);
                     data.SetValue("client_ip", PubFunction.ipAdress);
                     data.SetValue("act_name", act_name);
                     data.SetValue("remark", remark);
                     WxPayData result = WxPayApi.Sendredpack(data, PubFunction.curParameter.strMchKey, "cert\\apiclient_cert.p12", PubFunction.curParameter.strMchid, 10);
                     if (!result.IsSet("return_code") || result.GetValue("return_code").ToString() == "FAIL")
                     {
                         string arg_2DD_0 = result.IsSet("return_msg") ? result.GetValue("return_msg").ToString() : "";
                         this.spGetMoney.InnerHtml   = "";
                         this.spResultInfo.InnerHtml = "红包接口调用失败!" + result.GetValue("return_msg").ToString();
                     }
                     else if (result.GetValue("return_code").ToString() == "SUCCESS" && result.GetValue("result_code").ToString() == "SUCCESS")
                     {
                         if (int.Parse(this.MemCount.Value) > 0)
                         {
                             Chain.BLL.WeiXinGiveMoney bllWeiXinGiveMoney = new Chain.BLL.WeiXinGiveMoney();
                             bllWeiXinGiveMoney.Add(new Chain.Model.WeiXinGiveMoney
                             {
                                 MemID     = int.Parse(this.txtMemID.Value),
                                 MoneyID   = int.Parse(this.txtMoneyID.Value),
                                 GiveMoney = decimal.Parse(getmoney.ToString()),
                                 GiveTime  = DateTime.Now,
                                 IsWin     = 1
                             });
                             bllWeiXinMoney.UpdateGiveMoney(int.Parse(this.txtMoneyID.Value), decimal.Parse(getmoney.ToString()));
                             this.spResultInfo.InnerHtml = "红包发放成功!";
                             this.spGetMoney.InnerHtml   = getmoney.ToString("#0.00");
                             this.moneyInfo.Visible      = true;
                         }
                         else
                         {
                             this.spGetMoney.InnerHtml   = "";
                             this.spResultInfo.InnerHtml = "您的红包领取次数已用完!";
                         }
                     }
                     else
                     {
                         this.spGetMoney.InnerHtml   = "";
                         this.spResultInfo.InnerHtml = "红包发放失败!" + result.GetValue("return_msg").ToString();
                     }
                 }
             }
         }
         else
         {
             base.Response.Redirect("login.aspx");
         }
     }
 }
Exemple #27
0
        protected void Page_Load(object sender, EventArgs e)
        {
            WxPayData notifyData = new Notify(this.Page).GetNotifyData();

            if (!notifyData.IsSet("transaction_id"))
            {
                WxPayData res = new WxPayData();
                res.SetValue("return_code", "FAIL");
                res.SetValue("return_msg", "支付结果中微信订单号不存在");
                Log.Error(base.GetType().ToString(), "The Pay result is error : " + res.ToXml());
                this.Page.Response.Write(res.ToXml());
                this.Page.Response.End();
            }
            string transaction_id = notifyData.GetValue("transaction_id").ToString();
            string out_trade_no   = notifyData.GetValue("out_trade_no").ToString();

            if (!this.QueryOrder(transaction_id))
            {
                WxPayData res = new WxPayData();
                res.SetValue("return_code", "FAIL");
                res.SetValue("return_msg", "订单查询失败");
                Log.Error(base.GetType().ToString(), "Order query failure : " + res.ToXml());
                this.Page.Response.Write(res.ToXml());
                this.Page.Response.End();
            }
            else
            {
                string   attach = notifyData.GetValue("attach").ToString();
                string[] data   = attach.Split(new char[]
                {
                    ','
                });
                Chain.BLL.PointLog bllPoint = new Chain.BLL.PointLog();
                int     intUserID           = 1;
                int     intUserShopID       = 1;
                int     intMemID            = int.Parse(data[0]);
                decimal money           = decimal.Parse(data[1]);
                decimal giveMoney       = decimal.Parse(data[2]);
                string  rechargeAccount = data[3];
                int     point           = int.Parse(data[4]);
                int     count           = new Chain.BLL.MemRecharge().GetRecordCount("RechargeAccount='" + rechargeAccount + "'");
                if (count <= 0)
                {
                    if (money + giveMoney <= 0m)
                    {
                        this.Context.Response.Write("-6");
                    }
                    else
                    {
                        string               strRemark   = "无";
                        DateTime             createTime  = DateTime.Now;
                        Chain.BLL.Mem        bllMem      = new Chain.BLL.Mem();
                        Chain.Model.Mem      modelMem    = bllMem.GetModel(intMemID);
                        Chain.BLL.PointLog   bllPoingLog = new Chain.BLL.PointLog();
                        Chain.Model.PointLog mdPoint     = new Chain.Model.PointLog();
                        string               Remark      = string.Concat(new object[]
                        {
                            "会员微信充值,充值金额:[",
                            money.ToString(),
                            "],赠送:[",
                            giveMoney,
                            "],备注:",
                            strRemark
                        });
                        decimal sumMoney = money + giveMoney;
                        Chain.Model.MemRecharge mdRechange = new Chain.Model.MemRecharge();
                        mdRechange.RechargeMemID       = intMemID;
                        mdRechange.RechargeAccount     = rechargeAccount;
                        mdRechange.RechargeMoney       = money + giveMoney;
                        mdRechange.RechargeShopID      = intUserShopID;
                        mdRechange.RechargeUserID      = intUserID;
                        mdRechange.RechargeCreateTime  = createTime;
                        mdRechange.RechargeIsApprove   = true;
                        mdRechange.RechargeRemark      = strRemark;
                        mdRechange.RechargePoint       = point;
                        mdRechange.RechargeType        = 6;
                        mdRechange.RechargeGive        = giveMoney;
                        mdRechange.RechargeCardBalance = modelMem.MemMoney + sumMoney;
                        int flag = new Chain.BLL.MemRecharge().Add(mdRechange);
                        modelMem.MemMoney += sumMoney;
                        modelMem.MemPoint += point;
                        bllMem.Update(modelMem);
                        Chain.Model.MoneyChangeLog moneyChangeLogModel = new Chain.Model.MoneyChangeLog();
                        moneyChangeLogModel.MoneyChangeMemID      = modelMem.MemID;
                        moneyChangeLogModel.MoneyChangeUserID     = intUserID;
                        moneyChangeLogModel.MoneyChangeType       = 1;
                        moneyChangeLogModel.MoneyChangeAccount    = rechargeAccount;
                        moneyChangeLogModel.MoneyChangeMoney      = sumMoney;
                        moneyChangeLogModel.MemMoney              = modelMem.MemMoney;
                        moneyChangeLogModel.MoneyChangeCreateTime = DateTime.Now;
                        moneyChangeLogModel.MoneyChangeGiveMoney  = giveMoney;
                        new Chain.BLL.MoneyChangeLog().Add(moneyChangeLogModel);
                        mdPoint.PointMemID      = modelMem.MemID;
                        mdPoint.PointNumber     = point;
                        mdPoint.PointChangeType = 15;
                        mdPoint.PointRemark     = string.Concat(new object[]
                        {
                            "会员充值,充值金额:[",
                            money,
                            "],获得积分:[",
                            point,
                            "]"
                        });
                        mdPoint.PointShopID     = intUserShopID;
                        mdPoint.PointCreateTime = DateTime.Now;
                        mdPoint.PointUserID     = intUserID;
                        mdPoint.PointOrderCode  = rechargeAccount;
                        bllPoint.Add(mdPoint);
                        if (PubFunction.curParameter.bolShopPointManage)
                        {
                            PubFunction.SetShopPoint(intUserID, intUserShopID, point, "会员充值扣除店铺积分", 2);
                        }
                        MEMPointUpdate.MEMPointRate(modelMem, point, rechargeAccount, 15, intUserID, intUserShopID);
                        modelMem = new Chain.BLL.Mem().GetModel(modelMem.MemID);
                        PubFunction.UpdateMemLevel(modelMem);
                        WxPayData res = new WxPayData();
                        res.SetValue("return_code", "SUCCESS");
                        res.SetValue("return_msg", "OK");
                        Log.Info(base.GetType().ToString(), "order query success : " + res.ToXml());
                        this.Page.Response.Write(res.ToXml());
                        this.Page.Response.End();
                    }
                }
            }
        }
Exemple #28
0
 protected void Rpt_WeiXinCoupon_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         DataRowView        row            = (DataRowView)e.Item.DataItem;
         string             CouponType     = row["CouponType"].ToString();
         string             CouponStart    = row["CouponStart"].ToString();
         string             CouponEnd      = row["CouponEnd"].ToString();
         string             CouponMinMoney = row["CouponMinMoney"].ToString();
         string             CouponNumber   = row["CouponNumber"].ToString();
         string             ID             = row["ID"].ToString();
         HtmlGenericControl spDesc         = (HtmlGenericControl)e.Item.FindControl("spDesc");
         HtmlGenericControl spTime         = (HtmlGenericControl)e.Item.FindControl("spTime");
         if (CouponType == "0")
         {
             if (CouponStart == "")
             {
                 spTime.InnerText = "永久有效";
                 spTime.Style.Add("color", "Red");
             }
             else
             {
                 spTime.InnerText = DateTime.Parse(CouponStart).ToString("yyyy-MM-dd") + "至" + DateTime.Parse(CouponEnd).ToString("yyyy-MM-dd");
             }
             if (CouponMinMoney == "0")
             {
                 spDesc.InnerText = "优惠¥" + decimal.Parse(CouponNumber).ToString("F2");
             }
             else
             {
                 spDesc.InnerText = "最低消费¥" + decimal.Parse(CouponMinMoney).ToString("F2") + "可优惠¥" + decimal.Parse(CouponNumber).ToString("F2");
             }
         }
         else if (CouponType == "1")
         {
             if (CouponStart == "")
             {
                 spTime.InnerText = "永久有效";
                 spTime.Style.Add("color", "Red");
             }
             else
             {
                 spTime.InnerText = DateTime.Parse(CouponStart).ToString("yyyy-MM-dd") + "至" + DateTime.Parse(CouponEnd).ToString("yyyy-MM-dd");
             }
             spDesc.InnerText = string.Concat(new string[]
             {
                 "最低消费¥",
                 decimal.Parse(CouponMinMoney).ToString("F2"),
                 "可打",
                 CouponNumber,
                 "折"
             });
         }
         Chain.Model.Mem mem = new Chain.BLL.Mem().GetMemByWeiXinCard(this.MemWeiXinCard);
         if (mem != null)
         {
             int           MemID    = mem.MemID;
             StringBuilder strWhere = new StringBuilder();
             strWhere.Append("CouPonID = " + ID);
             strWhere.Append(" and CouPonMID = " + MemID);
             strWhere.Append(" and CouPonSY = 0 ");
             DataTable          dt       = new Chain.BLL.CouponList().GetList(1, strWhere.ToString(), "CID").Tables[0];
             HtmlGenericControl spCouPon = (HtmlGenericControl)e.Item.FindControl("spCouPon");
             if (dt.Rows.Count > 0)
             {
                 spCouPon.InnerHtml = "优惠券号:<span style='color:Red'>" + dt.Rows[0]["CouPon"].ToString() + "</span>";
             }
             else
             {
                 int CouponPredictNu = int.Parse(row["CouponPredictNu"].ToString());
                 int CouponYF        = int.Parse(row["CouponYF"].ToString());
                 if (CouponYF >= CouponPredictNu)
                 {
                     spCouPon.InnerText = "该优惠券已发完";
                     spCouPon.Style.Add("color", "Red");
                 }
                 else
                 {
                     spCouPon.InnerHtml = "<span style='color:Red'>点击申请</span>";
                     HtmlAnchor application = (HtmlAnchor)e.Item.FindControl("application");
                     application.HRef = "WeiXinCoupon.aspx?MemWeiXinCard=" + this.MemWeiXinCard + "&CouPonID=" + ID;
                 }
             }
         }
     }
 }
Exemple #29
0
        protected void SendCoupon()
        {
            int flag = 0;

            try
            {
                string             strMemID    = new Chain.BLL.Mem().GetMemByWeiXinCard(this.MemWeiXinCard).MemID.ToString();
                int                intNumber   = 1;
                int                intCouponID = int.Parse(base.Request["CouponID"].ToString());
                Chain.BLL.Coupon   bllCoupon   = new Chain.BLL.Coupon();
                Chain.Model.Coupon modelCoupon = new Chain.Model.Coupon();
                modelCoupon = bllCoupon.GetModel(intCouponID);
                if (modelCoupon.CouponPredictNu - modelCoupon.CouponYF < intNumber)
                {
                    flag = 1;
                }
                else
                {
                    Chain.BLL.CouponList bllCouponList = new Chain.BLL.CouponList();
                    DataRow row    = bllCouponList.GetList(intNumber, " CouPonID=" + intCouponID + " and CouPonYF='False' ", " CID ").Tables[0].Rows[0];
                    string  strSql = string.Concat(new string[]
                    {
                        "update CouponList set CouPonYF='True',CouPonMID=",
                        strMemID,
                        ",ConPonSendTime='",
                        DateTime.Now.ToString(),
                        "'"
                    });
                    object obj = strSql;
                    strSql = string.Concat(new object[]
                    {
                        obj,
                        " where Coupon = '",
                        row["CouPon"],
                        "'"
                    });
                    if (bllCouponList.DataUpdateTran(new ArrayList
                    {
                        strSql
                    }))
                    {
                        modelCoupon.CouponYF += intNumber;
                        bllCoupon.Update(modelCoupon);
                    }
                    flag = 2;
                }
            }
            catch
            {
                flag = -1;
            }
            finally
            {
                base.Response.Redirect(string.Concat(new object[]
                {
                    "WeiXinCoupon.aspx?MemWeiXinCard=",
                    this.MemWeiXinCard,
                    "&flag=",
                    flag
                }));
            }
        }
Exemple #30
0
 private void BindMemInfo(int MemID)
 {
     Chain.Model.Mem modelMem = new Chain.BLL.Mem().GetModel(MemID);
     this.mobile.Value = modelMem.MemMobile;
 }