Beispiel #1
0
        static void addStudent(int selection)
        {
            Console.Write("STUDENT ID     >> ");
            string id = Console.ReadLine();

            Console.Write("FIRST NAME     >> ");
            string fName = Console.ReadLine();

            Console.Write("LAST NAME      >> ");
            string lName = Console.ReadLine();

            FileWorker fw = new FileWorker(filename);

            if (selection == 0)
            {
                Console.Write("CAMPUS         >> ");
                string          campus = Console.ReadLine();
                FullTimeStudent fts    = new FullTimeStudent(id, fName, lName, true, campus);
                ListHolder.addStudent(fts);
                fw.addToFile(StudentFormatter.formatForWrite(fts));
            }
            else
            {
                Console.Write("FACILITATOR    >> ");
                string          facilitator = Console.ReadLine();
                DistanceStudent dts         = new DistanceStudent(id, fName, lName, true, facilitator);
                ListHolder.addStudent(dts);
                fw.addToFile(StudentFormatter.formatForWrite(dts));
            }

            System.Console.WriteLine($"Student with id {id} added");
            System.Console.WriteLine("Press any key to go back ...");
            Console.ReadKey();
            addStudentMenu();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            FileWorker fw = new FileWorker(filename);

            ListHolder.setStudents(fw.readFile());
            titleScreen();
            mainMenu();
        }
Beispiel #3
0
        static void viewStudents()
        {
            Console.Clear();
            Console.ForegroundColor = ConsoleColor.Cyan;
            System.Console.WriteLine("");

            System.Console.WriteLine(StudentFormatter.studentReport(ListHolder.getStudents()));

            System.Console.WriteLine("\n\n\nPress any Key to go back ...");
            Console.ReadKey();

            mainMenu();
        }