Пример #1
0
 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;
     }
 }
Пример #2
0
 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;
     }
 }
Пример #3
0
 public override int ReplyLeaveComment(LeaveCommentReplyInfo leaveReply)
 {
     DbCommand sqlStringCommand = database.GetSqlStringCommand("INSERT INTO Hishop_LeaveCommentReplys(LeaveId,UserId,ReplyContent,ReplyDate) VALUES(@LeaveId,@UserId,@ReplyContent,@ReplyDate);SELECT @@IDENTITY ");
     database.AddInParameter(sqlStringCommand, "leaveId", DbType.Int64, leaveReply.LeaveId);
     database.AddInParameter(sqlStringCommand, "UserId", DbType.Int32, leaveReply.UserId);
     database.AddInParameter(sqlStringCommand, "ReplyContent", DbType.String, leaveReply.ReplyContent);
     database.AddInParameter(sqlStringCommand, "ReplyDate", DbType.String, DataHelper.GetSafeDateTimeFormat(leaveReply.ReplyDate));
     object obj2 = database.ExecuteScalar(sqlStringCommand);
     if (obj2 != null)
     {
         return Convert.ToInt32(obj2);
     }
     return 0;
 }
Пример #4
0
 public static LeaveCommentReplyInfo PopulateLeaveCommentReply(IDataReader reader)
 {
     if (null == reader)
     {
         return null;
     }
     LeaveCommentReplyInfo info = new LeaveCommentReplyInfo();
     info.LeaveId = (long) reader["LeaveId"];
     info.ReplyId = (long) reader["ReplyId"];
     info.UserId = (int) reader["UserId"];
     info.ReplyContent = (string) reader["ReplyContent"];
     info.ReplyDate = (DateTime) reader["ReplyDate"];
     return info;
 }
Пример #5
0
 public static int ReplyLeaveComment(LeaveCommentReplyInfo leaveReply)
 {
     leaveReply.ReplyDate = DateTime.Now;
     return CommentsProvider.Instance().ReplyLeaveComment(leaveReply);
 }
Пример #6
0
 public abstract int ReplyLeaveComment(LeaveCommentReplyInfo leaveReply);