private void новыйToolStripMenuItem_Click(object sender, EventArgs e) { var frm = new frmDocTypeEdit(0); if (frm.ShowDialog() == DialogResult.OK) { docTypeBindingSource.DataSource = new DocumentTypeRepository().GetDocTypes(); } }
private void изменитьToolStripMenuItem_Click(object sender, EventArgs e) { var docType = docTypeBindingSource.Current as DocumentType; if (docType == null) return; var frm = new frmDocTypeEdit(docType.Id); if (frm.ShowDialog() == DialogResult.OK) { docTypeBindingSource.DataSource = new DocumentTypeRepository().GetDocTypes(); } }