private void AddNewVehicleToolStripMenuItem_Click(object sender, EventArgs e) { frmMaintainVehicles vehicle = new frmMaintainVehicles(); frmParent parent = this; vehicle.setMode("add"); vehicle.clearForm(); vehicle.MdiParent = parent; vehicle.Show(); }
private void BtnUpdate_Click(object sender, EventArgs e) { frmMaintainVehicles maintainVehicles = new frmMaintainVehicles(); maintainVehicles.setMode("update"); maintainVehicles.clearForm(); maintainVehicles.setRegNo(dgVehicles.Rows[rowIndex].Cells[1].Value.ToString()); try { maintainVehicles.setVehicleID(dgVehicles.Rows[rowIndex].Cells[0].Value.ToString()); } catch (ArgumentOutOfRangeException m) { Console.WriteLine(m.Message); } maintainVehicles.Show(); }