private List <MantenimientoAeronave> GenerarListado(List <DALC.MANTENIMIENTO_AERONAVE> DalcMantenciones)
 {
     try
     {
         List <MantenimientoAeronave> mantencionesAeronave = new List <MantenimientoAeronave>();
         foreach (Halcones.DALC.MANTENIMIENTO_AERONAVE mantAeronave in DalcMantenciones)
         {
             MantenimientoAeronave mantA = new MantenimientoAeronave();
             mantA._idMantenimientoAeronave = int.Parse(mantAeronave.ID_MANTENIMIENTO_AERONAVE.ToString());
             mantA._estado              = mantAeronave.ESTADO;
             mantA._tipoMantenimiento   = mantAeronave.TIPO_MANTENIMIENTO;
             mantA._fechaManteniminento = DateTime.Parse(mantAeronave.FECHA_MATENIMIENTO.ToString());
             CommonBC.ModeloEscuelaHalcones.Entry(mantAeronave).Reference(a => a.AERONAVE).Load();
             mantA._aeronave._idAeronave = int.Parse(mantAeronave.AERONAVE.ID_AERONAVE.ToString());
             mantA._aeronave._matricula  = mantAeronave.AERONAVE.MATRICULA;
             mantencionesAeronave.Add(mantA);
         }
         return(mantencionesAeronave);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(null);
     }
 }
