public override int ReplyLeaveComment(LeaveCommentReplyInfo leaveReply)
        {
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand("INSERT INTO distro_LeaveCommentReplys(LeaveId,UserId,ReplyContent,ReplyDate) VALUES(@LeaveId,@UserId,@ReplyContent,@ReplyDate); SELECT @@IDENTITY ");

            this.database.AddInParameter(sqlStringCommand, "leaveId", DbType.Int64, leaveReply.LeaveId);
            this.database.AddInParameter(sqlStringCommand, "UserId", DbType.Int32, leaveReply.UserId);
            this.database.AddInParameter(sqlStringCommand, "ReplyContent", DbType.String, leaveReply.ReplyContent);
            this.database.AddInParameter(sqlStringCommand, "ReplyDate", DbType.String, DataHelper.GetSafeDateTimeFormat(leaveReply.ReplyDate));
            object obj2 = this.database.ExecuteScalar(sqlStringCommand);

            if (obj2 != null)
            {
                return(Convert.ToInt32(obj2));
            }
            return(0);
        }
Beispiel #2
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 info2 = new LeaveCommentReplyInfo();

            info2.LeaveId = this.LeaveId;
            LeaveCommentReplyInfo target = info2;

            if (string.IsNullOrEmpty(this.fckReplyContent.Text))
            {
                target.ReplyContent = null;
            }
            else
            {
                target.ReplyContent = this.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);
                }
                this.ShowMsg(msg, false);
            }
            else
            {
                if (SubsiteCommentsHelper.ReplyLeaveComment(target) > 0)
                {
                    base.Response.Redirect(Globals.ApplicationPath + string.Format("/Shopadmin/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;
            }
        }
 public abstract int ReplyLeaveComment(LeaveCommentReplyInfo leaveReply);
Beispiel #6
0
 public static int ReplyLeaveComment(LeaveCommentReplyInfo leaveReply)
 {
     leaveReply.ReplyDate = DateTime.Now;
     return(SubsiteCommentsProvider.Instance().ReplyLeaveComment(leaveReply));
 }
Beispiel #7
0
 public static int ReplyLeaveComment(LeaveCommentReplyInfo leaveReply)
 {
     leaveReply.ReplyDate = DateTime.Now;
     return(new LeaveCommentDao().ReplyLeaveComment(leaveReply));
 }