Пример #1
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);
            }
        }
Пример #2
0
 private void reFriend_ItemCommand(object sender, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         if (ProductCommentHelper.DeleteFriendExtension(int.Parse(e.CommandArgument.ToString())) > 0)
         {
             this.BindData();
             this.ShowMsg("删除成功", true);
             Literal literal = (Literal)e.Item.FindControl("Literal1");
             string  text    = literal.Text;
             if (!string.IsNullOrEmpty(text))
             {
                 foreach (string str2 in text.Split(new char[] { '|' }))
                 {
                     string path = str2;
                     path = base.Server.MapPath(path);
                     if (File.Exists(path))
                     {
                         File.Delete(path);
                     }
                 }
             }
         }
         else
         {
             this.ShowMsg("删除失败", false);
         }
     }
 }
Пример #3
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            FriendExtensionInfo query = new FriendExtensionInfo {
                ExensionImg     = this.hidpic.Value,
                ExensiontRemark = this.txtName.Text.Trim(),
                ExtensionId     = int.Parse(base.Request.QueryString["ExtensionId"])
            };

            if (ProductCommentHelper.UpdateFriendExtension(query))
            {
                this.ShowMsg("修改成功", true);
                if (!string.IsNullOrEmpty(this.hidpicdel.Value))
                {
                    foreach (string str in this.hidpicdel.Value.Split(new char[] { '|' }))
                    {
                        string path = str;
                        path = base.Server.MapPath(path);
                        if (File.Exists(path))
                        {
                            File.Delete(path);
                        }
                    }
                }
                this.hidpicdel.Value = "";
            }
            else
            {
                this.ShowMsg("修改失败", false);
            }
        }
Пример #4
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;
             }
         }
     }
 }
Пример #5
0
        public void LoadMoreProductReviews(System.Web.HttpContext context)
        {
            StringBuilder      stringBuilder      = new StringBuilder();
            ProductReviewQuery productReviewQuery = new ProductReviewQuery();

            productReviewQuery.SortBy    = "ReviewDate";
            productReviewQuery.SortOrder = SortAction.Desc;
            productReviewQuery.PageIndex = int.Parse(context.Request["pageNumber"]);
            productReviewQuery.PageSize  = int.Parse(context.Request["size"]);
            productReviewQuery.productId = int.Parse(context.Request["ProductId"]);

            Globals.EntityCoding(productReviewQuery, true);
            DataTable dt = (DataTable)ProductCommentHelper.GetProductReviews(productReviewQuery).Data;

            stringBuilder.Append("{");
            if (dt.Rows.Count > 0)
            {
                stringBuilder.Append("\"Success\":1,");
                stringBuilder.Append("\"productcomments\":");
                IsoDateTimeConverter convert = new IsoDateTimeConverter();
                convert.DateTimeFormat = "yyyy-MM-dd";
                string strReviews = Newtonsoft.Json.JsonConvert.SerializeObject(dt, Formatting.None, convert);
                stringBuilder.Append(strReviews);
                stringBuilder.Append("}");
            }

            else
            {
                stringBuilder.Append("\"Success\":0");
                stringBuilder.Append("}");
            }

            context.Response.Write(stringBuilder.ToString());
            context.Response.End();
        }
        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);
            }
        }
        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);
                }
            }
        }
Пример #8
0
 private void reFriend_ItemCommand(object sender, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "Del")
     {
         if (ProductCommentHelper.DeleteFriendExtension(int.Parse(e.CommandArgument.ToString())) > 0)
         {
             this.BindData();
             this.ShowMsg("删除成功", true);
             System.Web.UI.WebControls.Literal literal = (System.Web.UI.WebControls.Literal)e.Item.FindControl("Literal1");
             string text = literal.Text;
             if (!string.IsNullOrEmpty(text))
             {
                 string[] array = text.Split(new char[]
                 {
                     '|'
                 });
                 for (int i = 0; i < array.Length; i++)
                 {
                     string str2 = array[i];
                     string path = str2;
                     path = base.Server.MapPath(path);
                     if (System.IO.File.Exists(path))
                     {
                         System.IO.File.Delete(path);
                     }
                 }
             }
         }
         else
         {
             this.ShowMsg("删除失败", false);
         }
     }
 }
