Esempio n. 1
0
 //TimetableWPVs _wpvs
 public void printTimetable(string _professorName, TimetableCourses _courses, TimetableRooms _rooms, TimetableWPVs _wpvs)
 {
     string[] dayNames = { "Monday", "Thuesday", "Wednesday", "Thursday", "Friday" };
     Dictionary <string, List <Dozenti> >[] timesOfDaysDozenti = { this.blocksOfMonday, this.blocksOfThuesday, this.blocksOfWednesday, this.blocksOfThursday, this.blocksOfFriday };
     for (int day = 0; day < timesOfDaysDozenti.Length; day++)
     {
         for (int block = 1; block < 7; block++)
         {
             for (int i = 0; i < timesOfDaysDozenti[day][block + ".Block"].Count; i++)
             {
                 Dozenti dozent = timesOfDaysDozenti[day][block + ".Block"][i];
                 if (dozent.name == _professorName)
                 {
                     Console.WriteLine(dayNames[day] + ": " + block + ".Block: " +
                                       _courses.days[dayNames[day]][block + ".Block"][i].name + ": " +
                                       _rooms.days[dayNames[day]][block + ".Block"][i].roomnumber);
                 }
             }
             //For-Schleife war noch nicht drinnen
             for (int j = 0; j < _wpvs.days[dayNames[day]][block + ".Block"].Count; j++)
             {
                 WPVs wpv = _wpvs.days[dayNames[day]][block + ".Block"][j];
                 if (wpv.professor == _professorName)
                 {
                     Console.WriteLine(dayNames[day] + ": " + block + ".Block: " +
                                       wpv.name + ": " + wpv.assignedRoom.roomnumber);
                 }
             }
         }
     }
 }
Esempio n. 2
0
        private void insertObjectsInTimetable(List <Rooms> _listRooms, TimetableCourses _timetableCourses)
        {
            Dictionary <string, List <Rooms> >[]   timesOfDaysRooms   = { this.blocksOfMonday, this.blocksOfThuesday, this.blocksOfWednesday, this.blocksOfThursday, this.blocksOfFriday };
            Dictionary <string, List <Courses> >[] timesOfDaysCourses = { _timetableCourses.blocksOfMonday, _timetableCourses.blocksOfThuesday, _timetableCourses.blocksOfWednesday, _timetableCourses.blocksOfThursday, _timetableCourses.blocksOfFriday };

            for (int day = 0; day < timesOfDaysCourses.Length; day++)
            {
                for (int block = 1; block < 7; block++)
                {
                    for (int i = 0; i < timesOfDaysCourses[day][block + ".Block"].Count; i++)
                    {
                        Courses course = timesOfDaysCourses[day][block + ".Block"][i];
                        for (int j = 0; j < _listRooms.Count; j++)
                        {
                            if (compareCapacity(_listRooms[j], course) && compareInterior(_listRooms[j], course))
                            {
                                timesOfDaysRooms[day][block + ".Block"].Add(_listRooms[j]);
                                _listRooms.Add(_listRooms[j]);
                                _listRooms.Remove(_listRooms[j]);
                                break;
                            }
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        public TimetableRooms(List <Rooms> _listRooms, TimetableCourses _tableCourses, TimetableWPVs _tableWPVs)
        {
            fillDictionaries();

            days.Add("Monday", blocksOfMonday);
            days.Add("Thuesday", blocksOfThuesday);
            days.Add("Wednesday", blocksOfWednesday);
            days.Add("Thursday", blocksOfThursday);
            days.Add("Friday", blocksOfFriday);

            insertObjectsInTimetable(_listRooms, _tableCourses);
            assignRoomsToWPVs(_listRooms, _tableWPVs);
        }
Esempio n. 4
0
        public void printTimetable(string _roomNumber, TimetableCourses _tableCourses, TimetableDozenti _tableDozenti)
        {
            string[] dayNames = { "Monday", "Thuesday", "Wednesday", "Thursday", "Friday" };
            Dictionary <string, List <Rooms> >[] timesOfDaysRooms = { this.blocksOfMonday, this.blocksOfThuesday, this.blocksOfWednesday, this.blocksOfThursday, this.blocksOfFriday };
            for (int day = 0; day < timesOfDaysRooms.Length; day++)
            {
                for (int block = 1; block < 7; block++)
                {
                    for (int i = 0; i < timesOfDaysRooms[day][block + ".Block"].Count; i++)
                    {
                        Rooms room = timesOfDaysRooms[day][block + ".Block"][i];

                        if (room.roomnumber == _roomNumber)
                        {
                            Console.WriteLine(dayNames[day] + ": " + block + ".Block: " +
                                              _tableCourses.days[dayNames[day]][block + ".Block"][i].name + ": " +
                                              _tableDozenti.days[dayNames[day]][block + ".Block"][i].name);
                        }
                    }
                }
            }
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            fillListsWithJsonData();

            TimetableWPVs    tableWPVs    = new TimetableWPVs(allWPVObjects);
            TimetableDozenti tableDozenti = new TimetableDozenti(allDozentiObjects, tableWPVs);
            TimetableCourses tableCourses = new TimetableCourses(allRegularCourseObjects, tableDozenti);
            TimetableRooms   tableRooms   = new TimetableRooms(allRoomsObjects, tableCourses, tableWPVs);

            bool runProgram = true;

            Console.WriteLine("Gooday Day, what would you like to do ?");

            while (runProgram == true)
            {
                Console.WriteLine("");
                Console.WriteLine("You can choose between 4 kinds Timetables");
                Console.WriteLine("1. Specific course of Study");
                Console.WriteLine("2. All Courses");
                Console.WriteLine("3. Professor");
                Console.WriteLine("4. Rooms");
                Console.WriteLine("5. Exit");
                Console.WriteLine("Please type in the number you want");
                string mode = Console.ReadLine();

                switch (mode)
                {
                case "1":
                    Console.Clear();
                    Console.WriteLine("Please, enter the name of the course of study you would like to see (MIB, OMB, MKB)");
                    string course = Console.ReadLine();
                    Console.WriteLine("Which Semester are you interested in ?");
                    string semesterString = Console.ReadLine();
                    int    semesterNumber = Int32.Parse(semesterString);
                    Console.Clear();
                    Console.WriteLine("");
                    tableCourses.printTimetable(course, semesterNumber, tableWPVs);
                    break;

                case "2":
                    Console.Clear();
                    Console.WriteLine("");
                    tableCourses.printAllCoursesTimetable(tableRooms);
                    break;

                case "3":
                    Console.Clear();
                    Console.WriteLine("Please, enter the name of the professor you are interested in");
                    string professorName = Console.ReadLine();
                    Console.WriteLine("");
                    tableDozenti.printTimetable(professorName, tableCourses, tableRooms, tableWPVs);     //tableWPVs
                    break;

                case "4":
                    Console.Clear();
                    Console.WriteLine("Please, enter the roomname you are interested in");
                    string roomName = Console.ReadLine();
                    Console.WriteLine("");
                    tableRooms.printTimetable(roomName, tableCourses, tableDozenti);
                    break;

                case "5":
                    Console.Clear();
                    runProgram = false;
                    break;

                default:
                    Console.Clear();
                    Console.WriteLine("Please, enter a valid number");
                    break;
                }
            }
        }