private void btnConsultar_Click(object sender, EventArgs e) { if (myInfo == null) { myInfo = new Empresas(); } if (txt_cod.Text == "") { MessageBox.Show("Ingrese el codigo de Sunat"); txt_cod.Focus(); existeRuc = false; } else { try { //llamamos a los metodos de la libreria ConsultaReniec... myInfo.GetInfo(this.txtruc.Text, this.txt_cod.Text); this.txt_direccion.Text = myInfo.ApeMaterno; this.txtrazonsocial.Text = myInfo.Nombres; // this.txtRuc.Text = txtNumDni.Text; // this.txtNumDni.Text = ""; this.txt_cod.Text = ""; txtrazonsocial.Focus(); CargarImagen(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
void CargarImagen() { try { if (myInfo == null) { myInfo = new Clases.Empresas(); } this.pictureCapcha.Image = myInfo.GetCapcha; } catch (Exception ex) { MessageBox.Show("Error temporal al Conectarse con el servidor de SUNAT. Llene los Datos de Forma Manual y Seleccione Agregar", "San Agustin", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
void CargarImagen() { try { if (myInfo == null) { myInfo = new Empresas(); } this.pictureCapcha.Image = myInfo.GetCapcha; } catch (Exception ex) { MessageBox.Show(ex.Message); } }