private void PBPesquisar_Click(object sender, EventArgs e) { if (TBNomeMedico.Text == String.Empty || TBNomePaciente.Text == String.Empty) { MessageBox.Show("Campos obrigatórios para pesquisa não informados!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { frmConsCons = new FRM_ConsultaConsultas(TBNomeMedico.Text.ToString(), TBNomePaciente.Text.ToString()); frmConsCons.Show(); this.Close(); } }
private void PBPesquisar_Click(object sender, EventArgs e) { //Se tiver mais de um registro if (false) { frmConsCons = new FRM_ConsultaConsultas(TBNome.Text.ToString()); frmConsCons.Show(); this.Close(); } //Se tiver só um registro só preenche as TextBox else { mt.AlterarEdicaoTextBoxes(Controls, false); PBEditar.Visible = true; } }