public string Process(RequestMsgModel msg) { SubscribeEventRequestMsgModel msgMode = msg as SubscribeEventRequestMsgModel; if (msgMode != null) { SiteActivityDAL dal = new SiteActivityDAL(); SiteActivity activity = dal.GetSiteAct(Params["SiteCode"].ToString(), "Coupon"); if (activity != null) { CouponDAL cdal = new CouponDAL(); if (!cdal.ExistCoupon(Params["SiteCode"].ToString(), activity.ID, msgMode.FromUserName)) { Coupon coupon = new Coupon() { SiteCode = Params["SiteCode"].ToString(), SiteActivityID = activity.ID, OpenID = msgMode.FromUserName, CouponCode = GetCouponCode(msgMode.FromUserName), CouponStatus = 0 }; cdal.InsertInfo(coupon); } } } return(string.Empty); }
/// <summary> /// 获取兑奖SN码 /// </summary> void GetSNcode() { string sncode = string.Empty; string peizeid = string.Empty; if (Request["peizeid"] != null && Request["peizeid"] != "") { peizeid = Common.Common.NoHtml(Request["peizeid"].ToString()); } if (strOpenID.Trim() != null && strOpenID.Trim() != "") { if (!AwardUserDal.ExistAwardUser(strOpenID, "", "", peizeid, strActID)) { sncode = GenerateCheckCode(7); if (AwardUserDal.UpdateUserSNCode(strOpenID, peizeid, strActID, sncode)) { string strGuid = Guid.NewGuid().ToString("N"); CouponDAL cdal = new CouponDAL(); Model.ACT.Coupon coupon = null; coupon = new Model.ACT.Coupon() { ID = strGuid, SiteCode = strSiteCode, SiteActivityID = strActID, OpenID = strOpenID, CouponCode = sncode, CouponStatus = 0 }; cdal.InsertInfo(coupon); Response.Write("{\"success\":true,\"sn\":\"" + sncode + "\"}"); } else { Response.Write("{\"error\":\"invalid\"}"); } } else { sncode = AwardUserDal.GetSNCodeByPhone(strOpenID, "", "", strActID); if (sncode.Trim() != null && sncode.Trim() != "") { Response.Write("{\"error\":\"getsn\",\"sn\":\"" + sncode + "\"}"); } else { Response.Write("{\"error\":\"isdoing\"}"); } } } else { Response.Write("{\"error\":true,\"msg\":\"操作失败,请重新操作\"}"); return; } }
protected override bool BeforeLoad() { if (null == Request.QueryString["id"]) { return(false); } CouponID = Common.Common.NoHtml(Request.QueryString["id"].ToString()); string strGuid = string.Empty; if (null != Request.QueryString["sitecode"] && null != Request.QueryString["openid"]) { SiteCode = Common.Common.NoHtml(Request.QueryString["sitecode"].ToString()); OpenID = Common.Common.NoHtml(Request.QueryString["openid"].ToString()); //插入优惠券 SiteActivityDAL dalActive = new SiteActivityDAL(); DataSet dsActive = dalActive.GetActivityDetail(CouponID); if (null != dsActive && dsActive.Tables.Count > 0 && dsActive.Tables[0].Rows.Count > 0) { strGuid = Guid.NewGuid().ToString("N"); CouponDAL cdal = new CouponDAL(); if (!cdal.ExistCoupon(SiteCode, CouponID, OpenID)) { Coupon coupon = new Coupon() { ID = strGuid, SiteCode = SiteCode, SiteActivityID = CouponID, OpenID = OpenID, CouponStatus = 0 }; cdal.InsertInfo(coupon); } } CouponID = strGuid; } else { SiteActivityDAL dalActive = new SiteActivityDAL(); DataSet dsActive = dalActive.GetActivityDetail(CouponID); if (null != dsActive && dsActive.Tables.Count > 0 && dsActive.Tables[0].Rows.Count > 0) { SiteCode = dsActive.Tables[0].Rows[0]["SIteCode"].ToString(); } } return(base.BeforeLoad()); }
protected void btnCoupon_Click(object sender, EventArgs e) { string strWhere = " "; if (Session["strRoleCode"].ToString() != "ADMIN") { strWhere = " a.SiteCode = '" + Session["strSiteCode"].ToString() + "' "; } if (ddlselectName.SelectedValue.Trim() != null && ddlselectName.SelectedValue.Trim() != "" && ddlselectName.SelectedValue.Trim() != "0") { if (strWhere.Trim() != null && strWhere.Trim() != "") { strWhere = strWhere + " AND "; } strWhere = strWhere + " b.ID='" + ddlselectName.SelectedValue + "' "; } if (ddlselectName.SelectedValue.Trim() != null && ddlselectName.SelectedValue.Trim() != "" && ddlselectName.SelectedValue.Trim() != "0") { if (strWhere.Trim() != null && strWhere.Trim() != "") { strWhere = strWhere + " AND "; } string arrow = GetLoseWin(ddlselectName.SelectedValue); if (arrow == "0") { MessageBox.Show(this, "请设置正确的比赛结果再做统计!"); return; } strWhere = strWhere + " [dbo].[split](GuessScore,':',0) " + arrow + " [dbo].[split](GuessScore,':',1) "; } else { MessageBox.Show(this, "操作失败,请选择相应的赛事!"); return; } JC_ScoreDAL dal = new JC_ScoreDAL(); DataSet ds = dal.GetJCScoreListByStateNO(strWhere); //取正确比分 foreach (DataRow row in ds.Tables[0].Rows) { string strOpenID = row["OpenID"].ToString(); string strScoreID = row["ID"].ToString(); string strGuessScore = row["GuessScore"].ToString(); string strRightScore = row["RightScore"].ToString(); //修改竞猜状态; dal.UpdateJCScoreState(strScoreID); //写入优惠券 //AC87CE288FC24F23B7B68CE8F3D93D13 string strGuid = Guid.NewGuid().ToString("N"); CouponDAL cdal = new CouponDAL(); string strSiteCode = Session["strSiteCode"].ToString(); Model.ACT.Coupon coupon = null; if (strGuessScore == strRightScore) { coupon = new Model.ACT.Coupon() { ID = strGuid, SiteCode = Session["strSiteCode"].ToString(), SiteActivityID = "AC87CE288FC24F23B7B68CE8F3D93D18", OpenID = strOpenID, CouponStatus = 0 }; } else { coupon = new Model.ACT.Coupon() { ID = strGuid, SiteCode = Session["strSiteCode"].ToString(), SiteActivityID = "AC87CE288FC24F23B7B68CE8F3D93D22", OpenID = strOpenID, CouponStatus = 0 }; } cdal.InsertInfo(coupon); } MessageBox.Show(this, "优惠券发放完成!"); }
/// <summary> /// 处理回复消息 /// "text":回复文本消息处理,MsgValue对应回复的文本 /// "sub_auto_coupon":回复订阅自动优惠券处理,MsgValue对应回复的图文消息ID /// "auto_news_article":根据文章自动生成图文消息进行回复,MsgValue为类别ID /// "news":回复图文表中的消息,MsgValue为图文消息表ID集,用逗号分隔 /// </summary> /// <param name="replyMsgType"></param> /// <param name="replyMsgValue"></param> /// <param name="customParams"></param> /// <returns></returns> private string ProcessReply(RequestMsgModel msgModel, string replyMsgType, string replyMsgValue) { string res = string.Empty; try { switch (replyMsgType.ToLower()) { case "text": //回复文本消息处理,MsgValue对应回复的文本 TextResponseMsgModel textMsg = new TextResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString(), Content = replyMsgValue == null ? string.Empty : TransformText(replyMsgValue, msgModel) }; res = textMsg.ToString(); break; case "voice": //回复语音消息处理,MsgValue对应回复的文本 VoiceResponseMsgModel voiceMsg = new VoiceResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString(), }; Media media = MediaDAL.CreateInstance().GetMediaByID(replyMsgValue); if (media != null && !string.IsNullOrEmpty(media.MediaID)) { voiceMsg.MediaId = media.MediaID; } res = voiceMsg.ToString(); break; case "wxpay_test": //用于微信支付测试 TextResponseMsgModel textMsgx = new TextResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString(), Content = string.Format("<a href='{0}/Payment/wxpay/wxpayDemo.aspx?openid={1}'>微信支付测试</a>", GetSiteUrl(), msgModel.FromUserName) }; res = textMsgx.ToString(); break; case "transfer_customer_service": //将消息转发到多客服 TransferCustomerServiceResponseMsgModel transferMsg = new TransferCustomerServiceResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString(), }; res = transferMsg.ToString(); break; case "sub_auto_coupon": //回复订阅自动优惠券处理,MsgValue对应回复的优惠券图文消息ID //SubscribeCouponActHandle sch = new SubscribeCouponActHandle(); SiteActivityDAL dal = new SiteActivityDAL(); SiteActivity activity = dal.GetSiteAct(siteCode, "Coupon"); if (activity != null) { CouponDAL cdal = new CouponDAL(); if (!cdal.ExistCoupon(siteCode, activity.ID, msgModel.FromUserName)) { Coupon coupon = new Coupon() { SiteCode = siteCode, SiteActivityID = activity.ID, OpenID = msgModel.FromUserName, //CouponCode = msgModel.FromUserName, CouponStatus = 0 }; cdal.InsertInfo(coupon); } } CouponNewsDAL nmDAL = new CouponNewsDAL(); CouponNews nm = nmDAL.GetCouponNews(replyMsgValue); if (nm != null) { NewsResponseMsgModel newsModel = new NewsResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString() }; List <Article> articles = new List <Article>(); articles.Add(new Article() { Title = nm.Title, Description = nm.Description, PicUrl = GetPicUrl(nm.PicUrl), Url = TransformUrl(nm.Url, msgModel) }); newsModel.Articles = articles; res = newsModel.ToString(); } break; case "auto_coupon_category": SiteActivityDAL dalCatList = new SiteActivityDAL(); SiteActivity activityCat = dalCatList.GetSiteAct(siteCode, "Coupon"); if (activityCat != null) { CouponDAL cdal = new CouponDAL(); if (!cdal.ExistCoupon(siteCode, activityCat.ID, msgModel.FromUserName)) { Coupon coupon = new Coupon() { SiteCode = siteCode, SiteActivityID = activityCat.ID, OpenID = msgModel.FromUserName, //CouponCode = msgModel.FromUserName, CouponStatus = 0 }; cdal.InsertInfo(coupon); } } ArticleDAL catDal = new ArticleDAL(); DataSet cdsCat = catDal.GetCategoryList(siteCode, replyMsgValue); if (cdsCat != null && cdsCat.Tables.Count > 0 && cdsCat.Tables[0] != null && cdsCat.Tables[0].Rows.Count > 0) { int i = 0; NewsResponseMsgModel newsModel = new NewsResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString() }; List <Article> articles = new List <Article>(); foreach (DataRow dr in cdsCat.Tables[0].Rows) { if (++i > 4) { break; } articles.Add(new Article() { Title = dr["Title"].ToString(), Description = dr["Summary"].ToString(), //Description = RemoveHtmlTag(dr["Content"].ToString(), 30), PicUrl = GetPicUrl(dr["Pic"].ToString()), Url = GetArticleUrl(dr["ID"].ToString()) }); } newsModel.Articles = articles; res = newsModel.ToString(); } break; case "auto_news_article": //根据文章自动生成图文消息进行回复,MsgValue为文章ID ArticleDAL aDal = new ArticleDAL(); DataSet ds = aDal.GetArticleDetail(replyMsgValue); if (ds != null && ds.Tables.Count > 0 && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0) { int i = 0; NewsResponseMsgModel newsModel = new NewsResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString() }; List <Article> articles = new List <Article>(); foreach (DataRow dr in ds.Tables[0].Rows) { if (++i > 4) { break; } articles.Add(new Article() { Title = dr["Title"].ToString(), Description = dr["Summary"].ToString(), //Description = RemoveHtmlTag(dr["Content"].ToString(), 100), PicUrl = GetPicUrl(dr["Pic"].ToString()), Url = GetArticleUrl(dr["ID"].ToString()) }); } newsModel.Articles = articles; res = newsModel.ToString(); } break; case "auto_news_category": //根据类别自动生成图文消息进行回复,MsgValue为类别ID ArticleDAL cDal = new ArticleDAL(); DataSet cds = cDal.GetCategoryList(siteCode, replyMsgValue); if (cds != null && cds.Tables.Count > 0 && cds.Tables[0] != null && cds.Tables[0].Rows.Count > 0) { int i = 0; NewsResponseMsgModel newsModel = new NewsResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString() }; List <Article> articles = new List <Article>(); foreach (DataRow dr in cds.Tables[0].Rows) { if (++i > 4) { break; } articles.Add(new Article() { Title = dr["Title"].ToString(), Description = dr["Summary"].ToString(), //Description = RemoveHtmlTag(dr["Content"].ToString(), 30), PicUrl = GetPicUrl(dr["Pic"].ToString()), Url = GetArticleUrl(dr["ID"].ToString()) }); } newsModel.Articles = articles; res = newsModel.ToString(); } break; case "coupon": //回复图文表中的消息,MsgValue为图文消息表ID集,用逗号分隔 NewsMsgDAL nmDAL1 = new NewsMsgDAL(); NewsMsg nms = nmDAL1.GetNewsMsg(replyMsgValue); if (nms != null) { NewsResponseMsgModel newsModel = new NewsResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString() }; List <Article> articles = new List <Article>(); articles.Add(new Article() { Title = nms.Title, Description = nms.Description, PicUrl = GetPicUrl(nms.PicUrl), Url = TransformUrl(nms.Url, msgModel) }); newsModel.Articles = articles; res = newsModel.ToString(); } break; case "news": //回复图文表中的消息,MsgValue为图文消息表ID集,用逗号分隔 NewsMsgDAL nmDALs = new NewsMsgDAL(); IList <NewsMsg> newsMsgs = nmDALs.GetNewsMsgs(replyMsgValue); if (newsMsgs != null) { NewsResponseMsgModel newsModel = new NewsResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString() }; List <Article> articles = new List <Article>(); foreach (NewsMsg msg in newsMsgs) { articles.Add(new Article() { Title = msg.Title, Description = msg.Description, PicUrl = GetPicUrl(msg.PicUrl), Url = TransformUrl(msg.Url, msgModel) }); } newsModel.Articles = articles; res = newsModel.ToString(); } break; case "url": //根据文章自动生成图文消息进行回复,MsgValue为文章ID DAL.SYS.AccountDAL dalUrl = new DAL.SYS.AccountDAL(); DataSet dsUrl = dalUrl.GetAccountExtData(replyMsgValue); if (dsUrl != null && dsUrl.Tables.Count > 0 && dsUrl.Tables[0] != null && dsUrl.Tables[0].Rows.Count > 0) { int i = 0; NewsResponseMsgModel newsModel = new NewsResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString() }; List <Article> articles = new List <Article>(); foreach (DataRow dr in dsUrl.Tables[0].Rows) { if (++i > 4) { break; } articles.Add(new Article() { Title = dr["Name"].ToString(), Description = dr["Summary"].ToString(), PicUrl = GetPicUrl(dr["Photo"].ToString()), Url = GetSiteInfo(dr["ID"].ToString()) }); } newsModel.Articles = articles; res = newsModel.ToString(); } break; case "hp_photo_text": //为当前hp_photo对应的照片附加文字信息 PhotoDAL photoDal = new PhotoDAL(); if (photoDal.ExistPhoto(siteCode, msgModel.FromUserName, 0)) { TextRequestMsgModel temp = msgModel as TextRequestMsgModel; string text = temp.Content.Replace("#ms", ""); //附加图片文字 photoDal.UpdateAttachText(siteCode, msgModel.FromUserName, text); TextResponseMsgModel textMsg2 = new TextResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString(), Content = replyMsgValue == null ? string.Empty : TransformText(replyMsgValue, msgModel) }; res = textMsg2.ToString(); } else { TextResponseMsgModel textMsg2 = new TextResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString(), Content = "对不起,您暂未参加图片打印活动!" }; res = textMsg2.ToString(); } break; case "hp_photo_ticket": //对当前hp_photo对应的照片进行打印认证 PrintCodeDAL printCodeDAL = new PrintCodeDAL(); TextRequestMsgModel temp1 = msgModel as TextRequestMsgModel; string printCode = temp1.Content.Replace("#dy", ""); string clientID = printCodeDAL.GetClientIDByPrintCode(printCode, siteCode); ExceptionLogDAL.InsertExceptionLog(new ExceptionLog() { Message = clientID }); if (!string.IsNullOrEmpty(clientID)) { PhotoDAL photoDal1 = new PhotoDAL(); photoDal1.UpdatePrintInfo(printCode, clientID, siteCode, msgModel.FromUserName); TextResponseMsgModel textMsg2 = new TextResponseMsgModel() { ToUserName = msgModel.FromUserName, FromUserName = msgModel.ToUserName, CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString(), Content = replyMsgValue == null ? string.Empty : TransformText(replyMsgValue, msgModel) }; res = textMsg2.ToString(); //TextResponseMsgModel textMsg2 = new TextResponseMsgModel() //{ // ToUserName = msgModel.FromUserName, // FromUserName = msgModel.ToUserName, // CreateTime = WeiXinHelper.ConvertDateTimeInt(DateTime.Now).ToString(), // Content = "照片打印中,请稍侯..." //}; //res = textMsg2.ToString(); } break; default: break; } } catch (Exception ex) { ExceptionLogDAL.InsertExceptionLog(ex); } return(res); }
/// <summary> /// 用户注册 /// </summary> void saveUserinfo() { if (strOpenID != null && strOpenID != "") { if (!AwardUserDal.ExistAwardUser(strOpenID, "", "", "", "")) { LuckyAwardUsers usermodel = new LuckyAwardUsers(); usermodel.ID = Guid.NewGuid().ToString("N").ToUpper(); usermodel.IsDel = 0; usermodel.OpenID = strOpenID; usermodel.SendAward = 0; usermodel.ActID = strActID; if (AwardUserDal.AddAwardUsers(usermodel)) { Random ran = new Random(); int RandKey = ran.Next(0, 6); string strGuid = Guid.NewGuid().ToString("N"); string strSN = GenerateCheckCode(7); string strCouActID = "AC87CE288FC24F23B7B68CE8F3D93D04"; switch (RandKey) { case 1: strCouActID = "AC87CE288FC24F23B7B68CE8F3D93D01"; break; case 2: strCouActID = "AC87CE288FC24F23B7B68CE8F3D93D02"; break; case 3: strCouActID = "AC87CE288FC24F23B7B68CE8F3D93D03"; break; case 4: strCouActID = "AC87CE288FC24F23B7B68CE8F3D93D04"; break; case 5: strCouActID = "AC87CE288FC24F23B7B68CE8F3D93D05"; break; case 6: strCouActID = "AC87CE288FC24F23B7B68CE8F3D93D06"; break; default: strCouActID = "AC87CE288FC24F23B7B68CE8F3D93D04"; break; } CouponDAL cdal = new CouponDAL(); Model.ACT.Coupon coupon = null; coupon = new Model.ACT.Coupon() { ID = strGuid, SiteCode = strSiteCode, SiteActivityID = strCouActID, OpenID = strOpenID, CouponCode = strSN, CouponStatus = 0 }; cdal.InsertInfo(coupon); Response.Write("{\"success\":\"true\",\"prizetype\":\"" + RandKey.ToString() + "\",\"sn\":\"a" + strSN + "\"}"); } else { Response.Write("{\"error\":\"invalid\"}"); } } else { //Response.Write("{\"prizetype\":\"null\",\"sn\":\"no\"}"); Response.Write("{\"error\":\"isdoing\"}"); } } else { Response.Write("{\"prizetype\":\"null\",\"sn\":\"no\"}"); } }
protected override bool BeforeLoad() { string strGuid = string.Empty; if (null != Request.QueryString["sitecode"] && null != Request.QueryString["openid"] && null != Request.QueryString["couponid"]) { CouponID = Common.Common.NoHtml(Request.QueryString["couponid"].ToString()); SiteCode = Common.Common.NoHtml(Request.QueryString["sitecode"].ToString()); if (Request.QueryString["sitecode"].ToString().Length > 6) { return(false); } if (Request.QueryString["couponid"].ToString().Length != 32) { return(false); } if (Request.QueryString["openid"].ToString().Length > 29 || Request.QueryString["openid"].ToString().Length < 25) { return(false); } else { OpenID = Request.QueryString["openid"].ToString(); } //插入优惠券 SiteActivityDAL dalActive = new SiteActivityDAL(); DataSet dsActive = dalActive.GetActivityDetail(CouponID); if (null != dsActive && dsActive.Tables.Count > 0 && dsActive.Tables[0].Rows.Count > 0) { strGuid = Guid.NewGuid().ToString("N"); CouponDAL cdal = new CouponDAL(); if (!cdal.ExistCoupon(SiteCode, CouponID, OpenID)) { //判断是否可以参加 //取当前已经参加的人数 int iCount = 10000000; if (null != dsActive.Tables[0].Rows[0]["DayLimit"].ToString()) { string strCount = "SiteCode = '" + SiteCode + "' AND SiteActivityID = '" + CouponID + "' AND CONVERT(VARCHAR(10),AddTime,120) = CONVERT(VARCHAR(10),GETDATE(),120)"; iCount = cdal.GetCouponCount(strCount); } string strStartTime = dsActive.Tables[0].Rows[0]["StartTime"].ToString(); string strEndTime = dsActive.Tables[0].Rows[0]["EndTime"].ToString(); string strOpenTime = dsActive.Tables[0].Rows[0]["OpenTime"].ToString(); string strCloseTime = dsActive.Tables[0].Rows[0]["CloseTime"].ToString(); string strDayLimit = dsActive.Tables[0].Rows[0]["DayLimit"].ToString(); if (DateTime.Now >= Convert.ToDateTime(strStartTime) && DateTime.Now < Convert.ToDateTime(strEndTime) && DateTime.Now.Hour >= int.Parse(strOpenTime) && DateTime.Now.Hour < int.Parse(strCloseTime) ) { if (iCount < int.Parse(strDayLimit)) { Coupon coupon = new Coupon() { ID = strGuid, SiteCode = SiteCode, SiteActivityID = CouponID, OpenID = OpenID, CouponStatus = 0 }; cdal.InsertInfo(coupon); strReHtml = "RushBuyOK.html"; } else { strReHtml = "RushBuyOver.html"; strMessage = "抱歉!优惠券已经被抢完,请关注下期活动!"; } } else { strReHtml = "RushBuyOver.html"; strMessage = "抱歉!近期活动未开始或者已经结束,请关注公方微信优惠消息!"; } } else { strReHtml = "RushBuyOver.html"; strMessage = "抱歉!您已经参与了活动,请把机会留给其余的顾客。"; } } CouponID = strGuid; } else { Response.Write("<script>window.opener=null;window.close();</script>"); return(false); } return(base.BeforeLoad()); }