Пример #9
0
        private void Delete(HttpContext context)
        {
            int value = base.GetIntParam(context, "ReviewId", false).Value;

            if (ProductCommentHelper.DeleteProductReview(value))
            {
                base.ReturnSuccessResult(context, "成功删除了选择的商品评论回复!", 0, true);
                return;
            }
            throw new HidistroAshxException("删除商品评论失败!");
        }
Пример #10
0
        private void dlstPtReviews_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
        {
            int num = int.Parse(this.dlstPtReviews.DataKeys[e.RowIndex].Value.ToString());

            if (ProductCommentHelper.DeleteProductReview((long)num) > 0)
            {
                this.ShowMsg("成功删除了选择的客户评论", true);
                this.BindPtReview();
                return;
            }
            this.ShowMsg("删除失败", false);
        }
Пример #11
0
 private void dlstPtReviews_DeleteCommand(object source, DataListCommandEventArgs e)
 {
     if (ProductCommentHelper.DeleteProductReview((long)Convert.ToInt32(e.CommandArgument, CultureInfo.InvariantCulture)) > 0)
     {
         ShowMsg("成功删除了选择的商品评论回复", true);
         BindPtReview();
     }
     else
     {
         ShowMsg("删除失败", false);
     }
 }
Пример #12
0
 private void dlstPtReviews_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     if (ProductCommentHelper.DeleteProductReview((long)int.Parse(this.dlstPtReviews.DataKeys[e.RowIndex].Value.ToString())) > 0)
     {
         this.ShowMsg("成功删除了选择的商品评论回复", true);
         this.BindPtReview();
     }
     else
     {
         this.ShowMsg("删除失败", false);
     }
 }
Пример #13
0
 private void dlstPtReviews_DeleteCommand(object source, System.Web.UI.WebControls.DataListCommandEventArgs e)
 {
     if (ProductCommentHelper.DeleteProductReview((long)System.Convert.ToInt32(e.CommandArgument, System.Globalization.CultureInfo.InvariantCulture)) > 0)
     {
         this.ShowMsg("成功删除了选择的商品评论回复", true);
         this.BindPtReview();
     }
     else
     {
         this.ShowMsg("删除失败", false);
     }
 }
Пример #14
0
        private void grdConsultation_RowDeleting(object sender, System.Web.UI.WebControls.GridViewDeleteEventArgs e)
        {
            int consultationId = (int)this.grdConsultation.DataKeys[e.RowIndex].Value;

            if (ProductCommentHelper.DeleteProductConsultation(consultationId) > 0)
            {
                this.ShowMsg("成功删除了选择的商品咨询", true);
                this.BinddlstProductConsultation();
                return;
            }
            this.ShowMsg("删除商品咨询失败", false);
        }
Пример #15
0
        private void grdConsultation_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int consultationId = (int)grdConsultation.DataKeys[e.RowIndex].Value;

            if (ProductCommentHelper.DeleteProductConsultation(consultationId) > 0)
            {
                ShowMsg("成功删除了选择的商品咨询", true);
                BindConsultation();
            }
            else
            {
                ShowMsg("删除商品咨询失败", false);
            }
        }
Пример #16
0
        private void BindData()
        {
            FriendExtensionQuery entity = new FriendExtensionQuery {
                PageIndex = this.pager.PageIndex,
                PageSize  = this.pager.PageSize,
                SortOrder = SortAction.Desc,
                SortBy    = "ExtensionId"
            };

            Globals.EntityCoding(entity, true);
            DbQueryResult result = ProductCommentHelper.FriendExtensionList(entity);

            this.reFriend.DataSource = result.Data;
            this.reFriend.DataBind();
            this.pager.TotalRecords = result.TotalRecords;
        }
 protected void btnReplyProductConsultation_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(this.txtReply.Text))
     {
         this.ShowMsg("请输入回复内容", false);
     }
     if (ProductCommentHelper.BatchReplyProductReviews(this.reviewIdList, this.txtReply.Text))
     {
         this.txtReply.Text = string.Empty;
         base.CloseWindow(null);
     }
     else
     {
         this.ShowMsg("回复商品评论失败", false);
     }
 }
Пример #18
0
        private DataGridViewModel <Dictionary <string, object> > GetDataList(ProductConsultationAndReplyQuery query)
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();

            if (query != null)
            {
                DbQueryResult consultationProducts = ProductCommentHelper.GetConsultationProducts(query);
                dataGridViewModel.rows  = DataHelper.DataTableToDictionary(consultationProducts.Data);
                dataGridViewModel.total = consultationProducts.TotalRecords;
                foreach (Dictionary <string, object> row in dataGridViewModel.rows)
                {
                    row.Add("Type", (int)query.Type);
                }
            }
            return(dataGridViewModel);
        }
