Beispiel #1
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;
     }
 }
        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 = "该类型已被使用";
            }
        }
Beispiel #3
0
        public override AbstractResponse DefaultResponse(AbstractRequest requestMessage)
        {
            ReplyInfo        mismatchReply = ReplyHelper.GetMismatchReply();
            AbstractResponse result;

            if (mismatchReply == null || this.IsOpenManyService())
            {
                result = this.GotoManyCustomerService(requestMessage);
            }
            else
            {
                AbstractResponse response = this.GetResponse(mismatchReply, requestMessage.FromUserName);
                if (response == null)
                {
                    result = this.GotoManyCustomerService(requestMessage);
                }
                else
                {
                    response.ToUserName   = requestMessage.FromUserName;
                    response.FromUserName = requestMessage.ToUserName;
                    result = response;
                }
            }
            return(result);
        }
 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();
     }
 }
Beispiel #5
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;
         }
     }
 }
 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 = "";
             }
         }
     }
 }
Beispiel #7
0
        public override AbstractResponse DefaultResponse(AbstractRequest requestMessage)
        {
            WeiXinHelper.UpdateRencentOpenID(requestMessage.FromUserName);
            Hidistro.Entities.VShop.ReplyInfo mismatchReply = ReplyHelper.GetMismatchReply();
            if (mismatchReply == null || this.IsOpenManyService())
            {
                return(this.GotoManyCustomerService(requestMessage));
            }
            AbstractResponse response = this.GetResponse(mismatchReply, requestMessage.FromUserName);

            if (response == null)
            {
                return(this.GotoManyCustomerService(requestMessage));
            }
            response.ToUserName   = requestMessage.FromUserName;
            response.FromUserName = requestMessage.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 (!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();
     }
 }
        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;
            }
        }
Beispiel #10
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;
     }
 }
Beispiel #11
0
        public override AbstractResponse DefaultResponse(AbstractRequest requestMessage)
        {
            IDictionary <string, string> dictionary = new Dictionary <string, string>();

            dictionary.Add("CreateTime", requestMessage.CreateTime.ToNullString());
            dictionary.Add("FromUserName", requestMessage.FromUserName.ToNullString());
            dictionary.Add("MsgId", requestMessage.MsgId.ToNullString());
            dictionary.Add("MsgType", requestMessage.MsgType.ToNullString());
            ReplyInfo mismatchReply = ReplyHelper.GetMismatchReply();

            if (mismatchReply == null || this.IsOpenManyService())
            {
                return(this.GotoManyCustomerService(requestMessage));
            }
            AbstractResponse response = this.GetResponse(mismatchReply, requestMessage.FromUserName, null);

            if (response == null)
            {
                return(this.GotoManyCustomerService(requestMessage));
            }
            response.ToUserName   = requestMessage.FromUserName;
            response.FromUserName = requestMessage.ToUserName;
            return(response);
        }
Beispiel #12
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 = "";
             }
         }
     }
 }
Beispiel #13
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 = "";
             }
         }
     }
 }
Beispiel #14
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();
                }
            }
        }
Beispiel #15
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 = "";
             }
         }
     }
 }
 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();
             }
         }
     }
 }
		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();
					}
				}
			}
		}