示例#1
0
        public override AbstractResponse OnEvent_SubscribeRequest(SubscribeEventRequest subscribeEventRequest)
        {
            WriteLog("GetSubscribeReply");
            ReplyInfo        subscribeReply = ReplyHelper.GetSubscribeReply();
            AbstractResponse result;

            if (subscribeReply == null)
            {
                WriteLog("subscribeReply == null");
                result = null;
            }
            else
            {
                WriteLog("取消关注再关注,进入这个事件");
                subscribeReply.Keys = "登录";
                AbstractResponse response = this.GetResponse(subscribeReply, subscribeEventRequest.FromUserName);

                if (response == null)
                {
                    this.GotoManyCustomerService(subscribeEventRequest);
                }
                response.ToUserName   = subscribeEventRequest.FromUserName;
                response.FromUserName = subscribeEventRequest.ToUserName;
                result = response;
                //取消关注再关注,进入这个事件
                ScanVisitDistributor(subscribeEventRequest, subscribeEventRequest.EventKey);
            }
            return(result);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.radMatch.Items[0].Text   = "模糊匹配";
            this.radMatch.Items[1].Text   = "精确匹配";
            this.radDisable.Items[0].Text = "启用";
            this.radDisable.Items[1].Text = "禁用";
            this.chkNo.Enabled            = (ReplyHelper.GetMismatchReply() == null);
            this.chkSub.Enabled           = (ReplyHelper.GetSubscribeReply() == null);
            IList <CouponInfo> allUsedCoupons = CouponHelper.GetAllUsedCoupons(1);

            if (allUsedCoupons != null && allUsedCoupons.Count > 0)
            {
                foreach (CouponInfo item in allUsedCoupons)
                {
                    if (CouponHelper.GetCouponSurplus(item.CouponId) > 0)
                    {
                        this.ddlCoupon.Items.Add(new ListItem(item.CouponName.ToNullString(), item.CouponId.ToNullString()));
                    }
                }
            }
            if (this.ddlCoupon.Items.Count == 0)
            {
                this.ddlsubType.Items.RemoveAt(1);
                this.ddlCoupon.Items.Add(new ListItem("请选择优惠券", "0"));
            }
            if (!this.chkNo.Enabled)
            {
                this.chkNo.ToolTip = "该类型已被使用";
            }
            if (!this.chkSub.Enabled)
            {
                this.chkSub.ToolTip = "该类型已被使用";
            }
        }
示例#3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     wid = GetCurWebId();
     if (string.IsNullOrEmpty(wid))
     {
         return;
     }
     this.btnAdd.Click            += new EventHandler(this.btnSubmit_Click);
     this.radMatch.Items[0].Text   = "模糊匹配";
     this.radMatch.Items[1].Text   = "精确匹配";
     this.radDisable.Items[0].Text = "启用";
     this.radDisable.Items[1].Text = "禁用";
     this.chkNo.Enabled            = ReplyHelper.GetMismatchReply(this.wid) == null;
     this.chkSub.Enabled           = ReplyHelper.GetSubscribeReply(this.wid) == null;
     if (!this.chkNo.Enabled)
     {
         this.chkNo.ToolTip = "该类型已被使用";
     }
     if (!this.chkSub.Enabled)
     {
         this.chkSub.ToolTip = "该类型已被使用";
     }
     if (!base.IsPostBack)
     {
         this.chkKeys.Checked = true;
     }
 }
示例#4
0
        public override AbstractResponse OnEvent_SubscribeRequest(SubscribeEventRequest subscribeEventRequest)
        {
            string text = "";

            if (subscribeEventRequest.EventKey != null)
            {
                text = subscribeEventRequest.EventKey;
            }
            if (text.Contains("qrscene_"))
            {
                text = text.Replace("qrscene_", "").Trim();
                if (text == "1")
                {
                    if (WeiXinHelper.BindAdminOpenId.Count > 10)
                    {
                        WeiXinHelper.BindAdminOpenId.Clear();
                    }
                    if (WeiXinHelper.BindAdminOpenId.ContainsKey(subscribeEventRequest.Ticket))
                    {
                        WeiXinHelper.BindAdminOpenId[subscribeEventRequest.Ticket] = subscribeEventRequest.FromUserName;
                    }
                    else
                    {
                        WeiXinHelper.BindAdminOpenId.Add(subscribeEventRequest.Ticket, subscribeEventRequest.FromUserName);
                    }
                    return(new TextResponse
                    {
                        CreateTime = System.DateTime.Now,
                        Content = "您正在扫描尝试绑定管理员身份,身份已识别",
                        ToUserName = subscribeEventRequest.FromUserName,
                        FromUserName = subscribeEventRequest.ToUserName
                    });
                }
                ScanInfos scanInfosByTicket = ScanHelp.GetScanInfosByTicket(subscribeEventRequest.Ticket);
                Globals.Debuglog(text + ":" + subscribeEventRequest.Ticket, "_Debuglog.txt");
                if (!MemberProcessor.IsExitOpenId(subscribeEventRequest.FromUserName) && scanInfosByTicket != null && scanInfosByTicket.BindUserId > 0)
                {
                    this.CreatMember(subscribeEventRequest.FromUserName, scanInfosByTicket.BindUserId);
                    ScanHelp.updateScanInfosLastActiveTime(System.DateTime.Now, scanInfosByTicket.Sceneid);
                }
            }
            WeiXinHelper.UpdateRencentOpenID(subscribeEventRequest.FromUserName);
            Hidistro.Entities.VShop.ReplyInfo subscribeReply = ReplyHelper.GetSubscribeReply();
            if (subscribeReply == null)
            {
                return(null);
            }
            subscribeReply.Keys = "登录";
            AbstractResponse response = this.GetResponse(subscribeReply, subscribeEventRequest.FromUserName);

            if (response == null)
            {
                this.GotoManyCustomerService(subscribeEventRequest);
            }
            response.ToUserName   = subscribeEventRequest.FromUserName;
            response.FromUserName = subscribeEventRequest.ToUserName;
            return(response);
        }
示例#5
0
        public override AbstractResponse OnEvent_ScanRequest(ScanEventRequest scanEventRequest)
        {
            string eventKey = scanEventRequest.EventKey;

            if (eventKey == "1")
            {
                if (WeiXinHelper.BindAdminOpenId.Count > 10)
                {
                    WeiXinHelper.BindAdminOpenId.Clear();
                }
                if (WeiXinHelper.BindAdminOpenId.ContainsKey(scanEventRequest.Ticket))
                {
                    WeiXinHelper.BindAdminOpenId[scanEventRequest.Ticket] = scanEventRequest.FromUserName;
                }
                else
                {
                    WeiXinHelper.BindAdminOpenId.Add(scanEventRequest.Ticket, scanEventRequest.FromUserName);
                }
                return(new TextResponse {
                    CreateTime = DateTime.Now, Content = "您正在扫描尝试绑定管理员身份,身份已识别", ToUserName = scanEventRequest.FromUserName, FromUserName = scanEventRequest.ToUserName
                });
            }
            ScanInfos scanInfosByTicket = ScanHelp.GetScanInfosByTicket(scanEventRequest.Ticket);

            Globals.Debuglog(eventKey + ":" + scanEventRequest.Ticket, "_Debuglog.txt");
            bool flag = MemberProcessor.IsExitOpenId(scanEventRequest.FromUserName);

            if ((!flag && (scanInfosByTicket != null)) && (scanInfosByTicket.BindUserId > 0))
            {
                this.CreatMember(scanEventRequest.FromUserName, scanInfosByTicket.BindUserId);
            }
            if (scanInfosByTicket != null)
            {
                ScanHelp.updateScanInfosLastActiveTime(DateTime.Now, scanInfosByTicket.Sceneid);
            }
            if (flag)
            {
                return(new TextResponse {
                    CreateTime = DateTime.Now, Content = "您刚扫描了分销商公众号二维码!", ToUserName = scanEventRequest.FromUserName, FromUserName = scanEventRequest.ToUserName
                });
            }
            Hidistro.Entities.VShop.ReplyInfo subscribeReply = ReplyHelper.GetSubscribeReply();
            if (subscribeReply == null)
            {
                return(null);
            }
            subscribeReply.Keys = "扫描";
            AbstractResponse response = this.GetResponse(subscribeReply, scanEventRequest.FromUserName);

            response.ToUserName   = scanEventRequest.FromUserName;
            response.FromUserName = scanEventRequest.ToUserName;
            return(response);
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     wid = GetCurWebId();
     if (string.IsNullOrEmpty(wid))
     {
         return;
     }
     this.radMatch.Items[0].Text   = "模糊匹配";
     this.radMatch.Items[1].Text   = "精确匹配";
     this.radDisable.Items[0].Text = "启用";
     this.radDisable.Items[1].Text = "禁用";
     this.chkNo.Enabled            = ReplyHelper.GetMismatchReply(this.wid) == null;
     this.chkSub.Enabled           = ReplyHelper.GetSubscribeReply(this.wid) == null;
     if (!this.chkNo.Enabled)
     {
         this.chkNo.ToolTip = "该类型已被使用";
     }
     if (!this.chkSub.Enabled)
     {
         this.chkSub.ToolTip = "该类型已被使用";
     }
     if (!base.IsPostBack)
     {
         this.id = base.GetUrlIntParam("id");
         this.BindSingleArticle(this.id);
     }
     else
     {
         this.uploadpic.Src = this.hdpic.Value;
     }
     if (base.GetUrlBoolParam("iscallback"))
     {
         this.UploadImage();
     }
     else if (!string.IsNullOrEmpty(base.Request.Form["del"]))
     {
         string path = base.Request.Form["del"];
         string str2 = Globals.PhysicalPath(path);
         try
         {
             if (File.Exists(str2))
             {
                 File.Delete(str2);
                 base.Response.Write("true");
             }
         }
         catch (Exception)
         {
             base.Response.Write("false");
         }
         base.Response.End();
     }
 }
