コード例 #1
0
ファイル: CommentModel.cs プロジェクト: hoangdxvnu/SEA
 public bool Create(Comment pNewComment)
 {
     try
     {
         _db.Comments.Add(pNewComment);
         _db.SaveChanges();
         return true;
     }
     catch
     {
         return false;
     }
 }
コード例 #2
0
ファイル: CommentModel.cs プロジェクト: hoangdxvnu/SEA
 public bool Edit(int pId,Comment pNewComment)
 {
     try
     {
         var Object = _db.Comments.Find(pId);
         Object.CommentDate = pNewComment.CommentDate;
         Object.AccountID = pNewComment.AccountID;
         Object.PostID = pNewComment.PostID;
         Object.CommentLike = pNewComment.CommentLike;
         Object.CommentContent = pNewComment.CommentContent;
         Object.IsActive = pNewComment.IsActive;
         Object.LangId = pNewComment.LangId;
         Object.Permission = pNewComment.Permission;
         Object.ParentId = pNewComment.ParentId;
         _db.SaveChanges();
         return true;
     }
     catch
     {
         return false;
     }
 }
コード例 #3
0
ファイル: Factory.cs プロジェクト: hoangdxvnu/SEA
        public void SaveCommemntRealtime(Comment modelData)
        {
            dbContext = new ThangLongEntities();

            dbContext.Comments.Add(modelData);
        }