public M_Comment m_create(M_Comment comment) { CommentService dbcom = new CommentService(); var result = dbcom.AddEntity(comment); return(result); }
public int AddDiscuss(string username, string content, int caseid) { CommentService dbcomment = new CommentService(); UserInfo dbuser = new UserInfo(); string userid = dbuser.GetUseByName(username).Id; var result = dbcomment.AddEntity(new Models.M_Comment { CaseId = caseid, UserID = userid, Content = content, Date = DateTime.Now, UserName = username, }); if (result.ID != 0) { return(1); } else { return(0); } }