示例#7
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     this.btnAdd.Click            += new System.EventHandler(this.btnSubmit_Click);
     this.radMatch.Items[0].Text   = "模糊匹配";
     this.radMatch.Items[1].Text   = "精确匹配";
     this.radDisable.Items[0].Text = "启用";
     this.radDisable.Items[1].Text = "禁用";
     this.chkNo.Enabled            = (ReplyHelper.GetMismatchReply() == null);
     this.chkSub.Enabled           = (ReplyHelper.GetSubscribeReply() == null);
     if (!this.chkNo.Enabled)
     {
         this.chkNo.ToolTip = "该类型已被使用";
     }
     if (!this.chkSub.Enabled)
     {
         this.chkSub.ToolTip = "该类型已被使用";
     }
     if (!base.IsPostBack)
     {
         int           urlIntParam   = base.GetUrlIntParam("id");
         TextReplyInfo textReplyInfo = ReplyHelper.GetReply(urlIntParam) as TextReplyInfo;
         if (textReplyInfo == null)
         {
             base.GotoResourceNotFound();
             return;
         }
         this.fcContent.Text           = textReplyInfo.Text;
         this.txtKeys.Text             = textReplyInfo.Keys;
         this.radMatch.SelectedValue   = (textReplyInfo.MatchType == MatchType.Like);
         this.radDisable.SelectedValue = !textReplyInfo.IsDisable;
         this.chkKeys.Checked          = (ReplyType.Keys == (textReplyInfo.ReplyType & ReplyType.Keys));
         this.chkSub.Checked           = (ReplyType.Subscribe == (textReplyInfo.ReplyType & ReplyType.Subscribe));
         this.chkNo.Checked            = (ReplyType.NoMatch == (textReplyInfo.ReplyType & ReplyType.NoMatch));
         this.chkKefu.Checked          = (ReplyType.Kefu == textReplyInfo.ReplyType);
         if (this.chkNo.Checked)
         {
             this.chkNo.Enabled = true;
             this.chkNo.ToolTip = "";
         }
         if (this.chkSub.Checked)
         {
             this.chkSub.Enabled = true;
             this.chkSub.ToolTip = "";
         }
         if (this.chkKefu.Checked)
         {
             this.chkKeys.Checked = false;
             this.chkSub.Checked  = false;
             this.chkNo.Checked   = false;
         }
     }
 }
示例#8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     wid = GetCurWebId();
     if (string.IsNullOrEmpty(wid))
     {
         return;
     }
     this.btnAdd.Click            += new EventHandler(this.btnSubmit_Click);
     this.radMatch.Items[0].Text   = "模糊匹配";
     this.radMatch.Items[1].Text   = "精确匹配";
     this.radDisable.Items[0].Text = "启用";
     this.radDisable.Items[1].Text = "禁用";
     this.chkNo.Enabled            = ReplyHelper.GetMismatchReply(this.wid) == null;
     this.chkSub.Enabled           = ReplyHelper.GetSubscribeReply(this.wid) == null;
     if (!this.chkNo.Enabled)
     {
         this.chkNo.ToolTip = "该类型已被使用";
     }
     if (!this.chkSub.Enabled)
     {
         this.chkSub.ToolTip = "该类型已被使用";
     }
     if (!base.IsPostBack)
     {
         TextReplyInfo reply = ReplyHelper.GetReply(base.GetUrlIntParam("id")) as TextReplyInfo;
         if (reply == null)
         {
             base.GotoResourceNotFound();
         }
         else
         {
             this.fcContent.Text           = reply.Text;
             this.txtKeys.Text             = reply.Keys;
             this.radMatch.SelectedValue   = reply.MatchType == MatchType.Like;
             this.radDisable.SelectedValue = !reply.IsDisable;
             this.chkKeys.Checked          = ReplyType.Keys == (reply.ReplyType & ReplyType.Keys);
             this.chkSub.Checked           = ReplyType.Subscribe == (reply.ReplyType & ReplyType.Subscribe);
             this.chkNo.Checked            = ReplyType.NoMatch == (reply.ReplyType & ReplyType.NoMatch);
             if (this.chkNo.Checked)
             {
                 this.chkNo.Enabled = true;
                 this.chkNo.ToolTip = "";
             }
             if (this.chkSub.Checked)
             {
                 this.chkSub.Enabled = true;
                 this.chkSub.ToolTip = "";
             }
         }
     }
 }
示例#9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     wid = GetCurWebId();
     if (string.IsNullOrEmpty(wid))
     {
         return;
     }
     this.radMatch.Items[0].Text   = "模糊匹配";
     this.radMatch.Items[1].Text   = "精确匹配";
     this.radDisable.Items[0].Text = "启用";
     this.radDisable.Items[1].Text = "禁用";
     this.chkNo.Enabled            = ReplyHelper.GetMismatchReply(this.wid) == null;
     this.chkSub.Enabled           = ReplyHelper.GetSubscribeReply(this.wid) == null;
     if (!this.chkNo.Enabled)
     {
         this.chkNo.ToolTip = "该类型已被使用";
     }
     if (!this.chkSub.Enabled)
     {
         this.chkSub.ToolTip = "该类型已被使用";
     }
     if (!string.IsNullOrEmpty(base.Request.QueryString["iscallback"]) && Convert.ToBoolean(base.Request.QueryString["iscallback"]))
     {
         this.UploadImage();
     }
     else if (!string.IsNullOrEmpty(base.Request.Form["del"]))
     {
         string path = base.Request.Form["del"];
         string str2 = Globals.PhysicalPath(path);
         try
         {
             if (File.Exists(str2))
             {
                 File.Delete(str2);
                 base.Response.Write("true");
             }
         }
         catch (Exception)
         {
             base.Response.Write("false");
         }
         base.Response.End();
     }
 }
