Пример #1
0
        public Message Insert(SR_Comment comment)
        {
            Message msg = null;
            try
            {

                dbContext.SR_Comments.InsertOnSubmit(comment);
                dbContext.SubmitChanges();
                msg = new Message(MessageConstants.I0001, MessageType.Info, "Comment", "added");
            }
            catch
            {
                msg = new Message(MessageConstants.E0007, MessageType.Error);
            }
            return msg;
        }
Пример #2
0
 public Message Update(SR_Comment comment)
 {
     Message msg = null;
     try
     {
         SR_Comment src = GetCommentByServiceRequestID(comment.ServiceRequestID);
         src.Contents += "\r\n=============================\r\n" + comment.Poster +
             "(" + comment.PostTime.ToString(Constants.DATETIME_FORMAT_JR) + "):" + "\r\n" + comment.Contents;
         if (comment.Files != null)
         {
             src.Contents += CommonFunc.SplitFileName(comment.Files, Constants.SR_UPLOAD_PATH, false).Replace("<a" ,"#begin#").Replace("</a>", "#end#");
         }
         dbContext.SubmitChanges();
         msg = new Message(MessageConstants.I0001, MessageType.Info, "Comment", "updated");
     }
     catch
     {
         msg = new Message(MessageConstants.E0007, MessageType.Error);
     }
     return msg;
 }