public int UpsertComment(TaskReviewCommentViewModal comment) { using (var db = new E2EWebPortalEntities()) { return(db.sp_UpsertComments(comment.CommentID , comment.ReviewerID , comment.EmployerID , comment.CommendDescription , comment.IsDefault)); } }
public JsonResult SaveCommentData(FormCollection form) { var user = (UserViewModal)Session["User"]; TaskReviewCommentViewModal comment = new TaskReviewCommentViewModal(); comment.CommentID = Convert.ToInt16(form["CommentID"] != null ? form["CommentID"].ToString() : "0"); comment.ReviewerID = Convert.ToInt16(user.Id); comment.EmployerID = user.EmployerID; comment.CommendDescription = Convert.ToString(form["CommendDescription"].ToString()); comment.IsDefault = Convert.ToString(form["IsDefault"].ToString()); var result = _taskRepo.UpsertComment(comment); if (result == -1) { return(Json(new { Code = 1, Message = "Comment data has been saved successfully!" })); } else { return(Json(new { Code = 0, Message = "Something wrong occured! Please try again!" })); } }