private void btnAdd_Click(object sender, EventArgs e) { AddEditLPU aeLPU = new AddEditLPU(cbRegions.SelectedValue.ToString()); aeLPU.ShowDialog(); }
private void btnAdd_Click(object sender, EventArgs e) { RegionRR regionRR = GetRegionRR(); LpuRR lpuRR = new LpuRR(regionRR); AddEditLPU aeLPU = new AddEditLPU(lpuRR); if (aeLPU.ShowDialog() == System.Windows.Forms.DialogResult.OK) loadData1(); }
private void _dgv1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { try { if (_dgv1.Rows[_dgv1.SelectedCells[0].RowIndex].Cells["lpu_id"].Value.ToString() == "0") { MessageBox.Show("Для редактирования выделите ЛПУ.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } AddEditLPU aeLPU = new AddEditLPU(_dgv1.Rows[_dgv1.SelectedCells[0].RowIndex].Cells["lpu_id"].Value.ToString(), _dgv1.Rows[_dgv1.SelectedCells[0].RowIndex].Cells["lpu_sname"].Value.ToString(), _dgv1.Rows[_dgv1.SelectedCells[0].RowIndex].Cells["lpu_name"].Value.ToString()); aeLPU.ShowDialog(); } catch { MessageBox.Show("Не удалось войти в режим редактирования.", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void _dgv1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if ((e.RowIndex < 0) || (e.ColumnIndex < 0)) return; LpuRR lpuRR = GetLpuRR(); AddEditLPU aeLPU = new AddEditLPU(lpuRR); if (aeLPU.ShowDialog() == System.Windows.Forms.DialogResult.OK) loadData1(); }