コード例 #1
0
 public Students(string fn, string ln, Groups grp, JournalAccess jour)
 {
     Firstname = fn;
     Lastname  = ln;
     grp.AddStudent(new Students(fn, ln));
     group   = grp.indGroup;
     journal = jour;
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: Lxx2424/Console-03.02.2020
        static void Main(string[] args)
        {
            string userInput;
            Groups grp = new Groups();

            grp.GroupName = "K101";
            do
            {
                Console.WriteLine("1.Add Student to Group");
                Console.WriteLine("2.Add Student to Exam ");
                Console.WriteLine("3.Show Students");
                Console.WriteLine("4.Exit");
                userInput = Console.ReadLine();
                switch (userInput)
                {
                case "1":
                    grp.AddStudent();
                    break;

                case "2":
                    grp.ShowStudents();
                    break;

                case "3":
                    foreach (var stu in grp.StudentList)
                    {
                        Console.ForegroundColor = ConsoleColor.Cyan;
                        Console.WriteLine($"\nStudents:{stu.Firstname} {stu.Lastname}");
                        foreach (var exam in stu.examList)
                        {
                            Console.ForegroundColor = ConsoleColor.DarkYellow;
                            Console.WriteLine($"\nExamName:{exam.ExamName}");
                        }
                    }
                    break;

                default:
                    break;
                }
            } while (userInput != "4");
        }