Example #1
0
        static void Main(string[] args)
        {
            StudentController studentController = new StudentController();

            studentController.CreateStudent(new Student(
                                                "T012",
                                                "Le Huy Hai",
                                                new DateTime(1998, 1, 6),
                                                "*****@*****.**",
                                                "0931234567",
                                                new DateTime(2019, 4, 20),
                                                Student.StudentStatus.Active
                                                ));
            while (true)
            {
                GenerateMenu();
                var choice = Console.ReadLine();
                while (!Int32.TryParse(choice, out int result))
                {
                    Console.WriteLine("Not a choice. Re-enter:");
                    choice = Console.ReadLine();
                }
                switch (Int32.Parse(choice))
                {
                case 1:
                    studentController.CreateStudentManually();
                    break;

                case 2:
                    studentController.PrintListStudent();
                    break;

                case 3:
                    Console.WriteLine("\nEnter student's roll number:");
                    studentController.ChangeStudentStatus(Console.ReadLine());
                    break;

                case 4:
                    Console.WriteLine("\nEnter student's roll number:");
                    studentController.CheckNewStudent(Console.ReadLine());
                    break;

                case 5:
                    Console.WriteLine("\nProgram exited successfully.");
                    return;

                default:
                    Console.WriteLine("Not a choice");
                    break;
                }
            }
        }