예제 #1
0
        private void Do0ForApplicationMember()
        {
            this.Content = this.xmlDoc.GetElementsByTagName("Content")[0].InnerText.Trim();
            if (Regex.IsMatch(this.Content, "^1[3|4|5|8]\\d{9}$"))
            {
                Chain.Model.Mem mem = this.memBll.GetModelByMemMobile(this.Content);
                if (mem != null)
                {
                    this.sendXML = ResponseSendStr.Text(this.postStr, "该手机号已被注册,请重新输入一个新的手机号");
                }
                else if (PubFunction.curParameter.bolWeiXinSMSVcode)
                {
                    if (PubFunction.curParameter.bolSms)
                    {
                        if (SMSInfo.GetBalance(false) == "0")
                        {
                            this.sendXML = ResponseSendStr.Text(this.postStr, "商家短信不足,发送短信验证码失败,请与商家联系");
                            this.weiXinLogBLL.Delete(this.FromUserName);
                        }
                        else
                        {
                            string smsVCode = this.GetRandomCode();
                            string NewsDesc = string.IsNullOrEmpty(PubFunction.curParameter.strWeiXinShopName) ? "" : PubFunction.curParameter.strWeiXinShopName;
                            NewsDesc = string.Concat(new string[]
                            {
                                "温馨提示,欢迎您注册",
                                NewsDesc,
                                "微信会员,您的",
                                NewsDesc,
                                "微信会员短信验证码是:",
                                smsVCode
                            });
                            this.sendXML = ResponseSendStr.Text(this.postStr, "请发送短信验证码");
                            SMSInfo.Send_GXSMS(false, this.Content, NewsDesc, "");
                            Chain.Model.SmsLog modelSms = new Chain.Model.SmsLog();
                            modelSms.SmsMemID     = 0;
                            modelSms.SmsMobile    = this.Content;
                            modelSms.SmsContent   = NewsDesc;
                            modelSms.SmsTime      = DateTime.Now;
                            modelSms.SmsShopID    = 1;
                            modelSms.SmsUserID    = 1;
                            modelSms.SmsAmount    = PubFunction.GetSmsAmount(NewsDesc);
                            modelSms.SmsAllAmount = modelSms.SmsAmount;
                            Chain.BLL.SmsLog bllSms = new Chain.BLL.SmsLog();
                            bllSms.Add(modelSms);
                            this.GiveWeiXinLodAssignment(this.Content, 2, "1", smsVCode, 0);
                            this.weiXinLogBLL.Update(this.weiXinLogModel);
                        }
                    }
                    else
                    {
                        this.sendXML = ResponseSendStr.Text(this.postStr, "系统短信功能暂未开启,发送短信验证码失败,请与商家联系");
                        this.weiXinLogBLL.Delete(this.FromUserName);
                    }
                }
                else
                {
                    int isOk = this.MemRegister(false);
                    if (isOk > 0)
                    {
                        this.DoCard("恭喜您会员卡办理成功");
                    }
                    else
                    {
                        string strErr = "系统错误,会员办卡失败!";
                        int    num    = isOk;
                        if (num != -6)
                        {
                            switch (num)
                            {
                            case -2:
                                strErr = "手机号码重复,会员办卡失败!";
                                break;

                            case -1:
                                strErr = "会员卡号重复,会员办卡失败!";
                                break;
                            }
                        }
                        else
                        {
                            strErr = "卡面号重复,会员办卡失败!";
                        }
                        this.sendXML = ResponseSendStr.Text(this.postStr, strErr);
                    }
                }
            }
            else
            {
                this.GiveWeiXinLodAssignment("", 0, "0", "", this.weiXinLogModel.ErrorTimes + 1);
                this.ErrorNewsHandle("由于您的误操作次数过多,会员申请模式已退出", "您发送的手机号格式有误,请重新发送");
            }
        }
