예제 #1
0
        private static void LoadGroups(Schedule schedule, SQLiteCommand command)
        {
            command.CommandText = "select * from groups";

            var reader = command.ExecuteReader();
            while (reader.Read())
            {
                var grp = new Group
                {
                    Name = (string) reader["name"],
                    Specialization = schedule.Specializations[(int) reader["spec"]],
                    YearOfStudy = schedule.YearsOfStudy[(int) reader["year"]]
                };
                schedule.Groups.Add(grp);
            }
            reader.Close();
        }
예제 #2
0
 public void RemoveGroup(Group @group)
 {
     _groupClasses.RemoveGroup(@group);
     _titlesMarkup = new TitlesMarkup(_groupClasses.Subjects);
     InitializeTitles();
     InitLectureCards();
     if (UpdateTableViewDelegate != null)
     {
         UpdateTableViewDelegate(this);
     }
 }
예제 #3
0
 public void RemoveGroup(Group @group)
 {
     var lastSelectedYearOfStudy = Tables.Count != 0 ? Tables[SelectedIndex].YearOfStudy : null;
     Project.Schedule.RemoveGroup(group);
     var table = Tables.First(t => t.YearOfStudy == group.YearOfStudy);
     var index = Tables.IndexOf(table);
     Tables[index].RemoveGroup(group);
     if (Tables.Count > 0)
     {
         if (lastSelectedYearOfStudy != null)
         {
             var table1 = Tables.First(t => t.YearOfStudy == lastSelectedYearOfStudy);
             SelectedIndex = Tables.IndexOf(table1);
         }
         else
         {
             SelectedIndex = 0;
         }
     }
 }
예제 #4
0
파일: Elements.cs 프로젝트: GorelH/Schedule
 protected bool Equals(Group other)
 {
     return Equals(_specialization, other._specialization) && Equals(_yearOfStudy, other._yearOfStudy);
 }
예제 #5
0
파일: Schedule.cs 프로젝트: GorelH/Schedule
 public void RemoveGroup(Group group)
 {
     Groups.Remove(group);
     foreach (var classRecord in ClassRecords)
     {
         if (classRecord.Group == group)
         {
             classRecord.Group = null;
         }
     }
 }
예제 #6
0
 public void RemoveGroup(Group @group)
 {
     UpdateStatus("Удаление группы...");
     Mouse.OverrideCursor = Cursors.Wait;
     _tableController.RemoveGroup(group);
     Mouse.OverrideCursor = Cursors.Arrow;
     UpdateStatus("Группа удалена");
 }
예제 #7
0
파일: Schedule.cs 프로젝트: GorelH/Schedule
 /// <summary>
 /// Add new Specialization and Group to given new YearOfStudy
 /// </summary>
 /// <param name="year"></param>
 public void AddYSG(YearOfStudy year)
 {
     var spec = new Specialization { Name = "Специальность" };
     var group = new Group { Name = "Группа", YearOfStudy = year, Specialization = spec };
     AddYearOfStudy(year);
     AddSpecialization(spec);
     AddGroup(group);
 }
예제 #8
0
파일: Schedule.cs 프로젝트: GorelH/Schedule
 /// <summary>
 /// Add new YearOfStudy, Specialization and Group
 /// </summary>
 public Group AddYSG()
 {
     var year = new YearOfStudy { Name = "Новый курс" };
     var spec = new Specialization { Name = "Специальность" };
     var group = new Group { Name = "Группа", YearOfStudy = year, Specialization = spec };
     AddYearOfStudy(year);
     AddSpecialization(spec);
     AddGroup(group);
     return group;
 }
예제 #9
0
파일: Schedule.cs 프로젝트: GorelH/Schedule
 public Group AddNewGroup(YearOfStudy year, Specialization spec)
 {
     var group = new Group { Name = "Новая группа", YearOfStudy = year, Specialization = spec };
     AddGroup(group);
     return group;
 }
예제 #10
0
파일: Schedule.cs 프로젝트: GorelH/Schedule
 public void AddGroup(Group group)
 {
     Groups.Add(group);
 }
예제 #11
0
 public GroupCardViewModel(Group group)
 {
     Group = group;
 }