示例#1
0
 public bool addComment(BinhLuan binhLuan)
 {
     try
     {
         db.BinhLuan.Add(binhLuan);
         db.SaveChanges();
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
示例#2
0
        private CommentViewModels BinhLuan2ViewModels(BinhLuan p)
        {
            CommentViewModels result = new CommentViewModels();

            result.datePost = (DateTime) p.NgayDang;
            result.content = p.NoiDung;

            AccountBus acBus = new AccountBus();
            
            ThanhVien temp = acBus.getMemberByUserId(p.MS_ThanhVien.ToString());

            result.url_Avatar = temp.Avatar;
            result.fullName = temp.HoTen;

            result.IDPost = p.MS_BaiNhanXet.ToString();

            return result;


        }
示例#3
0
        internal CommentViewModels addComment(string CommentContent, string IDPost, string IDUser)
        {
            CommentViewModels result = new CommentViewModels();
            ReviewFilmsBus reviewBus = new ReviewFilmsBus();

            BinhLuan binhLuan = new BinhLuan();

            binhLuan.MS_BaiNhanXet = Int32.Parse(IDPost);
            binhLuan.MS_ThanhVien = IDUser;
            binhLuan.NoiDung = CommentContent;
            binhLuan.NgayDang = System.DateTime.Now;
            if(reviewBus.addComment(binhLuan))
            {
                result = BinhLuan2ViewModels(binhLuan);
            }
            
            return result;

        }
示例#4
0
        public bool addComment(BinhLuan binhLuan)
        {
            try
            {
                db.BinhLuan.Add(binhLuan);
                db.SaveChanges();
                return true;
            }
            catch (Exception e)
            {

                return false;
            }
        }