コード例 #1
0
ファイル: Program.cs プロジェクト: 19006041/StudentTracker
        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(file);

            if (selection == 0)
            {
                Console.Write("CAMPUS         >> ");
                string          campus = Console.ReadLine();
                FullTimeStudent fts    = new FullTimeStudent(id, fName, lName, true, campus);
                StudentWorker.addStudent(fts);
                fw.addToFile(StudentFormatter.formatForWrite(fts));
            }
            else
            {
                Console.Write("FACILITATOR    >> ");
                string          facilitator = Console.ReadLine();
                DistanceStudent dts         = new DistanceStudent(id, fName, lName, true, facilitator);
                StudentWorker.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();
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: 19006041/StudentTracker
        static void viewStudents()
        {
            Console.Clear();

            System.Console.WriteLine("");

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

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

            mainMenu();
        }