예제 #1
0
        private void PBPesquisar_Click(object sender, EventArgs e)
        {
            int pk_pac = repoPac.SelectPKPaciente(TBNomePaciente.Text.ToString(), TBCPFPaciente.Text.ToString());

            //Se o usuário pesquisado Existir
            if (pk_pac != 0)
            {
                repository.SelectAnamnese(TBNomePaciente.Text.ToString(), TBCPFPaciente.Text.ToString());
                this.Height      = 554;
                PBEditar.Visible = false;
            }
            //Se o usuário não existir
            else
            {
                var retorno =
                    MessageBox.Show("Paciente não cadastrado no Sistema! \n Deseja Cadastrar este Paciente?",
                                    "Alerta", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (retorno == DialogResult.Yes)
                {
                    FRM_Paciente frmPac = new FRM_Paciente();
                    frmPac.Show();
                    this.Close();
                }
            }
        }
 private void DGV_ConsultaPaciente_CellContentClick(object sender, DataGridViewCellEventArgs e)
 {
     frmPac = new FRM_Paciente(DGV_ConsultaPaciente.CurrentRow.Cells[0].Value.ToString(),
                               DGV_ConsultaPaciente.CurrentRow.Cells[1].Value.ToString(),
                               int.Parse(DGV_ConsultaPaciente.CurrentRow.Cells[2].Value.ToString()),
                               DGV_ConsultaPaciente.CurrentRow.Cells[3].Value.ToString(),
                               DGV_ConsultaPaciente.CurrentRow.Cells[4].Value.ToString(),
                               DGV_ConsultaPaciente.CurrentRow.Cells[5].Value.ToString());
     frmPac.Show();
     this.Close();
 }
 private void PBPesquisar_Click(object sender, EventArgs e)
 {
     //Se o usuário pesquisado Existir
     if (true)
     {
         //Se existir dados
         if (false)
         {
             var returno = MessageBox.Show
                               ("Anamnese já preenchida para este Paciente! \n Deseja consultar os dados?",
                               "Aviso", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
             if (returno == DialogResult.Yes)
             {
                 this.Height         = 554;
                 PBCancelar.Visible  = false;
                 PBConfirmar.Visible = false;
                 PBEditar.Visible    = true;
                 //usuario poderá vizualizar as informações e/ou editalas
             }
             else
             {
                 mt.limparTextBoxes(Controls);
             }
         }
         else
         {
             this.Height      = 554;
             PBEditar.Visible = false;
         }
     }
     //Se o usuário não existir
     else if (true)
     {
         var retorno =
             MessageBox.Show("Paciente não cadastrado no Sistema! \n Deseja Cadastrar este Paciente?",
                             "Alerta", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
         if (retorno == DialogResult.Yes)
         {
             FRM_Paciente frmPac = new FRM_Paciente();
             frmPac.Show();
             this.Close();
         }
     }
     //Se a consulta retornar mais de um dado
     else
     {
         FRM_ConsultaAnamnese frmCA = new FRM_ConsultaAnamnese();
         frmCA.Show();
         this.Close();
     }
 }
 private void BTPaciente_Click(object sender, EventArgs e)
 {
     frmPac = new FRM_Paciente();
     frmPac.Show();
     this.Close();
 }