// 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());
 }
예제 #2
0
        public ActionResult NhaSanXuat(int MaNSX)
        {
            var ds = SanPhamBus.SanPhambyNSX(MaNSX);

            ViewBag.NhaSanXuat = NhaSanXuatBus.ChiTiet(MaNSX);
            return(View(ds));
        }
        // GET: NhaSanXuat
        public ActionResult Index(int id, int?page)
        {
            int pageNumber   = (page ?? 1);
            int itemsPerPage = 3;
            var DSSanPham    = NhaSanXuatBus.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));
        }
예제 #5
0
        // GET: SanPham/Details/5
        public ActionResult Details(int id)
        {
            var sp  = SanPhamBus.ChiTiet(id);
            var nsx = NhaSanXuatBus.ChiTiet(sp.MaNSX);

            return(View(new SanPhamViewModels()
            {
                SanPham = sp, NhaSanXuat = nsx
            }));
        }
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         // TODO: Add delete logic here
         NhaSanXuatBus.Xoa(id);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Edit(int id, HangSP hsp)
 {
     try
     {
         // TODO: Add update logic here
         NhaSanXuatBus.Sua(id, hsp);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #8
0
 public ActionResult Edit(String id, NhaSanXuat NSX)
 {
     try
     {
         // TODO: Add update logic here
         NhaSanXuatBus.UpdateNSX(id, NSX);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Create(HangSP hsp)
 {
     try
     {
         // TODO: Add insert logic here
         NhaSanXuatBus.Them(hsp);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #10
0
 public ActionResult Remove(String id, NhaSanXuat NSX)
 {
     try
     {
         // TODO: Add delete logic here
         NSX.TinhTrang = 1;
         NhaSanXuatBus.UpdateNSX(id, NSX);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
예제 #11
0
        // GET: Admin/AdminNSX
        public ActionResult Index()
        {
            var sql = NhaSanXuatBus.DanhSanhNSXAdmin();

            return(View(sql));
        }
        // GET: Admin/NhaSanXuatAdmin/Delete/5
        public ActionResult Delete(int id)
        {
            var db = NhaSanXuatBus.ChiTiet(id);

            return(View(db));
        }
        // GET: Admin/NhaSanXuatAdmin
        public ActionResult Index()
        {
            var db = NhaSanXuatBus.DanhSach();

            return(View(db));
        }
예제 #14
0
 //xóa tạm thời
 public ActionResult Remove(String id)
 {
     return(View(NhaSanXuatBus.EditNSX(id)));
 }
예제 #15
0
 // GET: SanPham/Create
 public ActionResult Create()
 {
     ViewBag.MaNSX = new SelectList(NhaSanXuatBus.DanhSach(), "MaNSX", "TenNSX");
     return(View());
 }
예제 #16
0
        // GET: NhaSanXuat
        public ActionResult Index(String id, int PagedList = 1, int size = 6)
        {
            var sql = NhaSanXuatBus.ChiTietNSX(id).ToPagedList(PagedList, size);

            return(View(sql));
        }
 // GET: Admin/AdminSP/Create
 // GET: Admin/AdminSP/Create
 public ActionResult Create()
 {
     ViewBag.MaNhaSX  = new SelectList(NhaSanXuatBus.DanhSach(), "MaNhaSX", "TenNhaSX");
     ViewBag.MaLoaiSP = new SelectList(PhanLoaiBus.DanhSach(), "MaLoaiSP", "TenLoaiSP");
     return(View());
 }
        //catch
        //{
        //    return View();


        // GET: Admin/AdminSP/Edit/5
        public ActionResult Edit(string id)
        {
            ViewBag.MaNhaSX       = new SelectList(NhaSanXuatBus.DanhSach(), "MaNhaSX", "TenNhaSX");
            ViewBag.MaLoaiSanPham = new SelectList(PhanLoaiBus.DanhSach(), "MaLoaiSP", "TenLoaiSP");
            return(View(MobileShopBus.ChiTiet(id)));
        }