コード例 #1
0
 public void ThemBinhLuan(ChiTietSanPhamModel chiTietSanPham)
 {
     BinhLuanBLL.ThemBinhLuan(chiTietSanPham.BinhLuanDuocThem);
 }
コード例 #2
0
        public ActionResult ThemTraLoi(ChiTietSanPhamModel chiTietSanPham)
        {
            if (!Request.IsAuthenticated)
            {
                return Json(new
                {
                    MaBinhLuan = chiTietSanPham.BinhLuanDuocThem.MaBinhLuan,
                    Flag = "unsuccess"
                });
            }
            else
            {

                int maBinhLuan = chiTietSanPham.BinhLuanDuocThem.MaBinhLuan;

                chiTietSanPham.BinhLuanDuocThem.TenNguoiDang = User.Identity.Name;
                chiTietSanPham.BinhLuanDuocThem.NgayDang = DateTime.Now;
                chiTietSanPham.BinhLuanDuocThem.BiXoa = false;

                BinhLuanBLL.ThemTraLoi(maBinhLuan, chiTietSanPham.BinhLuanDuocThem);

                return Json(new
                {
                    MaBinhLuan = maBinhLuan,
                    TenNguoiDang = chiTietSanPham.BinhLuanDuocThem.TenNguoiDang,
                    NoiDung = chiTietSanPham.BinhLuanDuocThem.NoiDung
                }, JsonRequestBehavior.AllowGet);
            }
        }