Пример #19
0
        private DataGridViewModel <Dictionary <string, object> > GetDataList(ProductReviewQuery query)
        {
            DataGridViewModel <Dictionary <string, object> > dataGridViewModel = new DataGridViewModel <Dictionary <string, object> >();

            if (query != null)
            {
                DbQueryResult productReviews = ProductCommentHelper.GetProductReviews(query);
                dataGridViewModel.rows  = DataHelper.DataTableToDictionary(productReviews.Data);
                dataGridViewModel.total = productReviews.TotalRecords;
                foreach (Dictionary <string, object> row in dataGridViewModel.rows)
                {
                    ProductInfo       productById       = ProductHelper.GetProductById(row["ProductId"].ToInt(0));
                    ProductReviewInfo productReviewInfo = row.ToObject <ProductReviewInfo>();
                    row.Add("Type", query.havedReply);
                    if (productById.ProductName.Trim().Length > 22)
                    {
                        row.Add("ProductNameStr", productById.ProductName.Trim().Substring(0, 22) + "...");
                    }
                    else
                    {
                        row.Add("ProductNameStr", productById.ProductName.Trim());
                    }
                    if (productReviewInfo.ReviewText.Trim().Length >= 50)
                    {
                        row.Add("ReviewTextStr", productReviewInfo.ReviewText.Trim().Substring(0, 50) + "...");
                    }
                    else
                    {
                        row.Add("ReviewTextStr", productReviewInfo.ReviewText.Trim());
                    }
                    if (query.havedReply.ToBool())
                    {
                        if (productReviewInfo.ReplyText.Trim().Length >= 50)
                        {
                            row.Add("ReplyTextStr", productReviewInfo.ReplyText.Trim().Substring(0, 50) + "...");
                        }
                        else
                        {
                            row.Add("ReplyTextStr", productReviewInfo.ReplyText.Trim());
                        }
                    }
                }
            }
            return(dataGridViewModel);
        }
Пример #20
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            FriendExtensionInfo query = new FriendExtensionInfo {
                ExensionImg     = this.hidpic.Value,
                ExensiontRemark = this.txtName.Text.Trim()
            };

            if (ProductCommentHelper.InsertFriendExtension(query))
            {
                this.ShowMsg("保存成功", true);
                this.hidpic.Value = "";
                this.txtName.Text = "";
            }
            else
            {
                this.ShowMsg("保存失败", false);
            }
        }
Пример #21
0
        private void BindPtReview()
        {
            ProductReviewQuery productReviewQuery = new ProductReviewQuery();

            productReviewQuery.Keywords    = this.keywords;
            productReviewQuery.CategoryId  = this.categoryId;
            productReviewQuery.ProductCode = this.productCode;
            productReviewQuery.PageIndex   = this.pager.PageIndex;
            productReviewQuery.PageSize    = this.pager.PageSize;
            productReviewQuery.SortOrder   = SortAction.Desc;
            productReviewQuery.SortBy      = "ReviewDate";
            Globals.EntityCoding(productReviewQuery, true);
            DbQueryResult productReviews = ProductCommentHelper.GetProductReviews(productReviewQuery);

            this.dlstPtReviews.DataSource = productReviews.Data;
            this.dlstPtReviews.DataBind();
            this.pager.TotalRecords = productReviews.TotalRecords;
        }
Пример #22
0
        private void BindPtReview()
        {
            ProductReviewQuery entity = new ProductReviewQuery {
                Keywords    = this.keywords,
                CategoryId  = this.categoryId,
                ProductCode = this.productCode,
                PageIndex   = this.pager.PageIndex,
                PageSize    = this.pager.PageSize,
                SortOrder   = SortAction.Desc,
                SortBy      = "ReviewDate"
            };

            Globals.EntityCoding(entity, true);
            DbQueryResult productReviews = ProductCommentHelper.GetProductReviews(entity);

            this.dlstPtReviews.DataSource = productReviews.Data;
            this.dlstPtReviews.DataBind();
            this.pager.TotalRecords = productReviews.TotalRecords;
        }
