Пример #1
0
 public void AddPasajero(Pasajeros P1)
 {
     using (AeropuertoEntities context = new AeropuertoEntities())
     {
         context.Pasajeros.Add(P1);
         context.SaveChanges();
     }
 }
Пример #2
0
        public void AgregarPasajeros()
        {
            Pasajeros p = new Pasajeros();

            p.Id_vuelo  = 123456;
            p.Nombre    = "Juan";
            p.Apellidos = "Ortiz";
            p.Visa      = 0123456;
            p.Pasaporte = 005123456;

            using (AeropuertoEntities context = new AeropuertoEntities())
            {
                context.Pasajeros.Add(p);
                context.SaveChanges();
            }
        }
Пример #3
0
            public void Insertar()
            {
                Vuelos v1 = new Vuelos();

                v1.Id_vuelo = 5;
                v1.Escala   = "xxx";
                v1.Duracion = 5;


                Aviones A1 = new Aviones();

                A1.Id       = 4;
                A1.Modelo   = "Airbus456";
                A1.Asientos = "568";
                A1.Cantidad = 684;


                Paises_Destino_Aeropuerto PDA = new Paises_Destino_Aeropuerto();

                PDA.id         = 6;
                PDA.id_vuelo   = 5;
                PDA.Paises     = "USA";
                PDA.Destino    = "New York";
                PDA.Aeropuerto = "Juan Santa Maria ";
                PDA.Tarifa     = 564;

                Pasajeros pj = new Pasajeros();

                pj.id        = 8;
                pj.Id_vuelo  = 5;
                pj.Nombre    = "Nombre 1";
                pj.Apellidos = "Apellidos 1";
                pj.Visa      = 454221;
                pj.Pasaporte = 26564;



                using (AeropuertoEntities context = new AeropuertoEntities())
                {
                    context.Vuelos.Add(v1);
                    context.SaveChanges();
                }
            }
Пример #4
0
 public void AgregarPasajeros()
 {
     using (AeropuertoEntities context = new AeropuertoEntities())
     {
         try
         {
             var P1 = new Pasajeros();
             P1.Id_vuelo  = 0;
             P1.Apellidos = "Badilla";
             P1.Nombre    = "Jeison";
             P1.Pasaporte = 23;
             P1.Visa      = 111;
             bl.AddPasajero(P1);
         }
         catch (Exception exp)
         {
             Console.WriteLine("ERROR:  " + exp.Message);
         }
     }
 }