private void btAddBlock_Click(object sender, EventArgs e) { frmBlockVsDeps frmBvD = new frmBlockVsDeps(); frmBvD.Text = "Добавить связь блок-отдел"; if (DialogResult.OK == frmBvD.ShowDialog()) { getBlock(); } }
private void btEditBlock_Click(object sender, EventArgs e) { if (dtBlock == null || dtBlock.DefaultView.Count == 0 || dgvBlokVsDeps.CurrentRow == null || dgvBlokVsDeps.CurrentRow.Index == -1) { return; } DataRowView rowView = dtBlock.DefaultView[dgvBlokVsDeps.CurrentRow.Index]; frmBlockVsDeps frmBvD = new frmBlockVsDeps(); frmBvD.Text = "Редактировать связь блок-отдел"; frmBvD.rowView = rowView; if (DialogResult.OK == frmBvD.ShowDialog()) { getBlock(); } }