private void imbt_addNewRC_Click(object sender, EventArgs e) { bool Check_Repair = false; foreach (DataGridViewRow dgvr in dgvRepair.Rows) { if (!string.IsNullOrEmpty(dgvr.Cells["REASON_CODE"].Value.ToString())) { Check_Repair = true; } } if (Check_Repair) { M_RepairType = "D"; Frm_Update fu = new Frm_Update(this); fu.ShowDialog(); } else { ShowMessage("请先填写维修信息,再增加其它维修项"); } }
private void Repair_Update() { if (dgvRepair.Rows.Count > 0) { bool Check_Repair = false; foreach (DataGridViewRow dgvr in dgvRepair.Rows) { if (!string.IsNullOrEmpty(dgvr.Cells["REASON_CODE"].Value.ToString()) && dgvr.Cells["ROWID"].Value.ToString() == M_sRepair_Rowid) { Check_Repair = true; } } if (Check_Repair) { ShowMessage("维修信息已填写完成"); return; } M_RepairType = string.Empty; if (dgvRepair.Rows.Count == 1) { M_sRepair_Rowid = dgvRepair.Rows[0].Cells["ROWID"].Value.ToString(); } else { if (string.IsNullOrEmpty(M_sRepair_Rowid)) { ShowMessage("请先选择待维修信息"); return; } } Frm_Update fu = new Frm_Update(this); fu.ShowDialog(); } }