Beispiel #1
0
        protected void btnReplyLeaveComments_Click(object sender, System.EventArgs e)
        {
            LeaveCommentReplyInfo leaveCommentReplyInfo = new LeaveCommentReplyInfo();

            leaveCommentReplyInfo.LeaveId = this.leaveId;
            if (string.IsNullOrEmpty(this.fckReplyContent.Text))
            {
                leaveCommentReplyInfo.ReplyContent = null;
            }
            else
            {
                leaveCommentReplyInfo.ReplyContent = this.fckReplyContent.Text;
            }
            leaveCommentReplyInfo.UserId = HiContext.Current.User.UserId;
            ValidationResults validationResults = Validation.Validate <LeaveCommentReplyInfo>(leaveCommentReplyInfo, new string[]
            {
                "ValLeaveCommentReply"
            });
            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;
            }
            int num = NoticeHelper.ReplyLeaveComment(leaveCommentReplyInfo);

            if (num > 0)
            {
                base.Response.Redirect(Globals.GetAdminAbsolutePath(string.Format("/comment/ReplyedLeaveCommentsSuccsed.aspx?leaveId={0}", this.leaveId)), true);
            }
            else
            {
                this.ShowMsg("回复客户留言失败", false);
            }
            this.fckReplyContent.Text = string.Empty;
        }
        protected void btnReplyLeaveComments_Click(object sender, EventArgs e)
        {
            LeaveCommentReplyInfo target = new LeaveCommentReplyInfo();

            target.LeaveId = leaveId;
            if (string.IsNullOrEmpty(fckReplyContent.Text))
            {
                target.ReplyContent = null;
            }
            else
            {
                target.ReplyContent = fckReplyContent.Text;
            }
            target.UserId = HiContext.Current.User.UserId;
            ValidationResults results = Hishop.Components.Validation.Validation.Validate <LeaveCommentReplyInfo>(target, new string[] { "ValLeaveCommentReply" });
            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 (NoticeHelper.ReplyLeaveComment(target) > 0)
                {
                    base.Response.Redirect(Globals.GetAdminAbsolutePath(string.Format("/comment/ReplyedLeaveCommentsSuccsed.aspx?leaveId={0}", leaveId)), true);
                }
                else
                {
                    ShowMsg("回复客户留言失败", false);
                }
                fckReplyContent.Text = string.Empty;
            }
        }