예제 #1
0
        public static void SynthDataAssigment()
        {
            string[]   AssTitle     = { "NooB,", "NooB1,", "NooB3," };
            string[]   AssDescr     = { "Develop,", "Analyze,", "Execute," };
            DateTime[] AssDateTime  = { new DateTime(2019, 6, 5), new DateTime(2019, 6, 11), new DateTime(2020, 7, 9), new DateTime(2021, 8, 7) };
            int[]      AssOralMark  = { 56, 78, 98 };
            int[]      AssTotalMark = { 55, 77, 97 };

            Random random  = new Random();
            Random random1 = new Random();

            for (int i = 0; i < 3; i++)
            {
                Assigment assigment = new Assigment(AssTitle[i], AssDescr[i], AssDateTime[i], AssOralMark[i], AssTotalMark[i]);
                AddAssigment(assigment);

                assigment.Courses.Add(Course.Courses[random.Next(0, Course.Courses.Count)]);
                assigment.Students.Add(Student.Students[random1.Next(0, Student.Students.Count)]);
            }
        }
예제 #2
0
        public static void InputDataAssigment()
        {
            Console.Write("Enter the Title: ");
            string title = Console.ReadLine();

            Console.Write("Enter a description: ");
            string description = Console.ReadLine();

            Console.Write("Enter the deadline (yy/mm/dd): ");
            DateTime subDateTime = DateTime.Parse(Console.ReadLine());

            Console.Write("Enter the oral mark");
            int oralMark = Convert.ToInt32(Console.ReadLine());

            Console.Write("Enter the total mark");
            int totalMark = Convert.ToInt32(Console.ReadLine());

            Assigment assigment = new Assigment(title, description, subDateTime, oralMark, totalMark);

            Assigment.Assigments.Add(assigment);
        }
예제 #3
0
 public static void AddAssigment(Assigment assigment)
 {
     Assigments.Add(assigment);
 }
        static void Main(string[] args)
        {
            int    option1, option2, option3;
            string answer;

            do
            {
                Console.WriteLine("Do you want to use synthetic data? (y/n)");
                answer = Console.ReadLine();
            } while (answer != "y" && answer != "n");
            if (answer == "y")
            {
                Course.SynthDataCourse();
                Student.SynthDataStudent();
                Trainer.SynthDataTrainer();
                Assigment.SynthDataAssigment();
            }

            do
            {
                do
                {
                    Console.WriteLine("");
                    Console.WriteLine("1) Create an Entite: ");
                    Console.WriteLine("2) Preview Entites: ");
                    Console.WriteLine("3) Exit: ");

                    Console.Write("Choose an option: ");
                } while (!int.TryParse(Console.ReadLine(), out option1));


                MainMenu mainMenu = (MainMenu)option1;

                switch (mainMenu)
                {
                case MainMenu.AddEntity:
                    //Console.WriteLine("1) Create an Entity ");
                    do
                    {
                        do
                        {
                            Console.WriteLine("");
                            Console.WriteLine("1) Create a new Student: ");
                            Console.WriteLine("2) Create a new Course: ");
                            Console.WriteLine("3) Create a new Trainer: ");
                            Console.WriteLine("4) Create a new Assigment: ");
                            Console.WriteLine("5) Previous Menu<== ");

                            Console.Write("Choose an option: ");
                        } while (!int.TryParse(Console.ReadLine(), out option2));

                        AddEntity addEntity = (AddEntity)option2;

                        switch (addEntity)
                        {
                        case AddEntity.AddStudent:
                            Student.InputDataStudent();
                            break;

                        case AddEntity.AddCourse:
                            Course.InputDataCourse();
                            //Console.WriteLine("2) Create a new Course ");
                            break;

                        case AddEntity.AddTrainer:
                            Trainer.InputDataTrainer();
                            //Console.WriteLine("3) Create a new Trainer ");
                            break;

                        case AddEntity.AddAssigment:
                            Assigment.InputDataAssigment();
                            //Console.WriteLine("4) Create a new Assigment ");
                            break;

                        case AddEntity.PreviousMenu:
                            break;
                        }
                    }while(option2 != 5);
                    break;

                //case MainMenu.SynthData:
                //    break;
                case MainMenu.ShowData:
                    //Console.WriteLine("2) Preview ");
                    do
                    {
                        do
                        {
                            Console.WriteLine("1) Show me Students: ");
                            Console.WriteLine("2) Show me Course: ");
                            Console.WriteLine("3) Show me Trainers: ");
                            Console.WriteLine("4) Show me Assigments: ");
                            Console.WriteLine("5) Previous Menu<== ");

                            Console.Write("Choose an option: ");
                        } while (!int.TryParse(Console.ReadLine(), out option3));

                        ShowData showData = (ShowData)option3;

                        switch (showData)
                        {
                        case ShowData.ShowStudent:
                            Console.WriteLine("");
                            Student.OutputStudentData();
                            Console.WriteLine("");
                            Console.WriteLine("Students per Course: ");
                            Student.StudentsPerCourse();
                            Console.WriteLine("");
                            Console.WriteLine("More than one Student per Course: ");
                            Console.WriteLine(" ");
                            Student.MoreThanOneStudent();
                            //Console.Write("");
                            break;

                        case ShowData.ShowCourse:
                            Console.WriteLine("");
                            Course.OutputCourseData();
                            Console.WriteLine("");
                            break;

                        case ShowData.ShowTrainer:
                            Trainer.OutputTrainerData();
                            Trainer.TrainersPerCourse();
                            break;

                        case ShowData.ShowAssigment:
                            Assigment.OutputAssigmentData();
                            Console.WriteLine("");
                            Console.WriteLine(" Assigments Per Course: ");
                            Console.WriteLine("");
                            Assigment.AssigmentsPerCourse();
                            Console.WriteLine("");
                            Console.WriteLine(" Assigments Per Student: ");
                            Console.WriteLine("");
                            Assigment.AssigmentsPerStudent();

                            break;

                        case ShowData.PreviousMenu:
                            break;
                        }
                    } while (option3 != 5);
                    break;

                case MainMenu.Exit:
                    break;

                default:
                    break;
                }
            } while (option1 != 3);
        }