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)); }
// 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); }
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 })); }
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 })); }
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 })); }
// 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 })); }
// 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); }
// GET: api/BinhLuanApi public IEnumerable <BinhLuan> Get(int maSanPham) { return(BinhLuanBUS.DanhSachBL(maSanPham)); }
// 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); }
public ActionResult Index(string MaSP) { ViewBag.MaSP = MaSP; return View(BinhLuanBUS.DanhSach(MaSP)); }
public ActionResult Create(String MaSanPham, String NoiDung) { BinhLuanBUS.Them(MaSanPham, User.Identity.GetUserId(), User.Identity.Name, NoiDung); return RedirectToAction("Details", "Shop", new { Id = MaSanPham }); }
public ActionResult Index(int MaSanPham) { ViewBag.MaSanPham = MaSanPham; return(View(BinhLuanBUS.DanhSach(MaSanPham))); }