public void Test_DeleteNSX_Success()
 {
     nsxBUS = new NhaSanXuatBUS();
     Assert.AreEqual(5, nsxBUS.LoadNSXBUS().Count);
     nsxBUS.DeleteNSXBUS(6);
     Assert.AreEqual(4, nsxBUS.LoadNSXBUS().Count);
 }
 public ActionResult Create(NHASANXUAT nsx)
 {
     try
     {
         // TODO: Add insert logic here
         NhaSanXuatBUS.ThemNSX(nsx);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
 public ActionResult Edit(String id, NHASANXUAT nsx)
 {
     try
     {
         // TODO: Add update logic here
         NhaSanXuatBUS.UpdateNSX(id, nsx);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
        public void Test_UpdateNSX_Suscess()
        {
            nsx              = new NhaSanXuat();
            nsx.MaNSX        = 6;
            nsx.TenCongTyNSX = "nsxTestUpdate";

            nsxBUS = new NhaSanXuatBUS();
            Assert.AreEqual(0, nsxBUS.SearchTenNSXBUS(nsx.TenCongTyNSX).Count);

            nsxBUS.UpdateNSXBUS(nsx);

            Assert.AreEqual(1, nsxBUS.SearchTenNSXBUS(nsx.TenCongTyNSX).Count);
        }
        public void Test_AddNSX_Suscess()
        {
            nsxBUS = new NhaSanXuatBUS();
            Assert.AreEqual(4, nsxBUS.LoadNSXBUS().Count);

            nsx = new NhaSanXuat();
            nsx.TenCongTyNSX = "nsxTest";
            nsx.DiaChiNSX    = "1123 xyz";
            nsx.DienThoaiNSX = "012345";
            nsxBUS.AddNSXBUS(nsx);

            Assert.AreEqual(5, nsxBUS.LoadNSXBUS().Count);
        }
 public ActionResult XoaTamThoi(String id, NhaSanXuat nsx)
 {
     try
     {
         // TODO: Add delete logic here
         nsx.TinhTrang = "1";
         NhaSanXuatBUS.UpdateNSX(id, nsx);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
        // GET: NhaSanXuat
        public ActionResult Index(String id, int page = 1, int pagesize = 3)
        {
            var ds = NhaSanXuatBUS.ChiTiet(id).ToPagedList(page, pagesize);

            return(View(ds));
        }
 // GET: Admin/NhaSanXuat/Edit/5
 public ActionResult Edit(String id)
 {
     return(View(NhaSanXuatBUS.ChiTietAdmin(id)));
 }
        public void Test_SearchMaNSX_Suscess()
        {
            nsxBUS = new NhaSanXuatBUS();

            Assert.AreEqual(1, nsxBUS.SearchMaNSXBUS(1).Count);
        }
        // GET: Admin/NhaSanXuat
        public ActionResult Index()
        {
            var ds = NhaSanXuatBUS.DanhSachAdmin();

            return(View(ds));
        }
        public void Test_SearchMaNSX_Fail()
        {
            nsxBUS = new NhaSanXuatBUS();

            Assert.AreEqual(0, nsxBUS.SearchMaNSXBUS(100).Count);
        }
示例#12
0
 // GET: Admin/SanPham/Create
 public ActionResult Create()
 {
     ViewBag.MaNSX    = new SelectList(NhaSanXuatBUS.DanhSach(), "MaNSX", "TenNSX");
     ViewBag.MaLoaiSP = new SelectList(CuaHangBUS.DanhSach(), "MaLoaiSP", "TenLoaiSP");
     return(View());
 }
示例#13
0
 // GET: Admin/SanPham/Edit/5
 public ActionResult Edit(string id)
 {
     ViewBag.MaNSX    = new SelectList(NhaSanXuatBUS.DanhSach(), "MaNSX", "TenNSX", PetproShopBUS.ChiTiet(id).MaNSX);
     ViewBag.MaLoaiSP = new SelectList(CuaHangBUS.DanhSach(), "MaLoaiSP", "TenLoaiSP", PetproShopBUS.ChiTiet(id).MaLoaiSP);
     return(View(PetproShopBUS.ChiTiet(id)));
 }
示例#14
0
 // GET: Admin/SanPhamAdmin/Edit/5
 public ActionResult Edit(String id)
 {
     ViewBag.MaNhaSanXuat  = new SelectList(NhaSanXuatBUS.DanhSach(), "MaNhaSanXuat", "TenNhaSanXuat", ShopOnlineBUS.ChiTiet(id).MaNhaSanXuat);
     ViewBag.MaLoaiSanPham = new SelectList(LoaiSanPhamBUS.DanhSach(), "MaLoaiSanPham", "TenLoaiSanPham", ShopOnlineBUS.ChiTiet(id).MaLoaiSanPham);
     return(View(ShopOnlineBUS.ChiTiet(id)));
 }
示例#15
0
 // GET: Admin/SanPhamAdmin/Create
 public ActionResult Create()
 {
     ViewBag.MaNhaSanXuat  = new SelectList(NhaSanXuatBUS.DanhSach(), "MaNhaSanXuat", "TenNhaSanXuat");
     ViewBag.MaLoaiSanPham = new SelectList(LoaiSanPhamBUS.DanhSach(), "MaLoaiSanPham", "TenLoaiSanPham");
     return(View());
 }
        public void Test_SearchTenNSX_Suscess()
        {
            nsxBUS = new NhaSanXuatBUS();

            Assert.AreEqual(1, nsxBUS.SearchTenNSXBUS("CÔNG TY TNHH GẠCH AN PHÚ GIA").Count);
        }
 public ActionResult XoaTamThoi(String id)
 {
     return(View(NhaSanXuatBUS.ChiTietAdmin(id)));
 }
        // GET: Admin/NhaSanXuatAdmin
        public ActionResult Index(int page = 1, int pagesize = 5)
        {
            var ds = NhaSanXuatBUS.DanhSachAdmin().ToPagedList(page, pagesize);

            return(View(ds));
        }
        // GET: NhaSanXuat
        public ActionResult Index(int id, int page = 1, int pageSize = 8)
        {
            var ds = NhaSanXuatBUS.ChiTIet(id).ToPagedList(page, pageSize);;

            return(View(ds));
        }
        public void Test_SearchTenNSX_Fail()
        {
            nsxBUS = new NhaSanXuatBUS();

            Assert.AreEqual(0, nsxBUS.SearchTenNSXBUS("Tinh tinh").Count);
        }