示例#10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.radMatch.Items[0].Text   = "模糊匹配";
            this.radMatch.Items[1].Text   = "精确匹配";
            this.radDisable.Items[0].Text = "启用";
            this.radDisable.Items[1].Text = "禁用";
            this.chkNo.Enabled            = (ReplyHelper.GetMismatchReply() == null);
            this.chkSub.Enabled           = (ReplyHelper.GetSubscribeReply() == null);
            if (!this.chkNo.Enabled)
            {
                this.chkNo.ToolTip = "该类型已被使用";
            }
            if (!this.chkSub.Enabled)
            {
                this.chkSub.ToolTip = "该类型已被使用";
            }
            IList <CouponInfo> allUsedCoupons = CouponHelper.GetAllUsedCoupons(1);

            if (allUsedCoupons != null)
            {
                foreach (CouponInfo item in allUsedCoupons)
                {
                    if (CouponHelper.GetCouponSurplus(item.CouponId) > 0)
                    {
                        this.ddlCoupon.Items.Add(new ListItem(item.CouponName.ToNullString(), item.CouponId.ToNullString()));
                    }
                }
            }
            if (this.ddlCoupon.Items.Count == 0)
            {
                this.ddlsubType.Items.RemoveAt(1);
                this.ddlCoupon.Items.Add(new ListItem("请选择优惠券", "0"));
            }
            if (!base.IsPostBack)
            {
                this.id = base.GetUrlIntParam("id");
                this.BindSingleArticle(this.id);
            }
            else
            {
                this.uploadpic.Src = this.hdpic.Value;
            }
        }
示例#11
0
        public override AbstractResponse OnEvent_SubscribeRequest(SubscribeEventRequest subscribeEventRequest)
        {
            WeiXinHelper.UpdateRencentOpenID(subscribeEventRequest.FromUserName, this.wid);
            ReplyInfo subscribeReply = ReplyHelper.GetSubscribeReply(this.wid);

            if (subscribeReply == null)
            {
                return(null);
            }
            subscribeReply.Keys = "登录";
            AbstractResponse response = this.GetResponse(subscribeReply, subscribeEventRequest.FromUserName);

            if (response == null)
            {
                this.GotoManyCustomerService(subscribeEventRequest);
            }
            response.ToUserName   = subscribeEventRequest.FromUserName;
            response.FromUserName = subscribeEventRequest.ToUserName;
            return(response);
        }
示例#12
0
        public override AbstractResponse OnEvent_SubscribeRequest(SubscribeEventRequest subscribeEventRequest)
        {
            ReplyInfo subscribeReply = ReplyHelper.GetSubscribeReply();

            if (subscribeReply == null)
            {
                return(null);
            }
            subscribeReply.Keys = "登录";
            AbstractResponse response = this.GetResponse(subscribeReply, subscribeEventRequest.FromUserName);

            if (response == null)
            {
                this.GotoManyCustomerService(subscribeEventRequest);
            }
            response.ToUserName   = subscribeEventRequest.FromUserName;
            response.FromUserName = subscribeEventRequest.ToUserName;
            // 关注成功送优惠卷信息
            AddCoupon(subscribeEventRequest.FromUserName);
            return(response);
        }
示例#13
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     this.btnAdd.Click            += new System.EventHandler(this.btnSubmit_Click);
     this.radMatch.Items[0].Text   = "模糊匹配";
     this.radMatch.Items[1].Text   = "精确匹配";
     this.radDisable.Items[0].Text = "启用";
     this.radDisable.Items[1].Text = "禁用";
     this.chkNo.Enabled            = (ReplyHelper.GetMismatchReply() == null);
     this.chkSub.Enabled           = (ReplyHelper.GetSubscribeReply() == null);
     if (!this.chkNo.Enabled)
     {
         this.chkNo.ToolTip = "该类型已被使用";
     }
     if (!this.chkSub.Enabled)
     {
         this.chkSub.ToolTip = "该类型已被使用";
     }
     if (!base.IsPostBack)
     {
         this.chkKeys.Checked = true;
     }
 }
示例#14
0
        public override AbstractResponse OnEvent_SubscribeRequest(SubscribeEventRequest subscribeEventRequest)
        {
            ReplyInfo        subscribeReply = ReplyHelper.GetSubscribeReply();
            AbstractResponse result;

            if (subscribeReply == null)
            {
                result = null;
            }
            else
            {
                subscribeReply.Keys = "登录";
                AbstractResponse response = this.GetResponse(subscribeReply, subscribeEventRequest.FromUserName);
                if (response == null)
                {
                    this.GotoManyCustomerService(subscribeEventRequest);
                }
                response.ToUserName   = subscribeEventRequest.FromUserName;
                response.FromUserName = subscribeEventRequest.ToUserName;
                result = response;
            }
            return(result);
        }
示例#15
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!int.TryParse(base.Request.QueryString["id"], out this.MaterialID))
     {
         base.Response.Redirect("ReplyOnKey.aspx");
     }
     this.radMatch.Items[0].Text   = "模糊匹配";
     this.radMatch.Items[1].Text   = "精确匹配";
     this.radDisable.Items[0].Text = "启用";
     this.radDisable.Items[1].Text = "禁用";
     this.chkNo.Enabled            = (ReplyHelper.GetMismatchReply() == null);
     this.chkSub.Enabled           = (ReplyHelper.GetSubscribeReply() == null);
     if (!this.chkNo.Enabled)
     {
         this.chkNo.ToolTip = "该类型已被使用";
     }
     if (!this.chkSub.Enabled)
     {
         this.chkSub.ToolTip = "该类型已被使用";
     }
     if (!string.IsNullOrEmpty(base.Request.QueryString["cmd"]))
     {
         if (!string.IsNullOrEmpty(base.Request.Form["MultiArticle"]))
         {
             string str = base.Request.Form["MultiArticle"];
             System.Collections.Generic.List <ArticleList> list = JsonConvert.DeserializeObject <System.Collections.Generic.List <ArticleList> >(str);
             if (list != null && list.Count > 0)
             {
                 NewsReplyInfo reply = ReplyHelper.GetReply(this.MaterialID) as NewsReplyInfo;
                 reply.IsDisable = (base.Request.Form["radDisable"] != "true");
                 string str2 = base.Request.Form.Get("Keys");
                 if (base.Request.Form["chkKeys"] == "true")
                 {
                     if (!string.IsNullOrEmpty(str2) && reply.Keys != str2 && ReplyHelper.HasReplyKey(str2))
                     {
                         base.Response.Write("key");
                         base.Response.End();
                     }
                     reply.Keys = str2;
                 }
                 else
                 {
                     reply.Keys = string.Empty;
                 }
                 reply.MatchType = ((base.Request.Form["radMatch"] == "true") ? MatchType.Like : MatchType.Equal);
                 reply.ReplyType = ReplyType.None;
                 if (base.Request.Form["chkKeys"] == "true")
                 {
                     reply.ReplyType |= ReplyType.Keys;
                 }
                 if (base.Request.Form["chkSub"] == "true")
                 {
                     reply.ReplyType |= ReplyType.Subscribe;
                 }
                 if (base.Request.Form["chkNo"] == "true")
                 {
                     reply.ReplyType |= ReplyType.NoMatch;
                 }
                 foreach (NewsMsgInfo info2 in reply.NewsMsg)
                 {
                     ReplyHelper.DeleteNewsMsg(info2.Id);
                 }
                 System.Collections.Generic.List <NewsMsgInfo> list2 = new System.Collections.Generic.List <NewsMsgInfo>();
                 foreach (ArticleList list3 in list)
                 {
                     if (list3.Status != "del")
                     {
                         NewsMsgInfo item = list3;
                         if (item != null)
                         {
                             item.Reply = reply;
                             list2.Add(item);
                         }
                     }
                 }
                 reply.NewsMsg = list2;
                 if (ReplyHelper.UpdateReply(reply))
                 {
                     base.Response.Write("true");
                     base.Response.End();
                 }
             }
         }
     }
     else
     {
         NewsReplyInfo info3 = ReplyHelper.GetReply(this.MaterialID) as NewsReplyInfo;
         if (info3 != null)
         {
             System.Collections.Generic.List <ArticleList> list4 = new System.Collections.Generic.List <ArticleList>();
             if (info3.NewsMsg != null && info3.NewsMsg.Count > 0)
             {
                 int num = 1;
                 foreach (NewsMsgInfo info4 in info3.NewsMsg)
                 {
                     ArticleList list5 = new ArticleList
                     {
                         PicUrl      = info4.PicUrl,
                         Title       = info4.Title,
                         Url         = info4.Url,
                         Description = info4.Description,
                         Content     = info4.Content
                     };
                     list5.BoxId  = num++.ToString();
                     list5.Status = "";
                     list4.Add(list5);
                 }
                 this.articleJson = JsonConvert.SerializeObject(list4);
             }
             this.fkContent.Text           = info3.NewsMsg[0].Content;
             this.txtKeys.Text             = info3.Keys;
             this.radMatch.SelectedValue   = (info3.MatchType == MatchType.Like);
             this.radDisable.SelectedValue = !info3.IsDisable;
             this.chkKeys.Checked          = (ReplyType.Keys == (info3.ReplyType & ReplyType.Keys));
             this.chkSub.Checked           = (ReplyType.Subscribe == (info3.ReplyType & ReplyType.Subscribe));
             this.chkNo.Checked            = (ReplyType.NoMatch == (info3.ReplyType & ReplyType.NoMatch));
             if (this.chkNo.Checked)
             {
                 this.chkNo.Enabled = true;
                 this.chkNo.ToolTip = "";
             }
             if (this.chkSub.Checked)
             {
                 this.chkSub.Enabled = true;
                 this.chkSub.ToolTip = "";
             }
         }
     }
 }
示例#16
0
        public override AbstractResponse OnEvent_SubscribeRequest(SubscribeEventRequest subscribeEventRequest)
        {
            string eventKey = "";

            if (subscribeEventRequest.EventKey != null)
            {
                eventKey = subscribeEventRequest.EventKey;
            }
            if (eventKey.Contains("qrscene_"))
            {
                eventKey = eventKey.Replace("qrscene_", "").Trim();
                if (eventKey == "1")
                {
                    if (WeiXinHelper.BindAdminOpenId.Count > 10)
                    {
                        WeiXinHelper.BindAdminOpenId.Clear();
                    }
                    if (WeiXinHelper.BindAdminOpenId.ContainsKey(subscribeEventRequest.Ticket))
                    {
                        WeiXinHelper.BindAdminOpenId[subscribeEventRequest.Ticket] = subscribeEventRequest.FromUserName;
                    }
                    else
                    {
                        WeiXinHelper.BindAdminOpenId.Add(subscribeEventRequest.Ticket, subscribeEventRequest.FromUserName);
                    }
                    return(new TextResponse {
                        CreateTime = DateTime.Now, Content = "您正在扫描尝试绑定管理员身份,身份已识别", ToUserName = subscribeEventRequest.FromUserName, FromUserName = subscribeEventRequest.ToUserName
                    });
                }
                ScanInfos scanInfosByTicket = ScanHelp.GetScanInfosByTicket(subscribeEventRequest.Ticket);
                bool      flag       = MemberProcessor.IsExitOpenId(subscribeEventRequest.FromUserName);
                int       bindUserId = scanInfosByTicket.BindUserId;
                if (bindUserId < 0)
                {
                    bindUserId = 0;
                }
                if (!flag && (scanInfosByTicket != null))
                {
                    this.CreatMember(subscribeEventRequest.FromUserName, bindUserId, "");
                    ScanHelp.updateScanInfosLastActiveTime(DateTime.Now, scanInfosByTicket.Sceneid);
                }
            }
            else
            {
                bool flag2 = MemberProcessor.IsExitOpenId(subscribeEventRequest.FromUserName);
                Globals.Debuglog("关注公众号1", "_DebuglogConcern.txt");
                int referralUserId = 0;
                if (referralUserId < 0)
                {
                    referralUserId = 0;
                }
                if (!flag2)
                {
                    Globals.Debuglog("关注公众号生成用户1", "_DebuglogConcern.txt");
                    this.CreatMember(subscribeEventRequest.FromUserName, referralUserId, "");
                }
            }
            WeiXinHelper.UpdateRencentOpenID(subscribeEventRequest.FromUserName);
            string  str2 = "";
            DataSet set  = new DataSet();
            string  path = HttpContext.Current.Server.MapPath("/config/WifiConfig.xml");

            if (File.Exists(path))
            {
                set.ReadXml(path);
                if ((set != null) && (set.Tables.Count > 0))
                {
                    foreach (DataRow row in set.Tables[0].Rows)
                    {
                        if (row["id"].ToString() == eventKey)
                        {
                            str2 = row["WifiDescribe"].ToString() + "\r\nWIFI帐号:" + row["WifiName"].ToString() + "\r\n WIFI密码:" + row["WifiPwd"].ToString();
                        }
                    }
                }
            }
            if (str2 != "")
            {
                return(new TextResponse {
                    CreateTime = DateTime.Now, Content = str2, ToUserName = subscribeEventRequest.FromUserName, FromUserName = subscribeEventRequest.ToUserName
                });
            }
            Hidistro.Entities.VShop.ReplyInfo subscribeReply = ReplyHelper.GetSubscribeReply();
            if (subscribeReply == null)
            {
                return(null);
            }
            subscribeReply.Keys = "登录";
            AbstractResponse response = this.GetResponse(subscribeReply, subscribeEventRequest.FromUserName);

            if (response == null)
            {
                this.GotoManyCustomerService(subscribeEventRequest);
            }
            response.ToUserName   = subscribeEventRequest.FromUserName;
            response.FromUserName = subscribeEventRequest.ToUserName;
            return(response);
        }
