public QLGV TimTheoHo(string ho) { QLGV kq = new QLGV(); for (int i = 0; i < tongSo; i++) { if (danhsach[i].XuatHoLot() == ho) { kq.Them(danhsach[i]); } } return(kq); }
public QLGV TimTheoMaSo(string ma) { QLGV kq = new QLGV(); for (int i = 0; i < tongSo; i++) { if (danhsach[i].XuatMaSoSV() == ma) { kq.Them(danhsach[i]); } } return(kq); }
static void Main(string[] args) { QLGV a = new QLGV(); a.NhapDS(); a.Xuat(); QLGV kq = new QLGV(); string ho; Console.WriteLine("1. Tim giao vien theo Ho"); Console.Write("Nhap Ho Ten giao vien can tim: "); ho = Console.ReadLine(); kq = a.TimTheoHo(ho); kq.Xuat(); string ten; Console.WriteLine("2. Tim tat ca giao vien theo Ten"); Console.Write("Nhap Ten giao vien can tim: "); ten = Console.ReadLine(); a.TimTatCaTheoTen(ten); string ma; Console.WriteLine("3. Tim giao vien theo Ma So"); Console.Write("Nhap Ma So Giao Vien can tim: "); ma = Console.ReadLine(); kq = a.TimTheoMaSo(ma); kq.Xuat(); QLGV b = new QLGV(); Console.WriteLine("================================================ DANH SACH GIAO VIEN DOC TU FILE ==============================================="); b.Read(@"C:\Users\ASUS\Desktop\C#\LAB\LTHDT_CSharp\1710197_TranThanhKhoa_BaiKTCuoi\1710197_TranThanhKhoa_BaiKTCuoi\DuLieu.txt"); b.Xuat(); b.Write(@"C:\Users\ASUS\Desktop\C#\LAB\LTHDT_CSharp\1710197_TranThanhKhoa_BaiKTCuoi\1710197_TranThanhKhoa_BaiKTCuoi\DuLieuSaoChep.txt"); Console.WriteLine("\nMa Hoa Ma So Giao Vien!"); b.MaHoa(); b.Xuat(); Console.WriteLine("Giai Ma Ma So Giao Vien!"); b.GiaiMa(); b.Xuat(); Console.ReadLine(); }