public void AddGroup(YearOfStudy year, Specialization spec) { var group = Project.Schedule.AddNewGroup(year, spec); var table = Tables.First(t => t.YearOfStudy == year); var index = Tables.IndexOf(table); Tables[index].AddGroup(group); }
public ActionResult DeleteConfirmed(int id) { YearOfStudy yearOfStudy = db.YearOfStudies.Find(id); db.YearOfStudies.Remove(yearOfStudy); db.SaveChanges(); return(RedirectToAction("Index")); }
public void RemoveYearOfStudy(YearOfStudy year) { YearsOfStudy.Remove(year); foreach (var @group in Groups.Where(@group => @group.YearOfStudy == year)) { @group.YearOfStudy = null; } }
public Group AddNewGroup(YearOfStudy year, Specialization spec) { var group = new Group { Name = "Новая группа", YearOfStudy = year, Specialization = spec }; AddGroup(group); return(group); }
public ActionResult Edit([Bind(Include = "YearOfStudyID,StudyYear")] YearOfStudy yearOfStudy) { if (ModelState.IsValid) { db.Entry(yearOfStudy).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(yearOfStudy)); }
public GroupClasses(Schedule schedule, YearOfStudy yearOfStudy) : base(schedule) { YearOfStudy = yearOfStudy; SetSubjects(); SetSubjectIndexes(); // CreateTable(); CreateTableDictionary(); // SetClasses(); SetClassesDictionary(); }
public ActionResult Create([Bind(Include = "YearOfStudyID,StudyYear")] YearOfStudy yearOfStudy) { if (ModelState.IsValid) { db.YearOfStudies.Add(yearOfStudy); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(yearOfStudy)); }
/// <summary> /// Add new Specialization and Group to given YearOfStudy /// </summary> /// <param name="year"></param> public void AddNewSG(YearOfStudy year) { var spec = new Specialization { Name = "Новая специальность" }; var group = new Group { Name = "Новая группа", YearOfStudy = year, Specialization = spec }; AddSpecialization(spec); AddGroup(group); }
private void OnYearOfStudyChanged() { if (YearOfStudy == null) { return; } TableHeader = YearOfStudy.ToString(); _classesTable = Project.ClassesSchedule.GetClassesTable(YearOfStudy); _titlesMarkup = new TitlesMarkup(_classesTable.Groups); InitializeTitles(); InitLectureCards(); }
private void OnYearOfStudyChanged() { if (YearOfStudy == null) { return; } TableHeader = YearOfStudy.ToString(); _groupClasses = new GroupClasses(Project.Schedule, YearOfStudy); _titlesMarkup = new TitlesMarkup(_groupClasses.Subjects); InitializeTitles(); InitLectureCards(); }
// GET: YearOfStudies/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } YearOfStudy yearOfStudy = db.YearOfStudies.Find(id); if (yearOfStudy == null) { return(HttpNotFound()); } return(View(yearOfStudy)); }
/// <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); }
public void AddSpecialization(YearOfStudy yearOfStudy) { Project.Schedule.AddNewSG(yearOfStudy); UpdateAll(); }
/// <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); }
public void RemoveYearOfStudy(YearOfStudy yearOfStudy) { Project.Schedule.RemoveYearOfStudy(yearOfStudy); Tables.Remove(Tables.First(t => t.YearOfStudy == yearOfStudy)); }
// public void CreateNewTables() // { // Tables.Clear(); // foreach (var yearOfStudy in YearsOfStudy) // { // Tables.Add(new ClassesTable(this, yearOfStudy)); // } // } public bool HasGroups(YearOfStudy year) { return Groups.Any(g => g.YearOfStudy == year); }
/// <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; }
// public void AddLecturer(object param) // { // if (AddLecturerDelegate != null) // { // AddLecturerDelegate(param as Lecturer); // } // } // // public void AddSubject(object param) // { // if (AddSubjectDelegate != null) // { // AddSubjectDelegate(param as Subject); // } // } // // public void RemoveClassRecord(object param) // { // if (RemoveClassRecordDelegate != null) // { // RemoveClassRecordDelegate(param as ClassRecord); // } // } // public void RemoveYearOfStudy(YearOfStudy yearOfStudy) { Mouse.OverrideCursor = Cursors.Wait; _tableController.RemoveYearOfStudy(yearOfStudy); Mouse.OverrideCursor = Cursors.Arrow; }
public sYearOfStudy(YearOfStudy yearOfStudy) : base(yearOfStudy) { }
public void AddSpecialization(YearOfStudy yearOfStudy) { Mouse.OverrideCursor = Cursors.Wait; _tableController.AddSpecialization(yearOfStudy); Mouse.OverrideCursor = Cursors.Arrow; }
// public void CreateNewTables() // { // Tables.Clear(); // foreach (var yearOfStudy in YearsOfStudy) // { // Tables.Add(new ClassesTable(this, yearOfStudy)); // } // } public bool HasGroups(YearOfStudy year) { return(Groups.Any(g => g.YearOfStudy == year)); }
public void AddYearOfStudy(YearOfStudy year) { YearsOfStudy.Add(year); }
public void AddSpecialization(YearOfStudy yearOfStudy) { UpdateStatus("Создание новой специальности..."); Mouse.OverrideCursor = Cursors.Wait; _tableController.AddSpecialization(yearOfStudy); Mouse.OverrideCursor = Cursors.Arrow; UpdateStatus("Новая специальность создана"); }
// public void AddLecturer(object param) // { // if (AddLecturerDelegate != null) // { // AddLecturerDelegate(param as Lecturer); // } // } // // public void AddSubject(object param) // { // if (AddSubjectDelegate != null) // { // AddSubjectDelegate(param as Subject); // } // } // // public void RemoveClassRecord(object param) // { // if (RemoveClassRecordDelegate != null) // { // RemoveClassRecordDelegate(param as ClassRecord); // } // } // public void RemoveYearOfStudy(YearOfStudy yearOfStudy) { UpdateStatus("Удаление курса..."); Mouse.OverrideCursor = Cursors.Wait; _tableController.RemoveYearOfStudy(yearOfStudy); Mouse.OverrideCursor = Cursors.Arrow; UpdateStatus("Курс удален"); }
private static void LoadYearsOfStudy(Schedule schedule, SQLiteCommand command) { command.CommandText = "select * from years_of_study"; var reader = command.ExecuteReader(); while (reader.Read()) { var year = new YearOfStudy {Name = (string) reader["name"]}; schedule.YearsOfStudy.Add(year); } reader.Close(); }
public Group AddNewGroup(YearOfStudy year, Specialization spec) { var group = new Group { Name = "Новая группа", YearOfStudy = year, Specialization = spec }; AddGroup(group); return group; }