/// <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); } }
/// <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); } }
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); } }