public void Tim() { Console.Clear(); Console.SetCursorPosition(9, 5); Console.WriteLine("--------------------------------------------------------------------------------------------------------"); Console.SetCursorPosition(9, 6); Console.WriteLine("| Tim kiem thong tin nhan vien |"); Console.SetCursorPosition(9, 7); Console.WriteLine("|-------------------------------------------------------------------------------------------------------|"); INhanvienBLL sp = new NhanvienBLL(); List <Nhanvien> list = sp.TimNhanVien(new Nhanvien()); string makhach; Console.SetCursorPosition(27, 17); Console.Write("Nhap ma nhan vien can tim:"); makhach = Console.ReadLine(); int i; for (i = 0; i < list.Count; ++i) { if (makhach == list[i].Manv) { break; } } if (i < list.Count) { Console.SetCursorPosition(9, 9); Console.WriteLine("| Thong tin nhan vien |"); Console.SetCursorPosition(9, 10); Console.WriteLine("-------------------------------------------------------------------------------------------------------"); Console.SetCursorPosition(9, 11); Console.WriteLine("║ Ma nhan vien | Ten nhan vien | Gioi tinh | Ngay sinh | He so luong | Tien luong|"); Console.SetCursorPosition(9, 12); Console.WriteLine("-----------------------------------------------------------------------------------------------------------"); Console.SetCursorPosition(9, 13); Console.WriteLine("| " + list[i].Manv + "\t | " + list[i].Tennv + "| \t" + list[i].SNLV + "\t | " + list[i].HSL + list[i].Tinhluong + "\t | "); Console.SetCursorPosition(9, 14); Console.WriteLine("-------------------------------------------------------------------------------------------------------------"); Console.SetCursorPosition(9, 15); Console.Write(" Nhap phim bat ki de tiep tuc"); Console.ReadKey(); } else { Console.SetCursorPosition(9, 11); Console.Write(" Khong ton tai ma nhan vien nay...."); Console.SetCursorPosition(9, 15); Console.WriteLine("---------------------------------------------------------------------------------------------------------------"); Console.SetCursorPosition(47, 11); Console.ReadKey(); } }
public Form1() { InitializeComponent(); nvbll = new NhanvienBLL(); }