Beispiel #1
0
        private void roomLabelForTeacherView_DoubleClick(object sender, System.EventArgs e)
        {
            Label       roomLabel  = (Label)sender;
            IEnumerator enumerator = _allSubLabels.GetEnumerator();

            enumerator.MoveNext();
            Label[]    oneSubLabel  = (Label [])enumerator.Current;
            Label      courseLabel1 = oneSubLabel[0];
            Course     course       = (Course)courseLabel1.Tag;
            EduProgram ep           = (EduProgram)course.Parent;

            ArrayList [,] mytt = ep.getTimetable();
            ArrayList lessonsInOneTimeSlot = mytt[_indexRow, _indexCol];

            Object [] courseAndRoomPair = null;
            foreach (Object [] courseAndRoomPairCC in lessonsInOneTimeSlot)
            {
                Course courseCheck = (Course)courseAndRoomPairCC[0];
                if (courseCheck == course)
                {
                    courseAndRoomPair = courseAndRoomPairCC;
                    break;
                }
            }

            Room      currRoom     = (Room)roomLabel.Tag;
            ArrayList allowedRooms = calculateAllAllowedRooms(course, _indexRow, _indexCol);

            allowedRooms.Add(currRoom);

            roomLabel.BackColor = System.Drawing.Color.DarkOrange;

            RoomSelectionForm cu = new RoomSelectionForm(roomLabel, allowedRooms, currRoom, course, courseAndRoomPair);

            cu.ShowDialog(AppForm.getAppForm());
            if (cu.DialogResult == DialogResult.OK)
            {
                Room newRoom = cu.getSelectedRoom();

                ChooseRoomTSPTeachersViewCmd cuCmd = new ChooseRoomTSPTeachersViewCmd(courseAndRoomPair, course, currRoom, newRoom, roomLabel, _indexRow, _indexCol);
                CommandProcessor.getCommandProcessor().doCmd(cuCmd);
            }

            cu.Dispose();
            roomLabel.BackColor = System.Drawing.SystemColors.ControlLight;
        }
Beispiel #2
0
        private void roomLabelForCoursesView_DoubleClick(object sender, System.EventArgs e)
        {
            Label roomLabel = (Label)sender;
            int   subIndex  = getSubLabelIndex(roomLabel);

            ArrayList [,] mytt = AppForm.CURR_OCTT_DOC.ShownEduProgram.getTimetable();
            ArrayList   lessonsInOneTimeSlot = mytt[_indexRow, _indexCol];
            IEnumerator enumerator           = lessonsInOneTimeSlot.GetEnumerator();

            for (int k = 0; k <= subIndex; k++)
            {
                enumerator.MoveNext();
            }

            Object [] courseAndRoomPair = (Object [])enumerator.Current;
            Room      currRoom          = (Room)courseAndRoomPair[1];
            Course    course            = (Course)courseAndRoomPair[0];
            ArrayList allowedRooms      = calculateAllAllowedRooms(course, _indexRow, _indexCol);

            allowedRooms.Add(currRoom);

            roomLabel.BackColor = System.Drawing.Color.DarkOrange;

            RoomSelectionForm cu = new RoomSelectionForm(roomLabel, allowedRooms, currRoom, course, courseAndRoomPair);

            cu.ShowDialog(AppForm.getAppForm());
            if (cu.DialogResult == DialogResult.OK)
            {
                Room newRoom = cu.getSelectedRoom();

                ChooseRoomTSPCoursesViewCmd cuCmd = new ChooseRoomTSPCoursesViewCmd(courseAndRoomPair, course, currRoom, newRoom, roomLabel, _indexRow, _indexCol);
                CommandProcessor.getCommandProcessor().doCmd(cuCmd);
            }
            cu.Dispose();
            roomLabel.BackColor = System.Drawing.SystemColors.ControlLight;
        }