示例#17
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     if (!int.TryParse(base.Request.QueryString["id"], out this.MaterialID))
     {
         base.Response.Redirect("ReplyOnKey.aspx");
     }
     this.radMatch.Items[0].Text   = "模糊匹配";
     this.radMatch.Items[1].Text   = "精确匹配";
     this.radDisable.Items[0].Text = "启用";
     this.radDisable.Items[1].Text = "禁用";
     this.chkNo.Enabled            = (ReplyHelper.GetMismatchReply() == null);
     this.chkSub.Enabled           = (ReplyHelper.GetSubscribeReply() == null);
     if (!this.chkNo.Enabled)
     {
         this.chkNo.ToolTip = "该类型已被使用";
     }
     if (!this.chkSub.Enabled)
     {
         this.chkSub.ToolTip = "该类型已被使用";
     }
     if (!string.IsNullOrEmpty(base.Request.QueryString["cmd"]))
     {
         if (!string.IsNullOrEmpty(base.Request.Form["MultiArticle"]))
         {
             string value = base.Request.Form["MultiArticle"];
             System.Collections.Generic.List <ArticleList> list = JsonConvert.DeserializeObject(value, typeof(System.Collections.Generic.List <ArticleList>)) as System.Collections.Generic.List <ArticleList>;
             if (list != null && list.Count > 0)
             {
                 NewsReplyInfo newsReplyInfo = ReplyHelper.GetReply(this.MaterialID) as NewsReplyInfo;
                 newsReplyInfo.IsDisable = (base.Request.Form["radDisable"] != "true");
                 string text = base.Request.Form.Get("Keys");
                 if (base.Request.Form["chkKeys"] == "true")
                 {
                     if (!string.IsNullOrEmpty(text) && newsReplyInfo.Keys != text && ReplyHelper.HasReplyKey(text))
                     {
                         base.Response.Write("key");
                         base.Response.End();
                     }
                     newsReplyInfo.Keys = text;
                 }
                 else
                 {
                     newsReplyInfo.Keys = string.Empty;
                 }
                 newsReplyInfo.MatchType = ((base.Request.Form["radMatch"] == "true") ? MatchType.Like : MatchType.Equal);
                 newsReplyInfo.ReplyType = ReplyType.None;
                 if (base.Request.Form["chkKeys"] == "true")
                 {
                     newsReplyInfo.ReplyType |= ReplyType.Keys;
                 }
                 if (base.Request.Form["chkSub"] == "true")
                 {
                     newsReplyInfo.ReplyType |= ReplyType.Subscribe;
                 }
                 if (base.Request.Form["chkNo"] == "true")
                 {
                     newsReplyInfo.ReplyType |= ReplyType.NoMatch;
                 }
                 foreach (NewsMsgInfo current in newsReplyInfo.NewsMsg)
                 {
                     ReplyHelper.DeleteNewsMsg(current.Id);
                 }
                 System.Collections.Generic.List <NewsMsgInfo> list2 = new System.Collections.Generic.List <NewsMsgInfo>();
                 foreach (ArticleList current2 in list)
                 {
                     if (current2.Status != "del")
                     {
                         NewsMsgInfo newsMsgInfo = current2;
                         if (newsMsgInfo != null)
                         {
                             newsMsgInfo.Reply = newsReplyInfo;
                             list2.Add(newsMsgInfo);
                         }
                     }
                 }
                 newsReplyInfo.NewsMsg = list2;
                 if (ReplyHelper.UpdateReply(newsReplyInfo))
                 {
                     base.Response.Write("true");
                     base.Response.End();
                     return;
                 }
             }
         }
     }
     else
     {
         NewsReplyInfo newsReplyInfo2 = ReplyHelper.GetReply(this.MaterialID) as NewsReplyInfo;
         if (newsReplyInfo2 != null)
         {
             System.Collections.Generic.List <ArticleList> list3 = new System.Collections.Generic.List <ArticleList>();
             if (newsReplyInfo2.NewsMsg != null && newsReplyInfo2.NewsMsg.Count > 0)
             {
                 int num = 1;
                 foreach (NewsMsgInfo current3 in newsReplyInfo2.NewsMsg)
                 {
                     list3.Add(new ArticleList
                     {
                         PicUrl      = current3.PicUrl,
                         Title       = current3.Title,
                         Url         = current3.Url,
                         Description = current3.Description,
                         Content     = current3.Content,
                         BoxId       = num++.ToString(),
                         Status      = ""
                     });
                 }
                 this.articleJson = JsonConvert.SerializeObject(list3);
             }
             this.fkContent.Text           = newsReplyInfo2.NewsMsg[0].Content;
             this.txtKeys.Text             = newsReplyInfo2.Keys;
             this.radMatch.SelectedValue   = (newsReplyInfo2.MatchType == MatchType.Like);
             this.radDisable.SelectedValue = !newsReplyInfo2.IsDisable;
             this.chkKeys.Checked          = (ReplyType.Keys == (newsReplyInfo2.ReplyType & ReplyType.Keys));
             this.chkSub.Checked           = (ReplyType.Subscribe == (newsReplyInfo2.ReplyType & ReplyType.Subscribe));
             this.chkNo.Checked            = (ReplyType.NoMatch == (newsReplyInfo2.ReplyType & ReplyType.NoMatch));
             if (this.chkNo.Checked)
             {
                 this.chkNo.Enabled = true;
                 this.chkNo.ToolTip = "";
             }
             if (this.chkSub.Checked)
             {
                 this.chkSub.Enabled = true;
                 this.chkSub.ToolTip = "";
             }
         }
     }
 }
示例#18
0
        public override AbstractResponse OnEvent_ScanRequest(ScanEventRequest scanEventRequest)
        {
            ReplyInfo replyInfo    = ReplyHelper.GetSubscribeReply();
            string    fromUserName = scanEventRequest.FromUserName;

            try
            {
                MemberProcessor.UpdateWXUserIsSubscribeStatus(fromUserName, true);
            }
            catch (Exception ex)
            {
                IDictionary <string, string> dictionary = new Dictionary <string, string>();
                dictionary.Add("openId", fromUserName);
                Globals.WriteExceptionLog(ex, dictionary, "UpdateWXUserIsSubscribeStatus");
            }
            if (replyInfo == null)
            {
                replyInfo = new ReplyInfo();
            }
            replyInfo.Keys = "登录";
            if (scanEventRequest != null && !string.IsNullOrEmpty(scanEventRequest.EventKey) && scanEventRequest.EventKey.Split('_').Length >= 2)
            {
                string text = scanEventRequest.EventKey.Split('_')[1];
                if (text == "referralregister")
                {
                    replyInfo.Keys = "分销注册";
                }
                else if (text.Contains("referraluserid"))
                {
                    if (text.Split(':').Length == 2)
                    {
                        int referralUserId = text.Split(':')[1].ToInt(0);
                        MemberWXReferralInfo wXReferral = VShopHelper.GetWXReferral(scanEventRequest.FromUserName);
                        if (wXReferral != null && wXReferral.Id > 0)
                        {
                            VShopHelper.UpdateWXReferral(scanEventRequest.FromUserName, referralUserId);
                        }
                        else
                        {
                            VShopHelper.AddWXReferral(scanEventRequest.FromUserName, referralUserId);
                        }
                    }
                }
                else if (text.Contains("shoppingguiderid") && text.Split(':').Length == 2)
                {
                    int shoppingGuiderId = text.Split(':')[1].ToInt(0);
                    MemberWXShoppingGuiderInfo memberWXShoppingGuider = MemberHelper.GetMemberWXShoppingGuider(scanEventRequest.FromUserName);
                    if (memberWXShoppingGuider != null && memberWXShoppingGuider.Id > 0)
                    {
                        MemberHelper.UpdateWXShoppingGuider(scanEventRequest.FromUserName, shoppingGuiderId);
                    }
                    else
                    {
                        MemberHelper.AddWXShoppingGuider(scanEventRequest.FromUserName, shoppingGuiderId);
                    }
                }
            }
            AbstractResponse response = this.GetResponse(replyInfo, scanEventRequest.FromUserName, scanEventRequest);

            if (response == null)
            {
                return(this.GotoManyCustomerService(scanEventRequest));
            }
            response.ToUserName   = scanEventRequest.FromUserName;
            response.FromUserName = scanEventRequest.ToUserName;
            return(response);
        }
示例#19
0
        public override AbstractResponse OnEvent_SubscribeRequest(SubscribeEventRequest subscribeEventRequest)
        {
            string text = "";

            MemberProcessor.UpdateUserFollowStateByOpenId(subscribeEventRequest.FromUserName, 1);
            if (subscribeEventRequest.EventKey != null)
            {
                text = subscribeEventRequest.EventKey;
            }
            if (text.Contains("qrscene_"))
            {
                text = text.Replace("qrscene_", "").Trim();
                if (text == "1")
                {
                    if (WeiXinHelper.BindAdminOpenId.Count > 10)
                    {
                        WeiXinHelper.BindAdminOpenId.Clear();
                    }
                    if (WeiXinHelper.BindAdminOpenId.ContainsKey(subscribeEventRequest.Ticket))
                    {
                        WeiXinHelper.BindAdminOpenId[subscribeEventRequest.Ticket] = subscribeEventRequest.FromUserName;
                    }
                    else
                    {
                        WeiXinHelper.BindAdminOpenId.Add(subscribeEventRequest.Ticket, subscribeEventRequest.FromUserName);
                    }
                    return(new TextResponse
                    {
                        CreateTime = System.DateTime.Now,
                        Content = "您正在扫描尝试绑定管理员身份,身份已识别",
                        ToUserName = subscribeEventRequest.FromUserName,
                        FromUserName = subscribeEventRequest.ToUserName
                    });
                }
                ScanInfos scanInfosByTicket = ScanHelp.GetScanInfosByTicket(subscribeEventRequest.Ticket);
                bool      flag = MemberProcessor.IsExitOpenId(subscribeEventRequest.FromUserName);
                int       num  = scanInfosByTicket.BindUserId;
                if (num < 0)
                {
                    num = 0;
                }
                if (!flag && scanInfosByTicket != null)
                {
                    this.CreatMember(subscribeEventRequest.FromUserName, num, "");
                    ScanHelp.updateScanInfosLastActiveTime(System.DateTime.Now, scanInfosByTicket.Sceneid);
                }
            }
            else
            {
                bool flag2 = MemberProcessor.IsExitOpenId(subscribeEventRequest.FromUserName);
                Globals.Debuglog("关注公众号1", "_DebuglogConcern.txt");
                int num2 = 0;
                if (num2 < 0)
                {
                    num2 = 0;
                }
                if (!flag2)
                {
                    Globals.Debuglog("关注公众号生成用户1", "_DebuglogConcern.txt");
                    this.CreatMember(subscribeEventRequest.FromUserName, num2, "");
                }
            }
            WeiXinHelper.UpdateRencentOpenID(subscribeEventRequest.FromUserName);
            string text2 = "";

            System.Data.DataSet dataSet = new System.Data.DataSet();
            string text3 = System.Web.HttpContext.Current.Server.MapPath("/config/WifiConfig.xml");

            if (System.IO.File.Exists(text3))
            {
                dataSet.ReadXml(text3);
                if (dataSet != null && dataSet.Tables.Count > 0)
                {
                    foreach (System.Data.DataRow dataRow in dataSet.Tables[0].Rows)
                    {
                        if (dataRow["id"].ToString() == text)
                        {
                            text2 = string.Concat(new string[]
                            {
                                dataRow["WifiDescribe"].ToString(),
                                "\r\nWIFI帐号:",
                                dataRow["WifiName"].ToString(),
                                "\r\n WIFI密码:",
                                dataRow["WifiPwd"].ToString()
                            });
                        }
                    }
                }
            }
            if (text2 != "")
            {
                return(new TextResponse
                {
                    CreateTime = System.DateTime.Now,
                    Content = text2,
                    ToUserName = subscribeEventRequest.FromUserName,
                    FromUserName = subscribeEventRequest.ToUserName
                });
            }
            Hidistro.Entities.VShop.ReplyInfo subscribeReply = ReplyHelper.GetSubscribeReply();
            if (subscribeReply == null)
            {
                return(null);
            }
            subscribeReply.Keys = "登录";
            AbstractResponse response = this.GetResponse(subscribeReply, subscribeEventRequest.FromUserName);

            if (response == null)
            {
                this.GotoManyCustomerService(subscribeEventRequest);
            }
            response.ToUserName   = subscribeEventRequest.FromUserName;
            response.FromUserName = subscribeEventRequest.ToUserName;
            return(response);
        }
