public ActionResult Create() { List <DanHMuc> dm = DanhMucMager.getAllDanhMuc(); ViewBag.danhmuc = dm; return(View()); }
// GET: SanPham public ActionResult Index() { List <DanHMuc> dm = DanhMucMager.getAllDanhMuc(); ViewBag.danhmuc = new SelectList(dm, "MaDM", "TenDM"); List <SanPham> lstsp = SanPhamMager.getAllSanPham(); return(View(lstsp)); }
public ActionResult Edit(int id) { if (Ktdangnhap() == true) { List <DanHMuc> dm = DanhMucMager.getAllDanhMuc(); ViewBag.danhmuc = dm; SanPham sp = SanPhamMager.GetSanPhamByID(id); return(View(sp)); } else { return(RedirectToAction("Index")); } }
public ActionResult Seacrh(int?danhmuc, string TenSp, decimal?GiaNhap) { List <DanHMuc> dm = DanhMucMager.getAllDanhMuc(); ViewBag.danhmuc = new SelectList(dm, "MaDM", "TenDM"); List <SanPham> lstsp = SanPhamMager.GetSPbyDM(danhmuc); List <SanPham> lstsp1 = SanPhamMager.GetSPbytensp(TenSp); lstsp.AddRange(lstsp1); List <SanPham> lstsp2 = SanPhamMager.GetSpByGiaNhap(GiaNhap); lstsp.AddRange(lstsp2); return(View("Index", lstsp)); }
public ActionResult Index() { List <DanHMuc> lst = DanhMucMager.getAllDanhMuc(); return(View(lst)); }