public static void Run(TheLoai_DAL TheLoai_DAL, TheLoai_BLL TheLoai_BLL, ArrayList arrayList) { TheLoai_DAL.DocFile(arrayList); int chon; while (true) { Menu(); //chọn chức năng chon = int.Parse(Console.ReadLine()); //nếu nhập = 0 thì dừng chương trình if (chon == 0) { break; } switch (chon) { case 1: TheLoai_BLL.Nhap(arrayList); Console.WriteLine("Nhập phím bất kì để tiếp tục"); TheLoai_DAL.GhiFile(arrayList); Console.ReadLine(); Console.Clear(); break; case 2: TheLoai_BLL.Hien(arrayList); Console.WriteLine("Nhập phím bất kì để tiếp tục"); Console.ReadLine(); Console.Clear(); break; case 3: TheLoai_BLL.Sua(arrayList); Console.WriteLine("Nhập phím bất kì để tiếp tục"); TheLoai_DAL.GhiFile(arrayList); Console.ReadLine(); Console.Clear(); break; case 4: TheLoai_BLL.Xoa(arrayList); Console.WriteLine("Nhập phím bất kì để tiếp tục"); TheLoai_DAL.GhiFile(arrayList); Console.ReadLine(); Console.Clear(); break; case 5: TheLoai_BLL.TimKiem(arrayList); Console.WriteLine("Nhập phím bất kì để tiếp tục"); Console.ReadLine(); Console.Clear(); break; default: break; } } }