示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!int.TryParse(this.Page.Request.QueryString["ConsultationId"], out this.consultationId))
     {
         base.GotoResourceNotFound();
     }
     else
     {
         this.btnReplyProductConsultation.Click += new EventHandler(this.btnReplyProductConsultation_Click);
         if (!this.Page.IsPostBack)
         {
             ProductConsultationInfo productConsultation = ProductCommentHelper.GetProductConsultation(this.consultationId);
             if (productConsultation == null)
             {
                 base.GotoResourceNotFound();
             }
             else
             {
                 this.litUserName.Text         = productConsultation.UserName;
                 this.litConsultationText.Text = productConsultation.ConsultationText;
                 this.lblTime.Time             = productConsultation.ConsultationDate;
             }
         }
     }
 }
示例#2
0
        protected void btnReplyProductConsultation_Click(object sender, EventArgs e)
        {
            ProductConsultationInfo productConsultation = ProductCommentHelper.GetProductConsultation(consultationId);

            if (string.IsNullOrEmpty(fckReplyText.Text))
            {
                productConsultation.ReplyText = null;
            }
            else
            {
                productConsultation.ReplyText = fckReplyText.Text;
            }
            productConsultation.ReplyUserId = new int?(HiContext.Current.User.UserId);
            productConsultation.ReplyDate   = new DateTime?(DateTime.Now);
            ValidationResults results = Hishop.Components.Validation.Validation.Validate <ProductConsultationInfo>(productConsultation, new string[] { "Reply" });
            string            msg     = string.Empty;

            if (!results.IsValid)
            {
                foreach (ValidationResult result in (IEnumerable <ValidationResult>)results)
                {
                    msg = msg + Formatter.FormatErrorMessage(result.Message);
                }
                ShowMsg(msg, false);
            }
            else if (ProductCommentHelper.ReplyProductConsultation(productConsultation))
            {
                fckReplyText.Text = string.Empty;
                ShowMsg("成功回复了选择的商品咨询", true);
            }
            else
            {
                ShowMsg("回复商品咨询失败", false);
            }
        }
        protected void btnReplyProductConsultation_Click(object sender, EventArgs e)
        {
            ProductConsultationInfo productConsultation = ProductCommentHelper.GetProductConsultation(this.consultationId);

            productConsultation.ReplyText = this.txtReply.Text;
            if (string.IsNullOrEmpty(productConsultation.ReplyText))
            {
                this.ShowMsg("回复内容不能为空", false);
            }
            else
            {
                productConsultation.ReplyUserId = HiContext.Current.ManagerId;
                productConsultation.ReplyDate   = DateTime.Now;
                ValidationResults validationResults = Validation.Validate(productConsultation, "Reply");
                string            text = string.Empty;
                if (!validationResults.IsValid)
                {
                    foreach (ValidationResult item in (IEnumerable <ValidationResult>)validationResults)
                    {
                        text += Formatter.FormatErrorMessage(item.Message);
                    }
                    this.ShowMsg(text, false);
                }
                else if (ProductCommentHelper.ReplyProductConsultation(productConsultation))
                {
                    this.txtReply.Text = string.Empty;
                    base.CloseWindow(null);
                }
                else
                {
                    this.ShowMsg("回复商品咨询失败", false);
                }
            }
        }
        protected void btnReplyProductConsultation_Click(object sender, EventArgs e)
        {
            ProductConsultationInfo productConsultation = ProductCommentHelper.GetProductConsultation(this.consultationId);

            if (string.IsNullOrEmpty(this.fckReplyText.Text))
            {
                productConsultation.ReplyText = null;
            }
            else
            {
                productConsultation.ReplyText = this.fckReplyText.Text;
            }
            productConsultation.ReplyUserId = new int?(Globals.GetCurrentManagerUserId());
            productConsultation.ReplyDate   = new DateTime?(DateTime.Now);
            ValidationResults results = Hishop.Components.Validation.Validation.Validate <ProductConsultationInfo>(productConsultation, new string[] { "Reply" });
            string            msg     = string.Empty;

            if (!results.IsValid)
            {
                foreach (ValidationResult result in (IEnumerable <ValidationResult>)results)
                {
                    msg = msg + Formatter.FormatErrorMessage(result.Message);
                }
                this.ShowMsg(msg, false);
            }
            else if (ProductCommentHelper.ReplyProductConsultation(productConsultation))
            {
                this.fckReplyText.Text = string.Empty;
                this.CloseWindow();
            }
            else
            {
                this.ShowMsg("回复商品咨询失败", false);
            }
        }
