protected void txtCedula_TextChanged(object sender, EventArgs e) { VehiculoServiceClient servVehiculo = new VehiculoServiceClient(); long resp; try { resp = servVehiculo.ConsultarExistenciaContratista(txtCedula.Text); if (resp != 0) { MessageBox.Show("El Contratista ya se encuentra registrado en el sistema", "Registrar Contratista"); divInfoContratista.Visible = false; btnGuardar.Visible = false; txtCedula.Text = ""; txtCedulaCont.Text = ""; txtDireccion.Text = ""; txtNombreContratista.Text = ""; txtPrimerApellido.Text = ""; txtCedula.Focus(); } else { divInfoContratista.Visible = true; btnGuardar.Visible = true; txtNombreContratista.Focus(); txtCedulaCont.Text = txtCedula.Text; txtCedula.Text = ""; } } catch (Exception ex) { Response.Redirect("~/About.aspx"); } finally { servVehiculo.Close(); } }
protected void txtCedula_TextChanged(object sender, EventArgs e) { VehiculoServiceClient servVehiculo = new VehiculoServiceClient(); try { long consultarPropVehiculo = servVehiculo.ConsultarExistenciaContratista(txtCedula.Text); if (consultarPropVehiculo != 0) { txtCedula2.Text = txtCedula.Text; ContratistaBE objContratista = servVehiculo.ConsultarPropVehiculo(txtCedula2.Text); txtCedula.Text = ""; txtNombres.Text = objContratista.Nombres; txtApellidos.Text = objContratista.Apellidos; DivConsultaPropietario.Visible = true; txtCedula1.Focus(); } else { MessageBox.Show("El propietario no se encuentra registrado en el sistema", "Registro de Vehículos"); txtCedula.Text = ""; txtCedula2.Text = ""; txtNombres.Text = ""; txtApellidos.Text = ""; DivConsultaPropietario.Visible = false; txtCedula.Focus(); } } catch (Exception ex) { Response.Redirect("~/About.aspx"); } finally { servVehiculo.Close(); } }