示例#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);
     }
 }
 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
 protected bool Equals(Group other)
 {
     return Equals(_specialization, other._specialization) && Equals(_yearOfStudy, other._yearOfStudy);
 }
示例#5
0
 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
 /// <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
 /// <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
 public Group AddNewGroup(YearOfStudy year, Specialization spec)
 {
     var group = new Group { Name = "Новая группа", YearOfStudy = year, Specialization = spec };
     AddGroup(group);
     return group;
 }
示例#10
0
 public void AddGroup(Group group)
 {
     Groups.Add(group);
 }
示例#11
0
 public GroupCardViewModel(Group group)
 {
     Group = group;
 }