Example #1
0
        /// <summary>
        /// 添加回复
        /// </summary>
        /// <param name="result"></param>
        public void AddProductReply(ref string result)
        {
            int    productID     = RequestHelper.GetQueryString <int>("ProductID");
            int    commentID     = RequestHelper.GetQueryString <int>("CommentID");
            string replytCookies = CookiesHelper.ReadCookieValue("ReplytCookies" + commentID.ToString());

            if (ShopConfig.ReadConfigInfo().ReplyRestrictTime > 0 && replytCookies != string.Empty)
            {
                result = "请不要频繁提交";
            }
            else
            {
                ProductReplyInfo productReply = new ProductReplyInfo();
                productReply.ProductID = productID;
                productReply.CommentID = commentID;
                productReply.Content   = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("Content"));
                productReply.UserIP    = ClientHelper.IP;
                productReply.PostDate  = RequestHelper.DateNow;
                productReply.UserID    = base.UserID;
                productReply.UserName  = base.UserName;
                ProductReplyBLL.AddProductReply(productReply);
                if (ShopConfig.ReadConfigInfo().ReplyRestrictTime > 0)
                {
                    CookiesHelper.AddCookie("ReplytCookies" + commentID.ToString(), "ReplytCookies" + commentID.ToString(), ShopConfig.ReadConfigInfo().ReplyRestrictTime, TimeType.Second);
                }
            }
        }
Example #2
0
        public void AddProductReply(ref string result)
        {
            int    queryString = RequestHelper.GetQueryString <int>("ProductID");
            int    num2        = RequestHelper.GetQueryString <int>("CommentID");
            string str         = CookiesHelper.ReadCookieValue("ReplytCookies" + num2.ToString());

            if ((ShopConfig.ReadConfigInfo().ReplyRestrictTime > 0) && (str != string.Empty))
            {
                result = "Ç벻ҪƵ·±Ìá½»";
            }
            else
            {
                ProductReplyInfo productReply = new ProductReplyInfo();
                productReply.ProductID = queryString;
                productReply.CommentID = num2;
                productReply.Content   = StringHelper.AddSafe(RequestHelper.GetQueryString <string>("Content"));
                productReply.UserIP    = ClientHelper.IP;
                productReply.PostDate  = RequestHelper.DateNow;
                productReply.UserID    = base.UserID;
                productReply.UserName  = base.UserName;
                ProductReplyBLL.AddProductReply(productReply);
                if (ShopConfig.ReadConfigInfo().ReplyRestrictTime > 0)
                {
                    CookiesHelper.AddCookie("ReplytCookies" + num2.ToString(), "ReplytCookies" + num2.ToString(), ShopConfig.ReadConfigInfo().ReplyRestrictTime, TimeType.Second);
                }
            }
        }