// GET: Admin/SanPhamAdmin/Create
 public ActionResult Create()
 {
     ViewBag.MaHang      = new SelectList(NhaSanXuatBus.DanhSach(), "MaHang", "TenHang");
     ViewBag.MaLoai      = new SelectList(LoaiSanPhamBus.DanhSach(), "MaLoai", "TenLoai");
     ViewBag.MaTinhTrang = new SelectList(TinhTrangSanPhamBus.DanhSach(), "MaTinhTrang", "TenTinhTrang");
     return(View());
 }
Exemple #2
0
        // GET: LoaiSanPham
        public ActionResult Index(int id, int?page)
        {
            int pageNumber   = (page ?? 1);
            int itemsPerPage = 3;
            var DSSanPham    = LoaiSanPhamBus.DanhSachChiTetPage(id, pageNumber, itemsPerPage);

            return(View(DSSanPham));
        }
        // GET: Admin/SanPhamAdmin/Edit/5
        public ActionResult Edit(int id)
        {
            ViewBag.MaHang      = new SelectList(NhaSanXuatBus.DanhSach(), "MaHang", "TenHang");
            ViewBag.MaLoai      = new SelectList(LoaiSanPhamBus.DanhSach(), "MaLoai", "TenLoai");
            ViewBag.MaTinhTrang = new SelectList(TinhTrangSanPhamBus.DanhSach(), "MaTinhTrang", "TenTinhTrang");
            var db = SanPhamBus.ChiTiet(id);

            return(View(db));
        }
Exemple #4
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         LoaiSanPhamBus.Xoa(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemple #5
0
 public ActionResult Edit(int id, LoaiSP lsp)
 {
     try
     {
         //TODO: Add update logic here
         LoaiSanPhamBus.Sua(id, lsp);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemple #6
0
 public ActionResult Create(LoaiSP lsp)
 {
     try
     {
         // TODO: Add insert logic here
         LoaiSanPhamBus.Them(lsp);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
Exemple #7
0
 // GET: Menu
 public ActionResult Index()
 {
     return(View(LoaiSanPhamBus.DanhSach()));
 }
Exemple #8
0
        // GET: Admin/LoaiSanPhamAdmin/Delete/5
        public ActionResult Delete(int id)
        {
            var db = LoaiSanPhamBus.ChiTiet(id);

            return(View(db));
        }
Exemple #9
0
        // GET: Admin/LoaiSanPhamAdmin
        public ActionResult Index()
        {
            var db = LoaiSanPhamBus.DanhSach();

            return(View(db));
        }