Exemplo n.º 1
0
        private void delTerm_Click(object sender, System.EventArgs e)
        {
            if (ModelOperations.checkIfTermIsEmpty(_index))
            {
                DeleteTermCmd dtCmd = new DeleteTermCmd(_index);
                CommandProcessor.getCommandProcessor().doCmd(dtCmd);
            }
            else
            {
                string message;

                if (AppForm.CURR_OCTT_DOC.DocumentType == Constants.OCTT_DOC_TYPE_UNIVERSITY)
                {
                    message = RES_MANAGER.GetString("delTerm_Click.msb.termnotdeleted.university.message");
                }
                else
                {
                    message = RES_MANAGER.GetString("delTerm_Click.msb.termnotdeleted.school.message");
                }

                string            caption = RES_MANAGER.GetString("delTerm_Click.msb.termnotdeleted.caption");
                MessageBoxButtons buttons = MessageBoxButtons.OK;

                MessageBox.Show(this, message, caption, buttons,
                                MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
            }
        }
Exemplo n.º 2
0
        public override void doit()
        {
            AppForm.CURR_OCTT_DOC.setIsDayIncluded(_guiIndex, false);
            ModelOperations.delDayInModel(_dayIndexInModel, out _undoRedoLists);

            AppForm.getAppForm().refreshGUIAfterDaysTermsChange(true);

            if (_tabIndex == 0)
            {
                AppForm.CURR_OCTT_DOC.CTVSelectedNode = _workingNode;
                AppForm.getAppForm().ctvRefreshTimetablePanel(_workingNode, true, true);

                AppForm.getAppForm().getCoursesTreeView().AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().coursesTreeView_AfterSelect);
                AppForm.getAppForm().getCoursesTreeView().SelectedNode = _workingNode;
                AppForm.getAppForm().getCoursesTreeView().AfterSelect += new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().coursesTreeView_AfterSelect);
            }
            else if (_tabIndex == 1)
            {
                AppForm.getAppForm().getTeachersTreeView().AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().teachersTreeView_AfterSelect);
                AppForm.getAppForm().getTeachersTreeView().SelectedNode = _workingNode;
                AppForm.getAppForm().getTeachersTreeView().AfterSelect += new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().teachersTreeView_AfterSelect);

                AppForm.CURR_OCTT_DOC.TTVSelectedNode = _workingNode;
                AppForm.getAppForm().ttvRefreshTimetablePanel(_workingNode, true);
            }
            else if (_tabIndex == 2)
            {
                AppForm.getAppForm().getRoomsTreeView().AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().roomsTreeView_AfterSelect);
                AppForm.getAppForm().getRoomsTreeView().SelectedNode = _workingNode;
                AppForm.getAppForm().getRoomsTreeView().AfterSelect += new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().roomsTreeView_AfterSelect);

                AppForm.CURR_OCTT_DOC.RTVSelectedNode = _workingNode;
                AppForm.getAppForm().rtvRefreshTimetablePanel(_workingNode, true);
            }
        }
Exemplo n.º 3
0
        public override void doit()
        {
            ModelOperations.addTermInModel(_index);
            AppForm.CURR_OCTT_DOC.IncludedTerms.Insert(_index, _termData);

            AppForm.getAppForm().refreshGUIAfterDaysTermsChange(true);
        }
