public void Statistic() { Console.Clear(); bool exit = false; while (!exit) { string subId = user.SubjectID; List <Assignment> assignments = handler.GetList(); List <Teacher> teachers = teacherHandler.GetList(subId); Table table = new Table(90); table.PrintLine(); table.PrintRow("ID", "Tên", "Số giờ dạy", "Số giờ vượt", "Số giờ chuẩn"); table.PrintLine(); foreach (var teacher in teachers) { int workTime = handler.GetWorkTime(assignments, teacher.ID); float standardTime = handler.GetStandardTime(teacher.Position); float exceedTime = (float)workTime - standardTime; table.PrintRow(teacher.ID, teacher.Name, workTime.ToString(), exceedTime.ToString(), standardTime.ToString()); } table.PrintLine(); Console.WriteLine("nhấn esc để thoát"); ConsoleKeyInfo keyInfo = Console.ReadKey(); if (keyInfo.Key == ConsoleKey.Escape) { Console.Clear(); exit = true; } } }