private void gotoRepair_ToolStripMenuItem_Click(object sender, EventArgs e) { ToolSerialName = getSerialNumFromGrid(); Status = getStatusFromGrid(); RepairOperatorForm repairOperatorForm = new RepairOperatorForm(); if (repairOperatorForm.ShowDialog() == DialogResult.OK) { btnSearch_Click(sender, e); Show(); } }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (dataGridView1.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex > -1) { DataGridViewDisableButtonCell btnCell = dataGridView1.CurrentCell as DataGridViewDisableButtonCell; if (dataGridView1.Rows[e.RowIndex].Cells["StatusCol"].Value.ToString() == MaintainDeclare.RepairFinished) { btnCell.Enabled = false; return; } if (btnCell != null) { ToolSerialName = getSerialNumFromGrid(); Status = getStatusFromGrid(); RepairOperatorForm repairOperatorForm = new RepairOperatorForm(); if (repairOperatorForm.ShowDialog() == DialogResult.OK) { btnSearch_Click(sender, e); Show(); } } } }