示例#20
0
        //关注事件
        public override AbstractResponse OnEvent_SubscribeRequest(SubscribeEventRequest subscribeEventRequest)
        {
            Utils.LogWriter.SaveLog("产生关注事件:" + subscribeEventRequest.EventKey);
            string event_key = subscribeEventRequest.EventKey;

            if (!string.IsNullOrEmpty(event_key) && event_key.IndexOf("qrscene_") != -1)
            {
                //关联上级

                /*
                 * 打开分享图片
                 * 获取用户信息
                 *
                 * */

                string open_id = subscribeEventRequest.FromUserName;
                Utils.LogWriter.SaveLog("产生关注事件step1:" + open_id);
                int ReferralUserId = int.Parse(subscribeEventRequest.EventKey.Replace("qrscene_", ""));
                Utils.LogWriter.SaveLog("产生关注事件step2:" + ReferralUserId);

                //判断是否会员
                if (MemberProcessor.IsExitOpenId(open_id))
                {
                    Utils.LogWriter.SaveLog("产生关注事件step3:已存在会员信息");
                    Hidistro.Entities.Members.MemberInfo m = MemberProcessor.GetMembers(open_id);
                    if (m.ReferralUserId == 0 && m.OpenId != open_id)
                    {
                        m.ReferralUserId = ReferralUserId;
                        MemberProcessor.UpdateMember(m);
                        //Utils.LogWriter.SaveLog("扫码填补上级ID:" + ReferralUserId);
                        return(null);
                    }
                }
                else
                {
                    Utils.LogWriter.SaveLog("产生关注事件step3:不存在会员信息");
                    //关联上级并增加客户资料
                    SiteSettings masterSettings = SettingsManager.GetMasterSettings(true);

                    JObject wx_user_info = TokenApi.GetUserInfo(masterSettings.WeixinAppId, masterSettings.WeixinAppSecret, open_id);
                    Utils.LogWriter.SaveLog("产生关注事件step4:" + wx_user_info["nickname"].ToString());

                    string generateId = Globals.GetGenerateId();
                    Hidistro.Entities.Members.MemberInfo member = new Hidistro.Entities.Members.MemberInfo
                    {
                        GradeId        = MemberProcessor.GetDefaultMemberGrade(),
                        UserName       = Globals.UrlDecode(wx_user_info["nickname"].ToString()),
                        OpenId         = open_id,
                        CreateDate     = DateTime.Now,
                        SessionId      = generateId,
                        SessionEndTime = DateTime.Now.AddYears(10),
                        ReferralUserId = ReferralUserId
                    };

                    Utils.LogWriter.SaveLog("创建客户资料");
                    MemberProcessor.CreateMember(member);

                    //获取上级
                    Hidistro.Entities.Members.MemberInfo parentInfo = MemberProcessor.GetMember(ReferralUserId);

                    //获取第多少个会员
                    int count = MemberProcessor.GetMemberCount();

                    TextResponse r = new TextResponse
                    {
                        CreateTime = DateTime.Now,
                        Content    = "恭喜您!您已通过【" + parentInfo.UserName + "】的推荐成为本站会员,您是本站第" + (10000 + count)
                                     + "个会员,点击右下方【创业良机】~【组建团队】进入财富倍增快通道。",
                        ToUserName   = subscribeEventRequest.FromUserName,
                        FromUserName = subscribeEventRequest.ToUserName
                    };
                    return(r);
                }
            }

            ReplyInfo subscribeReply = ReplyHelper.GetSubscribeReply();

            if (subscribeReply == null)
            {
                return(null);
            }
            subscribeReply.Keys = "登录";
            AbstractResponse response = this.GetResponse(subscribeReply, subscribeEventRequest.FromUserName);

            if (response == null)
            {
                this.GotoManyCustomerService(subscribeEventRequest);
            }
            response.ToUserName   = subscribeEventRequest.FromUserName;
            response.FromUserName = subscribeEventRequest.ToUserName;
            return(response);
        }
