public override void doit() { AppForm.CURR_OCTT_DOC.incrUnallocatedLessonsCounter(1); Course course = (Course)_lviDroped.Tag; Teacher myTeacher = course.getTeacher(); EduProgram ep = (EduProgram)course.Parent; string [] courseTeacher = new string[2]; courseTeacher[0] = course.getFullName(); courseTeacher[1] = myTeacher.getLastName() + " " + myTeacher.getName(); ListViewItem lviNew = new ListViewItem(courseTeacher); lviNew.Tag = course; _ullv.Items.Add(lviNew); _ullv.EnsureVisible(_ullv.Items.IndexOf(lviNew)); ep.getUnallocatedLessonsList().Add(lviNew); if (course.getCoursesToHoldTogetherList().Count > 0) { foreach (Course courseHT in course.getCoursesToHoldTogetherList()) { EduProgram epHT = (EduProgram)courseHT.Parent; Teacher myTeacherHT = courseHT.getTeacher(); ListViewItem lviNewHT = new ListViewItem(); lviNewHT.Tag = courseHT; epHT.getUnallocatedLessonsList().Add(lviNewHT); } } AppForm.getAppForm().getStatusBarPanel2().Text = AppForm.CURR_OCTT_DOC.getNumOfUnallocatedLessonsStatusText(); }
public TeacherPropertiesForm(Teacher teacher) : this() { _isNew = false; _teacher = teacher; this._nameTextBox.Text = _teacher.getName(); this._lastnameTextBox.Text = _teacher.getLastName(); this._extIDTextBox.Text = _teacher.ExtID; this._titleComboBox.SelectedItem = _teacher.getTitle(); this._eduRankComboBox.SelectedItem = _teacher.getEduRank(); }
public ChangeTeacherDataCmd(Teacher teacher, string newName, string newLastName, string newTitle, string newEduRank, string newExtID) { _teacher = teacher; _oldName = _teacher.getName(); _oldLastName = _teacher.getLastName(); _oldTitle = _teacher.getTitle(); _oldEduRank = _teacher.getEduRank(); _oldExtID = _teacher.ExtID; _newName = newName; _newLastName = newLastName; _newTitle = newTitle; _newEduRank = newEduRank; _newExtID = newExtID; }
public void makeSubLabel(Course course, Teacher teacher) { Label[] oneSubLabel = new Label[2]; Label courseLabel = new Label(); courseLabel.Text = course.getFullName(); courseLabel.Tag = course; courseLabel.Font = new System.Drawing.Font("Arial", Settings.TIME_SLOT_PANEL_FONT_SIZE, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(238))); courseLabel.BackColor = course.MyGUIColor; courseLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; courseLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; //// courseLabel.MouseEnter += new System.EventHandler(this.courseLabel_MouseEnter); courseLabel.MouseLeave += new System.EventHandler(this.courseAndUnderLabel_MouseLeave); courseLabel.MouseDown += new System.Windows.Forms.MouseEventHandler(this.courseLabelForRoom_MouseDown); oneSubLabel[0] = courseLabel; Label teacherLabel = new Label(); string teacherName = teacher.getName().Substring(0, 1) + "." + teacher.getLastName(); teacherLabel.Text = teacherName; teacherLabel.Tag = teacher; teacherLabel.Font = new System.Drawing.Font("Arial", Settings.TIME_SLOT_PANEL_FONT_SIZE, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(238))); teacherLabel.BackColor = System.Drawing.SystemColors.ControlLight; teacherLabel.TextAlign = System.Drawing.ContentAlignment.TopCenter; teacherLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; teacherLabel.MouseEnter += new System.EventHandler(this.roomAndTeacherLabel_MouseEnter); teacherLabel.MouseLeave += new System.EventHandler(this.courseAndUnderLabel_MouseLeave); oneSubLabel[1] = teacherLabel; _allSubLabels.Add(oneSubLabel); putLabelsOnThePanel(); }
private static void createTableRow(XGraphics gfx, Teacher teacher) { XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode, PdfFontEmbedding.Always); XBrush brush = XBrushes.Black; XStringFormat format = new XStringFormat(); format.LineAlignment = XLineAlignment.Center; XPen xpen = new XPen(XColors.Black, 0.5); XBrush xbrush = XBrushes.Bisque; XRect rect; XFont font; int currX = X_START - 30; string ordinalNum = ROW_COUNTER.ToString() + "."; rect = new XRect(currX, CURR_Y, 28, ROW_HEIGHT); font = new XFont("Arial", 10, XFontStyle.Regular, options); format.Alignment = XStringAlignment.Far; //gfx.DrawRectangle(xpen, xbrush, rect); gfx.DrawString(ordinalNum, font, brush, rect, format); currX = X_START; string teacherLastName = teacher.getLastName(); rect = new XRect(currX, CURR_Y, COL_WIDTH[0], ROW_HEIGHT); font = new XFont("Arial", 10, XFontStyle.Regular, options); format.Alignment = XStringAlignment.Near; //gfx.DrawRectangle(xpen, xbrush, rect); gfx.DrawString(teacherLastName, font, brush, rect, format); currX += COL_WIDTH[0] + COL_GAP; string teacherName = teacher.getName(); rect = new XRect(currX, CURR_Y, COL_WIDTH[1], ROW_HEIGHT); //gfx.DrawRectangle(xpen, xbrush, rect); gfx.DrawString(teacherName, font, brush, rect, format); currX += COL_WIDTH[1] + COL_GAP; string teacherTitle = teacher.getTitle(); rect = new XRect(currX, CURR_Y, COL_WIDTH[2], ROW_HEIGHT); //gfx.DrawRectangle(xpen, xbrush, rect); gfx.DrawString(teacherTitle, font, brush, rect, format); currX += COL_WIDTH[2] + COL_GAP; string teacherEduRank = teacher.getEduRank(); rect = new XRect(currX, CURR_Y, COL_WIDTH[3], ROW_HEIGHT); //gfx.DrawRectangle(xpen, xbrush, rect); gfx.DrawString(teacherEduRank, font, brush, rect, format); currX += COL_WIDTH[3] + COL_GAP; string teacherExtID = teacher.ExtID; rect = new XRect(currX, CURR_Y, COL_WIDTH[4], ROW_HEIGHT); //gfx.DrawRectangle(xpen, xbrush, rect); gfx.DrawString(teacherExtID, font, brush, rect, format); gfx.DrawLine(xpen, X_START - 20, CURR_Y + ROW_HEIGHT + 2, X_START + 475, CURR_Y + ROW_HEIGHT + 2); CURR_Y += ROW_HEIGHT + 4; }
public string getTSPCoursesTextForStatusBar() { string textForStatusBar = this.getFullName() + ", "; textForStatusBar += _numberOfEnrolledStudents.ToString() + " " + RES_MANAGER.GetString("getTSPCoursesTextForStatusBar.enrolled_students.text") + ", " + _teacher.getLastName() + " " + _teacher.getName(); return(textForStatusBar); }
public override void doit() { _numOfUnallocatedLessonsUndoRedoCounter = 0; _epAndLviForUndoRedoList = new ArrayList(); ArrayList [,] mytt = _ep.getTimetable(); for (int j = 0; j < AppForm.CURR_OCTT_DOC.IncludedTerms.Count; j++) { for (int k = 0; k < AppForm.CURR_OCTT_DOC.getNumberOfDays(); k++) { ArrayList lessonsInOneTimeSlot = mytt[j, k]; if (lessonsInOneTimeSlot != null) { for (int step = 0; step < lessonsInOneTimeSlot.Count;) { IEnumerator enumerator = lessonsInOneTimeSlot.GetEnumerator(); enumerator.MoveNext(); Object [] courseAndRoomPair = (Object [])enumerator.Current; Course course = (Course)courseAndRoomPair[0]; lessonsInOneTimeSlot.Remove(courseAndRoomPair); AppForm.CURR_OCTT_DOC.incrUnallocatedLessonsCounter(1); _numOfUnallocatedLessonsUndoRedoCounter++; ListViewItem lvi = new ListViewItem(); lvi.Tag = course; _ep.getUnallocatedLessonsList().Add(lvi); //prepare for redo Object [] onePair = new Object[4]; onePair[0] = _ep; onePair[1] = lvi; onePair[2] = lessonsInOneTimeSlot; onePair[3] = courseAndRoomPair; _epAndLviForUndoRedoList.Add(onePair); if (course.getCoursesToHoldTogetherList().Count > 0) { foreach (Course courseHT in course.getCoursesToHoldTogetherList()) { EduProgram epHT = (EduProgram)courseHT.Parent; ArrayList [,] myttHT = epHT.getTimetable(); ArrayList lessonsInOneTimeSlotHT = myttHT[j, k]; IEnumerator enumeratorIP = lessonsInOneTimeSlotHT.GetEnumerator(); foreach (Object [] courseAndRoomPairHT in lessonsInOneTimeSlotHT) { enumeratorIP.MoveNext(); Course courseFromListHT = (Course)courseAndRoomPairHT[0]; if (courseFromListHT == courseHT) { break; } } Object [] courseAndRoomPairHTForDel = (Object [])enumeratorIP.Current; lessonsInOneTimeSlotHT.Remove(courseAndRoomPairHTForDel); ListViewItem lviNew = new ListViewItem(); lviNew.Tag = courseHT; epHT.getUnallocatedLessonsList().Add(lviNew); //prepare for redo Object [] onePairIP = new Object[4]; onePairIP[0] = epHT; onePairIP[1] = lviNew; onePairIP[2] = lessonsInOneTimeSlotHT; onePairIP[3] = courseAndRoomPairHTForDel; _epAndLviForUndoRedoList.Add(onePairIP); } } } } } } foreach (TimeSlotPanel tsp in AppForm.getAppForm().getMainTimetablePanel().Controls) { tsp.Controls.Clear(); tsp.getAllSubLabels().Clear(); tsp.putLabelsOnThePanel(); AppForm.getAppForm().getUnallocatedLessonsListView().BeginUpdate(); AppForm.getAppForm().getUnallocatedLessonsListView().Items.Clear(); foreach (ListViewItem lvi in _ep.getUnallocatedLessonsList()) { Course courseTag = (Course)lvi.Tag; Teacher teacher = courseTag.getTeacher(); string [] courseAndTeacher = new string[2]; courseAndTeacher[0] = courseTag.getFullName(); courseAndTeacher[1] = teacher.getLastName() + " " + teacher.getName(); ListViewItem newLvi = new ListViewItem(courseAndTeacher); newLvi.Tag = courseTag; AppForm.getAppForm().getUnallocatedLessonsListView().Items.Add(newLvi); } AppForm.getAppForm().getUnallocatedLessonsListView().EndUpdate(); } AppForm.getAppForm().getStatusBarPanel2().Text = AppForm.CURR_OCTT_DOC.getNumOfUnallocatedLessonsStatusText(); }
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); }
public static DataTable getPdfSharpMasterTimetableDataTable() { DataTable gdt = new DataTable(); int timePeriodsCount = AppForm.CURR_OCTT_DOC.IncludedTerms.Count; int daysCount = AppForm.CURR_OCTT_DOC.getNumberOfDays(); int totalColumnNumber = timePeriodsCount * daysCount; gdt.Columns.Add("Col_0"); for (int dd = 0; dd < totalColumnNumber; dd++) { gdt.Columns.Add("Col_" + (dd + 1)); } foreach (EduProgramGroup epg in AppForm.CURR_OCTT_DOC.CoursesRootNode.Nodes) { foreach (EduProgram ep in epg.Nodes) { DataRow dr = gdt.NewRow(); dr[0] = ep.getName(); if (ep.getCode() != null && ep.getCode() != "") { dr[0] += " (" + ep.getCode() + "/" + ep.getSemester() + ")"; } else { dr[0] += " (" + ep.getSemester() + ")"; } // int drColIndex = 0; for (int k = 0; k < daysCount; k++) { for (int j = 0; j < timePeriodsCount; j++) { drColIndex++; string drColText = ""; dr[drColIndex] = drColText; ArrayList[,] mytt = ep.getTimetable(); 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) { drColText += courseName + " @ " + roomName; } else { drColText += "\n" + courseName + " @ " + roomName; } if (Settings.TTREP_PRINT_TEACHER_IN_TS == 1) { drColText += " (" + teacherText + ")"; } helpCounter++; } dr[drColIndex] = drColText; } } } /// gdt.Rows.Add(dr); } } return(gdt); }