コード例 #1
0
        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;
                }
            }
        }
コード例 #2
0
        public void ReadAssignment()
        {
            List <Assignment> assignments = assignmentHandler.GetList(this.user.Account);
            List <Term>       terms       = termsHandler.GetListTerm();
            Teacher           teacher     = TeacherHandler.GetInfor(user.Account);

            Console.WriteLine("Giảng viên: ", teacher.Name);

            Table table = new Table(90);

            bool exit = false;

            while (!exit)
            {
                Console.Clear();
                table.PrintLine();
                table.PrintRow("Học phần", "Lớp", "Học kỳ", "Năm học");
                table.PrintLine();
                foreach (Assignment assignment in assignments)
                {
                    table.PrintRow(termsHandler.GetTerm(assignment.TermID, terms).Name, assignment.ClassID, assignment.Semester.ToString(), assignment.Year);
                }
                table.PrintLine();
                Console.WriteLine("Nhấn esc để thoát");
                ConsoleKeyInfo keyInfo = Console.ReadKey();
                if (keyInfo.Key == ConsoleKey.Escape)
                {
                    exit = true;
                }
            }
        }