コード例 #1
0
ファイル: Teacher.cs プロジェクト: ZAYEC77/Susie
 public int CountOfHours(Lesson L, Group G)
 {
     int count = 0;
     foreach (Lesson l in this.Lessons.Where(les => les.Semester == L.Semester).Where(les => les.Subject == L.Subject).Where(les => les.Groups.IndexOf(G) > -1).ToList())
     {
         if (l.Type == 0)
             count += 2;
         else
             count++;
     }
     return count;
 }
コード例 #2
0
ファイル: Lesson.cs プロジェクト: ZAYEC77/Susie
 public void AddGroup(Group G)
 {
     foreach (Lesson l in G.Lessons)
         if (l.Conflict(this))
         {
             message += "Група " + G.Title + " занята\n";
             break;
         }
     groups.Add(G);
     G.Lessons.Add(this);
 }
コード例 #3
0
ファイル: Schedule.cs プロジェクト: ZAYEC77/Susie
        private void WriteSchedule(Group G, Excel.Worksheet WorkSheet, int position)
        {
            int n = 4 + position;
            char C = (char)(100 + position);

            var excelCell = (Excel.Range)WorkSheet.Cells[1, n];
            excelCell.Value2 = G.Title;
            excelCell.Borders[Excel.XlBordersIndex.xlEdgeRight].Weight = "3";
            excelCell.Borders[Excel.XlBordersIndex.xlEdgeBottom].Weight = "3";
            for (int i = 1; i <= 80; i += 4)
            {
                excelCell = WorkSheet.get_Range(C + (i + 1).ToString(), C + (i + 4).ToString());
                excelCell.Borders[Excel.XlBordersIndex.xlEdgeRight].Weight = "3";
                excelCell.Borders[Excel.XlBordersIndex.xlEdgeBottom].Weight = "3";
            }
            foreach (Lesson l in G.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)WorkSheet.Cells[m + 1, n];
                    excelCell.Borders[Excel.XlBordersIndex.xlEdgeBottom].Weight = "3";
                    if (l.Type != 1) shift = 2;
                }
                excelCell = (Excel.Range)WorkSheet.Cells[m + shift, n];
                excelCell.Value2 = l.TitleSubject;
                for (int i = 0; i < l.Teachers.Count(); i++)
                {
                    excelCell = (Excel.Range)WorkSheet.Cells[m + 2 - offset + shift, n];
                    excelCell.Value2 += l.Teachers[i].FullName() + " ";
                    excelCell.Value2 += l.Classrooms[i].Title + " ";
                }
            }
        }
コード例 #4
0
ファイル: Schedule.cs プロジェクト: ZAYEC77/Susie
 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;
 }
コード例 #5
0
ファイル: Schedule.cs プロジェクト: ZAYEC77/Susie
 public List<Subject> GetSubjectsForGroup(Group G)
 {
     if (G == null)
         return new List<Subject>();
     EntitySet<Subject> subjects = new EntitySet<Subject>();
     var query = from s in G.Loads.Where(l => l.Semester == semester)
                 select s.Subject;
     foreach (Subject s in query)
         subjects.Add(s);
     return subjects.ToList<Subject>();
 }
コード例 #6
0
ファイル: Schedule.cs プロジェクト: ZAYEC77/Susie
        public void GetFormSchedule(Group G)
        {
            if (G == null) return;
            ScheduleView form = new ScheduleView();
            form.Text = G.Title;
            List<Lesson> query = (from l in Lessons
                                  where G.IsMember(l.Groups) && (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.ForGroup;
            }

            form.ShowDialog();
        }
コード例 #7
0
ファイル: Replacement.cs プロジェクト: ZAYEC77/Susie
 public void ShowFor(Group G)
 {
     RefreshFact();
     FactBind.DataSource = fact.
         Where(l => l.Groups.IndexOf(G) != -1).
         ToList();
 }