public override void doit() { AppForm.CURR_OCTT_DOC.incrUnallocatedLessonsCounter(1); Course course = (Course)_lviDroped.Tag; EduProgram eduProg = (EduProgram)course.Parent; string [] ulsEPSem = new string[3]; ulsEPSem[0] = course.getFullName(); string epText = ""; if (eduProg.getCode() != null) { epText = eduProg.getCode() + ", "; } epText += eduProg.getName(); ulsEPSem[1] = epText; ulsEPSem[2] = eduProg.getSemester(); ListViewItem newLvi = new ListViewItem(ulsEPSem); newLvi.Tag = course; _ullv.Items.Add(newLvi); _ullv.EnsureVisible(_ullv.Items.IndexOf(newLvi)); eduProg.getUnallocatedLessonsList().Add(_lviDroped); if (course.getCoursesToHoldTogetherList().Count > 0) { foreach (Course courseHT in course.getCoursesToHoldTogetherList()) { EduProgram epHT = (EduProgram)courseHT.Parent; ListViewItem lviNew = new ListViewItem(); lviNew.Tag = courseHT; epHT.getUnallocatedLessonsList().Add(lviNew); //add in ListView string [] ulsEPSemHT = new string[3]; ulsEPSemHT[0] = courseHT.getFullName(); string epTextHT = ""; if (epHT.getCode() != null) { epTextHT = epHT.getCode() + ", "; } epTextHT += epHT.getName(); ulsEPSemHT[1] = epTextHT; ulsEPSemHT[2] = epHT.getSemester(); ListViewItem newLviHT = new ListViewItem(ulsEPSemHT); newLviHT.Tag = courseHT; _ullv.Items.Add(newLviHT); } } AppForm.getAppForm().getStatusBarPanel2().Text = AppForm.CURR_OCTT_DOC.getNumOfUnallocatedLessonsStatusText(); }
public string getTSPTeachersAndRoomsTextForStatusBar() { string textForStatusBar = this.getFullName(); EduProgram ep = (EduProgram)this.Parent; if (AppForm.CURR_OCTT_DOC.DocumentType == Constants.OCTT_DOC_TYPE_UNIVERSITY) { textForStatusBar += ", " + ep.getName() + " " + ep.getCode() + "/" + ep.getSemester() + RES_MANAGER.GetString("getTSPTeachersAndRoomsTextForStatusBar.semester.university.text"); } else { textForStatusBar += ", " + ep.getName() + " " + ep.getCode() + "/" + ep.getSemester() + RES_MANAGER.GetString("getTSPTeachersAndRoomsTextForStatusBar.semester.school.text"); } return(textForStatusBar); }
public EduProgramPropertiesForm(EduProgram ep) : this() { _ep = ep; _isNew = false; this._codeTextBox.Text = _ep.getCode(); this._nameTextBox.Text = _ep.getName(); this._semesterTextBox.Text = _ep.getSemester(); this._extIDTextBox.Text = _ep.ExtID; }
public ChangeEduProgramDataCmd(EduProgram ep, string newName, string newCode, string newSemester, string newExtID) { _ep = ep; _oldName = _ep.getName(); _oldCode = _ep.getCode(); _oldSemester = _ep.getSemester(); _oldExtID = _ep.ExtID; _newName = newName; _newCode = newCode; _newSemester = newSemester; _newExtID = newExtID; }
private void Form_Load(object sender, System.EventArgs e) { _topLabel.Text = RES_MANAGER.GetString("Form_Load._topLabel.Text1") + " '" + _course.getFullName() + "' " + RES_MANAGER.GetString("Form_Load._topLabel.Text2"); if (_course.getCoursesToHoldTogetherList() != null) { _thtWorkingList = (ArrayList)_course.getCoursesToHoldTogetherList().Clone(); } foreach (Course tempCourse in _thtWorkingList) { string [] epgAndEpAndCourse = new string[3]; EduProgram ep = (EduProgram)tempCourse.Parent; EduProgramGroup epg = (EduProgramGroup)ep.Parent; String textEduProgram = ep.getName() + ", " + ep.getCode() + ", " + ep.getSemester() + ". " + RES_MANAGER.GetString("Form_Load.listView.textEduProgram.sem"); epgAndEpAndCourse[0] = epg.getName(); epgAndEpAndCourse[1] = textEduProgram; epgAndEpAndCourse[2] = tempCourse.getFullName(); ListViewItem newLvi = new ListViewItem(epgAndEpAndCourse); newLvi.Tag = tempCourse; _thtCoursesListView.Items.Add(newLvi); } this.fillPickListView(); if (_isFormDisabled) { this._thtPickListView.DoubleClick -= new System.EventHandler(this._thtPickListView_DoubleClick); this._thtCoursesListView.DoubleClick -= new System.EventHandler(this._thtCoursesListView_DoubleClick); this.Text += " - READ ONLY"; _okButton.Enabled = false; } }
public static ArrayList getPdfSharpReportDataTablesList(ArrayList listForPrint, int reportType) { Cursor.Current = Cursors.WaitCursor; ArrayList reportTablesList = new ArrayList(); /// int rowCount = AppForm.CURR_OCTT_DOC.IncludedTerms.Count; int columnCount = AppForm.CURR_OCTT_DOC.getNumberOfDays(); foreach (Object obj in listForPrint) { Object [] reportGroupAndTable = new object[2]; DataTable gdt = new DataTable(); for (int dd = 0; dd < columnCount; dd++) { gdt.Columns.Add("Day" + (dd + 1)); } ArrayList [,] mytt = null; Teacher teacher = null; Room room = null; string grName = null; if (obj is EduProgram) { EduProgram ep = (EduProgram)obj; mytt = ep.getTimetable(); grName = ep.getReportTitle(); } else if (obj is Teacher) { teacher = (Teacher)obj; grName = teacher.getReportTitle(); } else if (obj is Room) { room = (Room)obj; grName = room.getReportTitle(); } reportGroupAndTable[0] = grName; int foundInOneTSForTeacherAndRoom; for (int j = 0; j < rowCount; j++) { DataRow dr = gdt.NewRow(); for (int k = 0; k < columnCount; k++) { string timeSlotText = ""; dr["Day" + (k + 1)] = timeSlotText; foundInOneTSForTeacherAndRoom = 1; if (reportType == 1) { ArrayList lessonsInOneTimeSlot = mytt[j, k]; if (lessonsInOneTimeSlot != null && lessonsInOneTimeSlot.Count != 0) { int helpCounter = 1; foreach (Object [] courseAndRoomPair in lessonsInOneTimeSlot) { Room room11 = (Room)courseAndRoomPair[1]; Course course = (Course)courseAndRoomPair[0]; Teacher tcr = course.getTeacher(); string teacherText = tcr.getName().Substring(0, 1) + ". " + tcr.getLastName(); //string courseName=course.getReportName(); string courseName; if (Settings.TTREP_COURSE_FORMAT == 1) { courseName = course.getFullName(); } else { courseName = course.getReportName(); } string roomName = room11.getName(); if (helpCounter == 1) { timeSlotText += courseName + " @ " + roomName; } else { timeSlotText += "\n" + courseName + " @ " + roomName; } if (Settings.TTREP_PRINT_TEACHER_IN_TS == 1) { timeSlotText += " (" + teacherText + ")"; } helpCounter++; } dr["Day" + (k + 1)] = timeSlotText; } } else if (reportType == 2) { string lastUsedCourseName2 = null; foreach (EduProgramGroup epg in AppForm.CURR_OCTT_DOC.CoursesRootNode.Nodes) { foreach (EduProgram ep in epg.Nodes) { ArrayList [,] myttT = ep.getTimetable(); ArrayList lessonsInOneTimeSlot = myttT[j, k]; if (lessonsInOneTimeSlot != null && lessonsInOneTimeSlot.Count != 0) { foreach (Object [] courseAndRoomPair in lessonsInOneTimeSlot) { Course course = (Course)courseAndRoomPair[0]; Teacher teacherFromModel = course.getTeacher(); if (teacherFromModel == teacher) { Room room2 = (Room)courseAndRoomPair[1]; //string courseName=course.getReportName(); string courseName; if (Settings.TTREP_COURSE_FORMAT == 1) { courseName = course.getFullName(); } else { courseName = course.getReportName(); } string roomName = room2.getName(); if (foundInOneTSForTeacherAndRoom == 1) { timeSlotText += courseName + " @ " + roomName; } else { if (courseName != lastUsedCourseName2) { timeSlotText += "\n" + courseName + " @ " + roomName; } } lastUsedCourseName2 = courseName; foundInOneTSForTeacherAndRoom++; } } dr["Day" + (k + 1)] = timeSlotText; } } } } else if (reportType == 3) { string lastUsedCourseName3 = null; foreach (EduProgramGroup epg in AppForm.CURR_OCTT_DOC.CoursesRootNode.Nodes) { foreach (EduProgram ep in epg.Nodes) { ArrayList [,] myttR = ep.getTimetable(); ArrayList lessonsInOneTimeSlot = myttR[j, k]; if (lessonsInOneTimeSlot != null && lessonsInOneTimeSlot.Count != 0) { foreach (Object [] courseAndRoomPair in lessonsInOneTimeSlot) { Room roomFromModel = (Room)courseAndRoomPair[1]; if (roomFromModel == room) { Course course = (Course)courseAndRoomPair[0]; Teacher tcr = course.getTeacher(); string teacherText = tcr.getName().Substring(0, 1) + ". " + tcr.getLastName(); EduProgram ep3 = (EduProgram)course.Parent; string codeAndSem = ep3.getCode() + "/" + ep3.getSemester(); //string courseName=course.getReportName(); string courseName; if (Settings.TTREP_COURSE_FORMAT == 1) { courseName = course.getFullName(); } else { courseName = course.getReportName(); } if (foundInOneTSForTeacherAndRoom == 1) { timeSlotText += courseName + " @ " + codeAndSem; } else { if (courseName == lastUsedCourseName3) { timeSlotText += ", " + codeAndSem; } else { timeSlotText += "\n" + courseName + " @ " + codeAndSem; } } if (Settings.TTREP_PRINT_TEACHER_IN_TS == 1) { timeSlotText += " (" + teacherText + ")"; } lastUsedCourseName3 = courseName; foundInOneTSForTeacherAndRoom++; } } dr["Day" + (k + 1)] = timeSlotText; } } } } } gdt.Rows.Add(dr); } reportGroupAndTable[1] = gdt; reportTablesList.Add(reportGroupAndTable); } return(reportTablesList); }