public void nhapDanhSachDKHP() { ds_dkhp = new List <DTO_DKHP>(); int i = 1; while (true) { Console.WriteLine("#--------Thong tin dang ky hoc phan {0}--------#", i); BUS_DKHP t = new BUS_DKHP(); DTO_DKHP t1 = new DTO_DKHP(); t1 = t.nhapDKHP(t1); ds_dkhp.Add(t1); i++; Console.Write("1 tiep tuc (-1 thoat): "); string temp = Console.ReadLine(); if (float.TryParse(temp, out float n)) { float t2 = float.Parse(temp); if (t2 == -1) { break; } } else { Console.WriteLine("Thoat danh sach nhap!!"); break; } } }
public void xuatDS_DKHPtheoSinhVien(List <DTO_SINHVIEN> dssv) { foreach (var sv in dssv) { int i = 1; BUS_SINHVIEN svv = new BUS_SINHVIEN(); svv.XuatSinhVien(sv); Console.WriteLine("Danh sach mon"); foreach (var hp in ds_dkhp) { if (sv.docghiID == hp.docghiID_SV) { Console.WriteLine("#--------Thong tin mon {0}--------#", i); BUS_DKHP t = new BUS_DKHP(); t.xuatDKHP(hp); i++; } } } }