/// <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); } }
/// <summary> /// Inicializador de las variables de la clase Aeronave /// </summary> private void Init() { this._idAeronave = 0; this._matricula = string.Empty; this._totalSegundosVuelo = 0; this.HorasVuelo = new TimeSpan(); this._fechaInspeccionAnual = new DateTime(2016, 09, 22); this._fechaAeronavegabilidad = new DateTime(2016, 09, 22); this._annoFabricacion = 0; this._diasMantencion = 0; this._horasVueloMantencion = 0; this._totalHorasVueloMantencion = 0; this._ultimoMantenimiento = new DateTime(2016, 09, 22); this._estado = string.Empty; this._tipoAeronave = new TipoAeronave(); }
private List <TipoAeronave> GenerarListado(List <DALC.TIPO_AERONAVE> DalcTipoAeronaves) { try { List <TipoAeronave> tipoAeronaves = new List <TipoAeronave>(); foreach (Halcones.DALC.TIPO_AERONAVE tipoAeronave in DalcTipoAeronaves) { TipoAeronave tipo = new TipoAeronave(); tipo._idTipoAeronave = int.Parse(tipoAeronave.ID_TIPO_AERONAVE.ToString()); tipo._tipoAeronave = tipoAeronave.TIPO_AERONAVE1; tipoAeronaves.Add(tipo); } return(tipoAeronaves); } catch (Exception ex) { ConfigHalcones.GenerarLog("ERROR", ex.ToString()); return(null); } }