public static void Chon(List <XuatKho> list, XuatKho_BLL XuatKho_BLL, XuatKho_DAL XuatKho_DAL) { int chon; while (true) { Menu(); chon = int.Parse(Console.ReadLine()); if (chon == 0) { break; } Console.Clear(); switch (chon) { case 1: XuatKho_BLL.NhapXuatKho(list); Console.ReadKey(); Console.Clear(); XuatKho_DAL.GhiFile(list); break; case 2: XuatKho_BLL.HienXuatKho(list); Console.ReadKey(); Console.Clear(); break; case 3: XuatKho_BLL.TimKiem(list); Console.ReadKey(); Console.Clear(); break; case 4: XuatKho_BLL.Sua(list); XuatKho_DAL.GhiFile(list); Console.ReadKey(); Console.Clear(); break; case 5: XuatKho_BLL.Xoa(list); XuatKho_DAL.GhiFile(list); Console.ReadKey(); Console.Clear(); break; case 6: XuatKho_BLL.ThongKeXuat(list); Console.ReadKey(); Console.Clear(); break; default: break; } } }
public static void RunProgram() { List <SanPham> sanPhams = new List <SanPham>(); List <NhapKho> nhapKhos = new List <NhapKho>(); List <XuatKho> xuatKhos = new List <XuatKho>(); NhapKho_BLL nhapKho_BLL = new NhapKho_BLL(); XuatKho_BLL xuatKho_BLL = new XuatKho_BLL(); SanPham_BLL sanPham_BLL = new SanPham_BLL(); NhapKho_DAL nhapKho_DAL = new NhapKho_DAL(); SanPham_DAL sanPham_DAL = new SanPham_DAL(); XuatKho_DAL xuatKho_DAL = new XuatKho_DAL(); nhapKho_DAL.DocFile(nhapKhos); xuatKho_DAL.DocFile(xuatKhos); sanPham_DAL.DocFile(sanPhams); int chon; while (true) { Menu(); chon = int.Parse(Console.ReadLine()); Console.Clear(); if (chon == 0) { break; } switch (chon) { case 1: SanPham_GUI.Chon(sanPhams, sanPham_BLL, sanPham_DAL); Console.Clear(); break; case 2: NhapKho_GUI.Chon(nhapKhos, nhapKho_BLL, nhapKho_DAL); Console.Clear(); break; case 3: XuatKho_GUI.Chon(xuatKhos, xuatKho_BLL, xuatKho_DAL); Console.Clear(); break; default: break; } } }