public void AddDataHandler() { var editor = new SpecialtyEditorForm(); var result = editor.ShowDialog(); if (result != DialogResult.OK) { return; } _context.Specialty.Add(editor.ChangedData); RefreshDataHandler(); }
public void ChangeDataHolder(Specialty data) { var editor = new SpecialtyEditorForm(); var spec = _context.Specialty.GetAllSpecialties(); var result = editor.ShowDialog(data); if (result != DialogResult.OK) { return; } var chagedStudentData = editor.ChangedData; _context.Specialty.Update(data.Id, chagedStudentData); RefreshDataHandler(); }
public void ChangeDataHandler(Specialty data) { var editor = new SpecialtyEditorForm(); var result = editor.ShowDialog(data); if (result != DialogResult.OK) { return; } try { _context.Specialties.Update(data.Id, editor.ChangedData); RefreshDataHandler(); } catch { MessageBox.Show("Произошла ошибка при обновлении данных"); } }
public void AddDataHandler() { SpecialtyEditorForm specEditor = new SpecialtyEditorForm(); DialogResult result = specEditor.ShowDialog(); if (result != DialogResult.OK) { return; } try { _context.Specialties.Add(specEditor.NewData); RefreshDataHandler(); } catch { MessageBox.Show("Произошла ошибка при добавлении данных"); } }