Exemplo n.º 1
0
        public bool ExisteLicencia()
        {
            try
            {
                bool existe = false;
                if (this._idLicencia != 0)
                {
                    existe = CommonBC.ModeloEscuelaHalcones.LICENCIA.Any(
                        licencia => licencia.LICENCIA1 == this._licencia &&
                        licencia.ID_LICENCIA != this._idLicencia);
                }
                else
                {
                    existe = CommonBC.ModeloEscuelaHalcones.LICENCIA.Any(licencia => licencia.LICENCIA1 == this._licencia);
                }
                return(existe);
            }
            catch (Exception ex)
            {
                CredencialesAutenticacion.GenerarLog("ERROR", ex.ToString());
                return(false);
            }

            throw new NotImplementedException();
        }
Exemplo n.º 2
0
 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)
     {
         CredencialesAutenticacion.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Exemplo n.º 3
0
 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._licencia   = licencia.LICENCIA1;
         this._estado     = licencia.ESTADO;
         return(true);
     }
     catch (Exception ex)
     {
         CredencialesAutenticacion.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Exemplo n.º 4
0
 public bool Agregar()
 {
     try
     {
         Halcones.DALC.LICENCIA licencia = new DALC.LICENCIA();
         licencia.ID_LICENCIA = this._idLicencia;
         licencia.LICENCIA1   = this._licencia;
         licencia.ESTADO      = this._estado;
         CommonBC.ModeloEscuelaHalcones.LICENCIA.Add(licencia);
         CommonBC.ModeloEscuelaHalcones.SaveChanges();
         return(true);
     }
     catch (Exception ex)
     {
         CredencialesAutenticacion.GenerarLog("ERROR", ex.ToString());
         return(false);
     }
 }
Exemplo n.º 5
0
 private List <Condicion> GenerarListado(List <DALC.CONDICION_VUELO> DalcCondicion)
 {
     try
     {
         List <Condicion> condiciones = new List <Condicion>();
         foreach (Halcones.DALC.CONDICION_VUELO condicion in DalcCondicion)
         {
             Condicion cond = new Condicion();
             cond._idCondicion = int.Parse(condicion.ID_CONDICION.ToString());
             cond._condicion   = condicion.CONDICION;
             condiciones.Add(cond);
         }
         return(condiciones);
     }
     catch (Exception ex)
     {
         CredencialesAutenticacion.GenerarLog("ERROR", ex.ToString());
         return(null);
     }
 }
 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._aeronave._idAeronave    = int.Parse(mantAeronave.ID_AERONAVE.ToString());
             mantA._aeronave._matricula     = mantAeronave.AERONAVE.MATRICULA;
             mantA._estado              = mantAeronave.ESTADO;
             mantA._tipoMantenimiento   = mantAeronave.TIPO_MANTENIMIENTO;
             mantA._fechaManteniminento = DateTime.Parse(mantAeronave.FECHA_MATENIMIENTO.ToString());
             mantencionesAeronave.Add(mantA);
         }
         return(mantencionesAeronave);
     }
     catch (Exception ex)
     {
         CredencialesAutenticacion.GenerarLog("ERROR", ex.ToString());
         return(null);
     }
 }