예제 #1
0
        private void btnHistorico_Click(object sender, EventArgs e)
        {
            ConsultaController cc = new ConsultaController();

            historicoConsulta = cc.search("paciente", dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells[0].Value.ToString());
            if (historicoConsulta.Count > 0)
            {
                if (Application.OpenForms.OfType <GraficoGeral>().Count() <= 0)
                {
                    GraficoGeral gg = new GraficoGeral(historicoConsulta);
                    gg.Show();
                }
                else
                {
                    MessageBox.Show("Formulário já está aberto!");
                }
                if (Application.OpenForms.OfType <GraficoPressao>().Count() <= 0)
                {
                    GraficoPressao gp = new GraficoPressao(historicoConsulta);
                    gp.Show();
                }
                else
                {
                    MessageBox.Show("Formulário já está aberto!");
                }
            }
            else
            {
                MessageBox.Show("Paciente não possui dados em seu histórico!");
            }
        }
예제 #2
0
 private void dataGridView1_SelectionChanged(object sender, EventArgs e)
 {
     if (dataGridView1.SelectedRows.Count > 0)
     {
         int i = dataGridView1.SelectedRows[0].Index;
         ConsultaController cc = new ConsultaController();
         historicoConsulta = cc.search("id", dataGridView1.Rows[i].Cells[0].Value.ToString());
         if (historicoConsulta.Count > 0)
         {
             btnHistorico.Enabled = true;
         }
     }
 }