Exemplo n.º 4
0
        private void _findButton_Click(object sender, System.EventArgs e)
        {
            this.ClientSize = new System.Drawing.Size(528, 410);

            if (_resultsListView == null)
            {
                _resultsListView = new ListView();
                ColumnHeader columnHeader1 = new ColumnHeader();

                _resultsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
                    columnHeader1
                });
                _resultsListView.FullRowSelect = true;
                _resultsListView.GridLines     = true;
                _resultsListView.Location      = new System.Drawing.Point(24, 192);
                _resultsListView.MultiSelect   = false;
                _resultsListView.Name          = "_resultsListView";
                _resultsListView.Size          = new System.Drawing.Size(488, 195);
                _resultsListView.TabIndex      = 10;
                _resultsListView.View          = System.Windows.Forms.View.Details;



                columnHeader1.Width = 484;

                this._resultsListView.SmallImageList = AppForm.getAppForm().getTreeImageList();

                this._resultsListView.SelectedIndexChanged += new System.EventHandler(this._resultsListView_SelectedIndexChanged);

                this.Controls.Add(_resultsListView);
            }
            else
            {
                _resultsListView.Items.Clear();
            }

            LAST_SEARCHED_FOR = _searchForTextBox.Text.Trim();

            if (radioButton1.Checked)
            {
                LAST_SEARCHED_TYPE = 0;
            }
            else if (radioButton2.Checked)
            {
                LAST_SEARCHED_TYPE = 1;
            }
            else
            {
                LAST_SEARCHED_TYPE = 2;
            }

            _findButton.Enabled = false;

            ModelOperations.searchForStringInDocument(_searchForTextBox.Text.Trim(), _resultsListView, LAST_SEARCHED_TYPE);

            _resultsListView.Columns[0].Text = RES_MANAGER.GetString("_resultsListView.Column.Text1") + " " + _resultsListView.Items.Count + " - " + RES_MANAGER.GetString("_resultsListView.Column.Text2") + " '" + _searchForTextBox.Text.Trim() + "'";
        }
Exemplo n.º 5
0
        public override void doit()
        {
            foreach (int n in _toAddList)
            {
                AppForm.CURR_OCTT_DOC.setIsDayIncluded(n, true);
                int dayIndexInModel = AppForm.CURR_OCTT_DOC.getDayIndexInModel(n);
                ModelOperations.addDayInModel(dayIndexInModel);
            }

            AppForm.getAppForm().refreshGUIAfterDaysTermsChange(true);
        }
Exemplo n.º 6
0
        public override void undo()
        {
            foreach (int n in _toAddList)
            {
                int          dayIndexInModel = AppForm.CURR_OCTT_DOC.getDayIndexInModel(n);
                ArrayList [] urLists;
                ModelOperations.delDayInModel(dayIndexInModel, out urLists);
                AppForm.CURR_OCTT_DOC.setIsDayIncluded(n, false);
            }

            AppForm.getAppForm().getTreeTabControl().SelectedIndexChanged -= new System.EventHandler(AppForm.getAppForm().treeTabControl_SelectedIndexChanged);
            AppForm.getAppForm().getTreeTabControl().SelectedIndex         = _tabIndex;
            AppForm.getAppForm().getTreeTabControl().SelectedIndexChanged += new System.EventHandler(AppForm.getAppForm().treeTabControl_SelectedIndexChanged);

            //AppForm.getAppForm().refreshGUIAfterDaysTermsChange(false);
            AppForm.getAppForm().refreshGUIAfterDaysTermsChange(_calledFromMainForm);


            if (_tabIndex == 0)
            {
                AppForm.CURR_OCTT_DOC.CTVSelectedNode = _workingNode;
                AppForm.getAppForm().ctvRefreshTimetablePanel(_workingNode, true, true);

                AppForm.getAppForm().getCoursesTreeView().AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().coursesTreeView_AfterSelect);
                AppForm.getAppForm().getCoursesTreeView().SelectedNode = _workingNode;
                AppForm.getAppForm().getCoursesTreeView().AfterSelect += new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().coursesTreeView_AfterSelect);
            }
            else if (_tabIndex == 1)
            {
                AppForm.getAppForm().getTeachersTreeView().AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().teachersTreeView_AfterSelect);
                AppForm.getAppForm().getTeachersTreeView().SelectedNode = _workingNode;
                AppForm.getAppForm().getTeachersTreeView().AfterSelect += new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().teachersTreeView_AfterSelect);

                AppForm.CURR_OCTT_DOC.TTVSelectedNode = _workingNode;
                AppForm.getAppForm().ttvRefreshTimetablePanel(_workingNode, true);
            }
            else if (_tabIndex == 2)
            {
                AppForm.getAppForm().getRoomsTreeView().AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().roomsTreeView_AfterSelect);
                AppForm.getAppForm().getRoomsTreeView().SelectedNode = _workingNode;
                AppForm.getAppForm().getRoomsTreeView().AfterSelect += new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().roomsTreeView_AfterSelect);

                AppForm.CURR_OCTT_DOC.RTVSelectedNode = _workingNode;
                AppForm.getAppForm().rtvRefreshTimetablePanel(_workingNode, true);
            }
        }