Example #2
0
        /// <summary>
        /// Metodo que obtiene los datos de un Vuelo.
        /// </summary>
        /// <returns>Retorna true si se encontro el vuelo y false de caso contrario</returns>
        public bool Buscar()
        {
            try
            {
                Halcones.DALC.VUELO vuelo = CommonBC.ModeloEscuelaHalcones.VUELO.
                                            First(vue => vue.ID_VUELO == this._idVuelo);

                this._idVuelo     = int.Parse(vuelo.ID_VUELO.ToString());
                this._fechaSalida = DateTime.Parse(vuelo.FECHA_SALIDA.ToString());
                this._estado      = vuelo.ESTADO;
                this._origen      = vuelo.ORIGEN;
                this._destino     = vuelo.DESTINO;

                CommonBC.ModeloEscuelaHalcones.Entry(vuelo).Reference(a => a.AERONAVE).Load();
                this._aeronave._idAeronave = int.Parse(vuelo.AERONAVE.ID_AERONAVE.ToString());

                CommonBC.ModeloEscuelaHalcones.Entry(vuelo).Reference(a => a.PILOTO).Load();
                this._piloto._idPiloto = int.Parse(vuelo.PILOTO.ID_PILOTO.ToString());

                CommonBC.ModeloEscuelaHalcones.Entry(vuelo).Reference(a => a.PILOTO1).Load();
                this._copiloto._idPiloto = int.Parse(vuelo.PILOTO1.ID_PILOTO.ToString());

                CommonBC.ModeloEscuelaHalcones.Entry(vuelo).Reference(a => a.CONDICION_VUELO).Load();
                this._condicion._idCondicion = int.Parse(vuelo.CONDICION_VUELO.ID_CONDICION.ToString());

                CommonBC.ModeloEscuelaHalcones.Entry(vuelo).Reference(a => a.MISION).Load();
                this._mision._idMision = int.Parse(vuelo.MISION.ID_MISION.ToString());
                return(true);
            }
            catch (Exception ex)
            {
                ConfigHalcones.GenerarLog("ERROR", ex.ToString());
                return(false);
            }
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="DalcAeronaves"></param>
        /// <returns></returns>
        private List <Aeronave> GenerarListado(List <DALC.AERONAVE> DalcAeronaves)
        {
            try
            {
                List <Aeronave> Aeronaves = new List <Aeronave>();
                foreach (Halcones.DALC.AERONAVE itemAeronave in DalcAeronaves)
                {
                    Aeronave aeronave = new Aeronave();
                    aeronave._idAeronave                = int.Parse(itemAeronave.ID_AERONAVE.ToString());
                    aeronave._matricula                 = itemAeronave.MATRICULA;
                    aeronave._totalSegundosVuelo        = int.Parse(itemAeronave.TOTAL_SEGUNDOS_VUELO.ToString());
                    aeronave._fechaInspeccionAnual      = DateTime.Parse(itemAeronave.FECHA_INSPECCION_ANUAL.ToString());
                    aeronave._fechaAeronavegabilidad    = DateTime.Parse(itemAeronave.FECHA_AERONAVEGABILIDAD.ToString());
                    aeronave._annoFabricacion           = int.Parse(itemAeronave.ANNO_FABRICACION.ToString());
                    aeronave._diasMantencion            = int.Parse(itemAeronave.DIAS_MANTENCION.ToString());
                    aeronave._horasVueloMantencion      = int.Parse(itemAeronave.HORAS_VUELO_MANTENCION.ToString());;
                    aeronave._totalHorasVueloMantencion = int.Parse(itemAeronave.TOTAL_HORAS_VUELO_MANTENCION.ToString());;
                    aeronave._ultimoMantenimiento       = DateTime.Parse(itemAeronave.ULTIMO_MANTENIMIENTO.ToString());
                    aeronave._estado = itemAeronave.ESTADO;

                    CommonBC.ModeloEscuelaHalcones.Entry(itemAeronave).Reference(a => a.TIPO_AERONAVE).Load();
                    aeronave._tipoAeronave._idTipoAeronave = int.Parse(itemAeronave.ID_TIPO_AERONAVE.ToString());
                    aeronave._tipoAeronave._tipoAeronave   = itemAeronave.TIPO_AERONAVE.TIPO_AERONAVE1;
                    Aeronaves.Add(aeronave);
                }
                return(Aeronaves);
            }
            catch (Exception ex)
            {
                ConfigHalcones.GenerarLog("ERROR", ex.ToString());
                return(null);
            }
        }
        private List <ComponentesComponente> GenerarListado(List <DALC.COMPONENTES_COMPONENTE> DALC_ComponentesComponente)
        {
            try
            {
                List <ComponentesComponente> componentesComponente = new List <ComponentesComponente>();
                foreach (Halcones.DALC.COMPONENTES_COMPONENTE itemCC in DALC_ComponentesComponente)
                {
                    ComponentesComponente componenteComp = new ComponentesComponente();
                    componenteComp._idComponentesComponente = int.Parse(itemCC.ID_COMPONENTES_COMPONENTE.ToString());

                    CommonBC.ModeloEscuelaHalcones.Entry(itemCC).Reference(a => a.COMPONENTE).Load();
                    componenteComp._componente._idComponente = int.Parse(itemCC.COMPONENTE.ID_COMPONENTE.ToString());
                    componenteComp._componente._componente   = itemCC.COMPONENTE.COMPONENTE1;

                    CommonBC.ModeloEscuelaHalcones.Entry(itemCC).Reference(a => a.COMPONENTE1).Load();
                    componenteComp._subComponente._idComponente = int.Parse(itemCC.COMPONENTE1.ID_COMPONENTE.ToString());
                    componenteComp._subComponente._componente   = itemCC.COMPONENTE1.COMPONENTE1;

                    componentesComponente.Add(componenteComp);
                }
                return(componentesComponente);
            }
            catch (Exception ex)
            {
                ConfigHalcones.GenerarLog("ERROR", ex.ToString());
                return(null);
            }
        }
Example #5
0
 /// <summary>
 /// Metodo que genera el listado de Usuarios
 /// </summary>
 /// <param name="DalcUsuario">Lista de Usuarios Tipo DALC</param>
 /// <returns>Lista de Usuarios Tipo Usuario</returns>
 private List <Usuario> GenerarListado(List <Halcones.DALC.USUARIO> DalcUsuario)
 {
     try
     {
         List <Usuario> usuarios = new List <Usuario>();
         foreach (Halcones.DALC.USUARIO usuario in DalcUsuario)
         {
             Usuario usu = new Usuario();
             usu._idUsuario       = int.Parse(usuario.ID_USUARIO.ToString());
             usu._username        = usuario.USERNAME;
             usu._rut             = usuario.RUT;
             usu._correo          = usuario.CORREO;
             usu._nombres         = usuario.NOMBRES;
             usu._apellidos       = usuario.APELLIDOS;
             usu._fechaNacimiento = DateTime.Parse(usuario.FECHA_NACIMIENTO.ToString());
             usuarios.Add(usu);
         }
         return(usuarios);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(null);
     }
 }
        private List <LicenciaPiloto> GenerarListado(List <DALC.LICENCIA_PILOTO> DalcLicenciaPiloto)
        {
            try
            {
                List <LicenciaPiloto> licenciasPiloto = new List <LicenciaPiloto>();
                foreach (Halcones.DALC.LICENCIA_PILOTO licenciaPiloto in DalcLicenciaPiloto)
                {
                    LicenciaPiloto lp = new LicenciaPiloto();
                    lp._idLicenciaPiloto = int.Parse(licenciaPiloto.ID_LICENCIA_PILOTO.ToString());
                    lp._estado           = licenciaPiloto.ESTADO;
                    lp._ultimoControl    = DateTime.Parse(licenciaPiloto.ULTIMO_CONTROL.ToString());
                    lp._nuevoControl     = DateTime.Parse(licenciaPiloto.NUEVO_CONTROL.ToString());
                    lp._piloto._idPiloto = int.Parse(licenciaPiloto.ID_PILOTO.ToString());

                    CommonBC.ModeloEscuelaHalcones.Entry(licenciaPiloto).Reference(a => a.LICENCIA).Load();
                    lp._licencia._idLicencia = int.Parse(licenciaPiloto.ID_LICENCIA.ToString());
                    lp._licencia._licencia   = licenciaPiloto.LICENCIA.LICENCIA1;

                    licenciasPiloto.Add(lp);
                }
                return(licenciasPiloto);
            }
            catch (Exception ex)
            {
                ConfigHalcones.GenerarLog("ERROR", ex.ToString());
                return(null);
            }
        }
Example #7
0
        private List <Piloto> GenerarListadoPilotos(List <Halcones.DALC.PILOTO> DalcPiloto)
        {
            try
            {
                List <Piloto> pilotos = new List <Piloto>();
                foreach (Halcones.DALC.PILOTO piloto in DalcPiloto)
                {
                    Piloto pil = new Piloto();
                    pil._idPiloto             = int.Parse(piloto.ID_PILOTO.ToString());
                    pil._nacionalidad         = piloto.NACIONALIDAD;
                    pil._comuna               = piloto.COMUNA;
                    pil._direccion            = piloto.DIRECCION;
                    pil._medicinaAeroespacial = DateTime.Parse(piloto.MEDICINA_AEROSPACIAL.ToString());
                    pil._totalSegundosVuelo   = int.Parse(piloto.TOTAL_SEGUNDOS_VUELO.ToString());

                    CommonBC.ModeloEscuelaHalcones.Entry(piloto).Reference(a => a.USUARIO).Load();
                    pil._usuario._idUsuario = int.Parse(piloto.USUARIO.ID_USUARIO.ToString());
                    pil._usuario._nombres   = piloto.USUARIO.NOMBRES;
                    pil._usuario._apellidos = piloto.USUARIO.APELLIDOS;
                    pil._usuario._rut       = piloto.USUARIO.RUT;
                    pilotos.Add(pil);
                }
                return(pilotos);
            }
            catch (Exception ex)
            {
                ConfigHalcones.GenerarLog("ERROR", ex.ToString());
                return(null);
            }
        }
Example #8
0
 /// <summary>
 /// Metodo que registra una Aeronave.
 /// </summary>
 /// <returns>Retorna true si se registro la aeronave y false de caso contrario</returns>
 public bool Agregar()
 {
     try
     {
         Halcones.DALC.AERONAVE aeronave = new DALC.AERONAVE();
         aeronave.ID_AERONAVE                  = this._idAeronave;
         aeronave.MATRICULA                    = this._matricula.ToString();
         aeronave.TOTAL_SEGUNDOS_VUELO         = this._totalSegundosVuelo;
         aeronave.FECHA_INSPECCION_ANUAL       = DateTime.Parse(this._fechaInspeccionAnual.ToString());
         aeronave.FECHA_AERONAVEGABILIDAD      = DateTime.Parse(this._fechaAeronavegabilidad.ToString());
         aeronave.ULTIMO_MANTENIMIENTO         = DateTime.Parse(this._ultimoMantenimiento.ToString());
         aeronave.ANNO_FABRICACION             = int.Parse(this._annoFabricacion.ToString());
         aeronave.DIAS_MANTENCION              = int.Parse(this._diasMantencion.ToString());
         aeronave.HORAS_VUELO_MANTENCION       = int.Parse(this._horasVueloMantencion.ToString());
         aeronave.TOTAL_HORAS_VUELO_MANTENCION = int.Parse(this._totalHorasVueloMantencion.ToString());
         aeronave.ESTADO           = this._estado.ToString();
         aeronave.ID_TIPO_AERONAVE = this._tipoAeronave._idTipoAeronave;
         CommonBC.ModeloEscuelaHalcones.AERONAVE.Add(aeronave);
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #9
0
        /// <summary>
        /// Metodo que obtiene los datos de una Aeronave.
        /// </summary>
        /// <returns>Retorna true si se encontro la aeronave y false de caso contrario</returns>
        public bool Buscar()
        {
            try
            {
                Halcones.DALC.AERONAVE aeronave = CommonBC.ModeloEscuelaHalcones.AERONAVE.
                                                  First(aero => aero.ID_AERONAVE == this._idAeronave);
                this._idAeronave                = int.Parse(aeronave.ID_AERONAVE.ToString());
                this._matricula                 = aeronave.MATRICULA;
                this._totalSegundosVuelo        = int.Parse(aeronave.TOTAL_SEGUNDOS_VUELO.ToString());
                this._fechaInspeccionAnual      = DateTime.Parse(aeronave.FECHA_INSPECCION_ANUAL.ToString());
                this._fechaAeronavegabilidad    = DateTime.Parse(aeronave.FECHA_AERONAVEGABILIDAD.ToString());
                this._annoFabricacion           = int.Parse(aeronave.ANNO_FABRICACION.ToString());
                this._diasMantencion            = int.Parse(aeronave.DIAS_MANTENCION.ToString());
                this._horasVueloMantencion      = int.Parse(aeronave.HORAS_VUELO_MANTENCION.ToString());;
                this._totalHorasVueloMantencion = int.Parse(aeronave.TOTAL_HORAS_VUELO_MANTENCION.ToString());;
                this._ultimoMantenimiento       = DateTime.Parse(aeronave.ULTIMO_MANTENIMIENTO.ToString());
                this._estado = aeronave.ESTADO;

                CommonBC.ModeloEscuelaHalcones.Entry(aeronave).Reference(a => a.TIPO_AERONAVE).Load();
                this._tipoAeronave._idTipoAeronave = int.Parse(aeronave.ID_TIPO_AERONAVE.ToString());
                this._tipoAeronave._tipoAeronave   = aeronave.TIPO_AERONAVE.TIPO_AERONAVE1;
                return(true);
            }
            catch (Exception ex)
            {
                ConfigHalcones.GenerarLog("ERROR", ex.ToString());
                return(false);
            }
        }
Example #10
0
 /// <summary>
 /// Metodo que registra un usuario.
 /// </summary>
 /// <returns>Retorna true si se registro el usuario y false de caso contrario</returns>
 public bool Agregar()
 {
     try
     {
         Halcones.DALC.USUARIO usuario = new DALC.USUARIO();
         usuario.ID_USUARIO       = this._idUsuario;
         usuario.USERNAME         = this._username;
         usuario.PASSWORD         = this._contrasena;
         usuario.CORREO           = this._correo;
         usuario.RUT              = this._rut;
         usuario.NOMBRES          = this._nombres;
         usuario.APELLIDOS        = this._apellidos;
         usuario.FECHA_NACIMIENTO = this._fechaNacimiento;
         usuario.ESTADO           = this._estado;
         usuario.ID_PERFIL        = this._idPerfil;
         CommonBC.ModeloEscuelaHalcones.USUARIO.Add(usuario);
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #11
0
 /// <summary>
 /// Metodo que verifica la existencia de un componente asociado a la aeronave
 /// </summary>
 /// <returns>Retorna true si ya existe un username y false de caso contrario</returns>
 public bool ExisteComponente()
 {
     try
     {
         bool existe = false;
         if (this._idComponenteAeronave != 0)
         {
             existe = CommonBC.ModeloEscuelaHalcones.COMPONENTES_AERONAVE.Any(
                 compAero => compAero.ID_COMPONENTE == this._componente._idComponente &&
                 compAero.ID_COMPONENTE_AERONAVE != this._idComponenteAeronave
                 );
         }
         else
         {
             existe = CommonBC.ModeloEscuelaHalcones.COMPONENTES_AERONAVE.Any(
                 compAero => compAero.ID_COMPONENTE == this._componente._idComponente);
         }
         return(existe);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
        private List <ComponentesAeronave> GenerarListado(List <DALC.COMPONENTES_AERONAVE> DalcComponenteAeronave)
        {
            try
            {
                List <ComponentesAeronave> componentesAeronave = new List <ComponentesAeronave>();
                foreach (Halcones.DALC.COMPONENTES_AERONAVE itemCA in DalcComponenteAeronave)
                {
                    ComponentesAeronave compAeromave = new ComponentesAeronave();
                    compAeromave._idComponenteAeronave = int.Parse(itemCA.ID_COMPONENTE_AERONAVE.ToString());
                    compAeromave._totalHorasVuelo      = int.Parse(itemCA.TOTAL_SEGUNDOS_VUELO.ToString());

                    CommonBC.ModeloEscuelaHalcones.Entry(itemCA).Reference(a => a.AERONAVE).Load();
                    compAeromave._aeronave._idAeronave = int.Parse(itemCA.AERONAVE.ID_AERONAVE.ToString());
                    compAeromave._aeronave._matricula  = itemCA.AERONAVE.MATRICULA;

                    CommonBC.ModeloEscuelaHalcones.Entry(itemCA).Reference(a => a.COMPONENTE).Load();
                    compAeromave._componente._idComponente = int.Parse(itemCA.COMPONENTE.ID_COMPONENTE.ToString());
                    compAeromave._componente._componente   = itemCA.COMPONENTE.COMPONENTE1;

                    componentesAeronave.Add(compAeromave);
                }
                return(componentesAeronave);
            }
            catch (Exception ex)
            {
                ConfigHalcones.GenerarLog("ERROR", ex.ToString());
                return(null);
            }
        }
Example #13
0
 /// <summary>
 /// Metodo que registra una Vuelo.
 /// </summary>
 /// <returns>Retorna true si se registro el vuelo y false de caso contrario</returns>
 public bool Agregar()
 {
     try
     {
         Halcones.DALC.VUELO vuelo = new DALC.VUELO();
         vuelo.ID_VUELO     = this._idVuelo;
         vuelo.FECHA_SALIDA = this._fechaSalida;
         vuelo.ESTADO       = this._estado;
         vuelo.ORIGEN       = this._origen;
         vuelo.DESTINO      = this._destino;
         vuelo.ID_AERONAVE  = this._aeronave._idAeronave;
         vuelo.ID_PILOTO    = this._piloto._idPiloto;
         vuelo.ID_COPILOTO  = this._copiloto._idPiloto;
         vuelo.ID_CONDICION = this._condicion._idCondicion;
         vuelo.ID_MISION    = this._mision._idMision;
         CommonBC.ModeloEscuelaHalcones.VUELO.Add(vuelo);
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #14
0
 /// <summary>
 /// Metodo que verifica la existencia de asociacion de la licencia al piloto
 /// </summary>
 /// <returns>Retorna true si ya esta asociada la licencia al piloto y false de caso contrario</returns>
 public bool ExisteLicencia()
 {
     try
     {
         bool existe = false;
         if (this._idLicenciaPiloto != 0)
         {
             existe = CommonBC.ModeloEscuelaHalcones.LICENCIA_PILOTO.Any(
                 lp => lp.ID_LICENCIA == this._licencia._idLicencia &&
                 lp.ID_LICENCIA_PILOTO != this._idLicenciaPiloto
                 );
         }
         else
         {
             existe = CommonBC.ModeloEscuelaHalcones.LICENCIA_PILOTO.Any(
                 lp => lp.ID_LICENCIA == this._licencia._idLicencia);
         }
         return(existe);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #15
0
 /// <summary>
 /// Metodo que obtiene el Identificador de un Usuario
 /// </summary>
 public void ObtenerId()
 {
     try
     {
         Halcones.DALC.USUARIO usuario = CommonBC.ModeloEscuelaHalcones.USUARIO.
                                         First(p => p.USERNAME == this._username && p.RUT == this._rut);
         this._idUsuario = int.Parse(usuario.ID_USUARIO.ToString());
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
     }
 }
Example #16
0
        private List <Vuelo> GenerarListado(List <DALC.VUELO> DalcVuelos)
        {
            try
            {
                List <Vuelo> vuelos = new List <Vuelo>();
                foreach (Halcones.DALC.VUELO vuelo in DalcVuelos)
                {
                    Vuelo vu = new Vuelo();

                    vu._idVuelo     = int.Parse(vuelo.ID_VUELO.ToString());
                    vu._fechaSalida = DateTime.Parse(vuelo.FECHA_SALIDA.ToString());
                    vu._estado      = vuelo.ESTADO;
                    vu._origen      = vuelo.ORIGEN;
                    vu._destino     = vuelo.DESTINO;

                    CommonBC.ModeloEscuelaHalcones.Entry(vuelo).Reference(a => a.AERONAVE).Load();
                    vu._aeronave._idAeronave = int.Parse(vuelo.AERONAVE.ID_AERONAVE.ToString());
                    vu._aeronave._matricula  = vuelo.AERONAVE.MATRICULA;

                    CommonBC.ModeloEscuelaHalcones.Entry(vuelo).Reference(a => a.PILOTO).Load();
                    vu._piloto._idPiloto = int.Parse(vuelo.PILOTO.ID_PILOTO.ToString());
                    CommonBC.ModeloEscuelaHalcones.Entry(vuelo.PILOTO).Reference(a => a.USUARIO).Load();
                    vu._piloto._usuario._rut       = vuelo.PILOTO.USUARIO.RUT;
                    vu._piloto._usuario._nombres   = vuelo.PILOTO.USUARIO.NOMBRES;
                    vu._piloto._usuario._apellidos = vuelo.PILOTO.USUARIO.APELLIDOS;

                    CommonBC.ModeloEscuelaHalcones.Entry(vuelo).Reference(a => a.PILOTO1).Load();
                    vu._copiloto._idPiloto = int.Parse(vuelo.PILOTO1.ID_PILOTO.ToString());
                    CommonBC.ModeloEscuelaHalcones.Entry(vuelo.PILOTO1).Reference(a => a.USUARIO).Load();
                    vu._copiloto._usuario._rut       = vuelo.PILOTO1.USUARIO.RUT;
                    vu._copiloto._usuario._nombres   = vuelo.PILOTO1.USUARIO.NOMBRES;
                    vu._copiloto._usuario._apellidos = vuelo.PILOTO1.USUARIO.APELLIDOS;

                    CommonBC.ModeloEscuelaHalcones.Entry(vuelo).Reference(a => a.CONDICION_VUELO).Load();
                    vu._condicion._idCondicion = int.Parse(vuelo.CONDICION_VUELO.ID_CONDICION.ToString());
                    vu._condicion._condicion   = vuelo.CONDICION_VUELO.CONDICION;

                    CommonBC.ModeloEscuelaHalcones.Entry(vuelo).Reference(a => a.MISION).Load();
                    vu._mision._idMision = int.Parse(vuelo.MISION.ID_MISION.ToString());
                    vu._mision._mision   = vuelo.MISION.MISION1;

                    vuelos.Add(vu);
                }
                return(vuelos);
            }
            catch (Exception ex)
            {
                ConfigHalcones.GenerarLog("ERROR", ex.ToString());
                return(null);
            }
        }
Example #17
0
 /// <summary>
 /// Metodo que Da de Baja un Tipo de Licencia
 /// </summary>
 /// <returns>Retorna true si se dio de de baja el tipo de licencia y false de caso contrario</returns>
 public bool DarDeBaja()
 {
     try
     {
         Halcones.DALC.LICENCIA licencia = CommonBC.ModeloEscuelaHalcones.LICENCIA.First(li => li.ID_LICENCIA == this._idLicencia);
         licencia.ESTADO = this._estado;
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #18
0
 /// <summary>
 /// Metodo que desvincula un componente de una Aeronave
 /// </summary>
 /// <returns>Retorna true si se desvinculo el compontenen de la aeronave y false de caso contrario</returns>
 public bool DesvincularComponente()
 {
     try
     {
         Halcones.DALC.COMPONENTES_AERONAVE compAero = CommonBC.ModeloEscuelaHalcones.COMPONENTES_AERONAVE.
                                                       First(p => p.ID_COMPONENTE_AERONAVE == this._idComponenteAeronave);
         CommonBC.ModeloEscuelaHalcones.COMPONENTES_AERONAVE.Remove(compAero);
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #19
0
 /// <summary>
 /// Metodo que Da de Baja un usuario
 /// </summary>
 /// <returns>Retorna true si se dio de de baja el usuario y false de caso contrario</returns>
 public bool DarDeBaja()
 {
     try
     {
         Halcones.DALC.USUARIO usuario = CommonBC.ModeloEscuelaHalcones.USUARIO.First(
             usu => usu.ID_USUARIO == this._idUsuario);
         usuario.ESTADO = this._estado;
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #20
0
 /// <summary>
 /// Metodo que Da de Baja una Aeronave
 /// </summary>
 /// <returns>Retorna true si se dio de de baja la aeronave y false de caso contrario</returns>
 public bool DarDeBaja()
 {
     try
     {
         Halcones.DALC.AERONAVE aeronave = CommonBC.ModeloEscuelaHalcones.AERONAVE.First(
             aero => aero.ID_AERONAVE == this._idAeronave);
         aeronave.ESTADO = this._estado;
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #21
0
 /// <summary>
 /// Metodo que Da de Baja un Componente
 /// </summary>
 /// <returns>Retorna true si se dio de de baja el componente y false de caso contrario</returns>
 public bool DarDeBaja()
 {
     try
     {
         Halcones.DALC.COMPONENTE comp = CommonBC.ModeloEscuelaHalcones.COMPONENTE.First(
             c => c.ID_COMPONENTE == this._idComponente);
         comp.ESTADO = this._estado;
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #22
0
 /// <summary>
 /// Metodo que desvincula una licencia de un piloto
 /// </summary>
 /// <returns>Retorna true si se desvinculo la licencia del piloto y false de caso contrario</returns>
 public bool DesvincularLicencia()
 {
     try
     {
         Halcones.DALC.LICENCIA_PILOTO lp = CommonBC.ModeloEscuelaHalcones.LICENCIA_PILOTO.
                                            First(p => p.ID_LICENCIA_PILOTO == this._idLicenciaPiloto);
         CommonBC.ModeloEscuelaHalcones.LICENCIA_PILOTO.Remove(lp);
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #23
0
 /// <summary>
 /// Metodo que Da de Baja una Vuelo
 /// </summary>
 /// <returns>Retorna true si se dio de de baja el vuelo y false de caso contrario</returns>
 public bool DarDeBaja()
 {
     try
     {
         Halcones.DALC.VUELO vuelo = CommonBC.ModeloEscuelaHalcones.VUELO.First(
             vue => vue.ID_VUELO == this._idVuelo);
         vuelo.ESTADO = this._estado;
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #24
0
 /// <summary>
 /// Metodo que actualiza un Tipo de Licencia
 /// </summary>
 /// <returns>Retorna true si se actualizo el tipo de licencia y false de caso contrario</returns>
 public bool Actualizar()
 {
     try
     {
         Halcones.DALC.LICENCIA licencia = CommonBC.ModeloEscuelaHalcones.LICENCIA.
                                           First(li => li.ID_LICENCIA == this._idLicencia);
         licencia.LICENCIA1       = this._licencia;
         licencia.DIAS_RENOVACION = this._diasRenovacion;
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #25
0
        public bool BuscarFechaSalida()
        {
            try
            {
                Halcones.DALC.VUELO vuelo = CommonBC.ModeloEscuelaHalcones.VUELO.
                                            First(vue => vue.ID_VUELO == this._idVuelo);

                this._idVuelo     = int.Parse(vuelo.ID_VUELO.ToString());
                this._fechaSalida = DateTime.Parse(vuelo.FECHA_SALIDA.ToString());
                return(true);
            }
            catch (Exception ex)
            {
                ConfigHalcones.GenerarLog("ERROR", ex.ToString());
                return(false);
            }
        }
Example #26
0
 /// <summary>
 /// Metodo que obtiene los datos de un Tipo de Licencia.
 /// </summary>
 /// <returns>Retorna true si se encontro el tipo de licencia y false de caso contrario</returns>
 public bool Buscar()
 {
     try
     {
         Halcones.DALC.LICENCIA licencia = CommonBC.ModeloEscuelaHalcones.LICENCIA.
                                           First(li => li.ID_LICENCIA == this._idLicencia);
         this._idLicencia     = int.Parse(licencia.ID_LICENCIA.ToString());
         this._diasRenovacion = int.Parse(licencia.DIAS_RENOVACION.ToString());
         this._licencia       = licencia.LICENCIA1;
         this._estado         = licencia.ESTADO;
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #27
0
 /// <summary>
 /// Metodo que obtiene los datos de un Componente.
 /// </summary>
 /// <returns>Retorna true si se encontro el componente y false de caso contrario</returns>
 public bool Buscar()
 {
     try
     {
         Halcones.DALC.COMPONENTE comp = CommonBC.ModeloEscuelaHalcones.COMPONENTE.First(
             c => c.ID_COMPONENTE == this._idComponente);
         this._idComponente = int.Parse(comp.ID_COMPONENTE.ToString());
         this._componente   = comp.COMPONENTE1.ToString();
         this._fabricante   = comp.FABRICANTE.ToString();
         this._estado       = comp.ESTADO;
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #28
0
 /// <summary>
 /// Metodo que configura una licencia de un Piloto
 /// </summary>
 /// <returns>Retorna true si se configuro la licencia del piloto y false de caso contrario</returns>
 public bool ConfigurarLicencia()
 {
     try
     {
         Halcones.DALC.LICENCIA_PILOTO licenciaPiloto = CommonBC.ModeloEscuelaHalcones.LICENCIA_PILOTO.
                                                        First(lip => lip.ID_LICENCIA_PILOTO == this._idLicenciaPiloto);
         licenciaPiloto.ID_LICENCIA   = this._licencia._idLicencia;
         licenciaPiloto.ID_PILOTO     = this._piloto._idPiloto;
         licenciaPiloto.NUEVO_CONTROL = this._nuevoControl;
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #29
0
 /// <summary>
 /// Metodo que actualiza un Componente
 /// </summary>
 /// <returns>Retorna true si se actualizo el componente y false de caso contrario</returns>
 public bool Actualizar()
 {
     try
     {
         Halcones.DALC.COMPONENTE comp = CommonBC.ModeloEscuelaHalcones.COMPONENTE.First(
             c => c.ID_COMPONENTE == this._idComponente);
         comp.ID_COMPONENTE = this._idComponente;
         comp.COMPONENTE1   = this._componente;
         comp.FABRICANTE    = this._fabricante;
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Example #30
0
 /// <summary>
 /// Metodo que asocia un componente a una Aeronave.
 /// </summary>
 /// <returns>Retorna true si se asocio el componente a la aeronave y false de caso contrario</returns>
 public bool AsociarComponente()
 {
     try
     {
         Halcones.DALC.COMPONENTES_AERONAVE compAero = new DALC.COMPONENTES_AERONAVE();
         compAero.ID_COMPONENTE_AERONAVE = this._idComponenteAeronave;
         compAero.TOTAL_SEGUNDOS_VUELO   = this._totalHorasVuelo;
         compAero.ID_AERONAVE            = this._aeronave._idAeronave;
         compAero.ID_COMPONENTE          = this._componente._idComponente;
         CommonBC.ModeloEscuelaHalcones.COMPONENTES_AERONAVE.Add(compAero);
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         ConfigHalcones.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }