public static int createComment(Comment comment) { int id = -1; try { DataAccess da = new DataAccess(); Dictionary<string, object> TransactionComment = new Dictionary<string, object>(); TransactionComment.Add("UserId", comment.UserId); TransactionComment.Add("ActionBy", (int)comment.ActionBy); TransactionComment.Add("TransactionId ", comment.TransactionId); TransactionComment.Add("Comment", comment.comment); TransactionComment.Add("ReminderSent", 0); TransactionComment.Add("IsActive", 1); TransactionComment.Add("IsDeleted", 0); TransactionComment.Add("CreatedDate", DateTime.Now); TransactionComment.Add("ModifiedDate", DateTime.Now); id = da.insert(TransactionComment, "TransactionComments"); } catch (Exception ex) { Console.Write(ex.Message + " " + ex.StackTrace); } return id; }
public JsonResult newComment(string comment, ActionBy commentor, int userId, int OtherUserId, int transactionId) { Comment newComment = new Comment( -1, comment, userId, commentor, transactionId, 1, 0, DateTime.Now, DateTime.Now ); CommentHandler.createComment(newComment); return Json(""); }