Exemplo n.º 7
0
        private void printForTeachers()
        {
            ArrayList listForPrint = new ArrayList();

            foreach (TreeNode tn in _treeView1.Nodes)
            {
                if (tn.Checked)
                {
                    listForPrint.Add((Teacher)tn.Tag);
                }
            }

            if (listForPrint.Count > 0)
            {
                ArrayList pdfReportDataTablesList = ModelOperations.getPdfSharpReportDataTablesList(listForPrint, 2);
                PdfCreator.createPdfDocument(pdfReportDataTablesList);
            }
        }
Exemplo n.º 8
0
        public override void redo()
        {
            ModelOperations.addTermInModel(_index);
            AppForm.CURR_OCTT_DOC.IncludedTerms.Insert(_index, _termData);

            AppForm.getAppForm().getTreeTabControl().SelectedIndexChanged -= new System.EventHandler(AppForm.getAppForm().treeTabControl_SelectedIndexChanged);
            AppForm.getAppForm().getTreeTabControl().SelectedIndex         = _tabIndex;
            AppForm.getAppForm().getTreeTabControl().SelectedIndexChanged += new System.EventHandler(AppForm.getAppForm().treeTabControl_SelectedIndexChanged);

            //AppForm.getAppForm().refreshGUIAfterDaysTermsChange(false);
            AppForm.getAppForm().refreshGUIAfterDaysTermsChange(_calledFromMainForm);

            if (_tabIndex == 0)
            {
                AppForm.CURR_OCTT_DOC.CTVSelectedNode = _workingNode;
                AppForm.getAppForm().ctvRefreshTimetablePanel(_workingNode, true, true);

                AppForm.getAppForm().getCoursesTreeView().AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().coursesTreeView_AfterSelect);
                AppForm.getAppForm().getCoursesTreeView().SelectedNode = _workingNode;
                AppForm.getAppForm().getCoursesTreeView().AfterSelect += new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().coursesTreeView_AfterSelect);
            }
            else if (_tabIndex == 1)
            {
                AppForm.getAppForm().getTeachersTreeView().AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().teachersTreeView_AfterSelect);
                AppForm.getAppForm().getTeachersTreeView().SelectedNode = _workingNode;
                AppForm.getAppForm().getTeachersTreeView().AfterSelect += new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().teachersTreeView_AfterSelect);

                AppForm.CURR_OCTT_DOC.TTVSelectedNode = _workingNode;
                AppForm.getAppForm().ttvRefreshTimetablePanel(_workingNode, true);
            }
            else if (_tabIndex == 2)
            {
                AppForm.getAppForm().getRoomsTreeView().AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().roomsTreeView_AfterSelect);
                AppForm.getAppForm().getRoomsTreeView().SelectedNode = _workingNode;
                AppForm.getAppForm().getRoomsTreeView().AfterSelect += new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().roomsTreeView_AfterSelect);

                AppForm.CURR_OCTT_DOC.RTVSelectedNode = _workingNode;
                AppForm.getAppForm().rtvRefreshTimetablePanel(_workingNode, true);
            }
        }
Exemplo n.º 9
0
        private void printForEduPrograms()
        {
            ArrayList listForPrint = new ArrayList();

            foreach (TreeNode tn in _treeView1.Nodes)
            {
                if (tn.Nodes.Count > 0)
                {
                    foreach (TreeNode tnSub in tn.Nodes)
                    {
                        if (tnSub.Checked)
                        {
                            listForPrint.Add((EduProgram)tnSub.Tag);
                        }
                    }
                }
            }

            if (listForPrint.Count > 0)
            {
                ArrayList pdfReportDataTablesList = ModelOperations.getPdfSharpReportDataTablesList(listForPrint, 1);
                PdfCreator.createPdfDocument(pdfReportDataTablesList);
            }
        }
