private void MainForm_RepairsTab_AddButton_Click(object sender, EventArgs e) { focus = false; RepairAddEditForm addRepair = new RepairAddEditForm(null); addRepair.ShowDialog(); focus = true; RefreshForm(EDataGridType.Repairs); }
private void MainForm_RepairsTab_EditButton_Click(object sender, EventArgs e) { if (MainForm_RepairsTab_DataGrid.SelectedRows.Count > 0) { focus = false; var repair = MainForm_RepairsTab_DataGrid.CurrentRow.DataBoundItem as Repair; RepairAddEditForm addRepair = new RepairAddEditForm(repair); addRepair.ShowDialog(); focus = true; RefreshForm(EDataGridType.Repairs); MainForm_RepairsTab_DataGrid.ClearSelection(); repairPositionBindingSource.DataSource = null; MainForm_RepairsTab_DeviceIdNameLabel.Text = null; MainForm_RepairsTab_ClientIdNameLabel.Text = null; } else { MessageBox.Show(Messages.NoPosition); } }