private void frmPacientesManter_Load(object sender, EventArgs e)
 {
     if (this.comando.Equals("editar"))
     {
         Modelo.Controle controle = new Modelo.Controle();
         controle.GetPacienteDadosCadastrais(this.idPaciente);
         while (controle.Dr.Read())
         {
             txbID.Text             = this.idPaciente.ToString();
             txbProntuario.Text     = controle.Dr["prontuario"].ToString();
             txbPeso.Text           = controle.Dr["peso"].ToString();
             txbAltura.Text         = controle.Dr["altura"].ToString();
             txbGrupoSanguineo.Text = controle.Dr["grupoSanguineo"].ToString();
             cmbEstado.Text         = controle.Dr["estadoPaciente"].ToString();
             txbNome.Text           = controle.Dr["nome"].ToString();
             txbRg.Text             = controle.Dr["rg"].ToString();
             txbCpf.Text            = controle.Dr["cpf"].ToString();
             txbDtNascimento.Text   = controle.Dr["dtNascimento"].ToString();
             txbProfissao.Text      = controle.Dr["profissao"].ToString();
             txbGrauInstrucao.Text  = controle.Dr["grauInstrucao"].ToString();
         }
     }
     else
     {
         cmbEstado.SelectedIndex = 0;
     }
 }
Пример #2
0
 private void AtualizarCampos()
 {
     Modelo.Controle controle = new Modelo.Controle();
     controle.GetPacienteDadosCadastrais(this.idPaciente);
     while (controle.Dr.Read())
     {
         txbID.Text             = this.idPaciente.ToString();
         txbProntuario.Text     = controle.Dr["prontuario"].ToString();
         txbPeso.Text           = controle.Dr["peso"].ToString();
         txbAltura.Text         = controle.Dr["altura"].ToString();
         txbGrupoSanguineo.Text = controle.Dr["grupoSanguineo"].ToString();
         cmbEstado.Text         = controle.Dr["estadoPaciente"].ToString();
         txbNome.Text           = controle.Dr["nome"].ToString();
         txbRg.Text             = controle.Dr["rg"].ToString();
         txbCpf.Text            = controle.Dr["cpf"].ToString();
         txbDtNascimento.Text   = controle.Dr["dtNascimento"].ToString();
         txbProfissao.Text      = controle.Dr["profissao"].ToString();
         txbGrauInstrucao.Text  = controle.Dr["grauInstrucao"].ToString();
     }
 }