示例#21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(base.Request.QueryString["id"], out this.MaterialID))
     {
         base.Response.Redirect("ReplyOnKey.aspx");
     }
     this.radMatch.Items[0].Text   = "模糊匹配";
     this.radMatch.Items[1].Text   = "精确匹配";
     this.radDisable.Items[0].Text = "启用";
     this.radDisable.Items[1].Text = "禁用";
     this.chkNo.Enabled            = (ReplyHelper.GetMismatchReply() == null);
     this.chkSub.Enabled           = (ReplyHelper.GetSubscribeReply() == null);
     if (!this.chkNo.Enabled)
     {
         this.chkNo.ToolTip = "该类型已被使用";
     }
     if (!this.chkSub.Enabled)
     {
         this.chkSub.ToolTip = "该类型已被使用";
     }
     if (!string.IsNullOrEmpty(base.Request.QueryString["cmd"]))
     {
         if (!string.IsNullOrEmpty(base.Request.Form["MultiArticle"]))
         {
             string             value = base.Request.Form["MultiArticle"];
             List <ArticleList> list  = JsonConvert.DeserializeObject(value, typeof(List <ArticleList>)) as List <ArticleList>;
             if (list != null && list.Count > 0)
             {
                 NewsReplyInfo newsReplyInfo = ReplyHelper.GetReply(this.MaterialID) as NewsReplyInfo;
                 newsReplyInfo.IsDisable = (base.Request.Form["radDisable"] != "true");
                 string text = base.Request.Form.Get("Keys");
                 if (base.Request.Form["chkKeys"] == "true")
                 {
                     if (!string.IsNullOrEmpty(text) && newsReplyInfo.Keys != text && ReplyHelper.HasReplyKey(text))
                     {
                         base.Response.Write("key");
                         base.Response.End();
                     }
                     newsReplyInfo.Keys = text;
                 }
                 else
                 {
                     newsReplyInfo.Keys = string.Empty;
                 }
                 newsReplyInfo.MatchType = ((base.Request.Form["radMatch"] == "true") ? MatchType.Like : MatchType.Equal);
                 newsReplyInfo.ReplyType = ReplyType.None;
                 if (base.Request.Form["chkKeys"] == "true")
                 {
                     newsReplyInfo.ReplyType |= ReplyType.Keys;
                 }
                 if (base.Request.Form["chkSub"] == "true")
                 {
                     newsReplyInfo.ReplyType |= ReplyType.Subscribe;
                 }
                 if (base.Request.Form["chkNo"] == "true")
                 {
                     newsReplyInfo.ReplyType |= ReplyType.NoMatch;
                 }
                 foreach (NewsMsgInfo item in newsReplyInfo.NewsMsg)
                 {
                     ReplyHelper.DeleteNewsMsg(item.Id);
                 }
                 List <NewsMsgInfo> list2 = new List <NewsMsgInfo>();
                 foreach (ArticleList item2 in list)
                 {
                     if (item2.Status != "del")
                     {
                         NewsMsgInfo newsMsgInfo = item2;
                         if (newsMsgInfo != null)
                         {
                             newsMsgInfo.Reply = newsReplyInfo;
                             list2.Add(newsMsgInfo);
                         }
                     }
                 }
                 newsReplyInfo.NewsMsg = list2;
                 foreach (NewsMsgInfo item3 in newsReplyInfo.NewsMsg)
                 {
                     item3.PicUrl = Globals.SaveFile("article", item3.PicUrl, "/Storage/master/", true, false, "");
                 }
                 if (ReplyHelper.UpdateReply(newsReplyInfo))
                 {
                     base.Response.Write("true");
                     base.Response.End();
                 }
             }
         }
     }
     else
     {
         NewsReplyInfo newsReplyInfo2 = ReplyHelper.GetReply(this.MaterialID) as NewsReplyInfo;
         if (newsReplyInfo2 != null)
         {
             List <ArticleList> list3 = new List <ArticleList>();
             if (newsReplyInfo2.NewsMsg != null && newsReplyInfo2.NewsMsg.Count > 0)
             {
                 int num = 1;
                 foreach (NewsMsgInfo item4 in newsReplyInfo2.NewsMsg)
                 {
                     ArticleList articleList = new ArticleList();
                     articleList.PicUrl      = item4.PicUrl;
                     articleList.Title       = item4.Title;
                     articleList.Url         = item4.Url;
                     articleList.Description = item4.Description;
                     articleList.Content     = item4.Content;
                     ArticleList articleList2 = articleList;
                     int         num2         = num;
                     num = num2 + 1;
                     articleList2.BoxId = num2.ToString();
                     articleList.Status = "";
                     list3.Add(articleList);
                 }
                 this.articleJson = JsonConvert.SerializeObject(list3);
             }
             this.fkContent.Text           = newsReplyInfo2.NewsMsg[0].Content;
             this.txtKeys.Text             = newsReplyInfo2.Keys;
             this.radMatch.SelectedValue   = (newsReplyInfo2.MatchType == MatchType.Like);
             this.radDisable.SelectedValue = !newsReplyInfo2.IsDisable;
             this.chkKeys.Checked          = (ReplyType.Keys == (newsReplyInfo2.ReplyType & ReplyType.Keys));
             this.chkSub.Checked           = (ReplyType.Subscribe == (newsReplyInfo2.ReplyType & ReplyType.Subscribe));
             this.chkNo.Checked            = (ReplyType.NoMatch == (newsReplyInfo2.ReplyType & ReplyType.NoMatch));
             if (this.chkNo.Checked)
             {
                 this.chkNo.Enabled = true;
                 this.chkNo.ToolTip = "";
             }
             if (this.chkSub.Checked)
             {
                 this.chkSub.Enabled = true;
                 this.chkSub.ToolTip = "";
             }
         }
     }
 }
示例#22
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            this.radMatch.Items[0].Text   = "模糊匹配";
            this.radMatch.Items[1].Text   = "精确匹配";
            this.radDisable.Items[0].Text = "启用";
            this.radDisable.Items[1].Text = "禁用";
            this.chkNo.Enabled            = (ReplyHelper.GetMismatchReply() == null);
            this.chkSub.Enabled           = (ReplyHelper.GetSubscribeReply() == null);
            if (!this.chkNo.Enabled)
            {
                this.chkNo.ToolTip = "该类型已被使用";
            }
            if (!this.chkSub.Enabled)
            {
                this.chkSub.ToolTip = "该类型已被使用";
            }
            if (string.IsNullOrEmpty(base.Request.QueryString["cmd"]))
            {
                return;
            }
            if (string.IsNullOrEmpty(base.Request.Form["MultiArticle"]))
            {
                return;
            }
            string value = base.Request.Form["MultiArticle"];

            System.Collections.Generic.List <ArticleList> list = JsonConvert.DeserializeObject(value, typeof(System.Collections.Generic.List <ArticleList>)) as System.Collections.Generic.List <ArticleList>;
            if (list != null && list.Count > 0)
            {
                NewsReplyInfo newsReplyInfo = new NewsReplyInfo();
                newsReplyInfo.MessageType = MessageType.List;
                newsReplyInfo.IsDisable   = (base.Request.Form["radDisable"] != "true");
                if (base.Request.Form["chkKeys"] == "true")
                {
                    newsReplyInfo.Keys = base.Request.Form.Get("Keys");
                }
                if (!string.IsNullOrWhiteSpace(newsReplyInfo.Keys) && ReplyHelper.HasReplyKey(newsReplyInfo.Keys))
                {
                    base.Response.Write("key");
                    base.Response.End();
                }
                newsReplyInfo.MatchType = ((base.Request.Form["radMatch"] == "true") ? MatchType.Like : MatchType.Equal);
                newsReplyInfo.ReplyType = ReplyType.None;
                if (base.Request.Form["chkKeys"] == "true")
                {
                    newsReplyInfo.ReplyType |= ReplyType.Keys;
                }
                if (base.Request.Form["chkSub"] == "true")
                {
                    newsReplyInfo.ReplyType |= ReplyType.Subscribe;
                }
                if (base.Request.Form["chkNo"] == "true")
                {
                    newsReplyInfo.ReplyType |= ReplyType.NoMatch;
                }
                System.Collections.Generic.List <NewsMsgInfo> list2 = new System.Collections.Generic.List <NewsMsgInfo>();
                foreach (ArticleList current in list)
                {
                    if (current.Status != "del")
                    {
                        NewsMsgInfo newsMsgInfo = current;
                        if (newsMsgInfo != null)
                        {
                            newsMsgInfo.Reply = newsReplyInfo;
                            list2.Add(newsMsgInfo);
                        }
                    }
                }
                newsReplyInfo.NewsMsg = list2;
                if (ReplyHelper.SaveReply(newsReplyInfo))
                {
                    base.Response.Write("true");
                    base.Response.End();
                }
            }
        }
示例#23
0
 protected void Page_Load(object sender, EventArgs e)
 {
     wid = GetCurWebId();
     if (string.IsNullOrEmpty(wid))
     {
         return;
     }
     this.radMatch.Items[0].Text   = "模糊匹配";
     this.radMatch.Items[1].Text   = "精确匹配";
     this.radDisable.Items[0].Text = "启用";
     this.radDisable.Items[1].Text = "禁用";
     this.chkNo.Enabled            = ReplyHelper.GetMismatchReply(this.wid) == null;
     this.chkSub.Enabled           = ReplyHelper.GetSubscribeReply(this.wid) == null;
     if (!this.chkNo.Enabled)
     {
         this.chkNo.ToolTip = "该类型已被使用";
     }
     if (!this.chkSub.Enabled)
     {
         this.chkSub.ToolTip = "该类型已被使用";
     }
     if (!string.IsNullOrEmpty(base.Request.QueryString["cmd"]) && !string.IsNullOrEmpty(base.Request.Form["MultiArticle"]))
     {
         string             str  = base.Request.Form["MultiArticle"];
         List <ArticleList> list = JsonConvert.DeserializeObject <List <ArticleList> >(str);
         if ((list != null) && (list.Count > 0))
         {
             NewsReplyInfo reply = new NewsReplyInfo {
                 MessageType = MessageType.List,
                 IsDisable   = base.Request.Form["radDisable"] != "true"
             };
             if (base.Request.Form["chkKeys"] == "true")
             {
                 reply.Keys = base.Request.Form.Get("Keys");
             }
             if (!string.IsNullOrWhiteSpace(reply.Keys) && ReplyHelper.HasReplyKey(reply.Keys, this.wid))
             {
                 base.Response.Write("key");
                 base.Response.End();
             }
             reply.MatchType = (base.Request.Form["radMatch"] == "true") ? MatchType.Like : MatchType.Equal;
             reply.ReplyType = ReplyType.None;
             if (base.Request.Form["chkKeys"] == "true")
             {
                 reply.ReplyType |= ReplyType.Keys;
             }
             if (base.Request.Form["chkSub"] == "true")
             {
                 reply.ReplyType |= ReplyType.Subscribe;
             }
             if (base.Request.Form["chkNo"] == "true")
             {
                 reply.ReplyType |= ReplyType.NoMatch;
             }
             List <NewsMsgInfo> list2 = new List <NewsMsgInfo>();
             foreach (ArticleList list3 in list)
             {
                 if (list3.Status != "del")
                 {
                     NewsMsgInfo item = list3;
                     if (item != null)
                     {
                         item.Reply = reply;
                         list2.Add(item);
                     }
                 }
             }
             reply.NewsMsg = list2;
             if (ReplyHelper.SaveReply(reply))
             {
                 base.Response.Write("true");
                 base.Response.End();
             }
         }
     }
 }
