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