예제 #2
0
 private void Do2MemberTransform()
 {
     this.Content  = this.xmlDoc.GetElementsByTagName("Content")[0].InnerText.Trim();
     this.memModel = this.memBll.GetModelByMemCard(this.Content);
     if (this.memModel != null)
     {
         this.sendXML = ResponseSendStr.Text(this.postStr, "请发送您的会员卡密码,如果密码为空请回复 # 号");
         this.GiveWeiXinLodAssignment(this.memModel.MemCard, 1, "3", "", 0);
         this.weiXinLogBLL.Update(this.weiXinLogModel);
     }
     else
     {
         Chain.Model.Mem mem = this.memBll.GetModelByMemMobile(this.Content);
         if (mem != null)
         {
             if (PubFunction.curParameter.bolWeiXinSMSVcode)
             {
                 if (PubFunction.curParameter.bolSms)
                 {
                     if (SMSInfo.GetBalance(false) == "0")
                     {
                         string strTemplet = string.Format("由于本系统短信剩余条数不足,无法给您发送短信验证码;\r\n您的会员卡号为:{0}****{1},请发送您的会员卡密码,如果密码为空请回复 # 号", mem.MemCard.Substring(0, 1), mem.MemCard.Substring(mem.MemCard.Length - 1, 1));
                         this.sendXML = ResponseSendStr.Text(this.postStr, strTemplet);
                         this.GiveWeiXinLodAssignment(mem.MemCard, 1, "3", "", 0);
                         this.weiXinLogBLL.Update(this.weiXinLogModel);
                     }
                     else
                     {
                         string smsVCode = this.GetRandomCode();
                         string NewsDesc = string.IsNullOrEmpty(PubFunction.curParameter.strWeiXinShopName) ? "" : PubFunction.curParameter.strWeiXinShopName;
                         NewsDesc = string.Concat(new string[]
                         {
                             "温馨提示,欢迎您申请从商家会员转",
                             NewsDesc,
                             "微信会员,您的",
                             NewsDesc,
                             "微信会员短信验证码是:",
                             smsVCode
                         });
                         this.sendXML = ResponseSendStr.Text(this.postStr, "请发送短信验证码");
                         SMSInfo.Send_GXSMS(false, this.Content, NewsDesc, "");
                         Chain.Model.SmsLog modelSms = new Chain.Model.SmsLog();
                         modelSms.SmsMemID     = Convert.ToInt32(mem.MemID);
                         modelSms.SmsMobile    = this.Content;
                         modelSms.SmsContent   = NewsDesc;
                         modelSms.SmsTime      = DateTime.Now;
                         modelSms.SmsShopID    = 1;
                         modelSms.SmsUserID    = 1;
                         modelSms.SmsAmount    = PubFunction.GetSmsAmount(NewsDesc);
                         modelSms.SmsAllAmount = modelSms.SmsAmount;
                         Chain.BLL.SmsLog bllSms = new Chain.BLL.SmsLog();
                         bllSms.Add(modelSms);
                         this.GiveWeiXinLodAssignment(this.Content, 2, "3", smsVCode, 0);
                         this.weiXinLogBLL.Update(this.weiXinLogModel);
                     }
                 }
                 else
                 {
                     string strTemplet = string.Format("由于本系统短信功能暂未开启,无法给您发送短信验证码;\r\n您的会员卡号为:{0}****{1},请发送您的会员卡密码,如果密码为空请回复 # 号", mem.MemCard.Substring(0, 1), mem.MemCard.Substring(mem.MemCard.Length - 1, 1));
                     this.sendXML = ResponseSendStr.Text(this.postStr, strTemplet);
                     this.GiveWeiXinLodAssignment(mem.MemCard, 1, "3", "", 0);
                     this.weiXinLogBLL.Update(this.weiXinLogModel);
                 }
             }
             else
             {
                 this.memModel = this.memBll.GetMemInfoByMobile(this.Content);
                 this.memModel.MemWeiXinCard = this.FromUserName;
                 this.memBll.Update(this.memModel);
                 this.DoCard("恭喜您已转移成微信会员");
             }
         }
         else
         {
             this.GiveWeiXinLodAssignment(this.weiXinLogModel.RecordContent, this.weiXinLogModel.RecordContentType, this.weiXinLogModel.StatusCode, this.weiXinLogModel.RandomCode, this.weiXinLogModel.ErrorTimes + 1);
             this.ErrorNewsHandle("由于您的错误操作次数过多,转微信会员模式已退出", "您发送的手机号或卡号在系统中没找着,请重新发送");
         }
     }
 }
