Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
        }
Ejemplo n.º 3
0
 void passenger_plane_FlightDeleteHandler(object sender, FlightEventArgs args)
 {
     Console.WriteLine("{0} was deleted", this.Name);
     this.Delete_passenger();
 }