コード例 #1
0
        static void AddStudent(int selection)
        {
            Console.Write("STUDENT ID     : ");
            string id = Console.ReadLine();

            Console.Write("FIRST NAME     : ");
            string firstName = Console.ReadLine();

            Console.Write("LAST NAME      : ");
            string lastName = Console.ReadLine();

            StudentFile studentFile = new (filename);

            if (selection == 0)
            {
                Console.Write("CAMPUS         : ");
                string   campus = Console.ReadLine();
                FStudent fts    = new (id, firstName, lastName, true, campus);
                ListStorage.AddStudent(fts);
                studentFile.AddingToFile(Organizer.Format(fts));
            }
            else
            {
                Console.Write("LECTURER      : ");
                string   lecturer = Console.ReadLine();
                DStudent dts      = new(id, lecturer, firstName, lastName, true);
                ListStorage.AddStudent(dts);
                studentFile.AddingToFile(Organizer.Format(dts));
            }
            Console.WriteLine($"Student ID: {id} has been added to our system");
            Console.WriteLine("Press any key to go back ...");
            Console.ReadKey();
            AddStudentMenu();
        }
コード例 #2
0
 static void ViewStudents()
 {
     Console.Clear();
     Console.WriteLine("");
     Console.WriteLine(Organizer.StudentReport(ListStorage.GetStudents()));
     Console.WriteLine("\n\n\nPress any Key to go back ...");
     Console.ReadKey();
     MainMenu();
 }