예제 #3
0
 public void Execute(XmlNode node)
 {
     if (PubFunction.curParameter.bolIsAutoSendSMSByMemBirthday)
     {
         if (PubFunction.curParameter.bolSms && Convert.ToInt32(SMSInfo.GetBalance(false)) > 0)
         {
             Chain.BLL.Mem MemBll = new Chain.BLL.Mem();
             Chain.BLL.MemberSMSRemindLog MemberSMSRemindLogBll = new Chain.BLL.MemberSMSRemindLog();
             DataTable dtMem = MemBll.GetMemBirthday(PubFunction.curParameter.intAutoSendSMSByMemBirthdayForDay).Tables[0];
             DataTable dtLog = MemberSMSRemindLogBll.GetMemBirthdayed().Tables[0];
             if (dtMem != null && dtMem.Rows.Count > 0)
             {
                 for (int i = 0; i < dtMem.Rows.Count; i++)
                 {
                     if (dtLog.Select("MemberSMSRemindMemID=" + dtMem.Rows[i]["MemID"]).Length == 0)
                     {
                         if (Convert.ToInt32(SMSInfo.GetBalance(false)) > 0)
                         {
                             string strSendContent = SMSInfo.GetSendContent(10, new SmsTemplateParameter
                             {
                                 strCardID    = dtMem.Rows[i]["MemCard"].ToString(),
                                 strName      = dtMem.Rows[i]["MemName"].ToString(),
                                 dclMoney     = Convert.ToDecimal(dtMem.Rows[i]["MemMoney"]),
                                 dclTempMoney = 0m,
                                 intTempPoint = 0,
                                 intPoint     = Convert.ToInt32(dtMem.Rows[i]["MemPoint"]),
                                 OldLevelID   = Convert.ToInt32(dtMem.Rows[i]["MemLevelID"]),
                                 NewLevelID   = Convert.ToInt32(dtMem.Rows[i]["MemLevelID"]),
                                 MemBirthday  = Convert.ToDateTime(dtMem.Rows[i]["MemBirthday"]),
                                 MemPastTime  = Convert.ToDateTime(dtMem.Rows[i]["MemPastTime"])
                             }, 1);
                             bool result = SMSInfo.Send_GXSMS(false, dtMem.Rows[i]["MemMobile"].ToString(), strSendContent, "");
                             if (result)
                             {
                                 Chain.Model.SmsLog modelSms = new Chain.Model.SmsLog();
                                 modelSms.SmsMemID     = Convert.ToInt32(dtMem.Rows[i]["MemID"]);
                                 modelSms.SmsMobile    = dtMem.Rows[i]["MemMobile"].ToString();
                                 modelSms.SmsContent   = strSendContent;
                                 modelSms.SmsTime      = DateTime.Now;
                                 modelSms.SmsShopID    = 1;
                                 modelSms.SmsUserID    = 1;
                                 modelSms.SmsAmount    = PubFunction.GetSmsAmount(strSendContent);
                                 modelSms.SmsAllAmount = modelSms.SmsAmount;
                                 Chain.BLL.SmsLog bllSms = new Chain.BLL.SmsLog();
                                 bllSms.Add(modelSms);
                                 MemberSMSRemindLogBll.Add(new Chain.Model.MemberSMSRemindLog
                                 {
                                     MemberSMSRemindMemID     = Convert.ToInt32(dtMem.Rows[i]["MemID"]),
                                     MemberSMSRemindMobile    = dtMem.Rows[i]["MemMobile"].ToString(),
                                     MemberSMSRemindContent   = strSendContent,
                                     MemberSMSRemindShopID    = 1,
                                     MemberSMSRemindTime      = DateTime.Now,
                                     MemberSMSRemindUserID    = 1,
                                     MemberSMSRemindAmount    = PubFunction.GetSmsAmount(strSendContent),
                                     MemberSMSRemindAllAmount = modelSms.SmsAmount,
                                     MemberSMSRemindType      = 1,
                                     MemberSMSRemindBirthday  = Convert.ToDateTime(dtMem.Rows[i]["MemBirthday"])
                                 });
                             }
                         }
                     }
                 }
             }
         }
     }
 }