private void repairB_Click(object sender, EventArgs e) { if (plateNumberCB.Text == "") { MessageBox.Show("Please choose a PLATE NUMBER", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else if (partCB.Text == "") { MessageBox.Show("Please choose a VEHICLE PART/n If VEHICLE PART does exist on the choices, please ADD a NEW PART.", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { _maintenanceID = _maintenance.CreateMaintenanceID(); _repairID = _repair.CreateRepairID(); _plateNumber = plateNumberCB.Text.Trim(); _partID = _part.RetrievePartID(partCB.Text.Trim()); _maintenance = new Maintenance(_maintenanceID, _plateNumber, _partID, _status); _maintenance.InsertMaintenance(_maintenance); plateNumberCB.Text = ""; partCB.Text = ""; } NewRepairForm newRepairForm = new NewRepairForm(); newRepairForm.ShowDialog(); Close(); }