private void RegistrarEscalaTecnica()
        {
            try
            {
                if (!ValidarCampos())
                {
                    return;
                }
                clsAeropuerto objValAero = new clsAeropuerto(strNombreApp);
                objValAero.CodigoAeropuerto = this.txtAeropuerto.Text.Trim();
                if (!objValAero.ConsultarAeropuerto())
                {
                    this.lblMensaje.Text   = "El Aeropuerto no existe";
                    this.pnlAlerta.Visible = true;
                    objValAero             = null;
                    return;
                }
                objValAero = null;
                clsEscalaTecnica objEscalaTecnica = new clsEscalaTecnica(strNombreApp);
                objEscalaTecnica.CodEscalaTecnica = this.txtCodEscalaTecnica.Text.Trim();
                if (objEscalaTecnica.ConsultarEscalaTenica())
                {
                    this.lblMensaje.Text   = "Lo sentimos, ya existe una Escala Técnica con ese código";
                    this.pnlAlerta.Visible = true;
                    objEscalaTecnica       = null;
                    return;
                }
                objEscalaTecnica.CodigoAeropuerto = this.txtAeropuerto.Text.Trim();
                if (!objEscalaTecnica.CrearEscalaTecnica())
                {
                    this.lblMensaje.Text   = objEscalaTecnica.Error;
                    this.pnlAlerta.Visible = true;
                    objEscalaTecnica       = null;
                    return;
                }

                if (objEscalaTecnica.Respuesta == 0)
                {
                    this.lblMensaje.Text   = objEscalaTecnica.Error;
                    this.pnlAlerta.Visible = true;
                    objEscalaTecnica       = null;
                    return;
                }
                else
                {
                    this.lblMensaje.Text = "Nueva Escala Técnica registrada con exito";
                    LimpiarCampos();
                    this.pnlAlerta.Visible = true;
                    objEscalaTecnica       = null;
                    return;
                }
            }
            catch (Exception ex)
            {
                this.lblMensaje.Text   = ex.Message;
                this.pnlAlerta.Visible = true;
                return;
            }
        }
        private bool ValidarAeropuertos()
        {
            clsAeropuerto objValAeropuerto = new clsAeropuerto(strNombreApp);

            objValAeropuerto.CodigoAeropuerto = this.txtAeroPartida.Text.Trim();
            if (!objValAeropuerto.ConsultarAeropuerto())
            {
                this.lblMensaje.Text   = "No existe ningín Aeropuerto con código " + objValAeropuerto.CodigoAeropuerto;
                this.pnlAlerta.Visible = true;
                objValAeropuerto       = null;
                return(false);
            }
            objValAeropuerto.CodigoAeropuerto = this.txtAeroLlegada.Text.Trim();
            if (!objValAeropuerto.ConsultarAeropuerto())
            {
                this.lblMensaje.Text   = "No existe ningín Aeropuerto con código " + objValAeropuerto.CodigoAeropuerto;
                this.pnlAlerta.Visible = true;
                objValAeropuerto       = null;
                return(false);
            }
            objValAeropuerto = null;
            return(true);
        }
Example #3
0
        private void AsignarAeroLA()
        {
            try
            {
                if (!ValidarCampos())
                {
                    return;
                }
                clsAeropuerto objAeropuerto = new clsAeropuerto(strNombreApp);
                objAeropuerto.CodigoAeropuerto = this.txtCodRAeropuerto.Text.Trim();
                if (!objAeropuerto.ConsultarAeropuerto())
                {
                    this.lblMensaje.Text   = "El Aeropuerto que intenta asignar no existe";
                    this.pnlAlerta.Visible = true;
                    objAeropuerto          = null;
                    return;
                }
                objAeropuerto = null;
                clsLineaAerea objLineaAerea = new clsLineaAerea(strNombreApp);
                objLineaAerea.CodLineaAerea = this.txtCodRLineaAerea.Text.Trim();
                if (!objLineaAerea.ConsultarLineaAerea())
                {
                    this.lblMensaje.Text   = "No existe una linea aerea con código " + objLineaAerea.CodLineaAerea;
                    this.pnlAlerta.Visible = true;
                    objLineaAerea          = null;
                    return;
                }
                objLineaAerea = null;

                clsAsignacion objAeroLA = new clsAsignacion(strNombreApp);
                objAeroLA.CodigoAeropuerto = this.txtCodRAeropuerto.Text.Trim();
                objAeroLA.CodigoLineaAerea = this.txtCodRLineaAerea.Text.Trim();

                if (!objAeroLA.AsginarAero_LineaAerea())
                {
                    this.lblMensaje.Text   = objAeroLA.Error;
                    this.pnlAlerta.Visible = true;
                    objAeroLA = null;
                    return;
                }

                if (objAeroLA.Respuesta == 0)
                {
                    this.lblMensaje.Text   = objAeroLA.Error;
                    this.pnlAlerta.Visible = true;
                    objAeroLA = null;
                    return;
                }
                else
                {
                    this.lblMensaje.Text   = "Asignación con exito";
                    this.pnlAlerta.Visible = true;
                    objAeroLA = null;
                    return;
                }
            }
            catch (Exception ex)
            {
                this.lblMensaje.Text   = "No hubo cambios, el Aeropuerto ya contaba con esta asignación";
                this.pnlAlerta.Visible = true;
                return;
            }
        }
        private void RegistrarAeropuerto()
        {
            try
            {
                if (!ValidarCampos())
                {
                    return;
                }
                clsAeropuerto objAeropuerto = new clsAeropuerto(strNombreApp);
                objAeropuerto.CodigoAeropuerto = this.txtCodAeropuerto.Text.Trim();
                if (objAeropuerto.ConsultarAeropuerto())
                {
                    this.lblMensaje.Text   = "El Aeropuerto ya se encuentra registrado";
                    this.pnlAlerta.Visible = true;
                    objAeropuerto          = null;
                    return;
                }
                clsPersona objValPersona = new clsPersona(strNombreApp);
                objValPersona.Identificacion = this.txtCodResponsable.Text.Trim();
                if (!objValPersona.ValidarIdentificacion())
                {
                    this.lblMensaje.Text   = "No existe un usuario con la identificación " + objValPersona.Identificacion;
                    this.pnlAlerta.Visible = true;
                    objValPersona          = null;
                    return;
                }
                objValPersona = null;

                objAeropuerto.Nombre            = this.txtNombreAeropuerto.Text.Trim();
                objAeropuerto.Pais              = this.txtPaisAeropuerto.Text.Trim();
                objAeropuerto.Ciudad            = this.txtPaisAeropuerto.Text.Trim();
                objAeropuerto.CodigoResponsable = this.txtCodResponsable.Text.Trim();
                objAeropuerto.Estado            = this.txtEstado.Text.Trim();


                if (!objAeropuerto.CrearAeropuerto())
                {
                    this.lblMensaje.Text   = objAeropuerto.Error;
                    this.pnlAlerta.Visible = true;
                    objAeropuerto          = null;
                    return;
                }

                if (objAeropuerto.Respuesta == 0)
                {
                    this.lblMensaje.Text   = objAeropuerto.Error;
                    this.pnlAlerta.Visible = true;
                    objAeropuerto          = null;
                    return;
                }
                else
                {
                    this.lblMensaje.Text   = "Registro de Aeropuerto con exito";
                    this.pnlAlerta.Visible = true;
                    objAeropuerto          = null;
                    return;
                }
            }
            catch (Exception ex)
            {
                this.lblMensaje.Text   = ex.Message;
                this.pnlAlerta.Visible = true;
                return;
            }
        }