private void btnDel_Click(object sender, EventArgs e) { if (lbLicenses.SelectedItem != null) { License.Delete((License)lbLicenses.SelectedItem); } lbLicenses.Items.Clear(); ShowLicenses(); }
public static void Delete(TransportType transporttype) { License.Delete(transporttype); foreach (var route in Route.Routes) { if (route.TransportType == transporttype) { route.SetTransportType(null); } } foreach (var trn in Transportation.Transportations) { if (trn.TransportType == transporttype) { trn.TransportType = null; } } TransportTypes.Remove(transporttype); }