Exemple #1
0
        public ActionResult Create()
        {
            List <DanHMuc> dm = DanhMucMager.getAllDanhMuc();

            ViewBag.danhmuc = dm;
            return(View());
        }
Exemple #2
0
        // 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));
        }
Exemple #3
0
 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"));
     }
 }
Exemple #4
0
        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));
        }
Exemple #5
0
        public ActionResult Index()
        {
            List <DanHMuc> lst = DanhMucMager.getAllDanhMuc();

            return(View(lst));
        }