示例#5
0
        public void ProcessRequest(HttpContext context)
        {
            wid = context.Session[DTKeys.SESSION_WEB_ID] as string;
            if (string.IsNullOrEmpty(wid))
            {
                return;
            }
            context.Response.ContentType = "text/plain";
            int num = 0;

            int.TryParse(context.Request["id"].ToString(), out num);
            string str = context.Request["content"].ToString();

            if ((num > 0) && !string.IsNullOrEmpty(str))
            {
                ProductConsultationInfo productConsultation = ProductCommentHelper.GetProductConsultation(num);
                productConsultation.ReplyText   = str;
                productConsultation.ReplyUserId = new int?(Globals.GetCurrentManagerUserId());
                productConsultation.ReplyDate   = new DateTime?(DateTime.Now);
                ValidationResults results = Hishop.Components.Validation.Validation.Validate <ProductConsultationInfo>(productConsultation, new string[] { "Reply" });
                string            str2    = string.Empty;
                if (!results.IsValid)
                {
                    foreach (ValidationResult result in (IEnumerable <ValidationResult>)results)
                    {
                        str2 = str2 + Formatter.FormatErrorMessage(result.Message);
                    }
                    context.Response.Write("{\"type\":\"error\",\"data\":\"" + str2 + "\"}");
                }
                if (ProductCommentHelper.ReplyProductConsultation(productConsultation))
                {
                    context.Response.Write("{\"type\":\"success\",\"data\":\"\"}");
                }
                else
                {
                    context.Response.Write("{\"type\":\"success\",\"data\":\"回复商品咨询失败\"}");
                }
            }
            else
            {
                context.Response.Write("{\"type\":\"success\",\"data\":\"回复商品咨询失败\"}");
            }
        }
示例#6
0
        public void ProcessRequest(System.Web.HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int num = 0;

            int.TryParse(context.Request["id"].ToString(), out num);
            string text = context.Request["content"].ToString();

            if (num <= 0 || string.IsNullOrEmpty(text))
            {
                context.Response.Write("{\"type\":\"success\",\"data\":\"回复商品咨询失败\"}");
                return;
            }
            ProductConsultationInfo productConsultation = ProductCommentHelper.GetProductConsultation(num);

            productConsultation.ReplyText   = text;
            productConsultation.ReplyUserId = new int?(Globals.GetCurrentManagerUserId());
            productConsultation.ReplyDate   = new System.DateTime?(System.DateTime.Now);
            ValidationResults validationResults = Validation.Validate <ProductConsultationInfo>(productConsultation, new string[]
            {
                "Reply"
            });
            string text2 = string.Empty;

            if (!validationResults.IsValid)
            {
                foreach (ValidationResult current in ((System.Collections.Generic.IEnumerable <ValidationResult>)validationResults))
                {
                    text2 += Formatter.FormatErrorMessage(current.Message);
                }
                context.Response.Write("{\"type\":\"error\",\"data\":\"" + text2 + "\"}");
            }
            if (ProductCommentHelper.ReplyProductConsultation(productConsultation))
            {
                context.Response.Write("{\"type\":\"success\",\"data\":\"\"}");
                return;
            }
            context.Response.Write("{\"type\":\"success\",\"data\":\"回复商品咨询失败\"}");
        }
        protected void btnReplyProductConsultation_Click(object sender, System.EventArgs e)
        {
            ProductConsultationInfo productConsultation = ProductCommentHelper.GetProductConsultation(this.consultationId);

            if (string.IsNullOrEmpty(this.fckReplyText.Text))
            {
                productConsultation.ReplyText = null;
            }
            else
            {
                productConsultation.ReplyText = this.fckReplyText.Text;
            }
            productConsultation.ReplyUserId = new int?(Globals.GetCurrentManagerUserId());
            productConsultation.ReplyDate   = new System.DateTime?(System.DateTime.Now);
            ValidationResults validationResults = Validation.Validate <ProductConsultationInfo>(productConsultation, new string[]
            {
                "Reply"
            });
            string text = string.Empty;

            if (!validationResults.IsValid)
            {
                foreach (ValidationResult current in ((System.Collections.Generic.IEnumerable <ValidationResult>)validationResults))
                {
                    text += Formatter.FormatErrorMessage(current.Message);
                }
                this.ShowMsg(text, false);
                return;
            }
            if (ProductCommentHelper.ReplyProductConsultation(productConsultation))
            {
                this.fckReplyText.Text = string.Empty;
                this.ShowMsg("回复商品咨询成功", true);
                base.Response.Redirect("ProductConsultations.aspx");
                return;
            }
            this.ShowMsg("回复商品咨询失败", false);
        }
        protected void btnReplyProductConsultation_Click(object sender, System.EventArgs e)
        {
            ProductConsultationInfo productConsultation = ProductCommentHelper.GetProductConsultation(this.consultationId);

            if (string.IsNullOrEmpty(this.fckReplyText.Text))
            {
                productConsultation.ReplyText = null;
            }
            else
            {
                productConsultation.ReplyText = this.fckReplyText.Text;
            }
            productConsultation.ReplyUserId = new int?(Hidistro.Membership.Context.HiContext.Current.User.UserId);
            productConsultation.ReplyDate   = new System.DateTime?(System.DateTime.Now);
            ValidationResults validationResults = Validation.Validate <ProductConsultationInfo>(productConsultation, new string[]
            {
                "Reply"
            });
            string text = string.Empty;

            if (!validationResults.IsValid)
            {
                foreach (ValidationResult current in (System.Collections.Generic.IEnumerable <ValidationResult>)validationResults)
                {
                    text += Formatter.FormatErrorMessage(current.Message);
                }
                this.ShowMsg(text, false);
                return;
            }
            if (ProductCommentHelper.ReplyProductConsultation(productConsultation))
            {
                this.fckReplyText.Text = string.Empty;
                this.CloseWindow();
                return;
            }
            this.ShowMsg("回复商品咨询失败", false);
        }