Exemplo n.º 10
0
        public override void undo()
        {
            AppForm.CURR_OCTT_DOC.setIsDayIncluded(_guiIndex, true);

            ModelOperations.addDayInModel(_dayIndexInModel);

            ArrayList epgURList      = _undoRedoLists[0];
            ArrayList epURList       = _undoRedoLists[1];
            ArrayList teachersURList = _undoRedoLists[2];
            ArrayList roomsURList    = _undoRedoLists[3];

            foreach (object [] oneItem in epgURList)
            {
                EduProgramGroup epg = (EduProgramGroup)oneItem[0];
                bool [,] epgAllowedTimeSlotsUR = (bool[, ])oneItem[1];

                for (int j = 0; j < AppForm.CURR_OCTT_DOC.IncludedTerms.Count; j++)
                {
                    epg.getAllowedTimeSlots()[j, _dayIndexInModel] = epgAllowedTimeSlotsUR[j, 0];
                }
            }

            foreach (object [] oneItem in epURList)
            {
                EduProgram ep = (EduProgram)oneItem[0];
                bool [,] epAllowedTimeSlotsUR = (bool[, ])oneItem[1];

                for (int j = 0; j < AppForm.CURR_OCTT_DOC.IncludedTerms.Count; j++)
                {
                    ep.getAllowedTimeSlots()[j, _dayIndexInModel] = epAllowedTimeSlotsUR[j, 0];
                }
            }


            foreach (object [] oneItem in teachersURList)
            {
                Teacher teacher = (Teacher)oneItem[0];
                bool [,] teacherAllowedTimeSlotsUR = (bool[, ])oneItem[1];

                for (int j = 0; j < AppForm.CURR_OCTT_DOC.IncludedTerms.Count; j++)
                {
                    teacher.getAllowedTimeSlots()[j, _dayIndexInModel] = teacherAllowedTimeSlotsUR[j, 0];
                }
            }


            foreach (object [] oneItem in roomsURList)
            {
                Room room = (Room)oneItem[0];
                bool [,] roomAllowedTimeSlotsUR = (bool[, ])oneItem[1];

                for (int j = 0; j < AppForm.CURR_OCTT_DOC.IncludedTerms.Count; j++)
                {
                    room.getAllowedTimeSlots()[j, _dayIndexInModel] = roomAllowedTimeSlotsUR[j, 0];
                }
            }

            AppForm.getAppForm().getTreeTabControl().SelectedIndexChanged -= new System.EventHandler(AppForm.getAppForm().treeTabControl_SelectedIndexChanged);
            AppForm.getAppForm().getTreeTabControl().SelectedIndex         = _tabIndex;
            AppForm.getAppForm().getTreeTabControl().SelectedIndexChanged += new System.EventHandler(AppForm.getAppForm().treeTabControl_SelectedIndexChanged);

            AppForm.getAppForm().refreshGUIAfterDaysTermsChange(false);

            if (_tabIndex == 0)
            {
                AppForm.CURR_OCTT_DOC.CTVSelectedNode = _workingNode;
                AppForm.getAppForm().ctvRefreshTimetablePanel(_workingNode, true, true);

                AppForm.getAppForm().getCoursesTreeView().AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().coursesTreeView_AfterSelect);
                AppForm.getAppForm().getCoursesTreeView().SelectedNode = _workingNode;
                AppForm.getAppForm().getCoursesTreeView().AfterSelect += new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().coursesTreeView_AfterSelect);
            }
            else if (_tabIndex == 1)
            {
                AppForm.getAppForm().getTeachersTreeView().AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().teachersTreeView_AfterSelect);
                AppForm.getAppForm().getTeachersTreeView().SelectedNode = _workingNode;
                AppForm.getAppForm().getTeachersTreeView().AfterSelect += new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().teachersTreeView_AfterSelect);

                AppForm.CURR_OCTT_DOC.TTVSelectedNode = _workingNode;
                AppForm.getAppForm().ttvRefreshTimetablePanel(_workingNode, true);
            }
            else if (_tabIndex == 2)
            {
                AppForm.getAppForm().getRoomsTreeView().AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().roomsTreeView_AfterSelect);
                AppForm.getAppForm().getRoomsTreeView().SelectedNode = _workingNode;
                AppForm.getAppForm().getRoomsTreeView().AfterSelect += new System.Windows.Forms.TreeViewEventHandler(AppForm.getAppForm().roomsTreeView_AfterSelect);

                AppForm.CURR_OCTT_DOC.RTVSelectedNode = _workingNode;
                AppForm.getAppForm().rtvRefreshTimetablePanel(_workingNode, true);
            }
        }