Пример #23
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\":\"回复商品咨询失败\"}");
            }
        }
        private void BinddlstProductConsultation()
        {
            ProductConsultationAndReplyQuery productConsultationAndReplyQuery = new ProductConsultationAndReplyQuery();

            productConsultationAndReplyQuery.Keywords    = this.keywords;
            productConsultationAndReplyQuery.CategoryId  = this.categoryId;
            productConsultationAndReplyQuery.ProductCode = this.productCode;
            productConsultationAndReplyQuery.PageIndex   = this.pager.PageIndex;
            productConsultationAndReplyQuery.PageSize    = this.pager.PageSize;
            productConsultationAndReplyQuery.SortOrder   = SortAction.Desc;
            productConsultationAndReplyQuery.SortBy      = "ReplyDate";
            productConsultationAndReplyQuery.Type        = ConsultationReplyType.Replyed;
            Globals.EntityCoding(productConsultationAndReplyQuery, true);
            DbQueryResult consultationProducts = ProductCommentHelper.GetConsultationProducts(productConsultationAndReplyQuery);

            this.grdConsultation.DataSource = consultationProducts.Data;
            this.grdConsultation.DataBind();
            this.pager.TotalRecords = consultationProducts.TotalRecords;
        }
Пример #25
0
        private void BindPtReview()
        {
            ProductReviewQuery entity = new ProductReviewQuery();

            entity.Keywords    = this.keywords;
            entity.CategoryId  = this.categoryId;
            entity.ProductCode = this.productCode;
            entity.PageIndex   = this.pager.PageIndex;
            entity.PageSize    = this.pager.PageSize;
            entity.SortOrder   = SortAction.Desc;
            entity.SortBy      = "ReviewDate";
            Globals.EntityCoding(entity, true);
            int     total          = 0;
            DataSet productReviews = ProductCommentHelper.GetProductReviews(out total, entity);

            this.dlstPtReviews.DataSource = productReviews.Tables[0].DefaultView;
            this.dlstPtReviews.DataBind();
            this.pager.TotalRecords  = total;
            this.pager1.TotalRecords = total;
        }
        private void BinddlstProductConsultation()
        {
            ProductConsultationAndReplyQuery entity = new ProductConsultationAndReplyQuery {
                Keywords    = this.keywords,
                CategoryId  = this.categoryId,
                ProductCode = this.productCode,
                PageIndex   = this.pager.PageIndex,
                PageSize    = this.pager.PageSize,
                SortOrder   = SortAction.Desc,
                SortBy      = "ReplyDate",
                Type        = ConsultationReplyType.Replyed
            };

            Globals.EntityCoding(entity, true);
            DbQueryResult consultationProducts = ProductCommentHelper.GetConsultationProducts(entity);

            this.grdConsultation.DataSource = consultationProducts.Data;
            this.grdConsultation.DataBind();
            this.pager.TotalRecords = consultationProducts.TotalRecords;
        }
Пример #27
0
        private void BindConsultation()
        {
            ProductConsultationAndReplyQuery entity = new ProductConsultationAndReplyQuery();

            entity.Keywords    = keywords;
            entity.CategoryId  = categoryId;
            entity.ProductCode = productCode;
            entity.PageIndex   = pager.PageIndex;
            entity.PageSize    = pager.PageSize;
            entity.SortOrder   = SortAction.Desc;
            entity.SortBy      = "ReplyDate";
            entity.Type        = ConsultationReplyType.NoReply;
            Globals.EntityCoding(entity, true);
            DbQueryResult consultationProducts = ProductCommentHelper.GetConsultationProducts(entity);

            grdConsultation.DataSource = consultationProducts.Data;
            grdConsultation.DataBind();
            pager.TotalRecords  = consultationProducts.TotalRecords;
            pager1.TotalRecords = consultationProducts.TotalRecords;
        }
Пример #28
0
        private void BindData()
        {
            FriendExtensionQuery entity = new FriendExtensionQuery {
                PageIndex = 1,
                PageSize  = 1,
                SortOrder = SortAction.Desc,
                SortBy    = "ExtensionId"
            };

            Globals.EntityCoding(entity, true);
            entity.ExtensionId = this.ExtensionId;
            DataTable data = new DataTable();

            data = (DataTable)ProductCommentHelper.FriendExtensionList(entity).Data;
            if (data.Rows.Count > 0)
            {
                this.txtName.Text = data.Rows[0]["ExensiontRemark"].ToString();
                this.hidpic.Value = data.Rows[0]["ExensionImg"].ToString();
            }
        }
Пример #29
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\":\"回复商品咨询失败\"}");
        }
Пример #30
0
        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);
        }