コード例 #1
0
        public ActionResult Index(int MaSanPham, int page = 1, int pagesize = 3)
        {
            ViewBag.MaSanPham = MaSanPham;
            var dsBL = BinhLuanBUS.DanhSachBL(MaSanPham).ToPagedList(page, pagesize);

            return(View(dsBL));
        }
コード例 #2
0
 // POST: api/BinhLuanAPI
 public void Post([FromBody] BinhLuan bl)
 {
     bl.MaTaiKhoan  = User.Identity.GetUserId();
     bl.TinhTrang   = 0;
     bl.ThoiGian    = DateTime.Now;
     bl.TenTaiKhoan = User.Identity.Name;
     BinhLuanBUS.ThemBinhLuan(bl);
 }
コード例 #3
0
 public ActionResult Create(BinhLuan bl)
 {
     bl.MaTaiKhoan  = User.Identity.GetUserId();
     bl.TinhTrang   = 0;
     bl.Ngay        = DateTime.Now;
     bl.TenTaiKhoan = User.Identity.Name;
     BinhLuanBUS.ThemBT(bl);
     return(RedirectToAction("Details", "Shop", new { id = bl.MaSanPham }));
 }
コード例 #4
0
 public ActionResult Create(int MaSanPham = 0, String NoiDung = "")
 {
     if (MaSanPham == 0)
     {
         return(Redirect("/"));
     }
     BinhLuanBUS.Them(MaSanPham, User.Identity.Name, User.Identity.GetUserId(), NoiDung);
     return(RedirectToAction("Details", "SanPham", new { Id = MaSanPham }));
 }
コード例 #5
0
 public ActionResult Create(int MaSanPham = 0, string NoiDungBinhLuan = "")
 {
     if (MaSanPham == 0)
     {
         return(Redirect("/"));
     }
     BinhLuanBUS.Them(NoiDungBinhLuan, MaSanPham, User.Identity.GetUserId(), User.Identity.Name);
     return(RedirectToAction("Details", "Product", new { id = MaSanPham }));
 }
コード例 #6
0
        // GET: SanPham/Details/5
        public ActionResult Details(int id)
        {
            var BinhLuan       = BinhLuanBUS.DanhSach(id);
            var ChiTietSP      = SanPhamBus.ChiTiet(id);
            var ChiTietLoaiSP  = LoaiBus.ChiTietViewModel(ChiTietSP.MaLoai);
            var ChitTietHangSP = HangBus.ChiTietViewModel(ChiTietSP.MaLoai);

            return(View(new SanPhamViewModel()
            {
                LoaiSP = ChiTietLoaiSP, HangSP = ChitTietHangSP, SanPham = ChiTietSP, BinhLuanSP = BinhLuan
            }));
        }
コード例 #7
0
        // GET: api/BinhLuanApi/5
        //public string Get(int id)
        //{
        //    return "value";
        //}

        // POST: api/BinhLuanApi
        public void Post([FromBody] BinhLuan binhluan)
        {
            BinhLuanBUS.Them(binhluan.MaSanPham, User.Identity.GetUserId(), User.Identity.Name, binhluan.NoiDung);
        }
コード例 #8
0
 // GET: api/BinhLuanApi
 public IEnumerable <BinhLuan> Get(int maSanPham)
 {
     return(BinhLuanBUS.DanhSachBL(maSanPham));
 }
コード例 #9
0
        // GET: api/APIBinhLuan/5
        //public string Get(int id)
        //{
        //    return "value";
        //}

        // POST: api/APIBinhLuan
        public void Post([FromBody] BinhLuan bl)
        {
            BinhLuanBUS.Them(bl.NoiDungBinhLuan, bl.MaSanPham, User.Identity.GetUserId(), User.Identity.Name);
        }
コード例 #10
0
 public ActionResult Index(string MaSP)
 {
     ViewBag.MaSP = MaSP;
     return View(BinhLuanBUS.DanhSach(MaSP));
 }
コード例 #11
0
        public ActionResult Create(String MaSanPham, String NoiDung)
        {

            BinhLuanBUS.Them(MaSanPham, User.Identity.GetUserId(), User.Identity.Name, NoiDung);
            return RedirectToAction("Details", "Shop", new { Id = MaSanPham });
        }
コード例 #12
0
 public ActionResult Index(int MaSanPham)
 {
     ViewBag.MaSanPham = MaSanPham;
     return(View(BinhLuanBUS.DanhSach(MaSanPham)));
 }