示例#24
0
        public override AbstractResponse OnEvent_ScanRequest(ScanEventRequest scanEventRequest)
        {
            string eventKey = scanEventRequest.EventKey;

            if (eventKey == "1")
            {
                if (WeiXinHelper.BindAdminOpenId.Count > 10)
                {
                    WeiXinHelper.BindAdminOpenId.Clear();
                }
                if (WeiXinHelper.BindAdminOpenId.ContainsKey(scanEventRequest.Ticket))
                {
                    WeiXinHelper.BindAdminOpenId[scanEventRequest.Ticket] = scanEventRequest.FromUserName;
                }
                else
                {
                    WeiXinHelper.BindAdminOpenId.Add(scanEventRequest.Ticket, scanEventRequest.FromUserName);
                }
                return(new TextResponse
                {
                    CreateTime = System.DateTime.Now,
                    Content = "您正在扫描尝试绑定管理员身份,身份已识别",
                    ToUserName = scanEventRequest.FromUserName,
                    FromUserName = scanEventRequest.ToUserName
                });
            }
            ScanInfos scanInfosByTicket = ScanHelp.GetScanInfosByTicket(scanEventRequest.Ticket);

            Globals.Debuglog(eventKey + ":" + scanEventRequest.Ticket, "_Debuglog.txt");
            bool flag = MemberProcessor.IsExitOpenId(scanEventRequest.FromUserName);

            if (!flag && scanInfosByTicket != null && scanInfosByTicket.BindUserId > 0)
            {
                this.CreatMember(scanEventRequest.FromUserName, scanInfosByTicket.BindUserId, "");
            }
            if (scanInfosByTicket != null)
            {
                ScanHelp.updateScanInfosLastActiveTime(System.DateTime.Now, scanInfosByTicket.Sceneid);
            }
            string text = "";

            System.Data.DataSet dataSet = new System.Data.DataSet();
            string text2 = System.Web.HttpContext.Current.Server.MapPath("/config/WifiConfig.xml");

            if (System.IO.File.Exists(text2))
            {
                dataSet.ReadXml(text2);
                if (dataSet != null && dataSet.Tables.Count > 0)
                {
                    foreach (System.Data.DataRow dataRow in dataSet.Tables[0].Rows)
                    {
                        if (dataRow["id"].ToString() == eventKey)
                        {
                            text = string.Concat(new string[]
                            {
                                dataRow["WifiDescribe"].ToString(),
                                "\r\nWIFI帐号:",
                                dataRow["WifiName"].ToString(),
                                "\r\n WIFI密码:",
                                dataRow["WifiPwd"].ToString()
                            });
                        }
                    }
                }
            }
            if (text != "")
            {
                return(new TextResponse
                {
                    CreateTime = System.DateTime.Now,
                    Content = text,
                    ToUserName = scanEventRequest.FromUserName,
                    FromUserName = scanEventRequest.ToUserName
                });
            }
            if (flag)
            {
                return(new TextResponse
                {
                    CreateTime = System.DateTime.Now,
                    Content = "您刚扫描了分销商公众号二维码!",
                    ToUserName = scanEventRequest.FromUserName,
                    FromUserName = scanEventRequest.ToUserName
                });
            }
            Hidistro.Entities.VShop.ReplyInfo subscribeReply = ReplyHelper.GetSubscribeReply();
            if (subscribeReply == null)
            {
                return(null);
            }
            subscribeReply.Keys = "扫描";
            AbstractResponse response = this.GetResponse(subscribeReply, scanEventRequest.FromUserName);

            response.ToUserName   = scanEventRequest.FromUserName;
            response.FromUserName = scanEventRequest.ToUserName;
            return(response);
        }
示例#25
0
		protected void Page_Load(object sender, EventArgs e)
		{
			this.radMatch.Items[0].Text = "模糊匹配";
			this.radMatch.Items[1].Text = "精确匹配";
			this.radDisable.Items[0].Text = "启用";
			this.radDisable.Items[1].Text = "禁用";
			this.chkNo.Enabled = (ReplyHelper.GetMismatchReply() == null);
			this.chkSub.Enabled = (ReplyHelper.GetSubscribeReply() == null);
			if (!this.chkNo.Enabled)
			{
				this.chkNo.ToolTip = "该类型已被使用";
			}
			if (!this.chkSub.Enabled)
			{
				this.chkSub.ToolTip = "该类型已被使用";
			}
			if (!string.IsNullOrEmpty(base.Request.QueryString["cmd"]) && !string.IsNullOrEmpty(base.Request.Form["MultiArticle"]))
			{
				string value = base.Request.Form["MultiArticle"];
				List<ArticleList> list = JsonConvert.DeserializeObject(value, typeof(List<ArticleList>)) as List<ArticleList>;
				if (list != null && list.Count > 0)
				{
					NewsReplyInfo newsReplyInfo = new NewsReplyInfo();
					newsReplyInfo.MessageType = MessageType.List;
					newsReplyInfo.IsDisable = (base.Request.Form["radDisable"] != "true");
					if (base.Request.Form["chkKeys"] == "true")
					{
						newsReplyInfo.Keys = base.Request.Form.Get("Keys");
					}
					if (!string.IsNullOrWhiteSpace(newsReplyInfo.Keys) && ReplyHelper.HasReplyKey(newsReplyInfo.Keys))
					{
						base.Response.Write("key");
						base.Response.End();
					}
					newsReplyInfo.MatchType = ((base.Request.Form["radMatch"] == "true") ? MatchType.Like : MatchType.Equal);
					newsReplyInfo.ReplyType = ReplyType.None;
					if (base.Request.Form["chkKeys"] == "true")
					{
						newsReplyInfo.ReplyType |= ReplyType.Keys;
					}
					if (base.Request.Form["chkSub"] == "true")
					{
						newsReplyInfo.ReplyType |= ReplyType.Subscribe;
					}
					if (base.Request.Form["chkNo"] == "true")
					{
						newsReplyInfo.ReplyType |= ReplyType.NoMatch;
					}
					List<NewsMsgInfo> list2 = new List<NewsMsgInfo>();
					foreach (ArticleList item in list)
					{
						if (item.Status != "del")
						{
							NewsMsgInfo newsMsgInfo = item;
							if (newsMsgInfo != null)
							{
								newsMsgInfo.Reply = newsReplyInfo;
								list2.Add(newsMsgInfo);
							}
						}
					}
					newsReplyInfo.NewsMsg = list2;
					foreach (NewsMsgInfo item2 in newsReplyInfo.NewsMsg)
					{
						item2.PicUrl = Globals.SaveFile("article", item2.PicUrl, "/Storage/master/", true, false, "");
					}
					if (ReplyHelper.SaveReply(newsReplyInfo))
					{
						base.Response.Write("true");
						base.Response.End();
					}
				}
			}
		}