public void AddTeacher(Teacher T) { foreach (Lesson l in T.Lessons) if (l.Conflict(this)) { message += "Викладач " + T.Title + " занятий(-a)\n"; break; } teachers.Add(T); T.Lessons.Add(this); }
int LoadHours(Teacher T, Group G) { Load load = new Load(); foreach (Load l in this.Loads) { if ((l.Teacher == T) && (l.Group == G) && (l.Semester == this.Semester)) { load = l; break; } } return load.WeeklyHour; }
public void GetExcelSchedule(Teacher T) { Excel.Application excelApp = new Excel.Application(); Excel.Workbooks excelAppWorkBooks = excelApp.Workbooks; Excel.Workbook excelAppWorkBook = excelApp.Workbooks.Open(ExcelTemplatePath, Type.Missing, Type.Missing, Type.Missing, "WWWWW", "WWWWW", Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing); Excel.Sheets excelSheets = excelAppWorkBook.Worksheets; Excel.Worksheet excelWorkSheet = (Excel.Worksheet)excelSheets[1]; int n = 4; var excelCell = (Excel.Range)excelWorkSheet.Cells[1, n]; excelCell.Value2 = T.Title; excelCell.Borders[Excel.XlBordersIndex.xlEdgeRight].Weight = "3"; excelCell.Borders[Excel.XlBordersIndex.xlEdgeBottom].Weight = "3"; foreach (Lesson l in T.Lessons.Where(l => l.Semester == semester).ToList()) { int m = l.Day * 16 + l.Number * 4 + 2; int offset = 0; int shift = 0; if (l.Type != 0) { offset = 1; excelCell = (Excel.Range)excelWorkSheet.Cells[m + 1, n]; excelCell.Borders[Excel.XlBordersIndex.xlEdgeBottom].Weight = "3"; if (l.Type != 1) shift = 2; } excelCell = (Excel.Range)excelWorkSheet.Cells[m + shift, n]; excelCell.Value2 = l.TitleSubject; excelCell = (Excel.Range)excelWorkSheet.Cells[m + 2 - offset + shift, n]; excelCell.Value2 += l.TitleGroups + " "; excelCell.Value2 += l.TitleClassrooms; } excelApp.Visible = true; }
public void GetFormSchedule(Teacher T) { if (T == null) return; ScheduleView form = new ScheduleView(); form.Text = T.Title; List<Lesson> query = (from l in Lessons where T.IsMember(l.Teachers) && (l.Semester == semester) select l).ToList<Lesson>(); form.panel1.Controls.Clear(); foreach (Lesson l in query) { VisualLesson c = new VisualLesson(); form.panel1.Controls.Add(c); c.Lesson = l; c.Mode = ViewMode.ForTeacher; } form.ShowDialog(); }
public void ShowFor(Teacher T) { RefreshFact(); FactBind.DataSource = fact. Where(l => l.Teachers.IndexOf(T) != -1). ToList(); }