Пример #1
0
        public void TaoLoaiKhachHang_1()
        {
            DAL.DataProvider.InitalizeConnection();

            LoaiKhachHangDTO loaiHangDTO = new LoaiKhachHangDTO(LoaiKhachHangBUS.PhatSinhLoaiKhachHang(), "abc", 0, 0, 0, 0, 0, 0, 0);

            LoaiKhachHangBUS.LuuThongTinLoaiKhachHang(loaiHangDTO);

            DataTable khachhangDT = LoaiKhachHangBUS.LayTatCaLoaiKhachHang_DataTable();

            Assert.IsTrue(loaiHangDTO.MaLoaiKH == (int)khachhangDT.Rows[khachhangDT.Rows.Count - 1]["MaLoaiKH"]);
        }
Пример #2
0
        public void SuaLoaiKhachHang_1()
        {
            DAL.DataProvider.InitalizeConnection();

            DataTable khachhangDT = LoaiKhachHangBUS.LayTatCaLoaiKhachHang_DataTable();

            LoaiKhachHangDTO loaiHangDTO = new LoaiKhachHangDTO((int)khachhangDT.Rows[khachhangDT.Rows.Count - 1]["MaLoaiKH"], "xyz", 0, 0, 0, 0, 0, 0, 0);

            LoaiKhachHangBUS.CapNhatThongTinLoaiKhachHang(loaiHangDTO);

            DataTable newKhachHangDT = LoaiKhachHangBUS.LayTatCaLoaiKhachHang_DataTable();

            Assert.IsTrue(newKhachHangDT.Rows[newKhachHangDT.Rows.Count - 1]["TenLoaiKH"].ToString() == khachhangDT.Rows[khachhangDT.Rows.Count - 1]["TenLoaiKH"].ToString());
        }
Пример #3
0
        public void XoaLoaiKhachHang_1()
        {
            DAL.DataProvider.InitalizeConnection();


            DataTable khachhangDT = LoaiKhachHangBUS.LayTatCaLoaiKhachHang_DataTable();

            //LoaiKhachHangDTO loaiHangDTO = new LoaiKhachHangDTO((int)khachhangDT.Rows[khachhangDT.Rows.Count - 1]["MaLoaiKH"], "xyz", 0, 0, 0, 0, 0, 0, 0);
            LoaiKhachHangBUS.XoaLoaiKhachHang((int)khachhangDT.Rows[khachhangDT.Rows.Count - 1]["MaLoaiKH"]);


            DataTable newKhachHangDT = LoaiKhachHangBUS.LayTatCaLoaiKhachHang_DataTable();

            Assert.IsTrue((int)newKhachHangDT.Rows[newKhachHangDT.Rows.Count - 1]["MaLoaiKH"] != (int)khachhangDT.Rows[khachhangDT.Rows.Count - 1]["MaLoaiKH"]);
        }