public void Delete_flight() { this.Flight_num = string.Empty; this.City = string.Empty; this.Airline = string.Empty; this.Terminal = string.Empty; this.Status = string.Empty; this.Gate = 0; this.arr_date = DateTime.MinValue; FlightEventArgs args = new FlightEventArgs(); args.flight_number = this.flight_num; FlightDeleteHandler(this, args); }
public void Delete_flight() { FlightEventArgs args = new FlightEventArgs(); args.flight_number = this.flight_num; //FlightDeleteHandler(this, args); using (var ctx = new AirplaneContext()) { ctx.Entry(this).State = EntityState.Deleted; ctx.SaveChanges(); } this.Flight_num = string.Empty; this.City = string.Empty; this.Airline = string.Empty; this.Terminal = string.Empty; this.Status = string.Empty; this.Gate = 0; this.arr_date = DateTime.MinValue; }
void passenger_plane_FlightDeleteHandler(object sender, FlightEventArgs args) { Console.WriteLine("{0} was deleted", this.Name); this.Delete_passenger(); }