private void button1_Click(object sender, EventArgs e) { if (textBoxNroAoP.Text.Length == 0) { MessageBox.Show("Ingrese el numero de Afiliado o Profesional segun desee"); } else { int result = 0; if (!int.TryParse(textBoxNroAoP.Text, out result)) { textBoxNroAoP.Text = ""; MessageBox.Show("Solo se permiten numeros"); } else { String validacion = "select me_activo from bugdeveloping.medico where me_persona = " + textBoxNroAoP.Text; ConnectorClass con = ConnectorClass.Instance; DataTable validar = new DataTable(); validar = con.executeQuery(validacion); if (validar.Rows.Count == 0) { MessageBox.Show("No existe el profesional nro: " + textBoxNroAoP.Text); } else { if (Convert.ToInt32(validar.Rows[0][0]) == 1) { nroAfilOProf = Convert.ToInt32(textBoxNroAoP.Text); Cancelar_Atencion.CancelacionProf frmProf = new CancelacionProf(); this.Close(); frmProf.Show(); } else { MessageBox.Show("El profesional " + textBoxNroAoP.Text + " no esta habilitado"); } } } } }
private void button1_Click(object sender, EventArgs e) { if (textBoxNroAoP.Text.Length == 0) { MessageBox.Show("Ingrese el numero de Afiliado o Profesional segun desee"); } else { int result = 0; if (!int.TryParse(textBoxNroAoP.Text, out result)) { textBoxNroAoP.Text = ""; MessageBox.Show("Solo se permiten numeros"); } else { String validacion = "select me_activo from bugdeveloping.medico where me_persona = " + textBoxNroAoP.Text; ConnectorClass con = ConnectorClass.Instance; DataTable validar = new DataTable(); validar = con.executeQuery(validacion); if (validar.Rows.Count == 0) { MessageBox.Show("No existe el profesional nro: " + textBoxNroAoP.Text); } else { if (Convert.ToInt32(validar.Rows[0][0]) == 1) { nroAfilOProf = Convert.ToInt32(textBoxNroAoP.Text); Cancelar_Atencion.CancelacionProf frmProf = new CancelacionProf(); this.Close(); frmProf.Show(); } else { MessageBox.Show("El profesional " + textBoxNroAoP.Text + " no esta habilitado"); } } } } }