public int Delete <T>(T entity) { Type type = entity.GetType(); if (type == typeof(City)) { return(CityTable.Delete((entity as City).Id)); } if (type == typeof(Customer)) { return(CustomerTable.Delete((entity as Customer).Id)); } if (type == typeof(Distillation)) { return(DistillationTable.Delete((entity as Distillation).Id)); } if (type == typeof(District)) { return(DistrictTable.Delete((entity as District).Id)); } if (type == typeof(Material)) { return(MaterialTable.Delete((entity as Material).Id)); } if (type == typeof(Period)) { return(PeriodTable.Delete((entity as Period).Id)); } if (type == typeof(Region)) { return(RegionTable.Delete((entity as Region).Id)); } if (type == typeof(Reservation)) { return(ReservationTable.Delete((entity as Reservation).Id)); } if (type == typeof(Season)) { return(SeasonTable.Delete((entity as Season).Id)); } if (type == typeof(UserInfo)) { return(UserInfoTable.Delete((entity as UserInfo).Id)); } return(0); }
private void smazat_Click(object sender, EventArgs e) { MaterialTable.Delete(Material); Close(); }