/// <summary> /// Deletes the <seealso cref="Vehicle"/> that the /// <seealso cref="Admin"/> has selected. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void deleteButton_Click(object sender, EventArgs e) { Vehicle v = RentalControl.SelectedVehicle; VehicleControl.RemoveVehicle(v); UpdateList(); carInfoPanel.Visible = false; searchPanel.Visible = true; }
public void RemoveVehicleTest() { Vehicle v = new Vehicle(); DBController.Save(v, DBObject.SaveTypes.Insert); VehicleControl.RemoveVehicle(v); Vehicle v2 = DBController.GetByPrimaryKey <Vehicle>(v.PrimaryKey); Assert.IsNull(v2); }