Esempio n. 1
0
        private void tsbCreateClearShedule_Click(object sender, EventArgs e)
        {
            if (!CheckInputData)
            {
                return;
            }

            CreateSheduleForm frmShedule = new CreateSheduleForm(false, new DateTime(DateTime.Now.Year, 9, 1), new DateTime(DateTime.Now.Year, 12, 31));

            if (frmShedule.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            Schedule = new ScheduleWeeks(Rooms, GetSetting(getWeeksInSem(frmShedule.FirstDaySem, frmShedule.LastDaySem)), frmShedule.FirstDaySem, frmShedule.LastDaySem);
            UpdateTableShedule();

            WatchTriggerStateChange(true);

            if (dgvSchedule.ColumnCount <= 0)
            {
                cmbView.Enabled = false;
            }
            else
            {
                cmbView.Enabled = true;
            }

            curSheduleType = scheduleType.leesons;
        }
Esempio n. 2
0
        private void tsiCreate_Exam_Click(object sender, EventArgs e)
        {
            if (!CheckInputData)
            {
                return;
            }

            CreateSheduleForm frmShedule = new CreateSheduleForm(true, new DateTime(DateTime.Now.Year + 2, 1, 1), new DateTime(DateTime.Now.Year + 2, 1, 31));

            if (frmShedule.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            SettingShedule settingBuf1 = GetSetting(getWeeksInSem(frmShedule.FirstDaySem, frmShedule.LastDaySem));

            settingBuf1.CountLessonsOfDay        = 1;
            settingBuf1.FirstLessonsOfWeekDay    = 1;
            settingBuf1.FirstLessonsOfWeekEnd    = 1;
            settingBuf1.LastLessonsOfWeekDay     = 1;
            settingBuf1.LastLessonsOfWeekEnd     = 1;
            settingBuf1.MaxCountLessonsOfWeekDay = 1;
            settingBuf1.MaxCountLessonsOfWeekEnd = 1;
            Schedule = new ScheduleWeeks(Rooms, settingBuf1, frmShedule.FirstDaySem, frmShedule.LastDaySem);
            UpdateTableShedule();

            WatchTriggerStateChange(true);

            if (dgvSchedule.ColumnCount <= 0)
            {
                cmbView.Enabled = false;
            }
            else
            {
                cmbView.Enabled = true;
            }

            curSheduleType = scheduleType.exams;
        }
Esempio n. 3
0
        private void tsbCreateShedule_Click(object sender, EventArgs e)
        {
            if (!CheckInputData)
            {
                return;
            }

            CreateSheduleForm frmShedule = new CreateSheduleForm(false, new DateTime(DateTime.Now.Year, 9, 1), new DateTime(DateTime.Now.Year, 12, 31));

            if (frmShedule.ShowDialog() != System.Windows.Forms.DialogResult.OK)
            {
                return;
            }

            ScheduleGenerator reactor = new ScheduleGenerator(EducationAdapter, Rooms,
                                                              GetSetting(getWeeksInSem(frmShedule.FirstDaySem, frmShedule.LastDaySem)),
                                                              frmShedule.FirstDaySem, frmShedule.LastDaySem, Schedule == null ? new Employments() : Schedule.Employments);

            Schedule = reactor.Generate();

            UpdateTableShedule();

            UpdateDistributeList(reactor.Results);

            WatchTriggerStateChange(false);

            if (dgvSchedule.ColumnCount <= 0)
            {
                cmbView.Enabled = false;
            }
            else
            {
                cmbView.Enabled = true;
            }

            curSheduleType = scheduleType.leesons;
        }