Beispiel #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            c = new Calcul();
            bool ok = true,ok2=true;
            try
            {
                viewDatePersTableAdapter.Fill(dateMedDataSet.ViewDatePers);
            }
            catch
            {
                ok = false;
            }
            try
            {
                statisticaTableAdapter.Fill(dateMedDataSet.Statistica);
            }
            catch
            {
                ok2 = false;
            }
            DataTable dt = dateMedDataSet.ViewDatePers;
            DataTable dt2 = dateMedDataSet.Statistica;
            if (ok == true)
            {
                if (istoriccomboBox.Text != "Selectati" && valcomboBox.Text != "Selectati")
                {
                    if (istoriccomboBox.Text == "Diabet Zaharat Parinti")
                    {
                        numelistBox.Items.Clear();
                        indicelistBox.Items.Clear();
                        datelistBox.Items.Clear();
                        otherlistBox.Items.Clear();
                        valoarelabel.Text = istoriccomboBox.Text;
                        foreach (DataRow row in dt.Rows)
                        {
                            if (row["DZP"].ToString() == valcomboBox.Text)
                            {
                                numelistBox.Items.Add(row["Nume"]);
                                indicelistBox.Items.Add(row["DZP"]);
                                ctr++;
                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                #region Alte Valori2
                                if (comboBox2.Text == "CNP")
                                {
                                    otherlabel.Text = comboBox2.Text;
                                    otherlistBox.Items.Add(row["CNP"]);
                                }
                                if (comboBox2.Text == "Ocupatie")
                                {
                                    otherlabel.Text = comboBox2.Text;
                                    otherlistBox.Items.Add(row["Ocupatie"]);
                                }
                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                {
                                    otherlistBox.Items.Add(row["DZP"]);
                                    otherlabel.Text = comboBox2.Text;
                                }
                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                {
                                    otherlabel.Text = comboBox2.Text;
                                    otherlistBox.Items.Add(row["DZF"]);
                                }
                                if (comboBox2.Text == "Boala Cardiovasculara")
                                {
                                    otherlabel.Text = comboBox2.Text;
                                    otherlistBox.Items.Add(row["BoliCardio"]);
                                }
                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                {
                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                    otherlistBox.Items.Add(row["HAFam"]);
                                }
                                if (comboBox2.Text == "Dislipidemie")
                                {
                                    otherlabel.Text = comboBox2.Text;
                                    otherlistBox.Items.Add(row["Dislipidemie"]);
                                }
                                if (comboBox2.Text == "Obezitate")
                                {
                                    otherlabel.Text = comboBox2.Text;
                                    otherlistBox.Items.Add(row["Obezitate"]);
                                }
                                if (comboBox2.Text == "Morti Subite")
                                {
                                    otherlabel.Text = comboBox2.Text;
                                    otherlistBox.Items.Add(row["MortiSubite"]);
                                }
                                if (comboBox2.Text == "Copil Macrosom")
                                {
                                    otherlabel.Text = comboBox2.Text;
                                    otherlistBox.Items.Add(row["CopilMacro"]);
                                }
                                if (comboBox2.Text == "Diabet Gestational")
                                {
                                    otherlabel.Text = comboBox2.Text;
                                    otherlistBox.Items.Add(row["DiabetG"]);

                                }
                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                {
                                    otherlabel.Text = comboBox2.Text;
                                    otherlistBox.Items.Add(row["CardioIschemica"]);
                                }
                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                {
                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                    otherlistBox.Items.Add(row["HAPers"]);
                                }
                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                {
                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                    otherlistBox.Items.Add(row["IMAVC"]);
                                }
                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                {
                                    otherlabel.Text = comboBox2.Text;
                                    otherlistBox.Items.Add(row["STGlucoza"]);
                                }
                                if (comboBox2.Text == "Varsta")
                                {
                                    otherlabel.Text = comboBox2.Text;
                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                }
                                if (ok2 == true)
                                {
                                    foreach (DataRow row2 in dt2.Rows)
                                    {
                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                        {
                                            if (comboBox2.Text == "Fumat")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                if (row2["Fumat"].ToString() == "DA")
                                                    otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                else
                                                    otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                            }
                                            if (comboBox2.Text == "Activitate Fizica")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                            }
                                            if (comboBox2.Text == "Masa Corporala")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                            }
                                            if (comboBox2.Text == "Inaltime")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                            }
                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                            }
                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                            }
                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                            }
                                            if (comboBox2.Text == "Glicemie")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                            }
                                            if (comboBox2.Text == "HDL Colesterol")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                            }
                                            if (comboBox2.Text == "LDL Colesterol")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                            }
                                            if (comboBox2.Text == "Trigliceride")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                            }
                                            if (comboBox2.Text == "Indice de masa corporala")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                imc = imcf.ToString();
                                                imcf = (float)Convert.ToDouble(imc);
                                                otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                            }
                                            if (comboBox2.Text == "Risc Cardiovascular")
                                            {
                                                int rcvs;
                                                rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                            }
                                        }
                                    }
                                }
                                #endregion
                            }
                            else
                                if (valcomboBox.Text == "Toate Valorile")
                                {
                                    numelistBox.Items.Add(row["Nume"]);
                                    indicelistBox.Items.Add(row["DZP"]);
                                    ctr++;
                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                    #region Alte Valori2
                                    if (comboBox2.Text == "CNP")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["CNP"]);
                                    }
                                    if (comboBox2.Text == "Ocupatie")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["Ocupatie"]);
                                    }
                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                    {
                                        otherlistBox.Items.Add(row["DZP"]);
                                        otherlabel.Text = comboBox2.Text;
                                    }
                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["DZF"]);
                                    }
                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["BoliCardio"]);
                                    }
                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                    {
                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                        otherlistBox.Items.Add(row["HAFam"]);
                                    }
                                    if (comboBox2.Text == "Dislipidemie")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["Dislipidemie"]);
                                    }
                                    if (comboBox2.Text == "Obezitate")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["Obezitate"]);
                                    }
                                    if (comboBox2.Text == "Morti Subite")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["MortiSubite"]);
                                    }
                                    if (comboBox2.Text == "Copil Macrosom")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["CopilMacro"]);
                                    }
                                    if (comboBox2.Text == "Diabet Gestational")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["DiabetG"]);

                                    }
                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["CardioIschemica"]);
                                    }
                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                    {
                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                        otherlistBox.Items.Add(row["HAPers"]);
                                    }
                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                    {
                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                        otherlistBox.Items.Add(row["IMAVC"]);
                                    }
                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["STGlucoza"]);
                                    }
                                    if (comboBox2.Text == "Varsta")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                    }
                                    if (ok2 == true)
                                    {
                                        foreach (DataRow row2 in dt2.Rows)
                                        {
                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                            {
                                                if (comboBox2.Text == "Fumat")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    if (row2["Fumat"].ToString() == "DA")
                                                        otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    else
                                                        otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Activitate Fizica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Masa Corporala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Inaltime")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Glicemie")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "HDL Colesterol")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "LDL Colesterol")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Trigliceride")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Indice de masa corporala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                    imc = imcf.ToString();
                                                    imcf = (float)Convert.ToDouble(imc);
                                                    otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                {
                                                    int rcvs;
                                                    rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                }
                        }
                        ctr = 0;
                    }
                    else
                        if (istoriccomboBox.Text == "Diabet Zaharat Frati")
                        {
                            numelistBox.Items.Clear();
                            indicelistBox.Items.Clear();
                            datelistBox.Items.Clear();
                            otherlistBox.Items.Clear();
                            valoarelabel.Text = istoriccomboBox.Text;
                            foreach (DataRow row in dt.Rows)
                            {
                                if (row["DZF"].ToString() == valcomboBox.Text)
                                {
                                    numelistBox.Items.Add(row["Nume"]);
                                    indicelistBox.Items.Add(row["DZF"]);
                                    ctr++;
                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                    #region Alte Valori2
                                    if (comboBox2.Text == "CNP")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["CNP"]);
                                    }
                                    if (comboBox2.Text == "Ocupatie")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["Ocupatie"]);
                                    }
                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                    {
                                        otherlistBox.Items.Add(row["DZP"]);
                                        otherlabel.Text = comboBox2.Text;
                                    }
                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["DZF"]);
                                    }
                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["BoliCardio"]);
                                    }
                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                    {
                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                        otherlistBox.Items.Add(row["HAFam"]);
                                    }
                                    if (comboBox2.Text == "Dislipidemie")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["Dislipidemie"]);
                                    }
                                    if (comboBox2.Text == "Obezitate")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["Obezitate"]);
                                    }
                                    if (comboBox2.Text == "Morti Subite")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["MortiSubite"]);
                                    }
                                    if (comboBox2.Text == "Copil Macrosom")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["CopilMacro"]);
                                    }
                                    if (comboBox2.Text == "Diabet Gestational")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["DiabetG"]);

                                    }
                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["CardioIschemica"]);
                                    }
                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                    {
                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                        otherlistBox.Items.Add(row["HAPers"]);
                                    }
                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                    {
                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                        otherlistBox.Items.Add(row["IMAVC"]);
                                    }
                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["STGlucoza"]);
                                    }
                                    if (comboBox2.Text == "Varsta")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                    }
                                    if (ok2 == true)
                                    {
                                        foreach (DataRow row2 in dt2.Rows)
                                        {
                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                            {
                                                if (comboBox2.Text == "Fumat")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    if (row2["Fumat"].ToString() == "DA")
                                                        otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    else
                                                        otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Activitate Fizica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Masa Corporala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Inaltime")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Glicemie")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "HDL Colesterol")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "LDL Colesterol")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Trigliceride")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Indice de masa corporala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                    imc = imcf.ToString();
                                                    imcf = (float)Convert.ToDouble(imc);
                                                    otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                {
                                                    int rcvs;
                                                    rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                }
                                else
                                    if (valcomboBox.Text == "Toate Valorile")
                                    {
                                        numelistBox.Items.Add(row["Nume"]);
                                        indicelistBox.Items.Add(row["DZF"]);
                                        ctr++;
                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                        #region Alte Valori2
                                        if (comboBox2.Text == "CNP")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["CNP"]);
                                        }
                                        if (comboBox2.Text == "Ocupatie")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Ocupatie"]);
                                        }
                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                        {
                                            otherlistBox.Items.Add(row["DZP"]);
                                            otherlabel.Text = comboBox2.Text;
                                        }
                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["DZF"]);
                                        }
                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["BoliCardio"]);
                                        }
                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                        {
                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                            otherlistBox.Items.Add(row["HAFam"]);
                                        }
                                        if (comboBox2.Text == "Dislipidemie")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Dislipidemie"]);
                                        }
                                        if (comboBox2.Text == "Obezitate")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Obezitate"]);
                                        }
                                        if (comboBox2.Text == "Morti Subite")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["MortiSubite"]);
                                        }
                                        if (comboBox2.Text == "Copil Macrosom")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["CopilMacro"]);
                                        }
                                        if (comboBox2.Text == "Diabet Gestational")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["DiabetG"]);

                                        }
                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["CardioIschemica"]);
                                        }
                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                        {
                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                            otherlistBox.Items.Add(row["HAPers"]);
                                        }
                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                        {
                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                            otherlistBox.Items.Add(row["IMAVC"]);
                                        }
                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["STGlucoza"]);
                                        }
                                        if (comboBox2.Text == "Varsta")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                        }
                                        if (ok2 == true)
                                        {
                                            foreach (DataRow row2 in dt2.Rows)
                                            {
                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                {
                                                    if (comboBox2.Text == "Fumat")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        if (row2["Fumat"].ToString() == "DA")
                                                            otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        else
                                                            otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Activitate Fizica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Masa Corporala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Inaltime")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Glicemie")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "HDL Colesterol")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "LDL Colesterol")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Trigliceride")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                        imc = imcf.ToString();
                                                        imcf = (float)Convert.ToDouble(imc);
                                                        otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                    {
                                                        int rcvs;
                                                        rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                }
                                            }
                                        }
                                        #endregion
                                    }
                            }
                            ctr = 0;
                        }
                        else
                            if (istoriccomboBox.Text == "Boala Cardiovasculara")
                            {
                                numelistBox.Items.Clear();
                                indicelistBox.Items.Clear();
                                datelistBox.Items.Clear();
                                otherlistBox.Items.Clear();
                                valoarelabel.Text = istoriccomboBox.Text;
                                foreach (DataRow row in dt.Rows)
                                {
                                    if (row["BoliCardio"].ToString() == valcomboBox.Text)
                                    {
                                        numelistBox.Items.Add(row["Nume"]);
                                        indicelistBox.Items.Add(row["BoliCardio"]);
                                        ctr++;
                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                        #region Alte Valori2
                                        if (comboBox2.Text == "CNP")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["CNP"]);
                                        }
                                        if (comboBox2.Text == "Ocupatie")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Ocupatie"]);
                                        }
                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                        {
                                            otherlistBox.Items.Add(row["DZP"]);
                                            otherlabel.Text = comboBox2.Text;
                                        }
                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["DZF"]);
                                        }
                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["BoliCardio"]);
                                        }
                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                        {
                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                            otherlistBox.Items.Add(row["HAFam"]);
                                        }
                                        if (comboBox2.Text == "Dislipidemie")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Dislipidemie"]);
                                        }
                                        if (comboBox2.Text == "Obezitate")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Obezitate"]);
                                        }
                                        if (comboBox2.Text == "Morti Subite")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["MortiSubite"]);
                                        }
                                        if (comboBox2.Text == "Copil Macrosom")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["CopilMacro"]);
                                        }
                                        if (comboBox2.Text == "Diabet Gestational")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["DiabetG"]);

                                        }
                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["CardioIschemica"]);
                                        }
                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                        {
                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                            otherlistBox.Items.Add(row["HAPers"]);
                                        }
                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                        {
                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                            otherlistBox.Items.Add(row["IMAVC"]);
                                        }
                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["STGlucoza"]);
                                        }
                                        if (comboBox2.Text == "Varsta")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                        }
                                        if (ok2 == true)
                                        {
                                            foreach (DataRow row2 in dt2.Rows)
                                            {
                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                {
                                                    if (comboBox2.Text == "Fumat")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        if (row2["Fumat"].ToString() == "DA")
                                                            otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        else
                                                            otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Activitate Fizica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Masa Corporala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Inaltime")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Glicemie")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "HDL Colesterol")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "LDL Colesterol")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Trigliceride")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                        imc = imcf.ToString();
                                                        imcf = (float)Convert.ToDouble(imc);
                                                        otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                    {
                                                        int rcvs;
                                                        rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                    }
                                                }
                                            }
                                        }
                                        #endregion
                                    }
                                    else
                                        if (valcomboBox.Text == "Toate Valorile")
                                        {
                                            numelistBox.Items.Add(row["Nume"]);
                                            indicelistBox.Items.Add(row["BoliCardio"]);
                                            ctr++;
                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                            #region Alte Valori2
                                            if (comboBox2.Text == "CNP")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["CNP"]);
                                            }
                                            if (comboBox2.Text == "Ocupatie")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["Ocupatie"]);
                                            }
                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                            {
                                                otherlistBox.Items.Add(row["DZP"]);
                                                otherlabel.Text = comboBox2.Text;
                                            }
                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["DZF"]);
                                            }
                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["BoliCardio"]);
                                            }
                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                            {
                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                otherlistBox.Items.Add(row["HAFam"]);
                                            }
                                            if (comboBox2.Text == "Dislipidemie")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["Dislipidemie"]);
                                            }
                                            if (comboBox2.Text == "Obezitate")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["Obezitate"]);
                                            }
                                            if (comboBox2.Text == "Morti Subite")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["MortiSubite"]);
                                            }
                                            if (comboBox2.Text == "Copil Macrosom")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["CopilMacro"]);
                                            }
                                            if (comboBox2.Text == "Diabet Gestational")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["DiabetG"]);

                                            }
                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["CardioIschemica"]);
                                            }
                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                            {
                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                otherlistBox.Items.Add(row["HAPers"]);
                                            }
                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                            {
                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                otherlistBox.Items.Add(row["IMAVC"]);
                                            }
                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["STGlucoza"]);
                                            }
                                            if (comboBox2.Text == "Varsta")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                            }
                                            if (ok2 == true)
                                            {
                                                foreach (DataRow row2 in dt2.Rows)
                                                {
                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                    {
                                                        if (comboBox2.Text == "Fumat")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            if (row2["Fumat"].ToString() == "DA")
                                                                otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            else
                                                                otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Activitate Fizica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Masa Corporala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Inaltime")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Glicemie")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "HDL Colesterol")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "LDL Colesterol")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Trigliceride")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Indice de masa corporala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                            imc = imcf.ToString();
                                                            imcf = (float)Convert.ToDouble(imc);
                                                            otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Risc Cardiovascular")
                                                        {
                                                            int rcvs;
                                                            rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                    }
                                                }
                                            }
                                            #endregion
                                        }
                                }
                                ctr = 0;
                            }
                            else
                                if (istoriccomboBox.Text == "Hipertensiune Arteriala(familie)")
                                {
                                    numelistBox.Items.Clear();
                                    indicelistBox.Items.Clear();
                                    datelistBox.Items.Clear();
                                    otherlistBox.Items.Clear();
                                    valoarelabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                    foreach (DataRow row in dt.Rows)
                                    {
                                        if (row["HAFam"].ToString() == valcomboBox.Text)
                                        {
                                            numelistBox.Items.Add(row["Nume"]);
                                            indicelistBox.Items.Add(row["HAFam"]);
                                            ctr++;
                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                            #region Alte Valori2
                                            if (comboBox2.Text == "CNP")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["CNP"]);
                                            }
                                            if (comboBox2.Text == "Ocupatie")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["Ocupatie"]);
                                            }
                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                            {
                                                otherlistBox.Items.Add(row["DZP"]);
                                                otherlabel.Text = comboBox2.Text;
                                            }
                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["DZF"]);
                                            }
                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["BoliCardio"]);
                                            }
                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                            {
                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                otherlistBox.Items.Add(row["HAFam"]);
                                            }
                                            if (comboBox2.Text == "Dislipidemie")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["Dislipidemie"]);
                                            }
                                            if (comboBox2.Text == "Obezitate")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["Obezitate"]);
                                            }
                                            if (comboBox2.Text == "Morti Subite")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["MortiSubite"]);
                                            }
                                            if (comboBox2.Text == "Copil Macrosom")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["CopilMacro"]);
                                            }
                                            if (comboBox2.Text == "Diabet Gestational")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["DiabetG"]);

                                            }
                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["CardioIschemica"]);
                                            }
                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                            {
                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                otherlistBox.Items.Add(row["HAPers"]);
                                            }
                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                            {
                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                otherlistBox.Items.Add(row["IMAVC"]);
                                            }
                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["STGlucoza"]);
                                            }
                                            if (comboBox2.Text == "Varsta")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                            }
                                            if (ok2 == true)
                                            {
                                                foreach (DataRow row2 in dt2.Rows)
                                                {
                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                    {
                                                        if (comboBox2.Text == "Fumat")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            if (row2["Fumat"].ToString() == "DA")
                                                                otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            else
                                                                otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Activitate Fizica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Masa Corporala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Inaltime")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Glicemie")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "HDL Colesterol")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "LDL Colesterol")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Trigliceride")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Indice de masa corporala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                            imc = imcf.ToString();
                                                            imcf = (float)Convert.ToDouble(imc);
                                                            otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                        if (comboBox2.Text == "Risc Cardiovascular")
                                                        {
                                                            int rcvs;
                                                            rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                        }
                                                    }
                                                }
                                            }
                                            #endregion
                                        }
                                        else
                                            if (valcomboBox.Text == "Toate Valorile")
                                            {
                                                numelistBox.Items.Add(row["Nume"]);
                                                indicelistBox.Items.Add(row["HAFam"]);
                                                ctr++;
                                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                #region Alte Valori2
                                                if (comboBox2.Text == "CNP")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["CNP"]);
                                                }
                                                if (comboBox2.Text == "Ocupatie")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["Ocupatie"]);
                                                }
                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                {
                                                    otherlistBox.Items.Add(row["DZP"]);
                                                    otherlabel.Text = comboBox2.Text;
                                                }
                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["DZF"]);
                                                }
                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["BoliCardio"]);
                                                }
                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                {
                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                    otherlistBox.Items.Add(row["HAFam"]);
                                                }
                                                if (comboBox2.Text == "Dislipidemie")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["Dislipidemie"]);
                                                }
                                                if (comboBox2.Text == "Obezitate")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["Obezitate"]);
                                                }
                                                if (comboBox2.Text == "Morti Subite")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["MortiSubite"]);
                                                }
                                                if (comboBox2.Text == "Copil Macrosom")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["CopilMacro"]);
                                                }
                                                if (comboBox2.Text == "Diabet Gestational")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["DiabetG"]);

                                                }
                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["CardioIschemica"]);
                                                }
                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                {
                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                    otherlistBox.Items.Add(row["HAPers"]);
                                                }
                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                {
                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                    otherlistBox.Items.Add(row["IMAVC"]);
                                                }
                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["STGlucoza"]);
                                                }
                                                if (comboBox2.Text == "Varsta")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                }
                                                if (ok2 == true)
                                                {
                                                    foreach (DataRow row2 in dt2.Rows)
                                                    {
                                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                        {
                                                            if (comboBox2.Text == "Fumat")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                if (row2["Fumat"].ToString() == "DA")
                                                                    otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                else
                                                                    otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Activitate Fizica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Masa Corporala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Inaltime")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Glicemie")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "HDL Colesterol")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "LDL Colesterol")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Trigliceride")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Indice de masa corporala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                imc = imcf.ToString();
                                                                imcf = (float)Convert.ToDouble(imc);
                                                                otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Risc Cardiovascular")
                                                            {
                                                                int rcvs;
                                                                rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                        }
                                                    }
                                                }
                                                #endregion
                                            }
                                    }
                                    ctr = 0;
                                }
                                else
                                    if (istoriccomboBox.Text == "Dislipidemie")
                                    {
                                        numelistBox.Items.Clear();
                                        indicelistBox.Items.Clear();
                                        datelistBox.Items.Clear();
                                        otherlistBox.Items.Clear();
                                        valoarelabel.Text = istoriccomboBox.Text;
                                        foreach (DataRow row in dt.Rows)
                                        {
                                            if (row["Dislipidemie"].ToString() == valcomboBox.Text)
                                            {
                                                numelistBox.Items.Add(row["Nume"]);
                                                indicelistBox.Items.Add(row["Dislipidemie"]);
                                                ctr++;
                                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                #region Alte Valori2
                                                if (comboBox2.Text == "CNP")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["CNP"]);
                                                }
                                                if (comboBox2.Text == "Ocupatie")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["Ocupatie"]);
                                                }
                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                {
                                                    otherlistBox.Items.Add(row["DZP"]);
                                                    otherlabel.Text = comboBox2.Text;
                                                }
                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["DZF"]);
                                                }
                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["BoliCardio"]);
                                                }
                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                {
                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                    otherlistBox.Items.Add(row["HAFam"]);
                                                }
                                                if (comboBox2.Text == "Dislipidemie")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["Dislipidemie"]);
                                                }
                                                if (comboBox2.Text == "Obezitate")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["Obezitate"]);
                                                }
                                                if (comboBox2.Text == "Morti Subite")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["MortiSubite"]);
                                                }
                                                if (comboBox2.Text == "Copil Macrosom")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["CopilMacro"]);
                                                }
                                                if (comboBox2.Text == "Diabet Gestational")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["DiabetG"]);

                                                }
                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["CardioIschemica"]);
                                                }
                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                {
                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                    otherlistBox.Items.Add(row["HAPers"]);
                                                }
                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                {
                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                    otherlistBox.Items.Add(row["IMAVC"]);
                                                }
                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["STGlucoza"]);
                                                }
                                                if (comboBox2.Text == "Varsta")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                }
                                                if (ok2 == true)
                                                {
                                                    foreach (DataRow row2 in dt2.Rows)
                                                    {
                                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                        {
                                                            if (comboBox2.Text == "Fumat")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                if (row2["Fumat"].ToString() == "DA")
                                                                    otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                else
                                                                    otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Activitate Fizica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Masa Corporala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Inaltime")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Glicemie")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "HDL Colesterol")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "LDL Colesterol")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Trigliceride")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Indice de masa corporala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                imc = imcf.ToString();
                                                                imcf = (float)Convert.ToDouble(imc);
                                                                otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                            if (comboBox2.Text == "Risc Cardiovascular")
                                                            {
                                                                int rcvs;
                                                                rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                            }
                                                        }
                                                    }
                                                }
                                                #endregion
                                            }
                                            else
                                                if (valcomboBox.Text == "Toate Valorile")
                                                {
                                                    numelistBox.Items.Add(row["Nume"]);
                                                    indicelistBox.Items.Add(row["Dislipidemie"]);
                                                    ctr++;
                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                    #region Alte Valori2
                                                    if (comboBox2.Text == "CNP")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["CNP"]);
                                                    }
                                                    if (comboBox2.Text == "Ocupatie")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["Ocupatie"]);
                                                    }
                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                    {
                                                        otherlistBox.Items.Add(row["DZP"]);
                                                        otherlabel.Text = comboBox2.Text;
                                                    }
                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["DZF"]);
                                                    }
                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["BoliCardio"]);
                                                    }
                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                    {
                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                        otherlistBox.Items.Add(row["HAFam"]);
                                                    }
                                                    if (comboBox2.Text == "Dislipidemie")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["Dislipidemie"]);
                                                    }
                                                    if (comboBox2.Text == "Obezitate")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["Obezitate"]);
                                                    }
                                                    if (comboBox2.Text == "Morti Subite")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["MortiSubite"]);
                                                    }
                                                    if (comboBox2.Text == "Copil Macrosom")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["CopilMacro"]);
                                                    }
                                                    if (comboBox2.Text == "Diabet Gestational")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["DiabetG"]);

                                                    }
                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["CardioIschemica"]);
                                                    }
                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                    {
                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                        otherlistBox.Items.Add(row["HAPers"]);
                                                    }
                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                    {
                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                        otherlistBox.Items.Add(row["IMAVC"]);
                                                    }
                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["STGlucoza"]);
                                                    }
                                                    if (comboBox2.Text == "Varsta")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                    }
                                                    if (ok2 == true)
                                                    {
                                                        foreach (DataRow row2 in dt2.Rows)
                                                        {
                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                            {
                                                                if (comboBox2.Text == "Fumat")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    if (row2["Fumat"].ToString() == "DA")
                                                                        otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    else
                                                                        otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Activitate Fizica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Masa Corporala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Inaltime")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Glicemie")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "HDL Colesterol")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "LDL Colesterol")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Trigliceride")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Indice de masa corporala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                    imc = imcf.ToString();
                                                                    imcf = (float)Convert.ToDouble(imc);
                                                                    otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                                {
                                                                    int rcvs;
                                                                    rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                            }
                                                        }
                                                    }
                                                    #endregion
                                                }
                                        }
                                        ctr = 0;
                                    }
                                    else
                                        if (istoriccomboBox.Text == "Obezitate")
                                        {
                                            numelistBox.Items.Clear();
                                            indicelistBox.Items.Clear();
                                            datelistBox.Items.Clear();
                                            otherlistBox.Items.Clear();
                                            valoarelabel.Text = istoriccomboBox.Text;
                                            foreach (DataRow row in dt.Rows)
                                            {
                                                if (row["Obezitate"].ToString() == valcomboBox.Text)
                                                {
                                                    numelistBox.Items.Add(row["Nume"]);
                                                    indicelistBox.Items.Add(row["Obezitate"]);
                                                    ctr++;
                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                    #region Alte Valori2
                                                    if (comboBox2.Text == "CNP")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["CNP"]);
                                                    }
                                                    if (comboBox2.Text == "Ocupatie")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["Ocupatie"]);
                                                    }
                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                    {
                                                        otherlistBox.Items.Add(row["DZP"]);
                                                        otherlabel.Text = comboBox2.Text;
                                                    }
                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["DZF"]);
                                                    }
                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["BoliCardio"]);
                                                    }
                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                    {
                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                        otherlistBox.Items.Add(row["HAFam"]);
                                                    }
                                                    if (comboBox2.Text == "Dislipidemie")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["Dislipidemie"]);
                                                    }
                                                    if (comboBox2.Text == "Obezitate")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["Obezitate"]);
                                                    }
                                                    if (comboBox2.Text == "Morti Subite")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["MortiSubite"]);
                                                    }
                                                    if (comboBox2.Text == "Copil Macrosom")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["CopilMacro"]);
                                                    }
                                                    if (comboBox2.Text == "Diabet Gestational")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["DiabetG"]);

                                                    }
                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["CardioIschemica"]);
                                                    }
                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                    {
                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                        otherlistBox.Items.Add(row["HAPers"]);
                                                    }
                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                    {
                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                        otherlistBox.Items.Add(row["IMAVC"]);
                                                    }
                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["STGlucoza"]);
                                                    }
                                                    if (comboBox2.Text == "Varsta")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                    }
                                                    if (ok2 == true)
                                                    {
                                                        foreach (DataRow row2 in dt2.Rows)
                                                        {
                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                            {
                                                                if (comboBox2.Text == "Fumat")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    if (row2["Fumat"].ToString() == "DA")
                                                                        otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    else
                                                                        otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Activitate Fizica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Masa Corporala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Inaltime")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Glicemie")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "HDL Colesterol")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "LDL Colesterol")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Trigliceride")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Indice de masa corporala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                    imc = imcf.ToString();
                                                                    imcf = (float)Convert.ToDouble(imc);
                                                                    otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                                {
                                                                    int rcvs;
                                                                    rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                }
                                                            }
                                                        }
                                                    }
                                                    #endregion
                                                }
                                                else
                                                    if (valcomboBox.Text == "Toate Valorile")
                                                    {
                                                        numelistBox.Items.Add(row["Nume"]);
                                                        indicelistBox.Items.Add(row["Obezitate"]);
                                                        ctr++;
                                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                        #region Alte Valori2
                                                        if (comboBox2.Text == "CNP")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["CNP"]);
                                                        }
                                                        if (comboBox2.Text == "Ocupatie")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["Ocupatie"]);
                                                        }
                                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                        {
                                                            otherlistBox.Items.Add(row["DZP"]);
                                                            otherlabel.Text = comboBox2.Text;
                                                        }
                                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["DZF"]);
                                                        }
                                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["BoliCardio"]);
                                                        }
                                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                        {
                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                            otherlistBox.Items.Add(row["HAFam"]);
                                                        }
                                                        if (comboBox2.Text == "Dislipidemie")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["Dislipidemie"]);
                                                        }
                                                        if (comboBox2.Text == "Obezitate")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["Obezitate"]);
                                                        }
                                                        if (comboBox2.Text == "Morti Subite")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["MortiSubite"]);
                                                        }
                                                        if (comboBox2.Text == "Copil Macrosom")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["CopilMacro"]);
                                                        }
                                                        if (comboBox2.Text == "Diabet Gestational")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["DiabetG"]);

                                                        }
                                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["CardioIschemica"]);
                                                        }
                                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                        {
                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                            otherlistBox.Items.Add(row["HAPers"]);
                                                        }
                                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                        {
                                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                            otherlistBox.Items.Add(row["IMAVC"]);
                                                        }
                                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["STGlucoza"]);
                                                        }
                                                        if (comboBox2.Text == "Varsta")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                        }
                                                        if (ok2 == true)
                                                        {
                                                            foreach (DataRow row2 in dt2.Rows)
                                                            {
                                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                {
                                                                    if (comboBox2.Text == "Fumat")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        if (row2["Fumat"].ToString() == "DA")
                                                                            otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        else
                                                                            otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Activitate Fizica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Masa Corporala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Inaltime")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Glicemie")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "HDL Colesterol")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "LDL Colesterol")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Trigliceride")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                        imc = imcf.ToString();
                                                                        imcf = (float)Convert.ToDouble(imc);
                                                                        otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                                    {
                                                                        int rcvs;
                                                                        rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        #endregion
                                                    }
                                            }
                                            ctr = 0;
                                        }
                                        else
                                            if (istoriccomboBox.Text == "Morti Subite")
                                            {
                                                numelistBox.Items.Clear();
                                                indicelistBox.Items.Clear();
                                                datelistBox.Items.Clear();
                                                otherlistBox.Items.Clear();
                                                valoarelabel.Text = istoriccomboBox.Text;
                                                foreach (DataRow row in dt.Rows)
                                                {
                                                    if (row["MortiSubite"].ToString() == valcomboBox.Text)
                                                    {
                                                        numelistBox.Items.Add(row["Nume"]);
                                                        indicelistBox.Items.Add(row["MortiSubite"]);
                                                        ctr++;
                                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                        #region Alte Valori2
                                                        if (comboBox2.Text == "CNP")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["CNP"]);
                                                        }
                                                        if (comboBox2.Text == "Ocupatie")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["Ocupatie"]);
                                                        }
                                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                        {
                                                            otherlistBox.Items.Add(row["DZP"]);
                                                            otherlabel.Text = comboBox2.Text;
                                                        }
                                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["DZF"]);
                                                        }
                                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["BoliCardio"]);
                                                        }
                                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                        {
                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                            otherlistBox.Items.Add(row["HAFam"]);
                                                        }
                                                        if (comboBox2.Text == "Dislipidemie")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["Dislipidemie"]);
                                                        }
                                                        if (comboBox2.Text == "Obezitate")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["Obezitate"]);
                                                        }
                                                        if (comboBox2.Text == "Morti Subite")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["MortiSubite"]);
                                                        }
                                                        if (comboBox2.Text == "Copil Macrosom")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["CopilMacro"]);
                                                        }
                                                        if (comboBox2.Text == "Diabet Gestational")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["DiabetG"]);

                                                        }
                                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["CardioIschemica"]);
                                                        }
                                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                        {
                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                            otherlistBox.Items.Add(row["HAPers"]);
                                                        }
                                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                        {
                                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                            otherlistBox.Items.Add(row["IMAVC"]);
                                                        }
                                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["STGlucoza"]);
                                                        }
                                                        if (comboBox2.Text == "Varsta")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                        }
                                                        if (ok2 == true)
                                                        {
                                                            foreach (DataRow row2 in dt2.Rows)
                                                            {
                                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                {
                                                                    if (comboBox2.Text == "Fumat")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        if (row2["Fumat"].ToString() == "DA")
                                                                            otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        else
                                                                            otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Activitate Fizica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Masa Corporala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Inaltime")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Glicemie")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "HDL Colesterol")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "LDL Colesterol")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Trigliceride")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                        imc = imcf.ToString();
                                                                        imcf = (float)Convert.ToDouble(imc);
                                                                        otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                                    {
                                                                        int rcvs;
                                                                        rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        #endregion
                                                    }
                                                    else
                                                        if (valcomboBox.Text == "Toate Valorile")
                                                        {
                                                            numelistBox.Items.Add(row["Nume"]);
                                                            indicelistBox.Items.Add(row["MortiSubite"]);
                                                            ctr++;
                                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                            #region Alte Valori2
                                                            if (comboBox2.Text == "CNP")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["CNP"]);
                                                            }
                                                            if (comboBox2.Text == "Ocupatie")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["Ocupatie"]);
                                                            }
                                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                            {
                                                                otherlistBox.Items.Add(row["DZP"]);
                                                                otherlabel.Text = comboBox2.Text;
                                                            }
                                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["DZF"]);
                                                            }
                                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["BoliCardio"]);
                                                            }
                                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                            {
                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                otherlistBox.Items.Add(row["HAFam"]);
                                                            }
                                                            if (comboBox2.Text == "Dislipidemie")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["Dislipidemie"]);
                                                            }
                                                            if (comboBox2.Text == "Obezitate")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["Obezitate"]);
                                                            }
                                                            if (comboBox2.Text == "Morti Subite")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["MortiSubite"]);
                                                            }
                                                            if (comboBox2.Text == "Copil Macrosom")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["CopilMacro"]);
                                                            }
                                                            if (comboBox2.Text == "Diabet Gestational")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["DiabetG"]);

                                                            }
                                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["CardioIschemica"]);
                                                            }
                                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                            {
                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                otherlistBox.Items.Add(row["HAPers"]);
                                                            }
                                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                            {
                                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                otherlistBox.Items.Add(row["IMAVC"]);
                                                            }
                                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["STGlucoza"]);
                                                            }
                                                            if (comboBox2.Text == "Varsta")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                            }
                                                            if (ok2 == true)
                                                            {
                                                                foreach (DataRow row2 in dt2.Rows)
                                                                {
                                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                    {
                                                                        if (comboBox2.Text == "Fumat")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            if (row2["Fumat"].ToString() == "DA")
                                                                                otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            else
                                                                                otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Activitate Fizica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Masa Corporala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Inaltime")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Glicemie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "HDL Colesterol")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "LDL Colesterol")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Trigliceride")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Indice de masa corporala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                            imc = imcf.ToString();
                                                                            imcf = (float)Convert.ToDouble(imc);
                                                                            otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Risc Cardiovascular")
                                                                        {
                                                                            int rcvs;
                                                                            rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                            #endregion
                                                        }
                                                }
                                                ctr = 0;
                                            }
                                            else
                                                if (istoriccomboBox.Text == "Copil Macrosom")
                                                {
                                                    numelistBox.Items.Clear();
                                                    indicelistBox.Items.Clear();
                                                    datelistBox.Items.Clear();
                                                    otherlistBox.Items.Clear();
                                                    valoarelabel.Text = istoriccomboBox.Text;
                                                    foreach (DataRow row in dt.Rows)
                                                    {
                                                        if (row["CopilMacro"].ToString() == valcomboBox.Text)
                                                        {
                                                            numelistBox.Items.Add(row["Nume"]);
                                                            indicelistBox.Items.Add(row["CopilMacro"]);
                                                            ctr++;
                                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                            #region Alte Valori2
                                                            if (comboBox2.Text == "CNP")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["CNP"]);
                                                            }
                                                            if (comboBox2.Text == "Ocupatie")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["Ocupatie"]);
                                                            }
                                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                            {
                                                                otherlistBox.Items.Add(row["DZP"]);
                                                                otherlabel.Text = comboBox2.Text;
                                                            }
                                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["DZF"]);
                                                            }
                                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["BoliCardio"]);
                                                            }
                                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                            {
                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                otherlistBox.Items.Add(row["HAFam"]);
                                                            }
                                                            if (comboBox2.Text == "Dislipidemie")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["Dislipidemie"]);
                                                            }
                                                            if (comboBox2.Text == "Obezitate")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["Obezitate"]);
                                                            }
                                                            if (comboBox2.Text == "Morti Subite")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["MortiSubite"]);
                                                            }
                                                            if (comboBox2.Text == "Copil Macrosom")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["CopilMacro"]);
                                                            }
                                                            if (comboBox2.Text == "Diabet Gestational")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["DiabetG"]);

                                                            }
                                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["CardioIschemica"]);
                                                            }
                                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                            {
                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                otherlistBox.Items.Add(row["HAPers"]);
                                                            }
                                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                            {
                                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                otherlistBox.Items.Add(row["IMAVC"]);
                                                            }
                                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["STGlucoza"]);
                                                            }
                                                            if (comboBox2.Text == "Varsta")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                            }
                                                            if (ok2 == true)
                                                            {
                                                                foreach (DataRow row2 in dt2.Rows)
                                                                {
                                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                    {
                                                                        if (comboBox2.Text == "Fumat")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            if (row2["Fumat"].ToString() == "DA")
                                                                                otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            else
                                                                                otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Activitate Fizica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Masa Corporala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Inaltime")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Glicemie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "HDL Colesterol")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "LDL Colesterol")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Trigliceride")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Indice de masa corporala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                            imc = imcf.ToString();
                                                                            imcf = (float)Convert.ToDouble(imc);
                                                                            otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                        if (comboBox2.Text == "Risc Cardiovascular")
                                                                        {
                                                                            int rcvs;
                                                                            rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                            #endregion
                                                        }
                                                        else
                                                            if (valcomboBox.Text == "Toate Valorile")
                                                            {
                                                                numelistBox.Items.Add(row["Nume"]);
                                                                indicelistBox.Items.Add(row["CopilMacro"]);
                                                                ctr++;
                                                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                #region Alte Valori2
                                                                if (comboBox2.Text == "CNP")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["CNP"]);
                                                                }
                                                                if (comboBox2.Text == "Ocupatie")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["Ocupatie"]);
                                                                }
                                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                {
                                                                    otherlistBox.Items.Add(row["DZP"]);
                                                                    otherlabel.Text = comboBox2.Text;
                                                                }
                                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["DZF"]);
                                                                }
                                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["BoliCardio"]);
                                                                }
                                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                {
                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                    otherlistBox.Items.Add(row["HAFam"]);
                                                                }
                                                                if (comboBox2.Text == "Dislipidemie")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["Dislipidemie"]);
                                                                }
                                                                if (comboBox2.Text == "Obezitate")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["Obezitate"]);
                                                                }
                                                                if (comboBox2.Text == "Morti Subite")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["MortiSubite"]);
                                                                }
                                                                if (comboBox2.Text == "Copil Macrosom")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["CopilMacro"]);
                                                                }
                                                                if (comboBox2.Text == "Diabet Gestational")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["DiabetG"]);

                                                                }
                                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["CardioIschemica"]);
                                                                }
                                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                {
                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                    otherlistBox.Items.Add(row["HAPers"]);
                                                                }
                                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                {
                                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                    otherlistBox.Items.Add(row["IMAVC"]);
                                                                }
                                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["STGlucoza"]);
                                                                }
                                                                if (comboBox2.Text == "Varsta")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                }
                                                                if (ok2 == true)
                                                                {
                                                                    foreach (DataRow row2 in dt2.Rows)
                                                                    {
                                                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                        {
                                                                            if (comboBox2.Text == "Fumat")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                if (row2["Fumat"].ToString() == "DA")
                                                                                    otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                else
                                                                                    otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            }
                                                                            if (comboBox2.Text == "Activitate Fizica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            }
                                                                            if (comboBox2.Text == "Masa Corporala")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            }
                                                                            if (comboBox2.Text == "Inaltime")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            }
                                                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            }
                                                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            }
                                                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            }
                                                                            if (comboBox2.Text == "Glicemie")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            }
                                                                            if (comboBox2.Text == "HDL Colesterol")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            }
                                                                            if (comboBox2.Text == "LDL Colesterol")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            }
                                                                            if (comboBox2.Text == "Trigliceride")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            }
                                                                            if (comboBox2.Text == "Indice de masa corporala")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                                imc = imcf.ToString();
                                                                                imcf = (float)Convert.ToDouble(imc);
                                                                                otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            }
                                                                            if (comboBox2.Text == "Risc Cardiovascular")
                                                                            {
                                                                                int rcvs;
                                                                                rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                                #endregion
                                                            }
                                                    }
                                                    ctr = 0;
                                                }
                                                else
                                                    if (istoriccomboBox.Text == "Diabet Gestational")
                                                    {
                                                        numelistBox.Items.Clear();
                                                        indicelistBox.Items.Clear();
                                                        datelistBox.Items.Clear();
                                                        otherlistBox.Items.Clear();
                                                        valoarelabel.Text = istoriccomboBox.Text;
                                                        foreach (DataRow row in dt.Rows)
                                                        {
                                                            if (row["Sex"].ToString() == "Feminin")
                                                            {
                                                                if (row["DiabetG"].ToString() == valcomboBox.Text)
                                                                {
                                                                    numelistBox.Items.Add(row["Nume"]);//???????????
                                                                    indicelistBox.Items.Add(row["DiabetG"]);
                                                                    ctr++;
                                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                    #region Alte Valori2
                                                                    if (comboBox2.Text == "CNP")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["CNP"]);
                                                                    }
                                                                    if (comboBox2.Text == "Ocupatie")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["Ocupatie"]);
                                                                    }
                                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                    {
                                                                        otherlistBox.Items.Add(row["DZP"]);
                                                                        otherlabel.Text = comboBox2.Text;
                                                                    }
                                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["DZF"]);
                                                                    }
                                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["BoliCardio"]);
                                                                    }
                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                    {
                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                        otherlistBox.Items.Add(row["HAFam"]);
                                                                    }
                                                                    if (comboBox2.Text == "Dislipidemie")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["Dislipidemie"]);
                                                                    }
                                                                    if (comboBox2.Text == "Obezitate")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["Obezitate"]);
                                                                    }
                                                                    if (comboBox2.Text == "Morti Subite")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["MortiSubite"]);
                                                                    }
                                                                    if (comboBox2.Text == "Copil Macrosom")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["CopilMacro"]);
                                                                    }
                                                                    if (comboBox2.Text == "Diabet Gestational")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["DiabetG"]);

                                                                    }
                                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["CardioIschemica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                    {
                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                        otherlistBox.Items.Add(row["HAPers"]);
                                                                    }
                                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                    {
                                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                        otherlistBox.Items.Add(row["IMAVC"]);
                                                                    }
                                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["STGlucoza"]);
                                                                    }
                                                                    if (comboBox2.Text == "Varsta")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                    }
                                                                    if (ok2 == true)
                                                                    {
                                                                        foreach (DataRow row2 in dt2.Rows)
                                                                        {
                                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                            {
                                                                                if (comboBox2.Text == "Fumat")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    if (row2["Fumat"].ToString() == "DA")
                                                                                        otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    else
                                                                                        otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Activitate Fizica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Masa Corporala")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Inaltime")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Glicemie")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "HDL Colesterol")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "LDL Colesterol")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Trigliceride")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Indice de masa corporala")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                                    imc = imcf.ToString();
                                                                                    imcf = (float)Convert.ToDouble(imc);
                                                                                    otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                                                {
                                                                                    int rcvs;
                                                                                    rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                    #endregion
                                                                }
                                                                else
                                                                    if (valcomboBox.Text == "Toate Valorile")
                                                                    {
                                                                        numelistBox.Items.Add(row["Nume"]);
                                                                        indicelistBox.Items.Add(row["DiabetG"]);
                                                                        ctr++;
                                                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                        #region Alte Valori2
                                                                        if (comboBox2.Text == "CNP")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["CNP"]);
                                                                        }
                                                                        if (comboBox2.Text == "Ocupatie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Ocupatie"]);
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                        {
                                                                            otherlistBox.Items.Add(row["DZP"]);
                                                                            otherlabel.Text = comboBox2.Text;
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["DZF"]);
                                                                        }
                                                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["BoliCardio"]);
                                                                        }
                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                        {
                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                            otherlistBox.Items.Add(row["HAFam"]);
                                                                        }
                                                                        if (comboBox2.Text == "Dislipidemie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Dislipidemie"]);
                                                                        }
                                                                        if (comboBox2.Text == "Obezitate")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Obezitate"]);
                                                                        }
                                                                        if (comboBox2.Text == "Morti Subite")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["MortiSubite"]);
                                                                        }
                                                                        if (comboBox2.Text == "Copil Macrosom")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["CopilMacro"]);
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Gestational")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["DiabetG"]);

                                                                        }
                                                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["CardioIschemica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                        {
                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                            otherlistBox.Items.Add(row["HAPers"]);
                                                                        }
                                                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                        {
                                                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                            otherlistBox.Items.Add(row["IMAVC"]);
                                                                        }
                                                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["STGlucoza"]);
                                                                        }
                                                                        if (comboBox2.Text == "Varsta")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                        }
                                                                        if (ok2 == true)
                                                                        {
                                                                            foreach (DataRow row2 in dt2.Rows)
                                                                            {
                                                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                {
                                                                                    if (comboBox2.Text == "Fumat")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        if (row2["Fumat"].ToString() == "DA")
                                                                                            otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        else
                                                                                            otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Activitate Fizica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Masa Corporala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Inaltime")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Glicemie")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "HDL Colesterol")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "LDL Colesterol")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Trigliceride")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                                        imc = imcf.ToString();
                                                                                        imcf = (float)Convert.ToDouble(imc);
                                                                                        otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                                                    {
                                                                                        int rcvs;
                                                                                        rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                        #endregion
                                                                    }
                                                            }
                                                        }
                                                        ctr = 0;
                                                    }
                                                    else
                                                        if (istoriccomboBox.Text == "Cardiopatie Ischemica")
                                                        {
                                                            numelistBox.Items.Clear();
                                                            indicelistBox.Items.Clear();
                                                            datelistBox.Items.Clear();
                                                            otherlistBox.Items.Clear();
                                                            valoarelabel.Text = istoriccomboBox.Text;
                                                            foreach (DataRow row in dt.Rows)
                                                            {
                                                                if (row["CardioIschemica"].ToString() == valcomboBox.Text)
                                                                {
                                                                    numelistBox.Items.Add(row["Nume"]);
                                                                    indicelistBox.Items.Add(row["CardioIschemica"]);
                                                                    ctr++;
                                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                    #region Alte Valori2
                                                                    if (comboBox2.Text == "CNP")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["CNP"]);
                                                                    }
                                                                    if (comboBox2.Text == "Ocupatie")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["Ocupatie"]);
                                                                    }
                                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                    {
                                                                        otherlistBox.Items.Add(row["DZP"]);
                                                                        otherlabel.Text = comboBox2.Text;
                                                                    }
                                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["DZF"]);
                                                                    }
                                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["BoliCardio"]);
                                                                    }
                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                    {
                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                        otherlistBox.Items.Add(row["HAFam"]);
                                                                    }
                                                                    if (comboBox2.Text == "Dislipidemie")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["Dislipidemie"]);
                                                                    }
                                                                    if (comboBox2.Text == "Obezitate")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["Obezitate"]);
                                                                    }
                                                                    if (comboBox2.Text == "Morti Subite")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["MortiSubite"]);
                                                                    }
                                                                    if (comboBox2.Text == "Copil Macrosom")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["CopilMacro"]);
                                                                    }
                                                                    if (comboBox2.Text == "Diabet Gestational")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["DiabetG"]);

                                                                    }
                                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["CardioIschemica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                    {
                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                        otherlistBox.Items.Add(row["HAPers"]);
                                                                    }
                                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                    {
                                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                        otherlistBox.Items.Add(row["IMAVC"]);
                                                                    }
                                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["STGlucoza"]);
                                                                    }
                                                                    if (comboBox2.Text == "Varsta")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                    }
                                                                    if (ok2 == true)
                                                                    {
                                                                        foreach (DataRow row2 in dt2.Rows)
                                                                        {
                                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                            {
                                                                                if (comboBox2.Text == "Fumat")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    if (row2["Fumat"].ToString() == "DA")
                                                                                        otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    else
                                                                                        otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Activitate Fizica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Masa Corporala")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Inaltime")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Glicemie")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "HDL Colesterol")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "LDL Colesterol")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Trigliceride")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Indice de masa corporala")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                                    imc = imcf.ToString();
                                                                                    imcf = (float)Convert.ToDouble(imc);
                                                                                    otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                                                {
                                                                                    int rcvs;
                                                                                    rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                    #endregion
                                                                }
                                                                else
                                                                    if (valcomboBox.Text == "Toate Valorile")
                                                                    {
                                                                        numelistBox.Items.Add(row["Nume"]);
                                                                        indicelistBox.Items.Add(row["CardioIschemica"]);
                                                                        ctr++;
                                                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                        #region Alte Valori2
                                                                        if (comboBox2.Text == "CNP")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["CNP"]);
                                                                        }
                                                                        if (comboBox2.Text == "Ocupatie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Ocupatie"]);
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                        {
                                                                            otherlistBox.Items.Add(row["DZP"]);
                                                                            otherlabel.Text = comboBox2.Text;
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["DZF"]);
                                                                        }
                                                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["BoliCardio"]);
                                                                        }
                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                        {
                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                            otherlistBox.Items.Add(row["HAFam"]);
                                                                        }
                                                                        if (comboBox2.Text == "Dislipidemie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Dislipidemie"]);
                                                                        }
                                                                        if (comboBox2.Text == "Obezitate")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Obezitate"]);
                                                                        }
                                                                        if (comboBox2.Text == "Morti Subite")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["MortiSubite"]);
                                                                        }
                                                                        if (comboBox2.Text == "Copil Macrosom")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["CopilMacro"]);
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Gestational")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["DiabetG"]);

                                                                        }
                                                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["CardioIschemica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                        {
                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                            otherlistBox.Items.Add(row["HAPers"]);
                                                                        }
                                                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                        {
                                                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                            otherlistBox.Items.Add(row["IMAVC"]);
                                                                        }
                                                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["STGlucoza"]);
                                                                        }
                                                                        if (comboBox2.Text == "Varsta")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                        }
                                                                        if (ok2 == true)
                                                                        {
                                                                            foreach (DataRow row2 in dt2.Rows)
                                                                            {
                                                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                {
                                                                                    if (comboBox2.Text == "Fumat")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        if (row2["Fumat"].ToString() == "DA")
                                                                                            otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        else
                                                                                            otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Activitate Fizica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Masa Corporala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Inaltime")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Glicemie")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "HDL Colesterol")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "LDL Colesterol")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Trigliceride")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                                        imc = imcf.ToString();
                                                                                        imcf = (float)Convert.ToDouble(imc);
                                                                                        otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                                                    {
                                                                                        int rcvs;
                                                                                        rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                        #endregion
                                                                    }
                                                            }
                                                            ctr = 0;
                                                        }
                                                        else
                                                            if (istoriccomboBox.Text == "Hipertensiune Arteriala(personala)")
                                                            {
                                                                numelistBox.Items.Clear();
                                                                indicelistBox.Items.Clear();
                                                                datelistBox.Items.Clear();
                                                                otherlistBox.Items.Clear();
                                                                valoarelabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                foreach (DataRow row in dt.Rows)
                                                                {
                                                                    if (row["HAPers"].ToString() == valcomboBox.Text)
                                                                    {
                                                                        numelistBox.Items.Add(row["Nume"]);
                                                                        indicelistBox.Items.Add(row["HAPers"]);
                                                                        ctr++;
                                                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                        #region Alte Valori2
                                                                        if (comboBox2.Text == "CNP")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["CNP"]);
                                                                        }
                                                                        if (comboBox2.Text == "Ocupatie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Ocupatie"]);
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                        {
                                                                            otherlistBox.Items.Add(row["DZP"]);
                                                                            otherlabel.Text = comboBox2.Text;
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["DZF"]);
                                                                        }
                                                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["BoliCardio"]);
                                                                        }
                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                        {
                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                            otherlistBox.Items.Add(row["HAFam"]);
                                                                        }
                                                                        if (comboBox2.Text == "Dislipidemie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Dislipidemie"]);
                                                                        }
                                                                        if (comboBox2.Text == "Obezitate")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Obezitate"]);
                                                                        }
                                                                        if (comboBox2.Text == "Morti Subite")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["MortiSubite"]);
                                                                        }
                                                                        if (comboBox2.Text == "Copil Macrosom")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["CopilMacro"]);
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Gestational")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["DiabetG"]);

                                                                        }
                                                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["CardioIschemica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                        {
                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                            otherlistBox.Items.Add(row["HAPers"]);
                                                                        }
                                                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                        {
                                                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                            otherlistBox.Items.Add(row["IMAVC"]);
                                                                        }
                                                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["STGlucoza"]);
                                                                        }
                                                                        if (comboBox2.Text == "Varsta")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                        }
                                                                        if (ok2 == true)
                                                                        {
                                                                            foreach (DataRow row2 in dt2.Rows)
                                                                            {
                                                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                {
                                                                                    if (comboBox2.Text == "Fumat")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        if (row2["Fumat"].ToString() == "DA")
                                                                                            otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        else
                                                                                            otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Activitate Fizica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Masa Corporala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Inaltime")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Glicemie")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "HDL Colesterol")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "LDL Colesterol")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Trigliceride")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                                        imc = imcf.ToString();
                                                                                        imcf = (float)Convert.ToDouble(imc);
                                                                                        otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                                                    {
                                                                                        int rcvs;
                                                                                        rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                        #endregion
                                                                    }
                                                                    else
                                                                        if (valcomboBox.Text == "Toate Valorile")
                                                                        {
                                                                            numelistBox.Items.Add(row["Nume"]);
                                                                            indicelistBox.Items.Add(row["HAPers"]);
                                                                            ctr++;
                                                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                            #region Alte Valori2
                                                                            if (comboBox2.Text == "CNP")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["CNP"]);
                                                                            }
                                                                            if (comboBox2.Text == "Ocupatie")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["Ocupatie"]);
                                                                            }
                                                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                            {
                                                                                otherlistBox.Items.Add(row["DZP"]);
                                                                                otherlabel.Text = comboBox2.Text;
                                                                            }
                                                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["DZF"]);
                                                                            }
                                                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["BoliCardio"]);
                                                                            }
                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                            {
                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                otherlistBox.Items.Add(row["HAFam"]);
                                                                            }
                                                                            if (comboBox2.Text == "Dislipidemie")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["Dislipidemie"]);
                                                                            }
                                                                            if (comboBox2.Text == "Obezitate")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["Obezitate"]);
                                                                            }
                                                                            if (comboBox2.Text == "Morti Subite")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["MortiSubite"]);
                                                                            }
                                                                            if (comboBox2.Text == "Copil Macrosom")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["CopilMacro"]);
                                                                            }
                                                                            if (comboBox2.Text == "Diabet Gestational")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["DiabetG"]);

                                                                            }
                                                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["CardioIschemica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                            {
                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                otherlistBox.Items.Add(row["HAPers"]);
                                                                            }
                                                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                            {
                                                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                otherlistBox.Items.Add(row["IMAVC"]);
                                                                            }
                                                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["STGlucoza"]);
                                                                            }
                                                                            if (comboBox2.Text == "Varsta")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                            }
                                                                            if (ok2 == true)
                                                                            {
                                                                                foreach (DataRow row2 in dt2.Rows)
                                                                                {
                                                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                    {
                                                                                        if (comboBox2.Text == "Fumat")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            if (row2["Fumat"].ToString() == "DA")
                                                                                                otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            else
                                                                                                otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Activitate Fizica")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Masa Corporala")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Inaltime")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Glicemie")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "HDL Colesterol")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "LDL Colesterol")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Trigliceride")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Indice de masa corporala")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                                            imc = imcf.ToString();
                                                                                            imcf = (float)Convert.ToDouble(imc);
                                                                                            otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Risc Cardiovascular")
                                                                                        {
                                                                                            int rcvs;
                                                                                            rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                            #endregion
                                                                        }
                                                                }
                                                                ctr = 0;
                                                            }
                                                            else
                                                                if (istoriccomboBox.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                {
                                                                    numelistBox.Items.Clear();
                                                                    indicelistBox.Items.Clear();
                                                                    datelistBox.Items.Clear();
                                                                    otherlistBox.Items.Clear();
                                                                    valoarelabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                    foreach (DataRow row in dt.Rows)
                                                                    {
                                                                        if (row["IMAVC"].ToString() == valcomboBox.Text)
                                                                        {
                                                                            numelistBox.Items.Add(row["Nume"]);
                                                                            indicelistBox.Items.Add(row["IMAVC"]);
                                                                            ctr++;
                                                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                            #region Alte Valori2
                                                                            if (comboBox2.Text == "CNP")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["CNP"]);
                                                                            }
                                                                            if (comboBox2.Text == "Ocupatie")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["Ocupatie"]);
                                                                            }
                                                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                            {
                                                                                otherlistBox.Items.Add(row["DZP"]);
                                                                                otherlabel.Text = comboBox2.Text;
                                                                            }
                                                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["DZF"]);
                                                                            }
                                                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["BoliCardio"]);
                                                                            }
                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                            {
                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                otherlistBox.Items.Add(row["HAFam"]);
                                                                            }
                                                                            if (comboBox2.Text == "Dislipidemie")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["Dislipidemie"]);
                                                                            }
                                                                            if (comboBox2.Text == "Obezitate")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["Obezitate"]);
                                                                            }
                                                                            if (comboBox2.Text == "Morti Subite")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["MortiSubite"]);
                                                                            }
                                                                            if (comboBox2.Text == "Copil Macrosom")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["CopilMacro"]);
                                                                            }
                                                                            if (comboBox2.Text == "Diabet Gestational")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["DiabetG"]);

                                                                            }
                                                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["CardioIschemica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                            {
                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                otherlistBox.Items.Add(row["HAPers"]);
                                                                            }
                                                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                            {
                                                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                otherlistBox.Items.Add(row["IMAVC"]);
                                                                            }
                                                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["STGlucoza"]);
                                                                            }
                                                                            if (comboBox2.Text == "Varsta")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                            }
                                                                            if (ok2 == true)
                                                                            {
                                                                                foreach (DataRow row2 in dt2.Rows)
                                                                                {
                                                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                    {
                                                                                        if (comboBox2.Text == "Fumat")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            if (row2["Fumat"].ToString() == "DA")
                                                                                                otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            else
                                                                                                otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Activitate Fizica")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Masa Corporala")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Inaltime")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Glicemie")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "HDL Colesterol")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "LDL Colesterol")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Trigliceride")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Indice de masa corporala")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                                            imc = imcf.ToString();
                                                                                            imcf = (float)Convert.ToDouble(imc);
                                                                                            otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Risc Cardiovascular")
                                                                                        {
                                                                                            int rcvs;
                                                                                            rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                            #endregion
                                                                        }
                                                                        else
                                                                            if (valcomboBox.Text == "Toate Valorile")
                                                                            {
                                                                                numelistBox.Items.Add(row["Nume"]);
                                                                                indicelistBox.Items.Add(row["IMAVC"]);
                                                                                ctr++;
                                                                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                                #region Alte Valori2
                                                                                if (comboBox2.Text == "CNP")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["CNP"]);
                                                                                }
                                                                                if (comboBox2.Text == "Ocupatie")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["Ocupatie"]);
                                                                                }
                                                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                {
                                                                                    otherlistBox.Items.Add(row["DZP"]);
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                }
                                                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["DZF"]);
                                                                                }
                                                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["BoliCardio"]);
                                                                                }
                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                {
                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                    otherlistBox.Items.Add(row["HAFam"]);
                                                                                }
                                                                                if (comboBox2.Text == "Dislipidemie")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["Dislipidemie"]);
                                                                                }
                                                                                if (comboBox2.Text == "Obezitate")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["Obezitate"]);
                                                                                }
                                                                                if (comboBox2.Text == "Morti Subite")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["MortiSubite"]);
                                                                                }
                                                                                if (comboBox2.Text == "Copil Macrosom")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["CopilMacro"]);
                                                                                }
                                                                                if (comboBox2.Text == "Diabet Gestational")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["DiabetG"]);

                                                                                }
                                                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["CardioIschemica"]);
                                                                                }
                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                {
                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                    otherlistBox.Items.Add(row["HAPers"]);
                                                                                }
                                                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                {
                                                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                    otherlistBox.Items.Add(row["IMAVC"]);
                                                                                }
                                                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["STGlucoza"]);
                                                                                }
                                                                                if (comboBox2.Text == "Varsta")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                                }
                                                                                if (ok2 == true)
                                                                                {
                                                                                    foreach (DataRow row2 in dt2.Rows)
                                                                                    {
                                                                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                        {
                                                                                            if (comboBox2.Text == "Fumat")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                if (row2["Fumat"].ToString() == "DA")
                                                                                                    otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                else
                                                                                                    otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Activitate Fizica")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Masa Corporala")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Inaltime")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Glicemie")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "HDL Colesterol")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "LDL Colesterol")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Trigliceride")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Indice de masa corporala")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                                                imc = imcf.ToString();
                                                                                                imcf = (float)Convert.ToDouble(imc);
                                                                                                otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Risc Cardiovascular")
                                                                                            {
                                                                                                int rcvs;
                                                                                                rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                                #endregion
                                                                            }
                                                                    }
                                                                    ctr = 0;
                                                                }
                                                                else
                                                                    if (istoriccomboBox.Text == "Scaderea Tolerantei La Glucoza")
                                                                    {
                                                                        numelistBox.Items.Clear();
                                                                        indicelistBox.Items.Clear();
                                                                        datelistBox.Items.Clear();
                                                                        otherlistBox.Items.Clear();
                                                                        valoarelabel.Text = "Scaderea Tolerantei" + "\n" + "La Glucoza";
                                                                        foreach (DataRow row in dt.Rows)
                                                                        {
                                                                            if (row["STGlucoza"].ToString() == valcomboBox.Text)
                                                                            {
                                                                                numelistBox.Items.Add(row["Nume"]);
                                                                                indicelistBox.Items.Add(row["STGlucoza"]);
                                                                                ctr++;
                                                                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                                #region Alte Valori2
                                                                                if (comboBox2.Text == "CNP")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["CNP"]);
                                                                                }
                                                                                if (comboBox2.Text == "Ocupatie")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["Ocupatie"]);
                                                                                }
                                                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                {
                                                                                    otherlistBox.Items.Add(row["DZP"]);
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                }
                                                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["DZF"]);
                                                                                }
                                                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["BoliCardio"]);
                                                                                }
                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                {
                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                    otherlistBox.Items.Add(row["HAFam"]);
                                                                                }
                                                                                if (comboBox2.Text == "Dislipidemie")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["Dislipidemie"]);
                                                                                }
                                                                                if (comboBox2.Text == "Obezitate")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["Obezitate"]);
                                                                                }
                                                                                if (comboBox2.Text == "Morti Subite")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["MortiSubite"]);
                                                                                }
                                                                                if (comboBox2.Text == "Copil Macrosom")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["CopilMacro"]);
                                                                                }
                                                                                if (comboBox2.Text == "Diabet Gestational")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["DiabetG"]);

                                                                                }
                                                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["CardioIschemica"]);
                                                                                }
                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                {
                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                    otherlistBox.Items.Add(row["HAPers"]);
                                                                                }
                                                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                {
                                                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                    otherlistBox.Items.Add(row["IMAVC"]);
                                                                                }
                                                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["STGlucoza"]);
                                                                                }
                                                                                if (comboBox2.Text == "Varsta")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                                }
                                                                                if (ok2 == true)
                                                                                {
                                                                                    foreach (DataRow row2 in dt2.Rows)
                                                                                    {
                                                                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                        {
                                                                                            if (comboBox2.Text == "Fumat")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                if (row2["Fumat"].ToString() == "DA")
                                                                                                    otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                else
                                                                                                    otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Activitate Fizica")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Masa Corporala")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Inaltime")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Glicemie")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "HDL Colesterol")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "LDL Colesterol")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Trigliceride")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Indice de masa corporala")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                                                imc = imcf.ToString();
                                                                                                imcf = (float)Convert.ToDouble(imc);
                                                                                                otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Risc Cardiovascular")
                                                                                            {
                                                                                                int rcvs;
                                                                                                rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                                #endregion
                                                                            }
                                                                            else
                                                                                if (valcomboBox.Text == "Toate Valorile")
                                                                                {
                                                                                    numelistBox.Items.Add(row["Nume"]);
                                                                                    indicelistBox.Items.Add(row["STGlucoza"]);
                                                                                    ctr++;
                                                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                                    #region Alte Valori2
                                                                                    if (comboBox2.Text == "CNP")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["CNP"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Ocupatie")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["Ocupatie"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                    {
                                                                                        otherlistBox.Items.Add(row["DZP"]);
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                    }
                                                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["DZF"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["BoliCardio"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                    {
                                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                        otherlistBox.Items.Add(row["HAFam"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Dislipidemie")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["Dislipidemie"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Obezitate")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["Obezitate"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Morti Subite")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["MortiSubite"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Copil Macrosom")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["CopilMacro"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Diabet Gestational")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["DiabetG"]);

                                                                                    }
                                                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["CardioIschemica"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                    {
                                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                        otherlistBox.Items.Add(row["HAPers"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                    {
                                                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                        otherlistBox.Items.Add(row["IMAVC"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["STGlucoza"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Varsta")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                                    }
                                                                                    if (ok2 == true)
                                                                                    {
                                                                                        foreach (DataRow row2 in dt2.Rows)
                                                                                        {
                                                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                            {
                                                                                                if (comboBox2.Text == "Fumat")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    if (row2["Fumat"].ToString() == "DA")
                                                                                                        otherlistBox.Items.Add(row2["Fumat"] + " (" + row2["Nrtigar"] + ") " + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                    else
                                                                                                        otherlistBox.Items.Add(row2["Fumat"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Activitate Fizica")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["ActFizica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Masa Corporala")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["G"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Inaltime")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["H"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["Ca"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["TaSistolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["TaDiastolica"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Glicemie")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["Glicemie"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "HDL Colesterol")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["HDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "LDL Colesterol")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["LDLCol"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Trigliceride")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["Tg"] + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Indice de masa corporala")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    imcf = c.IMC(row2["G"].ToString(), row2["H"].ToString());
                                                                                                    imc = imcf.ToString();
                                                                                                    imcf = (float)Convert.ToDouble(imc);
                                                                                                    otherlistBox.Items.Add(imcf + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                                                                {
                                                                                                    int rcvs;
                                                                                                    rcvs = c.RCV(row2["LDLCol"].ToString(), row2["CNP"].ToString(), row2["TaSistolica"].ToString(), row2["Fumat"].ToString(), Convert.ToDateTime(row2["Date"]).ToShortDateString().ToString());
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(rcvs + "    " + Convert.ToDateTime(row2["Date"]).ToShortDateString() + "   " + row2["Nume"]);
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                    #endregion
                                                                                }
                                                                        }
                                                                        ctr = 0;
                                                                    }
                }
                else
                {
                    MessageBox.Show("Selectati o valoare pentru a vedea statistica");
                }
            }
            else
                MessageBox.Show("Am întâmpinat probleme la încărcarea datelor!");
            int s = 0;
            for (int i = 1; i <= numelistBox.Items.Count; i++)
                s += i;
            if (s == 0)
                paclabel.Text = "";
        }
Beispiel #2
0
 private void rcvbutton_Click(object sender, EventArgs e)
 {
     Calcul c = new Calcul();
     string cnp;
     cnp = cNPTextBox.Text;
     if (cnp != "")
     {
         if (lDLColTextBox.Text != "" || taSistolicaTextBox.Text != "")
         {
             rcvscor = c.RCV(lDLColTextBox.Text, cnp, taSistolicaTextBox.Text, fumatTextBox.Text, dateTextBox.Text);
             rcvlabel.Text = rcvscor.ToString();
             if (rcvscor < 1)//aici in functie de scor schimbam culoarea de fundal al labelului
                 rcvlabel.BackColor = Color.GreenYellow;
             else
                 if (rcvscor == 1)
                     rcvlabel.BackColor = Color.Green;
                 else
                     if (rcvscor == 2)
                         rcvlabel.BackColor = Color.Yellow;
                     else
                         if (rcvscor == 3 || rcvscor == 4)
                             rcvlabel.BackColor = Color.Orange;
                         else
                             if (rcvscor >= 5 && rcvscor <= 9)
                                 rcvlabel.BackColor = Color.IndianRed;
                             else
                                 if (rcvscor >= 10 && rcvscor <= 14)
                                     rcvlabel.BackColor = Color.Red;
                                 else
                                     if (rcvscor >= 15)
                                         rcvlabel.BackColor = Color.DarkRed;
             rcvok = true;
         }
     }
 }
Beispiel #3
0
        private void afisbutton_Click(object sender, EventArgs e)
        {
            c = new Calcul();
            bool ok = true,ok2=true;
            try
            {
               this.statisticaTableAdapter.Fill(dateMedDataSet.Statistica);
            }
            catch
            {
                ok = false;
                MessageBox.Show("Vă rugăm reîncercați.");
            }
            try
            {
                viewDatePersTableAdapter.Fill(dateMedDataSet.ViewDatePers);
            }
            catch
            {
                ok2 = false;
                MessageBox.Show("Vă rugăm reîncercați.");
            }
            DataTable dt = dateMedDataSet.Statistica;
            DataTable dt2 = dateMedDataSet.ViewDatePers;
            if (FromtextBox.Text != "" && TotextBox.Text != "")
            {
                from = int.Parse(FromtextBox.Text);
                to = int.Parse(TotextBox.Text);
            }
            if (ok == true)
            {
                if (controlcomboBox.Text != "Selectati")
                {
                    if (controlcomboBox.Text == "Fumat")
                    {

                        numelistBox.Items.Clear();
                        datelistBox.Items.Clear();
                        indicelistBox.Items.Clear();
                        otherlistBox.Items.Clear();
                        valoarelabel.Text = controlcomboBox.Text;
                        foreach (DataRow row in dt.Rows)
                        {
                            if (row["Fumat"].ToString() == comboBox1.Text)
                            {
                                if (comboBox1.Text == "DA")
                                {
                                    fum = row["Fumat"] + " ( " + row["Nrtigar"] + " )";
                                    indicelistBox.Items.Add(fum);
                                    #region Alte valori
                                        if (comboBox2.Text == "CNP")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["CNP"]);
                                        }
                                        if(comboBox2.Text=="Fumat")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            if (row["Fumat"].ToString() == "DA")
                                                otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                            else
                                                otherlistBox.Items.Add(row["Fumat"]);
                                        }
                                        if (comboBox2.Text == "Activitate Fizica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["ActFizica"]);
                                        }
                                        if (comboBox2.Text == "Masa Corporala")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["G"]);
                                        }
                                        if (comboBox2.Text == "Inaltime")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["H"]);
                                        }
                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Ca"]);
                                        }
                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["TaSistolica"]);
                                        }
                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["TaDiastolica"]);
                                        }
                                        if (comboBox2.Text == "Glicemie")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Glicemie"]);
                                        }
                                        if (comboBox2.Text == "HDL Colesterol")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["HDLCol"]);
                                        }
                                        if (comboBox2.Text == "LDL Colesterol")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["LDLCol"]);
                                        }
                                        if (comboBox2.Text == "Trigliceride")
                                        {
                                            otherlistBox.Items.Add(row["Tg"]);
                                            otherlabel.Text = comboBox2.Text;
                                        }
                                        if (comboBox2.Text == "Indice de masa corporala")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                            imc = imcf.ToString();
                                            imcf = (float)Convert.ToDouble(imc);
                                            otherlistBox.Items.Add(imcf);
                                        }
                                        if (comboBox2.Text == "Varsta")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(),now));
                                        }
                                        if (comboBox2.Text == "Risc Cardiovascular")
                                        {
                                            int rcvs;
                                            rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(),Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(rcvs);
                                        }
                                        if (ok2 == true)
                                        {
                                            foreach (DataRow row2 in dt2.Rows)
                                            {
                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                {
                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["DZP"]);
                                                    }
                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["DZF"]);
                                                    }
                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["BoliCardio"]);
                                                    }
                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                    {
                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                        otherlistBox.Items.Add(row2["HAFam"]);
                                                    }
                                                    if (comboBox2.Text == "Dislipidemie")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                    }
                                                    if (comboBox2.Text == "Obezitate")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Obezitate"]);
                                                    }
                                                    if (comboBox2.Text == "Morti Subite")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["MortiSubite"]);
                                                    }
                                                    if (comboBox2.Text == "Ocupatie")
                                                    {
                                                        otherlistBox.Items.Add(row2["Ocupatie"]);
                                                        otherlabel.Text = comboBox2.Text;
                                                    }
                                                    if (comboBox2.Text == "Diabet Gestational")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["DiabetG"]);
                                                    }
                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                    }
                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                    {
                                                        otherlabel.Text="Hipertensiune Arteriala"+"\n" +"(personala)";
                                                        otherlistBox.Items.Add(row2["HAPers"]);
                                                    }
                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                    {
                                                        otherlabel.Text = "Infarct Miocardic"+"\n" +"Accident Vascular Cerebral";
                                                        otherlistBox.Items.Add(row2["IMAVC"]);
                                                    }
                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["STGlucoza"]);
                                                    }
                                                    if (comboBox2.Text == "Copil Macrosom")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["CopilMacro"]);
                                                    }
                                                }
                                            }
                                        }
                                #endregion
                                    ctr++;
                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();

                                }
                                else
                                    if (comboBox1.Text == "NU")
                                    {
                                        fum = row["Fumat"].ToString();
                                        indicelistBox.Items.Add(fum);
                                        #region Alte valori
                                        if (comboBox2.Text == "CNP")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["CNP"]);
                                        }
                                        if (comboBox2.Text == "Fumat")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            if (row["Fumat"].ToString() == "DA")
                                                otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                            else
                                                otherlistBox.Items.Add(row["Fumat"]);
                                        }
                                        if (comboBox2.Text == "Activitate Fizica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["ActFizica"]);
                                        }
                                        if (comboBox2.Text == "Masa Corporala")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["G"]);
                                        }
                                        if (comboBox2.Text == "Inaltime")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["H"]);
                                        }
                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Ca"]);
                                        }
                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["TaSistolica"]);
                                        }
                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["TaDiastolica"]);
                                        }
                                        if (comboBox2.Text == "Glicemie")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Glicemie"]);
                                        }
                                        if (comboBox2.Text == "HDL Colesterol")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["HDLCol"]);
                                        }
                                        if (comboBox2.Text == "LDL Colesterol")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["LDLCol"]);
                                        }
                                        if (comboBox2.Text == "Trigliceride")
                                        {
                                            otherlistBox.Items.Add(row["Tg"]);
                                            otherlabel.Text = comboBox2.Text;
                                        }
                                        if (comboBox2.Text == "Indice de masa corporala")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                            imc = imcf.ToString();
                                            imcf = (float)Convert.ToDouble(imc);
                                            otherlistBox.Items.Add(imcf);
                                        }
                                        if (comboBox2.Text == "Varsta")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                        }
                                        if (comboBox2.Text == "Risc Cardiovascular")
                                        {
                                            int rcvs;
                                            rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(rcvs);
                                        }
                                        if (ok2 == true)
                                        {
                                            foreach (DataRow row2 in dt2.Rows)
                                            {
                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                {
                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["DZP"]);
                                                    }
                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["DZF"]);
                                                    }
                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["BoliCardio"]);
                                                    }
                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                    {
                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                        otherlistBox.Items.Add(row2["HAFam"]);
                                                    }
                                                    if (comboBox2.Text == "Dislipidemie")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                    }
                                                    if (comboBox2.Text == "Obezitate")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Obezitate"]);
                                                    }
                                                    if (comboBox2.Text == "Morti Subite")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["MortiSubite"]);
                                                    }
                                                    if (comboBox2.Text == "Ocupatie")
                                                    {
                                                        otherlistBox.Items.Add(row2["Ocupatie"]);
                                                        otherlabel.Text = comboBox2.Text;
                                                    }
                                                    if (comboBox2.Text == "Diabet Gestational")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["DiabetG"]);
                                                    }
                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                    }
                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                    {
                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                        otherlistBox.Items.Add(row2["HAPers"]);
                                                    }
                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                    {
                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                        otherlistBox.Items.Add(row2["IMAVC"]);
                                                    }
                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["STGlucoza"]);
                                                    }
                                                    if (comboBox2.Text == "Copil Macrosom")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["CopilMacro"]);
                                                    }
                                                }
                                            }
                                        }
                                        #endregion
                                        ctr++;
                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();

                                    }
                                numelistBox.Items.Add(row["Nume"]);
                                datelistBox.Items.Add(row["Date"]);
                            }
                            else
                                if (comboBox1.Text == "Toate Valorile")
                                {
                                    if (row["Fumat"].ToString() == "DA")
                                        indicelistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                    else
                                        indicelistBox.Items.Add(row["Fumat"]);
                                    numelistBox.Items.Add(row["Nume"]);
                                    datelistBox.Items.Add(row["Date"]);
                                    #region Alte valori
                                    if (comboBox2.Text == "CNP")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["CNP"]);
                                    }
                                    if (comboBox2.Text == "Fumat")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        if (row["Fumat"].ToString() == "DA")
                                            otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                        else
                                            otherlistBox.Items.Add(row["Fumat"]);
                                    }
                                    if (comboBox2.Text == "Activitate Fizica")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["ActFizica"]);
                                    }
                                    if (comboBox2.Text == "Masa Corporala")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["G"]);
                                    }
                                    if (comboBox2.Text == "Inaltime")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["H"]);
                                    }
                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["Ca"]);
                                    }
                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["TaSistolica"]);
                                    }
                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["TaDiastolica"]);
                                    }
                                    if (comboBox2.Text == "Glicemie")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["Glicemie"]);
                                    }
                                    if (comboBox2.Text == "HDL Colesterol")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["HDLCol"]);
                                    }
                                    if (comboBox2.Text == "LDL Colesterol")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["LDLCol"]);
                                    }
                                    if (comboBox2.Text == "Trigliceride")
                                    {
                                        otherlistBox.Items.Add(row["Tg"]);
                                        otherlabel.Text = comboBox2.Text;
                                    }
                                    if (comboBox2.Text == "Indice de masa corporala")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                        imc = imcf.ToString();
                                        imcf = (float)Convert.ToDouble(imc);
                                        otherlistBox.Items.Add(imcf);
                                    }
                                    if (comboBox2.Text == "Varsta")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                    }
                                    if (comboBox2.Text == "Risc Cardiovascular")
                                    {
                                        int rcvs;
                                        rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(rcvs);
                                    }
                                    if (ok2 == true)
                                    {
                                        foreach (DataRow row2 in dt2.Rows)
                                        {
                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                            {
                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["DZP"]);
                                                }
                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["DZF"]);
                                                }
                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["BoliCardio"]);
                                                }
                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                {
                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                    otherlistBox.Items.Add(row2["HAFam"]);
                                                }
                                                if (comboBox2.Text == "Dislipidemie")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                }
                                                if (comboBox2.Text == "Obezitate")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["Obezitate"]);
                                                }
                                                if (comboBox2.Text == "Morti Subite")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["MortiSubite"]);
                                                }
                                                if (comboBox2.Text == "Ocupatie")
                                                {
                                                    otherlistBox.Items.Add(row2["Ocupatie"]);
                                                    otherlabel.Text = comboBox2.Text;
                                                }
                                                if (comboBox2.Text == "Diabet Gestational")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["DiabetG"]);
                                                }
                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                }
                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                {
                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                    otherlistBox.Items.Add(row2["HAPers"]);
                                                }
                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                {
                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                    otherlistBox.Items.Add(row2["IMAVC"]);
                                                }
                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["STGlucoza"]);
                                                }
                                                if (comboBox2.Text == "Copil Macrosom")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["CopilMacro"]);
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                    ctr++;
                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();

                                }
                        }
                        ctr = 0;
                    }
                    else
                        if (controlcomboBox.Text == "Activitate Fizica")
                        {
                            numelistBox.Items.Clear();
                            datelistBox.Items.Clear();
                            indicelistBox.Items.Clear();
                            otherlistBox.Items.Clear();
                            valoarelabel.Text = controlcomboBox.Text;
                            foreach (DataRow row in dt.Rows)
                            {
                                if (row["ActFizica"].ToString() == comboBox1.Text)
                                {
                                    indicelistBox.Items.Add(row["ActFizica"]);
                                    numelistBox.Items.Add(row["Nume"]);
                                    datelistBox.Items.Add(row["Date"]);
                                    ctr++;
                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                    #region Alte valori
                                    if (comboBox2.Text == "CNP")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["CNP"]);
                                    }
                                    if (comboBox2.Text == "Fumat")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        if (row["Fumat"].ToString() == "DA")
                                            otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                        else
                                            otherlistBox.Items.Add(row["Fumat"]);
                                    }
                                    if (comboBox2.Text == "Activitate Fizica")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["ActFizica"]);
                                    }
                                    if (comboBox2.Text == "Masa Corporala")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["G"]);
                                    }
                                    if (comboBox2.Text == "Inaltime")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["H"]);
                                    }
                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["Ca"]);
                                    }
                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["TaSistolica"]);
                                    }
                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["TaDiastolica"]);
                                    }
                                    if (comboBox2.Text == "Glicemie")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["Glicemie"]);
                                    }
                                    if (comboBox2.Text == "HDL Colesterol")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["HDLCol"]);
                                    }
                                    if (comboBox2.Text == "LDL Colesterol")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(row["LDLCol"]);
                                    }
                                    if (comboBox2.Text == "Trigliceride")
                                    {
                                        otherlistBox.Items.Add(row["Tg"]);
                                        otherlabel.Text = comboBox2.Text;
                                    }
                                    if (comboBox2.Text == "Indice de masa corporala")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                        imc = imcf.ToString();
                                        imcf = (float)Convert.ToDouble(imc);
                                        otherlistBox.Items.Add(imcf);
                                    }
                                    if (comboBox2.Text == "Varsta")
                                    {
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                    }
                                    if (comboBox2.Text == "Risc Cardiovascular")
                                    {
                                        int rcvs;
                                        rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                        otherlabel.Text = comboBox2.Text;
                                        otherlistBox.Items.Add(rcvs);
                                    }
                                    if (ok2 == true)
                                    {
                                        foreach (DataRow row2 in dt2.Rows)
                                        {
                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                            {
                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["DZP"]);
                                                }
                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["DZF"]);
                                                }
                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["BoliCardio"]);
                                                }
                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                {
                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                    otherlistBox.Items.Add(row2["HAFam"]);
                                                }
                                                if (comboBox2.Text == "Dislipidemie")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                }
                                                if (comboBox2.Text == "Obezitate")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["Obezitate"]);
                                                }
                                                if (comboBox2.Text == "Morti Subite")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["MortiSubite"]);
                                                }
                                                if (comboBox2.Text == "Ocupatie")
                                                {
                                                    otherlistBox.Items.Add(row2["Ocupatie"]);
                                                    otherlabel.Text = comboBox2.Text;
                                                }
                                                if (comboBox2.Text == "Diabet Gestational")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["DiabetG"]);
                                                }
                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                }
                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                {
                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                    otherlistBox.Items.Add(row2["HAPers"]);
                                                }
                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                {
                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                    otherlistBox.Items.Add(row2["IMAVC"]);
                                                }
                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["STGlucoza"]);
                                                }
                                                if (comboBox2.Text == "Copil Macrosom")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row2["CopilMacro"]);
                                                }
                                            }
                                        }
                                    }
                                    #endregion
                                }
                                else
                                    if (comboBox1.Text == "Toate Valorile")
                                    {
                                        indicelistBox.Items.Add(row["ActFizica"]);
                                        numelistBox.Items.Add(row["Nume"]);
                                        datelistBox.Items.Add(row["Date"]);
                                        ctr++;
                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                        #region Alte valori
                                        if (comboBox2.Text == "CNP")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["CNP"]);
                                        }
                                        if (comboBox2.Text == "Fumat")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            if (row["Fumat"].ToString() == "DA")
                                                otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                            else
                                                otherlistBox.Items.Add(row["Fumat"]);
                                        }
                                        if (comboBox2.Text == "Activitate Fizica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["ActFizica"]);
                                        }
                                        if (comboBox2.Text == "Masa Corporala")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["G"]);
                                        }
                                        if (comboBox2.Text == "Inaltime")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["H"]);
                                        }
                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Ca"]);
                                        }
                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["TaSistolica"]);
                                        }
                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["TaDiastolica"]);
                                        }
                                        if (comboBox2.Text == "Glicemie")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Glicemie"]);
                                        }
                                        if (comboBox2.Text == "HDL Colesterol")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["HDLCol"]);
                                        }
                                        if (comboBox2.Text == "LDL Colesterol")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["LDLCol"]);
                                        }
                                        if (comboBox2.Text == "Trigliceride")
                                        {
                                            otherlistBox.Items.Add(row["Tg"]);
                                            otherlabel.Text = comboBox2.Text;
                                        }
                                        if (comboBox2.Text == "Indice de masa corporala")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                            imc = imcf.ToString();
                                            imcf = (float)Convert.ToDouble(imc);
                                            otherlistBox.Items.Add(imcf);
                                        }
                                        if (comboBox2.Text == "Varsta")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                        }
                                        if (comboBox2.Text == "Risc Cardiovascular")
                                        {
                                            int rcvs;
                                            rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(rcvs);
                                        }
                                        if (ok2 == true)
                                        {
                                            foreach (DataRow row2 in dt2.Rows)
                                            {
                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                {
                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["DZP"]);
                                                    }
                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["DZF"]);
                                                    }
                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["BoliCardio"]);
                                                    }
                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                    {
                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                        otherlistBox.Items.Add(row2["HAFam"]);
                                                    }
                                                    if (comboBox2.Text == "Dislipidemie")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                    }
                                                    if (comboBox2.Text == "Obezitate")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Obezitate"]);
                                                    }
                                                    if (comboBox2.Text == "Morti Subite")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["MortiSubite"]);
                                                    }
                                                    if (comboBox2.Text == "Ocupatie")
                                                    {
                                                        otherlistBox.Items.Add(row2["Ocupatie"]);
                                                        otherlabel.Text = comboBox2.Text;
                                                    }
                                                    if (comboBox2.Text == "Diabet Gestational")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["DiabetG"]);
                                                    }
                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                    }
                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                    {
                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                        otherlistBox.Items.Add(row2["HAPers"]);
                                                    }
                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                    {
                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                        otherlistBox.Items.Add(row2["IMAVC"]);
                                                    }
                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["STGlucoza"]);
                                                    }
                                                    if (comboBox2.Text == "Copil Macrosom")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["CopilMacro"]);
                                                    }
                                                }
                                            }
                                        }
                                        #endregion
                                    }
                            }
                            ctr = 0;
                        }
                        else
                            if (controlcomboBox.Text == "Masa Corporala")
                            {
                                numelistBox.Items.Clear();
                                datelistBox.Items.Clear();
                                indicelistBox.Items.Clear();
                                otherlistBox.Items.Clear();
                                valoarelabel.Text = controlcomboBox.Text;
                                foreach (DataRow row in dt.Rows)
                                {
                                    if (Convert.ToInt32(row["G"]) >= from &&Convert.ToInt32(row["G"]) <= to)
                                    {
                                        indicelistBox.Items.Add(row["G"]);
                                        numelistBox.Items.Add(row["Nume"]);
                                        datelistBox.Items.Add(row["Date"]);
                                        ctr++;
                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                        #region Alte valori
                                        if (comboBox2.Text == "CNP")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["CNP"]);
                                        }
                                        if (comboBox2.Text == "Fumat")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            if (row["Fumat"].ToString() == "DA")
                                                otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                            else
                                                otherlistBox.Items.Add(row["Fumat"]);
                                        }
                                        if (comboBox2.Text == "Activitate Fizica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["ActFizica"]);
                                        }
                                        if (comboBox2.Text == "Masa Corporala")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["G"]);
                                        }
                                        if (comboBox2.Text == "Inaltime")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["H"]);
                                        }
                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Ca"]);
                                        }
                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["TaSistolica"]);
                                        }
                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["TaDiastolica"]);
                                        }
                                        if (comboBox2.Text == "Glicemie")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["Glicemie"]);
                                        }
                                        if (comboBox2.Text == "HDL Colesterol")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["HDLCol"]);
                                        }
                                        if (comboBox2.Text == "LDL Colesterol")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(row["LDLCol"]);
                                        }
                                        if (comboBox2.Text == "Trigliceride")
                                        {
                                            otherlistBox.Items.Add(row["Tg"]);
                                            otherlabel.Text = comboBox2.Text;
                                        }
                                        if (comboBox2.Text == "Indice de masa corporala")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                            imc = imcf.ToString();
                                            imcf = (float)Convert.ToDouble(imc);
                                            otherlistBox.Items.Add(imcf);
                                        }
                                        if (comboBox2.Text == "Varsta")
                                        {
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                        }
                                        if (comboBox2.Text == "Risc Cardiovascular")
                                        {
                                            int rcvs;
                                            rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                            otherlabel.Text = comboBox2.Text;
                                            otherlistBox.Items.Add(rcvs);
                                        }
                                        if (ok2 == true)
                                        {
                                            foreach (DataRow row2 in dt2.Rows)
                                            {
                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                {
                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["DZP"]);
                                                    }
                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["DZF"]);
                                                    }
                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["BoliCardio"]);
                                                    }
                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                    {
                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                        otherlistBox.Items.Add(row2["HAFam"]);
                                                    }
                                                    if (comboBox2.Text == "Dislipidemie")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                    }
                                                    if (comboBox2.Text == "Obezitate")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["Obezitate"]);
                                                    }
                                                    if (comboBox2.Text == "Morti Subite")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["MortiSubite"]);
                                                    }
                                                    if (comboBox2.Text == "Ocupatie")
                                                    {
                                                        otherlistBox.Items.Add(row2["Ocupatie"]);
                                                        otherlabel.Text = comboBox2.Text;
                                                    }
                                                    if (comboBox2.Text == "Diabet Gestational")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["DiabetG"]);
                                                    }
                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                    }
                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                    {
                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                        otherlistBox.Items.Add(row2["HAPers"]);
                                                    }
                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                    {
                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                        otherlistBox.Items.Add(row2["IMAVC"]);
                                                    }
                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["STGlucoza"]);
                                                    }
                                                    if (comboBox2.Text == "Copil Macrosom")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row2["CopilMacro"]);
                                                    }
                                                }
                                            }
                                        }
                                        #endregion
                                    }
                                    else
                                        if (from == 0 && Convert.ToInt32(row["G"]) <= to)
                                        {
                                            indicelistBox.Items.Add(row["G"]);
                                            numelistBox.Items.Add(row["Nume"]);
                                            datelistBox.Items.Add(row["Date"]);
                                            ctr++;
                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                            #region Alte valori
                                            if (comboBox2.Text == "CNP")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["CNP"]);
                                            }
                                            if (comboBox2.Text == "Fumat")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                if (row["Fumat"].ToString() == "DA")
                                                    otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                else
                                                    otherlistBox.Items.Add(row["Fumat"]);
                                            }
                                            if (comboBox2.Text == "Activitate Fizica")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["ActFizica"]);
                                            }
                                            if (comboBox2.Text == "Masa Corporala")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["G"]);
                                            }
                                            if (comboBox2.Text == "Inaltime")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["H"]);
                                            }
                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["Ca"]);
                                            }
                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["TaSistolica"]);
                                            }
                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["TaDiastolica"]);
                                            }
                                            if (comboBox2.Text == "Glicemie")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["Glicemie"]);
                                            }
                                            if (comboBox2.Text == "HDL Colesterol")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["HDLCol"]);
                                            }
                                            if (comboBox2.Text == "LDL Colesterol")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["LDLCol"]);
                                            }
                                            if (comboBox2.Text == "Trigliceride")
                                            {
                                                otherlistBox.Items.Add(row["Tg"]);
                                                otherlabel.Text = comboBox2.Text;
                                            }
                                            if (comboBox2.Text == "Indice de masa corporala")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                imc = imcf.ToString();
                                                imcf = (float)Convert.ToDouble(imc);
                                                otherlistBox.Items.Add(imcf);
                                            }
                                            if (comboBox2.Text == "Varsta")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                            }
                                            if (comboBox2.Text == "Risc Cardiovascular")
                                            {
                                                int rcvs;
                                                rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(rcvs);
                                            }
                                            if (ok2 == true)
                                            {
                                                foreach (DataRow row2 in dt2.Rows)
                                                {
                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                    {
                                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["DZP"]);
                                                        }
                                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["DZF"]);
                                                        }
                                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["BoliCardio"]);
                                                        }
                                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                        {
                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                            otherlistBox.Items.Add(row2["HAFam"]);
                                                        }
                                                        if (comboBox2.Text == "Dislipidemie")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                        }
                                                        if (comboBox2.Text == "Obezitate")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["Obezitate"]);
                                                        }
                                                        if (comboBox2.Text == "Morti Subite")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["MortiSubite"]);
                                                        }
                                                        if (comboBox2.Text == "Ocupatie")
                                                        {
                                                            otherlistBox.Items.Add(row2["Ocupatie"]);
                                                            otherlabel.Text = comboBox2.Text;
                                                        }
                                                        if (comboBox2.Text == "Diabet Gestational")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["DiabetG"]);
                                                        }
                                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                        }
                                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                        {
                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                            otherlistBox.Items.Add(row2["HAPers"]);
                                                        }
                                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                        {
                                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                            otherlistBox.Items.Add(row2["IMAVC"]);
                                                        }
                                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["STGlucoza"]);
                                                        }
                                                        if (comboBox2.Text == "Copil Macrosom")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["CopilMacro"]);
                                                        }
                                                    }
                                                }
                                            }
                                            #endregion
                                        }
                                        else
                                            if (from == 0 && to == 0)
                                            {

                                                indicelistBox.Items.Add(row["G"]);
                                                numelistBox.Items.Add(row["Nume"]);
                                                datelistBox.Items.Add(row["Date"]);
                                                ctr++;
                                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                #region Alte valori
                                                if (comboBox2.Text == "CNP")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["CNP"]);
                                                }
                                                if (comboBox2.Text == "Fumat")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    if (row["Fumat"].ToString() == "DA")
                                                        otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                    else
                                                        otherlistBox.Items.Add(row["Fumat"]);
                                                }
                                                if (comboBox2.Text == "Activitate Fizica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["ActFizica"]);
                                                }
                                                if (comboBox2.Text == "Masa Corporala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["G"]);
                                                }
                                                if (comboBox2.Text == "Inaltime")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["H"]);
                                                }
                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["Ca"]);
                                                }
                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["TaSistolica"]);
                                                }
                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["TaDiastolica"]);
                                                }
                                                if (comboBox2.Text == "Glicemie")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["Glicemie"]);
                                                }
                                                if (comboBox2.Text == "HDL Colesterol")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["HDLCol"]);
                                                }
                                                if (comboBox2.Text == "LDL Colesterol")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["LDLCol"]);
                                                }
                                                if (comboBox2.Text == "Trigliceride")
                                                {
                                                    otherlistBox.Items.Add(row["Tg"]);
                                                    otherlabel.Text = comboBox2.Text;
                                                }
                                                if (comboBox2.Text == "Indice de masa corporala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                    imc = imcf.ToString();
                                                    imcf = (float)Convert.ToDouble(imc);
                                                    otherlistBox.Items.Add(imcf);
                                                }
                                                if (comboBox2.Text == "Varsta")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                }
                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                {
                                                    int rcvs;
                                                    rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(rcvs);
                                                }
                                                if (ok2 == true)
                                                {
                                                    foreach (DataRow row2 in dt2.Rows)
                                                    {
                                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                        {
                                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["DZP"]);
                                                            }
                                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["DZF"]);
                                                            }
                                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["BoliCardio"]);
                                                            }
                                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                            {
                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                otherlistBox.Items.Add(row2["HAFam"]);
                                                            }
                                                            if (comboBox2.Text == "Dislipidemie")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                            }
                                                            if (comboBox2.Text == "Obezitate")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["Obezitate"]);
                                                            }
                                                            if (comboBox2.Text == "Morti Subite")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["MortiSubite"]);
                                                            }
                                                            if (comboBox2.Text == "Ocupatie")
                                                            {
                                                                otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                otherlabel.Text = comboBox2.Text;
                                                            }
                                                            if (comboBox2.Text == "Diabet Gestational")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["DiabetG"]);
                                                            }
                                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                            }
                                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                            {
                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                otherlistBox.Items.Add(row2["HAPers"]);
                                                            }
                                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                            {
                                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                otherlistBox.Items.Add(row2["IMAVC"]);
                                                            }
                                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["STGlucoza"]);
                                                            }
                                                            if (comboBox2.Text == "Copil Macrosom")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["CopilMacro"]);
                                                            }
                                                        }
                                                    }
                                                }
                                                #endregion
                                            }

                                }
                                ctr = 0;
                            }
                            else
                                if (controlcomboBox.Text == "Inaltime")
                                {
                                    numelistBox.Items.Clear();
                                    datelistBox.Items.Clear();
                                    indicelistBox.Items.Clear();
                                    otherlistBox.Items.Clear();
                                    valoarelabel.Text = controlcomboBox.Text;
                                    foreach (DataRow row in dt.Rows)
                                    {
                                        if (Convert.ToInt32(row["H"]) >= from && Convert.ToInt32(row["H"]) <= to)
                                        {
                                            indicelistBox.Items.Add(row["H"]);
                                            numelistBox.Items.Add(row["Nume"]);
                                            datelistBox.Items.Add(row["Date"]);
                                            ctr++;
                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                            #region Alte valori
                                            if (comboBox2.Text == "CNP")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["CNP"]);
                                            }
                                            if (comboBox2.Text == "Fumat")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                if (row["Fumat"].ToString() == "DA")
                                                    otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                else
                                                    otherlistBox.Items.Add(row["Fumat"]);
                                            }
                                            if (comboBox2.Text == "Activitate Fizica")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["ActFizica"]);
                                            }
                                            if (comboBox2.Text == "Masa Corporala")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["G"]);
                                            }
                                            if (comboBox2.Text == "Inaltime")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["H"]);
                                            }
                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["Ca"]);
                                            }
                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["TaSistolica"]);
                                            }
                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["TaDiastolica"]);
                                            }
                                            if (comboBox2.Text == "Glicemie")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["Glicemie"]);
                                            }
                                            if (comboBox2.Text == "HDL Colesterol")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["HDLCol"]);
                                            }
                                            if (comboBox2.Text == "LDL Colesterol")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(row["LDLCol"]);
                                            }
                                            if (comboBox2.Text == "Trigliceride")
                                            {
                                                otherlistBox.Items.Add(row["Tg"]);
                                                otherlabel.Text = comboBox2.Text;
                                            }
                                            if (comboBox2.Text == "Indice de masa corporala")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                imc = imcf.ToString();
                                                imcf = (float)Convert.ToDouble(imc);
                                                otherlistBox.Items.Add(imcf);
                                            }
                                            if (comboBox2.Text == "Varsta")
                                            {
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                            }
                                            if (comboBox2.Text == "Risc Cardiovascular")
                                            {
                                                int rcvs;
                                                rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                otherlabel.Text = comboBox2.Text;
                                                otherlistBox.Items.Add(rcvs);
                                            }
                                            if (ok2 == true)
                                            {
                                                foreach (DataRow row2 in dt2.Rows)
                                                {
                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                    {
                                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["DZP"]);
                                                        }
                                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["DZF"]);
                                                        }
                                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["BoliCardio"]);
                                                        }
                                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                        {
                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                            otherlistBox.Items.Add(row2["HAFam"]);
                                                        }
                                                        if (comboBox2.Text == "Dislipidemie")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                        }
                                                        if (comboBox2.Text == "Obezitate")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["Obezitate"]);
                                                        }
                                                        if (comboBox2.Text == "Morti Subite")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["MortiSubite"]);
                                                        }
                                                        if (comboBox2.Text == "Ocupatie")
                                                        {
                                                            otherlistBox.Items.Add(row2["Ocupatie"]);
                                                            otherlabel.Text = comboBox2.Text;
                                                        }
                                                        if (comboBox2.Text == "Diabet Gestational")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["DiabetG"]);
                                                        }
                                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                        }
                                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                        {
                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                            otherlistBox.Items.Add(row2["HAPers"]);
                                                        }
                                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                        {
                                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                            otherlistBox.Items.Add(row2["IMAVC"]);
                                                        }
                                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["STGlucoza"]);
                                                        }
                                                        if (comboBox2.Text == "Copil Macrosom")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row2["CopilMacro"]);
                                                        }
                                                    }
                                                }
                                            }
                                            #endregion
                                        }
                                        else
                                            if (from == 0 && Convert.ToInt32(row["H"]) <= to)
                                            {
                                                indicelistBox.Items.Add(row["H"]);
                                                numelistBox.Items.Add(row["Nume"]);
                                                datelistBox.Items.Add(row["Date"]);
                                                ctr++;
                                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                #region Alte valori
                                                if (comboBox2.Text == "CNP")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["CNP"]);
                                                }
                                                if (comboBox2.Text == "Fumat")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    if (row["Fumat"].ToString() == "DA")
                                                        otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                    else
                                                        otherlistBox.Items.Add(row["Fumat"]);
                                                }
                                                if (comboBox2.Text == "Activitate Fizica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["ActFizica"]);
                                                }
                                                if (comboBox2.Text == "Masa Corporala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["G"]);
                                                }
                                                if (comboBox2.Text == "Inaltime")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["H"]);
                                                }
                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["Ca"]);
                                                }
                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["TaSistolica"]);
                                                }
                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["TaDiastolica"]);
                                                }
                                                if (comboBox2.Text == "Glicemie")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["Glicemie"]);
                                                }
                                                if (comboBox2.Text == "HDL Colesterol")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["HDLCol"]);
                                                }
                                                if (comboBox2.Text == "LDL Colesterol")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["LDLCol"]);
                                                }
                                                if (comboBox2.Text == "Trigliceride")
                                                {
                                                    otherlistBox.Items.Add(row["Tg"]);
                                                    otherlabel.Text = comboBox2.Text;
                                                }
                                                if (comboBox2.Text == "Indice de masa corporala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                    imc = imcf.ToString();
                                                    imcf = (float)Convert.ToDouble(imc);
                                                    otherlistBox.Items.Add(imcf);
                                                }
                                                if (comboBox2.Text == "Varsta")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                }
                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                {
                                                    int rcvs;
                                                    rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(rcvs);
                                                }
                                                if (ok2 == true)
                                                {
                                                    foreach (DataRow row2 in dt2.Rows)
                                                    {
                                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                        {
                                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["DZP"]);
                                                            }
                                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["DZF"]);
                                                            }
                                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["BoliCardio"]);
                                                            }
                                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                            {
                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                otherlistBox.Items.Add(row2["HAFam"]);
                                                            }
                                                            if (comboBox2.Text == "Dislipidemie")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                            }
                                                            if (comboBox2.Text == "Obezitate")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["Obezitate"]);
                                                            }
                                                            if (comboBox2.Text == "Morti Subite")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["MortiSubite"]);
                                                            }
                                                            if (comboBox2.Text == "Ocupatie")
                                                            {
                                                                otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                otherlabel.Text = comboBox2.Text;
                                                            }
                                                            if (comboBox2.Text == "Diabet Gestational")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["DiabetG"]);
                                                            }
                                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                            }
                                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                            {
                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                otherlistBox.Items.Add(row2["HAPers"]);
                                                            }
                                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                            {
                                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                otherlistBox.Items.Add(row2["IMAVC"]);
                                                            }
                                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["STGlucoza"]);
                                                            }
                                                            if (comboBox2.Text == "Copil Macrosom")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["CopilMacro"]);
                                                            }
                                                        }
                                                    }
                                                }
                                                #endregion
                                            }
                                            else
                                                if (from == 0 && to == 0)
                                                {

                                                    indicelistBox.Items.Add(row["H"]);
                                                    numelistBox.Items.Add(row["Nume"]);
                                                    datelistBox.Items.Add(row["Date"]);
                                                    ctr++;
                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                    #region Alte valori
                                                    if (comboBox2.Text == "CNP")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["CNP"]);
                                                    }
                                                    if (comboBox2.Text == "Fumat")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        if (row["Fumat"].ToString() == "DA")
                                                            otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                        else
                                                            otherlistBox.Items.Add(row["Fumat"]);
                                                    }
                                                    if (comboBox2.Text == "Activitate Fizica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["ActFizica"]);
                                                    }
                                                    if (comboBox2.Text == "Masa Corporala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["G"]);
                                                    }
                                                    if (comboBox2.Text == "Inaltime")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["H"]);
                                                    }
                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["Ca"]);
                                                    }
                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["TaSistolica"]);
                                                    }
                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["TaDiastolica"]);
                                                    }
                                                    if (comboBox2.Text == "Glicemie")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["Glicemie"]);
                                                    }
                                                    if (comboBox2.Text == "HDL Colesterol")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["HDLCol"]);
                                                    }
                                                    if (comboBox2.Text == "LDL Colesterol")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["LDLCol"]);
                                                    }
                                                    if (comboBox2.Text == "Trigliceride")
                                                    {
                                                        otherlistBox.Items.Add(row["Tg"]);
                                                        otherlabel.Text = comboBox2.Text;
                                                    }
                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                        imc = imcf.ToString();
                                                        imcf = (float)Convert.ToDouble(imc);
                                                        otherlistBox.Items.Add(imcf);
                                                    }
                                                    if (comboBox2.Text == "Varsta")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                    }
                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                    {
                                                        int rcvs;
                                                        rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(rcvs);
                                                    }
                                                    if (ok2 == true)
                                                    {
                                                        foreach (DataRow row2 in dt2.Rows)
                                                        {
                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                            {
                                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["DZP"]);
                                                                }
                                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["DZF"]);
                                                                }
                                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                }
                                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                {
                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                    otherlistBox.Items.Add(row2["HAFam"]);
                                                                }
                                                                if (comboBox2.Text == "Dislipidemie")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                }
                                                                if (comboBox2.Text == "Obezitate")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["Obezitate"]);
                                                                }
                                                                if (comboBox2.Text == "Morti Subite")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                }
                                                                if (comboBox2.Text == "Ocupatie")
                                                                {
                                                                    otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                    otherlabel.Text = comboBox2.Text;
                                                                }
                                                                if (comboBox2.Text == "Diabet Gestational")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["DiabetG"]);
                                                                }
                                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                }
                                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                {
                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                    otherlistBox.Items.Add(row2["HAPers"]);
                                                                }
                                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                {
                                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                    otherlistBox.Items.Add(row2["IMAVC"]);
                                                                }
                                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                }
                                                                if (comboBox2.Text == "Copil Macrosom")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                }
                                                            }
                                                        }
                                                    }
                                                    #endregion
                                                }

                                    }
                                    ctr = 0;
                                }
                                else
                                    if (controlcomboBox.Text == "Tensiune Arteriala Sistolica")
                                    {
                                        numelistBox.Items.Clear();
                                        datelistBox.Items.Clear();
                                        indicelistBox.Items.Clear();
                                        otherlistBox.Items.Clear();
                                        valoarelabel.Text = controlcomboBox.Text;
                                        foreach (DataRow row in dt.Rows)
                                        {
                                            if (Convert.ToInt32(row["TaSistolica"]) >= from && Convert.ToInt32(row["TaSistolica"]) <= to)
                                            {
                                                indicelistBox.Items.Add(row["TaSistolica"]);
                                                numelistBox.Items.Add(row["Nume"]);
                                                datelistBox.Items.Add(row["Date"]);
                                                ctr++;
                                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                #region Alte valori
                                                if (comboBox2.Text == "CNP")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["CNP"]);
                                                }
                                                if (comboBox2.Text == "Fumat")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    if (row["Fumat"].ToString() == "DA")
                                                        otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                    else
                                                        otherlistBox.Items.Add(row["Fumat"]);
                                                }
                                                if (comboBox2.Text == "Activitate Fizica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["ActFizica"]);
                                                }
                                                if (comboBox2.Text == "Masa Corporala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["G"]);
                                                }
                                                if (comboBox2.Text == "Inaltime")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["H"]);
                                                }
                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["Ca"]);
                                                }
                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["TaSistolica"]);
                                                }
                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["TaDiastolica"]);
                                                }
                                                if (comboBox2.Text == "Glicemie")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["Glicemie"]);
                                                }
                                                if (comboBox2.Text == "HDL Colesterol")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["HDLCol"]);
                                                }
                                                if (comboBox2.Text == "LDL Colesterol")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(row["LDLCol"]);
                                                }
                                                if (comboBox2.Text == "Trigliceride")
                                                {
                                                    otherlistBox.Items.Add(row["Tg"]);
                                                    otherlabel.Text = comboBox2.Text;
                                                }
                                                if (comboBox2.Text == "Indice de masa corporala")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                    imc = imcf.ToString();
                                                    imcf = (float)Convert.ToDouble(imc);
                                                    otherlistBox.Items.Add(imcf);
                                                }
                                                if (comboBox2.Text == "Varsta")
                                                {
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                }
                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                {
                                                    int rcvs;
                                                    rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                    otherlabel.Text = comboBox2.Text;
                                                    otherlistBox.Items.Add(rcvs);
                                                }
                                                if (ok2 == true)
                                                {
                                                    foreach (DataRow row2 in dt2.Rows)
                                                    {
                                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                        {
                                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["DZP"]);
                                                            }
                                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["DZF"]);
                                                            }
                                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["BoliCardio"]);
                                                            }
                                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                            {
                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                otherlistBox.Items.Add(row2["HAFam"]);
                                                            }
                                                            if (comboBox2.Text == "Dislipidemie")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                            }
                                                            if (comboBox2.Text == "Obezitate")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["Obezitate"]);
                                                            }
                                                            if (comboBox2.Text == "Morti Subite")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["MortiSubite"]);
                                                            }
                                                            if (comboBox2.Text == "Ocupatie")
                                                            {
                                                                otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                otherlabel.Text = comboBox2.Text;
                                                            }
                                                            if (comboBox2.Text == "Diabet Gestational")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["DiabetG"]);
                                                            }
                                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                            }
                                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                            {
                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                otherlistBox.Items.Add(row2["HAPers"]);
                                                            }
                                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                            {
                                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                otherlistBox.Items.Add(row2["IMAVC"]);
                                                            }
                                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["STGlucoza"]);
                                                            }
                                                            if (comboBox2.Text == "Copil Macrosom")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row2["CopilMacro"]);
                                                            }
                                                        }
                                                    }
                                                }
                                                #endregion
                                            }
                                            else
                                                if (from == 0 && Convert.ToInt32(row["TaSistolica"]) <= to)
                                                {
                                                    indicelistBox.Items.Add(row["TaSistolica"]);
                                                    numelistBox.Items.Add(row["Nume"]);
                                                    datelistBox.Items.Add(row["Date"]);
                                                    ctr++;
                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                    #region Alte valori
                                                    if (comboBox2.Text == "CNP")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["CNP"]);
                                                    }
                                                    if (comboBox2.Text == "Fumat")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        if (row["Fumat"].ToString() == "DA")
                                                            otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                        else
                                                            otherlistBox.Items.Add(row["Fumat"]);
                                                    }
                                                    if (comboBox2.Text == "Activitate Fizica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["ActFizica"]);
                                                    }
                                                    if (comboBox2.Text == "Masa Corporala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["G"]);
                                                    }
                                                    if (comboBox2.Text == "Inaltime")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["H"]);
                                                    }
                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["Ca"]);
                                                    }
                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["TaSistolica"]);
                                                    }
                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["TaDiastolica"]);
                                                    }
                                                    if (comboBox2.Text == "Glicemie")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["Glicemie"]);
                                                    }
                                                    if (comboBox2.Text == "HDL Colesterol")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["HDLCol"]);
                                                    }
                                                    if (comboBox2.Text == "LDL Colesterol")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["LDLCol"]);
                                                    }
                                                    if (comboBox2.Text == "Trigliceride")
                                                    {
                                                        otherlistBox.Items.Add(row["Tg"]);
                                                        otherlabel.Text = comboBox2.Text;
                                                    }
                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                        imc = imcf.ToString();
                                                        imcf = (float)Convert.ToDouble(imc);
                                                        otherlistBox.Items.Add(imcf);
                                                    }
                                                    if (comboBox2.Text == "Varsta")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                    }
                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                    {
                                                        int rcvs;
                                                        rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(rcvs);
                                                    }
                                                    if (ok2 == true)
                                                    {
                                                        foreach (DataRow row2 in dt2.Rows)
                                                        {
                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                            {
                                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["DZP"]);
                                                                }
                                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["DZF"]);
                                                                }
                                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                }
                                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                {
                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                    otherlistBox.Items.Add(row2["HAFam"]);
                                                                }
                                                                if (comboBox2.Text == "Dislipidemie")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                }
                                                                if (comboBox2.Text == "Obezitate")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["Obezitate"]);
                                                                }
                                                                if (comboBox2.Text == "Morti Subite")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                }
                                                                if (comboBox2.Text == "Ocupatie")
                                                                {
                                                                    otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                    otherlabel.Text = comboBox2.Text;
                                                                }
                                                                if (comboBox2.Text == "Diabet Gestational")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["DiabetG"]);
                                                                }
                                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                }
                                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                {
                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                    otherlistBox.Items.Add(row2["HAPers"]);
                                                                }
                                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                {
                                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                    otherlistBox.Items.Add(row2["IMAVC"]);
                                                                }
                                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                }
                                                                if (comboBox2.Text == "Copil Macrosom")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                }
                                                            }
                                                        }
                                                    }
                                                    #endregion
                                                }
                                                else
                                                    if (from == 0 && to == 0)
                                                    {

                                                        indicelistBox.Items.Add(row["TaSistolica"]);
                                                        numelistBox.Items.Add(row["Nume"]);
                                                        datelistBox.Items.Add(row["Date"]);
                                                        ctr++;
                                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                        #region Alte valori
                                                        if (comboBox2.Text == "CNP")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["CNP"]);
                                                        }
                                                        if (comboBox2.Text == "Fumat")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            if (row["Fumat"].ToString() == "DA")
                                                                otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                            else
                                                                otherlistBox.Items.Add(row["Fumat"]);
                                                        }
                                                        if (comboBox2.Text == "Activitate Fizica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["ActFizica"]);
                                                        }
                                                        if (comboBox2.Text == "Masa Corporala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["G"]);
                                                        }
                                                        if (comboBox2.Text == "Inaltime")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["H"]);
                                                        }
                                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["Ca"]);
                                                        }
                                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["TaSistolica"]);
                                                        }
                                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["TaDiastolica"]);
                                                        }
                                                        if (comboBox2.Text == "Glicemie")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["Glicemie"]);
                                                        }
                                                        if (comboBox2.Text == "HDL Colesterol")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["HDLCol"]);
                                                        }
                                                        if (comboBox2.Text == "LDL Colesterol")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["LDLCol"]);
                                                        }
                                                        if (comboBox2.Text == "Trigliceride")
                                                        {
                                                            otherlistBox.Items.Add(row["Tg"]);
                                                            otherlabel.Text = comboBox2.Text;
                                                        }
                                                        if (comboBox2.Text == "Indice de masa corporala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                            imc = imcf.ToString();
                                                            imcf = (float)Convert.ToDouble(imc);
                                                            otherlistBox.Items.Add(imcf);
                                                        }
                                                        if (comboBox2.Text == "Varsta")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                        }
                                                        if (comboBox2.Text == "Risc Cardiovascular")
                                                        {
                                                            int rcvs;
                                                            rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(rcvs);
                                                        }
                                                        if (ok2 == true)
                                                        {
                                                            foreach (DataRow row2 in dt2.Rows)
                                                            {
                                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                {
                                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["DZP"]);
                                                                    }
                                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["DZF"]);
                                                                    }
                                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                    }
                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                    {
                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                        otherlistBox.Items.Add(row2["HAFam"]);
                                                                    }
                                                                    if (comboBox2.Text == "Dislipidemie")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                    }
                                                                    if (comboBox2.Text == "Obezitate")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["Obezitate"]);
                                                                    }
                                                                    if (comboBox2.Text == "Morti Subite")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                    }
                                                                    if (comboBox2.Text == "Ocupatie")
                                                                    {
                                                                        otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                        otherlabel.Text = comboBox2.Text;
                                                                    }
                                                                    if (comboBox2.Text == "Diabet Gestational")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["DiabetG"]);
                                                                    }
                                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                    {
                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                        otherlistBox.Items.Add(row2["HAPers"]);
                                                                    }
                                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                    {
                                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                        otherlistBox.Items.Add(row2["IMAVC"]);
                                                                    }
                                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                    }
                                                                    if (comboBox2.Text == "Copil Macrosom")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        #endregion
                                                    }

                                        }
                                        ctr = 0;
                                    }
                                    else
                                        if (controlcomboBox.Text == "Circumferinta Abdominala")
                                        {
                                            numelistBox.Items.Clear();
                                            datelistBox.Items.Clear();
                                            indicelistBox.Items.Clear();
                                            otherlistBox.Items.Clear();
                                            valoarelabel.Text = controlcomboBox.Text;
                                            foreach (DataRow row in dt.Rows)
                                            {
                                                if (Convert.ToInt32(row["Ca"]) >= from && Convert.ToInt32(row["Ca"]) <= to)
                                                {
                                                    indicelistBox.Items.Add(row["Ca"]);
                                                    numelistBox.Items.Add(row["Nume"]);
                                                    datelistBox.Items.Add(row["Date"]);
                                                    ctr++;
                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                    #region Alte valori
                                                    if (comboBox2.Text == "CNP")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["CNP"]);
                                                    }
                                                    if (comboBox2.Text == "Fumat")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        if (row["Fumat"].ToString() == "DA")
                                                            otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                        else
                                                            otherlistBox.Items.Add(row["Fumat"]);
                                                    }
                                                    if (comboBox2.Text == "Activitate Fizica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["ActFizica"]);
                                                    }
                                                    if (comboBox2.Text == "Masa Corporala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["G"]);
                                                    }
                                                    if (comboBox2.Text == "Inaltime")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["H"]);
                                                    }
                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["Ca"]);
                                                    }
                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["TaSistolica"]);
                                                    }
                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["TaDiastolica"]);
                                                    }
                                                    if (comboBox2.Text == "Glicemie")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["Glicemie"]);
                                                    }
                                                    if (comboBox2.Text == "HDL Colesterol")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["HDLCol"]);
                                                    }
                                                    if (comboBox2.Text == "LDL Colesterol")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(row["LDLCol"]);
                                                    }
                                                    if (comboBox2.Text == "Trigliceride")
                                                    {
                                                        otherlistBox.Items.Add(row["Tg"]);
                                                        otherlabel.Text = comboBox2.Text;
                                                    }
                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                        imc = imcf.ToString();
                                                        imcf = (float)Convert.ToDouble(imc);
                                                        otherlistBox.Items.Add(imcf);
                                                    }
                                                    if (comboBox2.Text == "Varsta")
                                                    {
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                    }
                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                    {
                                                        int rcvs;
                                                        rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                        otherlabel.Text = comboBox2.Text;
                                                        otherlistBox.Items.Add(rcvs);
                                                    }
                                                    if (ok2 == true)
                                                    {
                                                        foreach (DataRow row2 in dt2.Rows)
                                                        {
                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                            {
                                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["DZP"]);
                                                                }
                                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["DZF"]);
                                                                }
                                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                }
                                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                {
                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                    otherlistBox.Items.Add(row2["HAFam"]);
                                                                }
                                                                if (comboBox2.Text == "Dislipidemie")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                }
                                                                if (comboBox2.Text == "Obezitate")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["Obezitate"]);
                                                                }
                                                                if (comboBox2.Text == "Morti Subite")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                }
                                                                if (comboBox2.Text == "Ocupatie")
                                                                {
                                                                    otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                    otherlabel.Text = comboBox2.Text;
                                                                }
                                                                if (comboBox2.Text == "Diabet Gestational")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["DiabetG"]);
                                                                }
                                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                }
                                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                {
                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                    otherlistBox.Items.Add(row2["HAPers"]);
                                                                }
                                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                {
                                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                    otherlistBox.Items.Add(row2["IMAVC"]);
                                                                }
                                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                }
                                                                if (comboBox2.Text == "Copil Macrosom")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                }
                                                            }
                                                        }
                                                    }
                                                    #endregion
                                                }
                                                else
                                                    if (from == 0 && Convert.ToInt32(row["Ca"]) <= to)
                                                    {
                                                        indicelistBox.Items.Add(row["Ca"]);
                                                        numelistBox.Items.Add(row["Nume"]);
                                                        datelistBox.Items.Add(row["Date"]);
                                                        ctr++;
                                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                        #region Alte valori
                                                        if (comboBox2.Text == "CNP")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["CNP"]);
                                                        }
                                                        if (comboBox2.Text == "Fumat")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            if (row["Fumat"].ToString() == "DA")
                                                                otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                            else
                                                                otherlistBox.Items.Add(row["Fumat"]);
                                                        }
                                                        if (comboBox2.Text == "Activitate Fizica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["ActFizica"]);
                                                        }
                                                        if (comboBox2.Text == "Masa Corporala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["G"]);
                                                        }
                                                        if (comboBox2.Text == "Inaltime")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["H"]);
                                                        }
                                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["Ca"]);
                                                        }
                                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["TaSistolica"]);
                                                        }
                                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["TaDiastolica"]);
                                                        }
                                                        if (comboBox2.Text == "Glicemie")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["Glicemie"]);
                                                        }
                                                        if (comboBox2.Text == "HDL Colesterol")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["HDLCol"]);
                                                        }
                                                        if (comboBox2.Text == "LDL Colesterol")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["LDLCol"]);
                                                        }
                                                        if (comboBox2.Text == "Trigliceride")
                                                        {
                                                            otherlistBox.Items.Add(row["Tg"]);
                                                            otherlabel.Text = comboBox2.Text;
                                                        }
                                                        if (comboBox2.Text == "Indice de masa corporala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                            imc = imcf.ToString();
                                                            imcf = (float)Convert.ToDouble(imc);
                                                            otherlistBox.Items.Add(imcf);
                                                        }
                                                        if (comboBox2.Text == "Varsta")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                        }
                                                        if (comboBox2.Text == "Risc Cardiovascular")
                                                        {
                                                            int rcvs;
                                                            rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(rcvs);
                                                        }
                                                        if (ok2 == true)
                                                        {
                                                            foreach (DataRow row2 in dt2.Rows)
                                                            {
                                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                {
                                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["DZP"]);
                                                                    }
                                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["DZF"]);
                                                                    }
                                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                    }
                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                    {
                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                        otherlistBox.Items.Add(row2["HAFam"]);
                                                                    }
                                                                    if (comboBox2.Text == "Dislipidemie")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                    }
                                                                    if (comboBox2.Text == "Obezitate")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["Obezitate"]);
                                                                    }
                                                                    if (comboBox2.Text == "Morti Subite")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                    }
                                                                    if (comboBox2.Text == "Ocupatie")
                                                                    {
                                                                        otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                        otherlabel.Text = comboBox2.Text;
                                                                    }
                                                                    if (comboBox2.Text == "Diabet Gestational")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["DiabetG"]);
                                                                    }
                                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                    {
                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                        otherlistBox.Items.Add(row2["HAPers"]);
                                                                    }
                                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                    {
                                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                        otherlistBox.Items.Add(row2["IMAVC"]);
                                                                    }
                                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                    }
                                                                    if (comboBox2.Text == "Copil Macrosom")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        #endregion
                                                    }
                                                    else
                                                        if (from == 0 && to == 0)
                                                        {

                                                            indicelistBox.Items.Add(row["Ca"]);
                                                            numelistBox.Items.Add(row["Nume"]);
                                                            datelistBox.Items.Add(row["Date"]);
                                                            ctr++;
                                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                            #region Alte valori
                                                            if (comboBox2.Text == "CNP")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["CNP"]);
                                                            }
                                                            if (comboBox2.Text == "Fumat")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                if (row["Fumat"].ToString() == "DA")
                                                                    otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                else
                                                                    otherlistBox.Items.Add(row["Fumat"]);
                                                            }
                                                            if (comboBox2.Text == "Activitate Fizica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["ActFizica"]);
                                                            }
                                                            if (comboBox2.Text == "Masa Corporala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["G"]);
                                                            }
                                                            if (comboBox2.Text == "Inaltime")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["H"]);
                                                            }
                                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["Ca"]);
                                                            }
                                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["TaSistolica"]);
                                                            }
                                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["TaDiastolica"]);
                                                            }
                                                            if (comboBox2.Text == "Glicemie")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["Glicemie"]);
                                                            }
                                                            if (comboBox2.Text == "HDL Colesterol")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["HDLCol"]);
                                                            }
                                                            if (comboBox2.Text == "LDL Colesterol")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["LDLCol"]);
                                                            }
                                                            if (comboBox2.Text == "Trigliceride")
                                                            {
                                                                otherlistBox.Items.Add(row["Tg"]);
                                                                otherlabel.Text = comboBox2.Text;
                                                            }
                                                            if (comboBox2.Text == "Indice de masa corporala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                imc = imcf.ToString();
                                                                imcf = (float)Convert.ToDouble(imc);
                                                                otherlistBox.Items.Add(imcf);
                                                            }
                                                            if (comboBox2.Text == "Varsta")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                            }
                                                            if (comboBox2.Text == "Risc Cardiovascular")
                                                            {
                                                                int rcvs;
                                                                rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(rcvs);
                                                            }
                                                            if (ok2 == true)
                                                            {
                                                                foreach (DataRow row2 in dt2.Rows)
                                                                {
                                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                    {
                                                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["DZP"]);
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["DZF"]);
                                                                        }
                                                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                        }
                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                        {
                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                            otherlistBox.Items.Add(row2["HAFam"]);
                                                                        }
                                                                        if (comboBox2.Text == "Dislipidemie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                        }
                                                                        if (comboBox2.Text == "Obezitate")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["Obezitate"]);
                                                                        }
                                                                        if (comboBox2.Text == "Morti Subite")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                        }
                                                                        if (comboBox2.Text == "Ocupatie")
                                                                        {
                                                                            otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                            otherlabel.Text = comboBox2.Text;
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Gestational")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["DiabetG"]);
                                                                        }
                                                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                        {
                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                            otherlistBox.Items.Add(row2["HAPers"]);
                                                                        }
                                                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                        {
                                                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                            otherlistBox.Items.Add(row2["IMAVC"]);
                                                                        }
                                                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                        }
                                                                        if (comboBox2.Text == "Copil Macrosom")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                            #endregion
                                                        }

                                            }
                                            ctr = 0;
                                        }
                                        else
                                            if (controlcomboBox.Text == "Tensiune Arteriala Diastolica")
                                            {
                                                numelistBox.Items.Clear();
                                                datelistBox.Items.Clear();
                                                indicelistBox.Items.Clear();
                                                otherlistBox.Items.Clear();
                                                valoarelabel.Text = controlcomboBox.Text;
                                                foreach (DataRow row in dt.Rows)
                                                {
                                                    if (Convert.ToInt32(row["TaDiastolica"]) >= from && Convert.ToInt32(row["TaDiastolica"]) <= to)
                                                    {
                                                        indicelistBox.Items.Add(row["TaDiastolica"]);
                                                        numelistBox.Items.Add(row["Nume"]);
                                                        datelistBox.Items.Add(row["Date"]);
                                                        ctr++;
                                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                        #region Alte valori
                                                        if (comboBox2.Text == "CNP")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["CNP"]);
                                                        }
                                                        if (comboBox2.Text == "Fumat")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            if (row["Fumat"].ToString() == "DA")
                                                                otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                            else
                                                                otherlistBox.Items.Add(row["Fumat"]);
                                                        }
                                                        if (comboBox2.Text == "Activitate Fizica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["ActFizica"]);
                                                        }
                                                        if (comboBox2.Text == "Masa Corporala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["G"]);
                                                        }
                                                        if (comboBox2.Text == "Inaltime")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["H"]);
                                                        }
                                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["Ca"]);
                                                        }
                                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["TaSistolica"]);
                                                        }
                                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["TaDiastolica"]);
                                                        }
                                                        if (comboBox2.Text == "Glicemie")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["Glicemie"]);
                                                        }
                                                        if (comboBox2.Text == "HDL Colesterol")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["HDLCol"]);
                                                        }
                                                        if (comboBox2.Text == "LDL Colesterol")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(row["LDLCol"]);
                                                        }
                                                        if (comboBox2.Text == "Trigliceride")
                                                        {
                                                            otherlistBox.Items.Add(row["Tg"]);
                                                            otherlabel.Text = comboBox2.Text;
                                                        }
                                                        if (comboBox2.Text == "Indice de masa corporala")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                            imc = imcf.ToString();
                                                            imcf = (float)Convert.ToDouble(imc);
                                                            otherlistBox.Items.Add(imcf);
                                                        }
                                                        if (comboBox2.Text == "Varsta")
                                                        {
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                        }
                                                        if (comboBox2.Text == "Risc Cardiovascular")
                                                        {
                                                            int rcvs;
                                                            rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                            otherlabel.Text = comboBox2.Text;
                                                            otherlistBox.Items.Add(rcvs);
                                                        }
                                                        if (ok2 == true)
                                                        {
                                                            foreach (DataRow row2 in dt2.Rows)
                                                            {
                                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                {
                                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["DZP"]);
                                                                    }
                                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["DZF"]);
                                                                    }
                                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                    }
                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                    {
                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                        otherlistBox.Items.Add(row2["HAFam"]);
                                                                    }
                                                                    if (comboBox2.Text == "Dislipidemie")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                    }
                                                                    if (comboBox2.Text == "Obezitate")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["Obezitate"]);
                                                                    }
                                                                    if (comboBox2.Text == "Morti Subite")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                    }
                                                                    if (comboBox2.Text == "Ocupatie")
                                                                    {
                                                                        otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                        otherlabel.Text = comboBox2.Text;
                                                                    }
                                                                    if (comboBox2.Text == "Diabet Gestational")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["DiabetG"]);
                                                                    }
                                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                    {
                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                        otherlistBox.Items.Add(row2["HAPers"]);
                                                                    }
                                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                    {
                                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                        otherlistBox.Items.Add(row2["IMAVC"]);
                                                                    }
                                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                    }
                                                                    if (comboBox2.Text == "Copil Macrosom")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                    }
                                                                }
                                                            }
                                                        }
                                                        #endregion
                                                    }
                                                    else
                                                        if (from == 0 && Convert.ToInt32(row["TaDiastolica"]) <= to)
                                                        {
                                                            indicelistBox.Items.Add(row["TaDiastolica"]);
                                                            numelistBox.Items.Add(row["Nume"]);
                                                            datelistBox.Items.Add(row["Date"]);
                                                            ctr++;
                                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                            #region Alte valori
                                                            if (comboBox2.Text == "CNP")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["CNP"]);
                                                            }
                                                            if (comboBox2.Text == "Fumat")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                if (row["Fumat"].ToString() == "DA")
                                                                    otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                else
                                                                    otherlistBox.Items.Add(row["Fumat"]);
                                                            }
                                                            if (comboBox2.Text == "Activitate Fizica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["ActFizica"]);
                                                            }
                                                            if (comboBox2.Text == "Masa Corporala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["G"]);
                                                            }
                                                            if (comboBox2.Text == "Inaltime")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["H"]);
                                                            }
                                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["Ca"]);
                                                            }
                                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["TaSistolica"]);
                                                            }
                                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["TaDiastolica"]);
                                                            }
                                                            if (comboBox2.Text == "Glicemie")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["Glicemie"]);
                                                            }
                                                            if (comboBox2.Text == "HDL Colesterol")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["HDLCol"]);
                                                            }
                                                            if (comboBox2.Text == "LDL Colesterol")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["LDLCol"]);
                                                            }
                                                            if (comboBox2.Text == "Trigliceride")
                                                            {
                                                                otherlistBox.Items.Add(row["Tg"]);
                                                                otherlabel.Text = comboBox2.Text;
                                                            }
                                                            if (comboBox2.Text == "Indice de masa corporala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                imc = imcf.ToString();
                                                                imcf = (float)Convert.ToDouble(imc);
                                                                otherlistBox.Items.Add(imcf);
                                                            }
                                                            if (comboBox2.Text == "Varsta")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                            }
                                                            if (comboBox2.Text == "Risc Cardiovascular")
                                                            {
                                                                int rcvs;
                                                                rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(rcvs);
                                                            }
                                                            if (ok2 == true)
                                                            {
                                                                foreach (DataRow row2 in dt2.Rows)
                                                                {
                                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                    {
                                                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["DZP"]);
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["DZF"]);
                                                                        }
                                                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                        }
                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                        {
                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                            otherlistBox.Items.Add(row2["HAFam"]);
                                                                        }
                                                                        if (comboBox2.Text == "Dislipidemie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                        }
                                                                        if (comboBox2.Text == "Obezitate")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["Obezitate"]);
                                                                        }
                                                                        if (comboBox2.Text == "Morti Subite")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                        }
                                                                        if (comboBox2.Text == "Ocupatie")
                                                                        {
                                                                            otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                            otherlabel.Text = comboBox2.Text;
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Gestational")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["DiabetG"]);
                                                                        }
                                                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                        {
                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                            otherlistBox.Items.Add(row2["HAPers"]);
                                                                        }
                                                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                        {
                                                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                            otherlistBox.Items.Add(row2["IMAVC"]);
                                                                        }
                                                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                        }
                                                                        if (comboBox2.Text == "Copil Macrosom")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                            #endregion
                                                        }
                                                        else
                                                            if (from == 0 && to == 0)
                                                            {

                                                                indicelistBox.Items.Add(row["TaDiastolica"]);
                                                                numelistBox.Items.Add(row["Nume"]);
                                                                datelistBox.Items.Add(row["Date"]);
                                                                ctr++;
                                                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                #region Alte valori
                                                                if (comboBox2.Text == "CNP")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["CNP"]);
                                                                }
                                                                if (comboBox2.Text == "Fumat")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    if (row["Fumat"].ToString() == "DA")
                                                                        otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                    else
                                                                        otherlistBox.Items.Add(row["Fumat"]);
                                                                }
                                                                if (comboBox2.Text == "Activitate Fizica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["ActFizica"]);
                                                                }
                                                                if (comboBox2.Text == "Masa Corporala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["G"]);
                                                                }
                                                                if (comboBox2.Text == "Inaltime")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["H"]);
                                                                }
                                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["Ca"]);
                                                                }
                                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["TaSistolica"]);
                                                                }
                                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                }
                                                                if (comboBox2.Text == "Glicemie")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["Glicemie"]);
                                                                }
                                                                if (comboBox2.Text == "HDL Colesterol")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["HDLCol"]);
                                                                }
                                                                if (comboBox2.Text == "LDL Colesterol")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["LDLCol"]);
                                                                }
                                                                if (comboBox2.Text == "Trigliceride")
                                                                {
                                                                    otherlistBox.Items.Add(row["Tg"]);
                                                                    otherlabel.Text = comboBox2.Text;
                                                                }
                                                                if (comboBox2.Text == "Indice de masa corporala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                    imc = imcf.ToString();
                                                                    imcf = (float)Convert.ToDouble(imc);
                                                                    otherlistBox.Items.Add(imcf);
                                                                }
                                                                if (comboBox2.Text == "Varsta")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                }
                                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                                {
                                                                    int rcvs;
                                                                    rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(rcvs);
                                                                }
                                                                if (ok2 == true)
                                                                {
                                                                    foreach (DataRow row2 in dt2.Rows)
                                                                    {
                                                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                        {
                                                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["DZP"]);
                                                                            }
                                                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["DZF"]);
                                                                            }
                                                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                            }
                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                            {
                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                otherlistBox.Items.Add(row2["HAFam"]);
                                                                            }
                                                                            if (comboBox2.Text == "Dislipidemie")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                            }
                                                                            if (comboBox2.Text == "Obezitate")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["Obezitate"]);
                                                                            }
                                                                            if (comboBox2.Text == "Morti Subite")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                            }
                                                                            if (comboBox2.Text == "Ocupatie")
                                                                            {
                                                                                otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                otherlabel.Text = comboBox2.Text;
                                                                            }
                                                                            if (comboBox2.Text == "Diabet Gestational")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["DiabetG"]);
                                                                            }
                                                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                            {
                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                otherlistBox.Items.Add(row2["HAPers"]);
                                                                            }
                                                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                            {
                                                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                otherlistBox.Items.Add(row2["IMAVC"]);
                                                                            }
                                                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                            }
                                                                            if (comboBox2.Text == "Copil Macrosom")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                                #endregion
                                                            }

                                                }
                                                ctr = 0;
                                            }
                                            else
                                                if (controlcomboBox.Text == "Glicemie")
                                                {
                                                    numelistBox.Items.Clear();
                                                    datelistBox.Items.Clear();
                                                    indicelistBox.Items.Clear();
                                                    otherlistBox.Items.Clear();
                                                    valoarelabel.Text = controlcomboBox.Text;
                                                    foreach (DataRow row in dt.Rows)
                                                    {
                                                        if (Convert.ToInt32(row["Glicemie"]) >= from && Convert.ToInt32(row["Glicemie"]) <= to)
                                                        {
                                                            indicelistBox.Items.Add(row["Glicemie"]);
                                                            numelistBox.Items.Add(row["Nume"]);
                                                            datelistBox.Items.Add(row["Date"]);
                                                            ctr++;
                                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                            #region Alte valori
                                                            if (comboBox2.Text == "CNP")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["CNP"]);
                                                            }
                                                            if (comboBox2.Text == "Fumat")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                if (row["Fumat"].ToString() == "DA")
                                                                    otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                else
                                                                    otherlistBox.Items.Add(row["Fumat"]);
                                                            }
                                                            if (comboBox2.Text == "Activitate Fizica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["ActFizica"]);
                                                            }
                                                            if (comboBox2.Text == "Masa Corporala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["G"]);
                                                            }
                                                            if (comboBox2.Text == "Inaltime")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["H"]);
                                                            }
                                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["Ca"]);
                                                            }
                                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["TaSistolica"]);
                                                            }
                                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["TaDiastolica"]);
                                                            }
                                                            if (comboBox2.Text == "Glicemie")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["Glicemie"]);
                                                            }
                                                            if (comboBox2.Text == "HDL Colesterol")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["HDLCol"]);
                                                            }
                                                            if (comboBox2.Text == "LDL Colesterol")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(row["LDLCol"]);
                                                            }
                                                            if (comboBox2.Text == "Trigliceride")
                                                            {
                                                                otherlistBox.Items.Add(row["Tg"]);
                                                                otherlabel.Text = comboBox2.Text;
                                                            }
                                                            if (comboBox2.Text == "Indice de masa corporala")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                imc = imcf.ToString();
                                                                imcf = (float)Convert.ToDouble(imc);
                                                                otherlistBox.Items.Add(imcf);
                                                            }
                                                            if (comboBox2.Text == "Varsta")
                                                            {
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                            }
                                                            if (comboBox2.Text == "Risc Cardiovascular")
                                                            {
                                                                int rcvs;
                                                                rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                otherlabel.Text = comboBox2.Text;
                                                                otherlistBox.Items.Add(rcvs);
                                                            }
                                                            if (ok2 == true)
                                                            {
                                                                foreach (DataRow row2 in dt2.Rows)
                                                                {
                                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                    {
                                                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["DZP"]);
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["DZF"]);
                                                                        }
                                                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                        }
                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                        {
                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                            otherlistBox.Items.Add(row2["HAFam"]);
                                                                        }
                                                                        if (comboBox2.Text == "Dislipidemie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                        }
                                                                        if (comboBox2.Text == "Obezitate")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["Obezitate"]);
                                                                        }
                                                                        if (comboBox2.Text == "Morti Subite")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                        }
                                                                        if (comboBox2.Text == "Ocupatie")
                                                                        {
                                                                            otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                            otherlabel.Text = comboBox2.Text;
                                                                        }
                                                                        if (comboBox2.Text == "Diabet Gestational")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["DiabetG"]);
                                                                        }
                                                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                        {
                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                            otherlistBox.Items.Add(row2["HAPers"]);
                                                                        }
                                                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                        {
                                                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                            otherlistBox.Items.Add(row2["IMAVC"]);
                                                                        }
                                                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                        }
                                                                        if (comboBox2.Text == "Copil Macrosom")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                            #endregion
                                                        }
                                                        else
                                                            if (from == 0 && Convert.ToInt32(row["Glicemie"]) <= to)
                                                            {
                                                                indicelistBox.Items.Add(row["Glicemie"]);
                                                                numelistBox.Items.Add(row["Nume"]);
                                                                datelistBox.Items.Add(row["Date"]);
                                                                ctr++;
                                                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                #region Alte valori
                                                                if (comboBox2.Text == "CNP")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["CNP"]);
                                                                }
                                                                if (comboBox2.Text == "Fumat")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    if (row["Fumat"].ToString() == "DA")
                                                                        otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                    else
                                                                        otherlistBox.Items.Add(row["Fumat"]);
                                                                }
                                                                if (comboBox2.Text == "Activitate Fizica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["ActFizica"]);
                                                                }
                                                                if (comboBox2.Text == "Masa Corporala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["G"]);
                                                                }
                                                                if (comboBox2.Text == "Inaltime")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["H"]);
                                                                }
                                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["Ca"]);
                                                                }
                                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["TaSistolica"]);
                                                                }
                                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                }
                                                                if (comboBox2.Text == "Glicemie")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["Glicemie"]);
                                                                }
                                                                if (comboBox2.Text == "HDL Colesterol")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["HDLCol"]);
                                                                }
                                                                if (comboBox2.Text == "LDL Colesterol")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["LDLCol"]);
                                                                }
                                                                if (comboBox2.Text == "Trigliceride")
                                                                {
                                                                    otherlistBox.Items.Add(row["Tg"]);
                                                                    otherlabel.Text = comboBox2.Text;
                                                                }
                                                                if (comboBox2.Text == "Indice de masa corporala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                    imc = imcf.ToString();
                                                                    imcf = (float)Convert.ToDouble(imc);
                                                                    otherlistBox.Items.Add(imcf);
                                                                }
                                                                if (comboBox2.Text == "Varsta")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                }
                                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                                {
                                                                    int rcvs;
                                                                    rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(rcvs);
                                                                }
                                                                if (ok2 == true)
                                                                {
                                                                    foreach (DataRow row2 in dt2.Rows)
                                                                    {
                                                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                        {
                                                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["DZP"]);
                                                                            }
                                                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["DZF"]);
                                                                            }
                                                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                            }
                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                            {
                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                otherlistBox.Items.Add(row2["HAFam"]);
                                                                            }
                                                                            if (comboBox2.Text == "Dislipidemie")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                            }
                                                                            if (comboBox2.Text == "Obezitate")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["Obezitate"]);
                                                                            }
                                                                            if (comboBox2.Text == "Morti Subite")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                            }
                                                                            if (comboBox2.Text == "Ocupatie")
                                                                            {
                                                                                otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                otherlabel.Text = comboBox2.Text;
                                                                            }
                                                                            if (comboBox2.Text == "Diabet Gestational")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["DiabetG"]);
                                                                            }
                                                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                            {
                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                otherlistBox.Items.Add(row2["HAPers"]);
                                                                            }
                                                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                            {
                                                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                otherlistBox.Items.Add(row2["IMAVC"]);
                                                                            }
                                                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                            }
                                                                            if (comboBox2.Text == "Copil Macrosom")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                                #endregion
                                                            }
                                                            else
                                                                if (from == 0 && to == 0)
                                                                {

                                                                    indicelistBox.Items.Add(row["Glicemie"]);
                                                                    numelistBox.Items.Add(row["Nume"]);
                                                                    datelistBox.Items.Add(row["Date"]);
                                                                    ctr++;
                                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                    #region Alte valori
                                                                    if (comboBox2.Text == "CNP")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["CNP"]);
                                                                    }
                                                                    if (comboBox2.Text == "Fumat")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        if (row["Fumat"].ToString() == "DA")
                                                                            otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                        else
                                                                            otherlistBox.Items.Add(row["Fumat"]);
                                                                    }
                                                                    if (comboBox2.Text == "Activitate Fizica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["ActFizica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Masa Corporala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["G"]);
                                                                    }
                                                                    if (comboBox2.Text == "Inaltime")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["H"]);
                                                                    }
                                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["Ca"]);
                                                                    }
                                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["TaSistolica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Glicemie")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["Glicemie"]);
                                                                    }
                                                                    if (comboBox2.Text == "HDL Colesterol")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["HDLCol"]);
                                                                    }
                                                                    if (comboBox2.Text == "LDL Colesterol")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["LDLCol"]);
                                                                    }
                                                                    if (comboBox2.Text == "Trigliceride")
                                                                    {
                                                                        otherlistBox.Items.Add(row["Tg"]);
                                                                        otherlabel.Text = comboBox2.Text;
                                                                    }
                                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                        imc = imcf.ToString();
                                                                        imcf = (float)Convert.ToDouble(imc);
                                                                        otherlistBox.Items.Add(imcf);
                                                                    }
                                                                    if (comboBox2.Text == "Varsta")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                    }
                                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                                    {
                                                                        int rcvs;
                                                                        rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(rcvs);
                                                                    }
                                                                    if (ok2 == true)
                                                                    {
                                                                        foreach (DataRow row2 in dt2.Rows)
                                                                        {
                                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                            {
                                                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["DZP"]);
                                                                                }
                                                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["DZF"]);
                                                                                }
                                                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                }
                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                {
                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                    otherlistBox.Items.Add(row2["HAFam"]);
                                                                                }
                                                                                if (comboBox2.Text == "Dislipidemie")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                }
                                                                                if (comboBox2.Text == "Obezitate")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                }
                                                                                if (comboBox2.Text == "Morti Subite")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                }
                                                                                if (comboBox2.Text == "Ocupatie")
                                                                                {
                                                                                    otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                }
                                                                                if (comboBox2.Text == "Diabet Gestational")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                }
                                                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                }
                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                {
                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                    otherlistBox.Items.Add(row2["HAPers"]);
                                                                                }
                                                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                {
                                                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                    otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                }
                                                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                }
                                                                                if (comboBox2.Text == "Copil Macrosom")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                    #endregion
                                                                }

                                                    }
                                                    ctr = 0;
                                                }
                                                else
                                                    if (controlcomboBox.Text == "HDL Colesterol")
                                                    {
                                                        numelistBox.Items.Clear();
                                                        datelistBox.Items.Clear();
                                                        indicelistBox.Items.Clear();
                                                        otherlistBox.Items.Clear();
                                                        valoarelabel.Text = controlcomboBox.Text;
                                                        foreach (DataRow row in dt.Rows)
                                                        {
                                                            if (Convert.ToInt32(row["HDLCol"]) >= from && Convert.ToInt32(row["HDLCol"]) <= to)
                                                            {
                                                                indicelistBox.Items.Add(row["HDLCol"]);
                                                                numelistBox.Items.Add(row["Nume"]);
                                                                datelistBox.Items.Add(row["Date"]);
                                                                ctr++;
                                                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                #region Alte valori
                                                                if (comboBox2.Text == "CNP")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["CNP"]);
                                                                }
                                                                if (comboBox2.Text == "Fumat")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    if (row["Fumat"].ToString() == "DA")
                                                                        otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                    else
                                                                        otherlistBox.Items.Add(row["Fumat"]);
                                                                }
                                                                if (comboBox2.Text == "Activitate Fizica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["ActFizica"]);
                                                                }
                                                                if (comboBox2.Text == "Masa Corporala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["G"]);
                                                                }
                                                                if (comboBox2.Text == "Inaltime")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["H"]);
                                                                }
                                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["Ca"]);
                                                                }
                                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["TaSistolica"]);
                                                                }
                                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                }
                                                                if (comboBox2.Text == "Glicemie")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["Glicemie"]);
                                                                }
                                                                if (comboBox2.Text == "HDL Colesterol")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["HDLCol"]);
                                                                }
                                                                if (comboBox2.Text == "LDL Colesterol")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(row["LDLCol"]);
                                                                }
                                                                if (comboBox2.Text == "Trigliceride")
                                                                {
                                                                    otherlistBox.Items.Add(row["Tg"]);
                                                                    otherlabel.Text = comboBox2.Text;
                                                                }
                                                                if (comboBox2.Text == "Indice de masa corporala")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                    imc = imcf.ToString();
                                                                    imcf = (float)Convert.ToDouble(imc);
                                                                    otherlistBox.Items.Add(imcf);
                                                                }
                                                                if (comboBox2.Text == "Varsta")
                                                                {
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                }
                                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                                {
                                                                    int rcvs;
                                                                    rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                    otherlabel.Text = comboBox2.Text;
                                                                    otherlistBox.Items.Add(rcvs);
                                                                }
                                                                if (ok2 == true)
                                                                {
                                                                    foreach (DataRow row2 in dt2.Rows)
                                                                    {
                                                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                        {
                                                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["DZP"]);
                                                                            }
                                                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["DZF"]);
                                                                            }
                                                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                            }
                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                            {
                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                otherlistBox.Items.Add(row2["HAFam"]);
                                                                            }
                                                                            if (comboBox2.Text == "Dislipidemie")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                            }
                                                                            if (comboBox2.Text == "Obezitate")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["Obezitate"]);
                                                                            }
                                                                            if (comboBox2.Text == "Morti Subite")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                            }
                                                                            if (comboBox2.Text == "Ocupatie")
                                                                            {
                                                                                otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                otherlabel.Text = comboBox2.Text;
                                                                            }
                                                                            if (comboBox2.Text == "Diabet Gestational")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["DiabetG"]);
                                                                            }
                                                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                            {
                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                otherlistBox.Items.Add(row2["HAPers"]);
                                                                            }
                                                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                            {
                                                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                otherlistBox.Items.Add(row2["IMAVC"]);
                                                                            }
                                                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                            }
                                                                            if (comboBox2.Text == "Copil Macrosom")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                                #endregion
                                                            }
                                                            else
                                                                if (from == 0 && Convert.ToInt32(row["HDLCol"]) <= to)
                                                                {
                                                                    indicelistBox.Items.Add(row["HDLCol"]);
                                                                    numelistBox.Items.Add(row["Nume"]);
                                                                    datelistBox.Items.Add(row["Date"]);
                                                                    ctr++;
                                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                    #region Alte valori
                                                                    if (comboBox2.Text == "CNP")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["CNP"]);
                                                                    }
                                                                    if (comboBox2.Text == "Fumat")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        if (row["Fumat"].ToString() == "DA")
                                                                            otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                        else
                                                                            otherlistBox.Items.Add(row["Fumat"]);
                                                                    }
                                                                    if (comboBox2.Text == "Activitate Fizica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["ActFizica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Masa Corporala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["G"]);
                                                                    }
                                                                    if (comboBox2.Text == "Inaltime")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["H"]);
                                                                    }
                                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["Ca"]);
                                                                    }
                                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["TaSistolica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Glicemie")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["Glicemie"]);
                                                                    }
                                                                    if (comboBox2.Text == "HDL Colesterol")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["HDLCol"]);
                                                                    }
                                                                    if (comboBox2.Text == "LDL Colesterol")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["LDLCol"]);
                                                                    }
                                                                    if (comboBox2.Text == "Trigliceride")
                                                                    {
                                                                        otherlistBox.Items.Add(row["Tg"]);
                                                                        otherlabel.Text = comboBox2.Text;
                                                                    }
                                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                        imc = imcf.ToString();
                                                                        imcf = (float)Convert.ToDouble(imc);
                                                                        otherlistBox.Items.Add(imcf);
                                                                    }
                                                                    if (comboBox2.Text == "Varsta")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                    }
                                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                                    {
                                                                        int rcvs;
                                                                        rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(rcvs);
                                                                    }
                                                                    if (ok2 == true)
                                                                    {
                                                                        foreach (DataRow row2 in dt2.Rows)
                                                                        {
                                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                            {
                                                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["DZP"]);
                                                                                }
                                                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["DZF"]);
                                                                                }
                                                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                }
                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                {
                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                    otherlistBox.Items.Add(row2["HAFam"]);
                                                                                }
                                                                                if (comboBox2.Text == "Dislipidemie")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                }
                                                                                if (comboBox2.Text == "Obezitate")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                }
                                                                                if (comboBox2.Text == "Morti Subite")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                }
                                                                                if (comboBox2.Text == "Ocupatie")
                                                                                {
                                                                                    otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                }
                                                                                if (comboBox2.Text == "Diabet Gestational")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                }
                                                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                }
                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                {
                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                    otherlistBox.Items.Add(row2["HAPers"]);
                                                                                }
                                                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                {
                                                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                    otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                }
                                                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                }
                                                                                if (comboBox2.Text == "Copil Macrosom")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                    #endregion
                                                                }
                                                                else
                                                                    if (from == 0 && to == 0)
                                                                    {

                                                                        indicelistBox.Items.Add(row["HDLCol"]);
                                                                        numelistBox.Items.Add(row["Nume"]);
                                                                        datelistBox.Items.Add(row["Date"]);
                                                                        ctr++;
                                                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                        #region Alte valori
                                                                        if (comboBox2.Text == "CNP")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["CNP"]);
                                                                        }
                                                                        if (comboBox2.Text == "Fumat")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            if (row["Fumat"].ToString() == "DA")
                                                                                otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                            else
                                                                                otherlistBox.Items.Add(row["Fumat"]);
                                                                        }
                                                                        if (comboBox2.Text == "Activitate Fizica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["ActFizica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Masa Corporala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["G"]);
                                                                        }
                                                                        if (comboBox2.Text == "Inaltime")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["H"]);
                                                                        }
                                                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Ca"]);
                                                                        }
                                                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["TaSistolica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Glicemie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Glicemie"]);
                                                                        }
                                                                        if (comboBox2.Text == "HDL Colesterol")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["HDLCol"]);
                                                                        }
                                                                        if (comboBox2.Text == "LDL Colesterol")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["LDLCol"]);
                                                                        }
                                                                        if (comboBox2.Text == "Trigliceride")
                                                                        {
                                                                            otherlistBox.Items.Add(row["Tg"]);
                                                                            otherlabel.Text = comboBox2.Text;
                                                                        }
                                                                        if (comboBox2.Text == "Indice de masa corporala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                            imc = imcf.ToString();
                                                                            imcf = (float)Convert.ToDouble(imc);
                                                                            otherlistBox.Items.Add(imcf);
                                                                        }
                                                                        if (comboBox2.Text == "Varsta")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                        }
                                                                        if (comboBox2.Text == "Risc Cardiovascular")
                                                                        {
                                                                            int rcvs;
                                                                            rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(rcvs);
                                                                        }
                                                                        if (ok2 == true)
                                                                        {
                                                                            foreach (DataRow row2 in dt2.Rows)
                                                                            {
                                                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                {
                                                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["DZP"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["DZF"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                    {
                                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                        otherlistBox.Items.Add(row2["HAFam"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Dislipidemie")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Obezitate")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Morti Subite")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Ocupatie")
                                                                                    {
                                                                                        otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                    }
                                                                                    if (comboBox2.Text == "Diabet Gestational")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                    {
                                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                        otherlistBox.Items.Add(row2["HAPers"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                    {
                                                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                        otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Copil Macrosom")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                        #endregion
                                                                    }
                                                        }
                                                        ctr = 0;
                                                    }
                                                    else
                                                        if (controlcomboBox.Text == "LDL Colesterol")
                                                        {
                                                            numelistBox.Items.Clear();
                                                            datelistBox.Items.Clear();
                                                            indicelistBox.Items.Clear();
                                                            otherlistBox.Items.Clear();
                                                            valoarelabel.Text = controlcomboBox.Text;
                                                            foreach (DataRow row in dt.Rows)
                                                            {
                                                                if (Convert.ToInt32(row["LDLCol"]) >= from && Convert.ToInt32(row["LDLCol"]) <= to)
                                                                {
                                                                    indicelistBox.Items.Add(row["LDLCol"]);
                                                                    numelistBox.Items.Add(row["Nume"]);
                                                                    datelistBox.Items.Add(row["Date"]);
                                                                    ctr++;
                                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                    #region Alte valori
                                                                    if (comboBox2.Text == "CNP")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["CNP"]);
                                                                    }
                                                                    if (comboBox2.Text == "Fumat")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        if (row["Fumat"].ToString() == "DA")
                                                                            otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                        else
                                                                            otherlistBox.Items.Add(row["Fumat"]);
                                                                    }
                                                                    if (comboBox2.Text == "Activitate Fizica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["ActFizica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Masa Corporala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["G"]);
                                                                    }
                                                                    if (comboBox2.Text == "Inaltime")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["H"]);
                                                                    }
                                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["Ca"]);
                                                                    }
                                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["TaSistolica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                    }
                                                                    if (comboBox2.Text == "Glicemie")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["Glicemie"]);
                                                                    }
                                                                    if (comboBox2.Text == "HDL Colesterol")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["HDLCol"]);
                                                                    }
                                                                    if (comboBox2.Text == "LDL Colesterol")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(row["LDLCol"]);
                                                                    }
                                                                    if (comboBox2.Text == "Trigliceride")
                                                                    {
                                                                        otherlistBox.Items.Add(row["Tg"]);
                                                                        otherlabel.Text = comboBox2.Text;
                                                                    }
                                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                        imc = imcf.ToString();
                                                                        imcf = (float)Convert.ToDouble(imc);
                                                                        otherlistBox.Items.Add(imcf);
                                                                    }
                                                                    if (comboBox2.Text == "Varsta")
                                                                    {
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                    }
                                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                                    {
                                                                        int rcvs;
                                                                        rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                        otherlabel.Text = comboBox2.Text;
                                                                        otherlistBox.Items.Add(rcvs);
                                                                    }
                                                                    if (ok2 == true)
                                                                    {
                                                                        foreach (DataRow row2 in dt2.Rows)
                                                                        {
                                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                            {
                                                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["DZP"]);
                                                                                }
                                                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["DZF"]);
                                                                                }
                                                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                }
                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                {
                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                    otherlistBox.Items.Add(row2["HAFam"]);
                                                                                }
                                                                                if (comboBox2.Text == "Dislipidemie")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                }
                                                                                if (comboBox2.Text == "Obezitate")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                }
                                                                                if (comboBox2.Text == "Morti Subite")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                }
                                                                                if (comboBox2.Text == "Ocupatie")
                                                                                {
                                                                                    otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                }
                                                                                if (comboBox2.Text == "Diabet Gestational")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                }
                                                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                }
                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                {
                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                    otherlistBox.Items.Add(row2["HAPers"]);
                                                                                }
                                                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                {
                                                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                    otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                }
                                                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                }
                                                                                if (comboBox2.Text == "Copil Macrosom")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                    #endregion
                                                                }
                                                                else
                                                                    if (from == 0 && Convert.ToInt32(row["LDLCol"]) <= to)
                                                                    {
                                                                        indicelistBox.Items.Add(row["LDLCol"]);
                                                                        numelistBox.Items.Add(row["Nume"]);
                                                                        datelistBox.Items.Add(row["Date"]);
                                                                        ctr++;
                                                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                        #region Alte valori
                                                                        if (comboBox2.Text == "CNP")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["CNP"]);
                                                                        }
                                                                        if (comboBox2.Text == "Fumat")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            if (row["Fumat"].ToString() == "DA")
                                                                                otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                            else
                                                                                otherlistBox.Items.Add(row["Fumat"]);
                                                                        }
                                                                        if (comboBox2.Text == "Activitate Fizica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["ActFizica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Masa Corporala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["G"]);
                                                                        }
                                                                        if (comboBox2.Text == "Inaltime")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["H"]);
                                                                        }
                                                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Ca"]);
                                                                        }
                                                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["TaSistolica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Glicemie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Glicemie"]);
                                                                        }
                                                                        if (comboBox2.Text == "HDL Colesterol")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["HDLCol"]);
                                                                        }
                                                                        if (comboBox2.Text == "LDL Colesterol")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["LDLCol"]);
                                                                        }
                                                                        if (comboBox2.Text == "Trigliceride")
                                                                        {
                                                                            otherlistBox.Items.Add(row["Tg"]);
                                                                            otherlabel.Text = comboBox2.Text;
                                                                        }
                                                                        if (comboBox2.Text == "Indice de masa corporala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                            imc = imcf.ToString();
                                                                            imcf = (float)Convert.ToDouble(imc);
                                                                            otherlistBox.Items.Add(imcf);
                                                                        }
                                                                        if (comboBox2.Text == "Varsta")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                        }
                                                                        if (comboBox2.Text == "Risc Cardiovascular")
                                                                        {
                                                                            int rcvs;
                                                                            rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(rcvs);
                                                                        }
                                                                        if (ok2 == true)
                                                                        {
                                                                            foreach (DataRow row2 in dt2.Rows)
                                                                            {
                                                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                {
                                                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["DZP"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["DZF"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                    {
                                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                        otherlistBox.Items.Add(row2["HAFam"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Dislipidemie")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Obezitate")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Morti Subite")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Ocupatie")
                                                                                    {
                                                                                        otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                    }
                                                                                    if (comboBox2.Text == "Diabet Gestational")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                    {
                                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                        otherlistBox.Items.Add(row2["HAPers"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                    {
                                                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                        otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Copil Macrosom")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                        #endregion
                                                                    }
                                                                    else
                                                                        if (from == 0 && to == 0)
                                                                        {

                                                                            indicelistBox.Items.Add(row["LDLCol"]);
                                                                            numelistBox.Items.Add(row["Nume"]);
                                                                            datelistBox.Items.Add(row["Date"]);
                                                                            ctr++;
                                                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                            #region Alte valori
                                                                            if (comboBox2.Text == "CNP")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["CNP"]);
                                                                            }
                                                                            if (comboBox2.Text == "Fumat")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                if (row["Fumat"].ToString() == "DA")
                                                                                    otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                                else
                                                                                    otherlistBox.Items.Add(row["Fumat"]);
                                                                            }
                                                                            if (comboBox2.Text == "Activitate Fizica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["ActFizica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Masa Corporala")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["G"]);
                                                                            }
                                                                            if (comboBox2.Text == "Inaltime")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["H"]);
                                                                            }
                                                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["Ca"]);
                                                                            }
                                                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["TaSistolica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Glicemie")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["Glicemie"]);
                                                                            }
                                                                            if (comboBox2.Text == "HDL Colesterol")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["HDLCol"]);
                                                                            }
                                                                            if (comboBox2.Text == "LDL Colesterol")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["LDLCol"]);
                                                                            }
                                                                            if (comboBox2.Text == "Trigliceride")
                                                                            {
                                                                                otherlistBox.Items.Add(row["Tg"]);
                                                                                otherlabel.Text = comboBox2.Text;
                                                                            }
                                                                            if (comboBox2.Text == "Indice de masa corporala")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                                imc = imcf.ToString();
                                                                                imcf = (float)Convert.ToDouble(imc);
                                                                                otherlistBox.Items.Add(imcf);
                                                                            }
                                                                            if (comboBox2.Text == "Varsta")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                            }
                                                                            if (comboBox2.Text == "Risc Cardiovascular")
                                                                            {
                                                                                int rcvs;
                                                                                rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(rcvs);
                                                                            }
                                                                            if (ok2 == true)
                                                                            {
                                                                                foreach (DataRow row2 in dt2.Rows)
                                                                                {
                                                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                    {
                                                                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["DZP"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["DZF"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                        {
                                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                            otherlistBox.Items.Add(row2["HAFam"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Dislipidemie")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Obezitate")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Morti Subite")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Ocupatie")
                                                                                        {
                                                                                            otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                        }
                                                                                        if (comboBox2.Text == "Diabet Gestational")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                        {
                                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                            otherlistBox.Items.Add(row2["HAPers"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                        {
                                                                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                            otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Copil Macrosom")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                            #endregion
                                                                        }
                                                            }
                                                            ctr = 0;
                                                        }
                                                        else
                                                            if (controlcomboBox.Text == "Trigliceride")
                                                            {
                                                                numelistBox.Items.Clear();
                                                                datelistBox.Items.Clear();
                                                                indicelistBox.Items.Clear();
                                                                otherlistBox.Items.Clear();
                                                                valoarelabel.Text = controlcomboBox.Text;
                                                                foreach (DataRow row in dt.Rows)
                                                                {
                                                                    if (Convert.ToInt32(row["Tg"]) >= from && Convert.ToInt32(row["Tg"]) <= to)
                                                                    {
                                                                        indicelistBox.Items.Add(row["Tg"]);
                                                                        numelistBox.Items.Add(row["Nume"]);
                                                                        datelistBox.Items.Add(row["Date"]);
                                                                        ctr++;
                                                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                        #region Alte valori
                                                                        if (comboBox2.Text == "CNP")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["CNP"]);
                                                                        }
                                                                        if (comboBox2.Text == "Fumat")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            if (row["Fumat"].ToString() == "DA")
                                                                                otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                            else
                                                                                otherlistBox.Items.Add(row["Fumat"]);
                                                                        }
                                                                        if (comboBox2.Text == "Activitate Fizica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["ActFizica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Masa Corporala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["G"]);
                                                                        }
                                                                        if (comboBox2.Text == "Inaltime")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["H"]);
                                                                        }
                                                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Ca"]);
                                                                        }
                                                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["TaSistolica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                        }
                                                                        if (comboBox2.Text == "Glicemie")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["Glicemie"]);
                                                                        }
                                                                        if (comboBox2.Text == "HDL Colesterol")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["HDLCol"]);
                                                                        }
                                                                        if (comboBox2.Text == "LDL Colesterol")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(row["LDLCol"]);
                                                                        }
                                                                        if (comboBox2.Text == "Trigliceride")
                                                                        {
                                                                            otherlistBox.Items.Add(row["Tg"]);
                                                                            otherlabel.Text = comboBox2.Text;
                                                                        }
                                                                        if (comboBox2.Text == "Indice de masa corporala")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                            imc = imcf.ToString();
                                                                            imcf = (float)Convert.ToDouble(imc);
                                                                            otherlistBox.Items.Add(imcf);
                                                                        }
                                                                        if (comboBox2.Text == "Varsta")
                                                                        {
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                        }
                                                                        if (comboBox2.Text == "Risc Cardiovascular")
                                                                        {
                                                                            int rcvs;
                                                                            rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                            otherlabel.Text = comboBox2.Text;
                                                                            otherlistBox.Items.Add(rcvs);
                                                                        }
                                                                        if (ok2 == true)
                                                                        {
                                                                            foreach (DataRow row2 in dt2.Rows)
                                                                            {
                                                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                {
                                                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["DZP"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["DZF"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                    {
                                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                        otherlistBox.Items.Add(row2["HAFam"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Dislipidemie")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Obezitate")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Morti Subite")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Ocupatie")
                                                                                    {
                                                                                        otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                    }
                                                                                    if (comboBox2.Text == "Diabet Gestational")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                    {
                                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                        otherlistBox.Items.Add(row2["HAPers"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                    {
                                                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                        otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Copil Macrosom")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                        #endregion
                                                                    }
                                                                    else
                                                                        if (from == 0 && Convert.ToInt32(row["Tg"]) <= to)
                                                                        {
                                                                            indicelistBox.Items.Add(row["Tg"]);
                                                                            numelistBox.Items.Add(row["Nume"]);
                                                                            datelistBox.Items.Add(row["Date"]);
                                                                            ctr++;
                                                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                            #region Alte valori
                                                                            if (comboBox2.Text == "CNP")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["CNP"]);
                                                                            }
                                                                            if (comboBox2.Text == "Fumat")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                if (row["Fumat"].ToString() == "DA")
                                                                                    otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                                else
                                                                                    otherlistBox.Items.Add(row["Fumat"]);
                                                                            }
                                                                            if (comboBox2.Text == "Activitate Fizica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["ActFizica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Masa Corporala")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["G"]);
                                                                            }
                                                                            if (comboBox2.Text == "Inaltime")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["H"]);
                                                                            }
                                                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["Ca"]);
                                                                            }
                                                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["TaSistolica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Glicemie")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["Glicemie"]);
                                                                            }
                                                                            if (comboBox2.Text == "HDL Colesterol")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["HDLCol"]);
                                                                            }
                                                                            if (comboBox2.Text == "LDL Colesterol")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["LDLCol"]);
                                                                            }
                                                                            if (comboBox2.Text == "Trigliceride")
                                                                            {
                                                                                otherlistBox.Items.Add(row["Tg"]);
                                                                                otherlabel.Text = comboBox2.Text;
                                                                            }
                                                                            if (comboBox2.Text == "Indice de masa corporala")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                                imc = imcf.ToString();
                                                                                imcf = (float)Convert.ToDouble(imc);
                                                                                otherlistBox.Items.Add(imcf);
                                                                            }
                                                                            if (comboBox2.Text == "Varsta")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                            }
                                                                            if (comboBox2.Text == "Risc Cardiovascular")
                                                                            {
                                                                                int rcvs;
                                                                                rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(rcvs);
                                                                            }
                                                                            if (ok2 == true)
                                                                            {
                                                                                foreach (DataRow row2 in dt2.Rows)
                                                                                {
                                                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                    {
                                                                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["DZP"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["DZF"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                        {
                                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                            otherlistBox.Items.Add(row2["HAFam"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Dislipidemie")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Obezitate")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Morti Subite")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Ocupatie")
                                                                                        {
                                                                                            otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                        }
                                                                                        if (comboBox2.Text == "Diabet Gestational")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                        {
                                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                            otherlistBox.Items.Add(row2["HAPers"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                        {
                                                                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                            otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Copil Macrosom")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                            #endregion
                                                                        }
                                                                        else
                                                                            if (from == 0 && to == 0)
                                                                            {

                                                                                indicelistBox.Items.Add(row["Tg"]);
                                                                                numelistBox.Items.Add(row["Nume"]);
                                                                                datelistBox.Items.Add(row["Date"]);
                                                                                ctr++;
                                                                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                                #region Alte valori
                                                                                if (comboBox2.Text == "CNP")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["CNP"]);
                                                                                }
                                                                                if (comboBox2.Text == "Fumat")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    if (row["Fumat"].ToString() == "DA")
                                                                                        otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                                    else
                                                                                        otherlistBox.Items.Add(row["Fumat"]);
                                                                                }
                                                                                if (comboBox2.Text == "Activitate Fizica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["ActFizica"]);
                                                                                }
                                                                                if (comboBox2.Text == "Masa Corporala")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["G"]);
                                                                                }
                                                                                if (comboBox2.Text == "Inaltime")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["H"]);
                                                                                }
                                                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["Ca"]);
                                                                                }
                                                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["TaSistolica"]);
                                                                                }
                                                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                                }
                                                                                if (comboBox2.Text == "Glicemie")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["Glicemie"]);
                                                                                }
                                                                                if (comboBox2.Text == "HDL Colesterol")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["HDLCol"]);
                                                                                }
                                                                                if (comboBox2.Text == "LDL Colesterol")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["LDLCol"]);
                                                                                }
                                                                                if (comboBox2.Text == "Trigliceride")
                                                                                {
                                                                                    otherlistBox.Items.Add(row["Tg"]);
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                }
                                                                                if (comboBox2.Text == "Indice de masa corporala")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                                    imc = imcf.ToString();
                                                                                    imcf = (float)Convert.ToDouble(imc);
                                                                                    otherlistBox.Items.Add(imcf);
                                                                                }
                                                                                if (comboBox2.Text == "Varsta")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                                }
                                                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                                                {
                                                                                    int rcvs;
                                                                                    rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(rcvs);
                                                                                }
                                                                                if (ok2 == true)
                                                                                {
                                                                                    foreach (DataRow row2 in dt2.Rows)
                                                                                    {
                                                                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                        {
                                                                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["DZP"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["DZF"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                            {
                                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                                otherlistBox.Items.Add(row2["HAFam"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Dislipidemie")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Obezitate")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Morti Subite")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Ocupatie")
                                                                                            {
                                                                                                otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                            }
                                                                                            if (comboBox2.Text == "Diabet Gestational")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                            {
                                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                                otherlistBox.Items.Add(row2["HAPers"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                            {
                                                                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                                otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Copil Macrosom")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                                #endregion
                                                                            }
                                                                }
                                                                ctr = 0;
                                                            }
                                                            else
                                                                if (controlcomboBox.Text == "Indice de masa corporala")
                                                                {
                                                                    float imcf;
                                                                    string imc;
                                                                    numelistBox.Items.Clear();
                                                                    datelistBox.Items.Clear();
                                                                    indicelistBox.Items.Clear();
                                                                    otherlistBox.Items.Clear();
                                                                    valoarelabel.Text = controlcomboBox.Text;
                                                                    foreach (DataRow row in dt.Rows)
                                                                    {
                                                                        imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                        imc = imcf.ToString();
                                                                        imcf = (float)Convert.ToDouble(imc);
                                                                        if (imcf >= from && imcf <= to)
                                                                        {
                                                                            indicelistBox.Items.Add(imcf);
                                                                            numelistBox.Items.Add(row["Nume"]);
                                                                            datelistBox.Items.Add(row["Date"]);
                                                                            ctr++;
                                                                            paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                            #region Alte valori
                                                                            if (comboBox2.Text == "CNP")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["CNP"]);
                                                                            }
                                                                            if (comboBox2.Text == "Fumat")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                if (row["Fumat"].ToString() == "DA")
                                                                                    otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                                else
                                                                                    otherlistBox.Items.Add(row["Fumat"]);
                                                                            }
                                                                            if (comboBox2.Text == "Activitate Fizica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["ActFizica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Masa Corporala")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["G"]);
                                                                            }
                                                                            if (comboBox2.Text == "Inaltime")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["H"]);
                                                                            }
                                                                            if (comboBox2.Text == "Circumferinta Abdominala")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["Ca"]);
                                                                            }
                                                                            if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["TaSistolica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                            }
                                                                            if (comboBox2.Text == "Glicemie")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["Glicemie"]);
                                                                            }
                                                                            if (comboBox2.Text == "HDL Colesterol")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["HDLCol"]);
                                                                            }
                                                                            if (comboBox2.Text == "LDL Colesterol")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(row["LDLCol"]);
                                                                            }
                                                                            if (comboBox2.Text == "Trigliceride")
                                                                            {
                                                                                otherlistBox.Items.Add(row["Tg"]);
                                                                                otherlabel.Text = comboBox2.Text;
                                                                            }
                                                                            if (comboBox2.Text == "Indice de masa corporala")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                                imc = imcf.ToString();
                                                                                imcf = (float)Convert.ToDouble(imc);
                                                                                otherlistBox.Items.Add(imcf);
                                                                            }
                                                                            if (comboBox2.Text == "Varsta")
                                                                            {
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                            }
                                                                            if (comboBox2.Text == "Risc Cardiovascular")
                                                                            {
                                                                                int rcvs;
                                                                                rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                                otherlabel.Text = comboBox2.Text;
                                                                                otherlistBox.Items.Add(rcvs);
                                                                            }
                                                                            if (ok2 == true)
                                                                            {
                                                                                foreach (DataRow row2 in dt2.Rows)
                                                                                {
                                                                                    if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                    {
                                                                                        if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["DZP"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["DZF"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                        {
                                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                            otherlistBox.Items.Add(row2["HAFam"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Dislipidemie")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Obezitate")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Morti Subite")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Ocupatie")
                                                                                        {
                                                                                            otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                        }
                                                                                        if (comboBox2.Text == "Diabet Gestational")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                        {
                                                                                            otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                            otherlistBox.Items.Add(row2["HAPers"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                        {
                                                                                            otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                            otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Copil Macrosom")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                            #endregion
                                                                        }
                                                                        else
                                                                            if (from == 0 && imcf <= to)
                                                                            {
                                                                                indicelistBox.Items.Add(imcf);
                                                                                numelistBox.Items.Add(row["Nume"]);
                                                                                datelistBox.Items.Add(row["Date"]);
                                                                                ctr++;
                                                                                paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                                #region Alte valori
                                                                                if (comboBox2.Text == "CNP")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["CNP"]);
                                                                                }
                                                                                if (comboBox2.Text == "Fumat")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    if (row["Fumat"].ToString() == "DA")
                                                                                        otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                                    else
                                                                                        otherlistBox.Items.Add(row["Fumat"]);
                                                                                }
                                                                                if (comboBox2.Text == "Activitate Fizica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["ActFizica"]);
                                                                                }
                                                                                if (comboBox2.Text == "Masa Corporala")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["G"]);
                                                                                }
                                                                                if (comboBox2.Text == "Inaltime")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["H"]);
                                                                                }
                                                                                if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["Ca"]);
                                                                                }
                                                                                if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["TaSistolica"]);
                                                                                }
                                                                                if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                                }
                                                                                if (comboBox2.Text == "Glicemie")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["Glicemie"]);
                                                                                }
                                                                                if (comboBox2.Text == "HDL Colesterol")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["HDLCol"]);
                                                                                }
                                                                                if (comboBox2.Text == "LDL Colesterol")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(row["LDLCol"]);
                                                                                }
                                                                                if (comboBox2.Text == "Trigliceride")
                                                                                {
                                                                                    otherlistBox.Items.Add(row["Tg"]);
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                }
                                                                                if (comboBox2.Text == "Indice de masa corporala")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                                    imc = imcf.ToString();
                                                                                    imcf = (float)Convert.ToDouble(imc);
                                                                                    otherlistBox.Items.Add(imcf);
                                                                                }
                                                                                if (comboBox2.Text == "Varsta")
                                                                                {
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                                }
                                                                                if (comboBox2.Text == "Risc Cardiovascular")
                                                                                {
                                                                                    int rcvs;
                                                                                    rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                    otherlistBox.Items.Add(rcvs);
                                                                                }
                                                                                if (ok2 == true)
                                                                                {
                                                                                    foreach (DataRow row2 in dt2.Rows)
                                                                                    {
                                                                                        if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                        {
                                                                                            if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["DZP"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["DZF"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                            {
                                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                                otherlistBox.Items.Add(row2["HAFam"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Dislipidemie")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Obezitate")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Morti Subite")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Ocupatie")
                                                                                            {
                                                                                                otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                            }
                                                                                            if (comboBox2.Text == "Diabet Gestational")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                            {
                                                                                                otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                                otherlistBox.Items.Add(row2["HAPers"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                            {
                                                                                                otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                                otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                            }
                                                                                            if (comboBox2.Text == "Copil Macrosom")
                                                                                            {
                                                                                                otherlabel.Text = comboBox2.Text;
                                                                                                otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                                #endregion
                                                                            }
                                                                            else
                                                                                if (from == 0 && to == 0)
                                                                                {
                                                                                    indicelistBox.Items.Add(imcf);
                                                                                    numelistBox.Items.Add(row["Nume"]);
                                                                                    datelistBox.Items.Add(row["Date"]);
                                                                                    ctr++;
                                                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                                    #region Alte valori
                                                                                    if (comboBox2.Text == "CNP")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["CNP"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Fumat")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        if (row["Fumat"].ToString() == "DA")
                                                                                            otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                                        else
                                                                                            otherlistBox.Items.Add(row["Fumat"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Activitate Fizica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["ActFizica"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Masa Corporala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["G"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Inaltime")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["H"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["Ca"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["TaSistolica"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Glicemie")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["Glicemie"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "HDL Colesterol")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["HDLCol"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "LDL Colesterol")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["LDLCol"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Trigliceride")
                                                                                    {
                                                                                        otherlistBox.Items.Add(row["Tg"]);
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                    }
                                                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                                        imc = imcf.ToString();
                                                                                        imcf = (float)Convert.ToDouble(imc);
                                                                                        otherlistBox.Items.Add(imcf);
                                                                                    }
                                                                                    if (comboBox2.Text == "Varsta")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                                    }
                                                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                                                    {
                                                                                        int rcvs;
                                                                                        rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(rcvs);
                                                                                    }
                                                                                    if (ok2 == true)
                                                                                    {
                                                                                        foreach (DataRow row2 in dt2.Rows)
                                                                                        {
                                                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                            {
                                                                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["DZP"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["DZF"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                                {
                                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                                    otherlistBox.Items.Add(row2["HAFam"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Dislipidemie")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Obezitate")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Morti Subite")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Ocupatie")
                                                                                                {
                                                                                                    otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                }
                                                                                                if (comboBox2.Text == "Diabet Gestational")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                                {
                                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                                    otherlistBox.Items.Add(row2["HAPers"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                                {
                                                                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                                    otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Copil Macrosom")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                    #endregion
                                                                                }
                                                                    }
                                                                    ctr = 0;
                                                                }
                                                                else
                                                                    if (controlcomboBox.Text == "Risc Cardiovascular")
                                                                    {
                                                                        int rcvs;
                                                                        numelistBox.Items.Clear();
                                                                        datelistBox.Items.Clear();
                                                                        indicelistBox.Items.Clear();
                                                                        otherlistBox.Items.Clear();
                                                                        valoarelabel.Text = controlcomboBox.Text;
                                                                        foreach (DataRow row in dt.Rows)
                                                                        {
                                                                            rcvs = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                                            if (rcvs >= from && rcvs <= to)
                                                                            {
                                                                                    indicelistBox.Items.Add(rcvs);
                                                                                    numelistBox.Items.Add(row["Nume"]);
                                                                                    datelistBox.Items.Add(row["Date"]);
                                                                                    #region Alte valori
                                                                                    if (comboBox2.Text == "CNP")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["CNP"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Fumat")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        if (row["Fumat"].ToString() == "DA")
                                                                                            otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                                        else
                                                                                            otherlistBox.Items.Add(row["Fumat"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Activitate Fizica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["ActFizica"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Masa Corporala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["G"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Inaltime")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["H"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["Ca"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["TaSistolica"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Glicemie")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["Glicemie"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "HDL Colesterol")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["HDLCol"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "LDL Colesterol")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["LDLCol"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Trigliceride")
                                                                                    {
                                                                                        otherlistBox.Items.Add(row["Tg"]);
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                    }
                                                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                                        imc = imcf.ToString();
                                                                                        imcf = (float)Convert.ToDouble(imc);
                                                                                        otherlistBox.Items.Add(imcf);
                                                                                    }
                                                                                    if (comboBox2.Text == "Varsta")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                                    }
                                                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(rcvs);
                                                                                    }
                                                                                    if (ok2 == true)
                                                                                    {
                                                                                        foreach (DataRow row2 in dt2.Rows)
                                                                                        {
                                                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                            {
                                                                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["DZP"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["DZF"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                                {
                                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                                    otherlistBox.Items.Add(row2["HAFam"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Dislipidemie")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Obezitate")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Morti Subite")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Ocupatie")
                                                                                                {
                                                                                                    otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                }
                                                                                                if (comboBox2.Text == "Diabet Gestational")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                                {
                                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                                    otherlistBox.Items.Add(row2["HAPers"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                                {
                                                                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                                    otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Copil Macrosom")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                    #endregion
                                                                                    ctr++;
                                                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                            }
                                                                            else
                                                                                if (from == 0 && rcvs <= to)
                                                                                {
                                                                                    indicelistBox.Items.Add(rcvs);
                                                                                    numelistBox.Items.Add(row["Nume"]);
                                                                                    datelistBox.Items.Add(row["Date"]);
                                                                                    ctr++;
                                                                                    paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                                    #region Alte valori
                                                                                    if (comboBox2.Text == "CNP")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["CNP"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Fumat")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        if (row["Fumat"].ToString() == "DA")
                                                                                            otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                                        else
                                                                                            otherlistBox.Items.Add(row["Fumat"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Activitate Fizica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["ActFizica"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Masa Corporala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["G"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Inaltime")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["H"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["Ca"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["TaSistolica"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Glicemie")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["Glicemie"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "HDL Colesterol")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["HDLCol"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "LDL Colesterol")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(row["LDLCol"]);
                                                                                    }
                                                                                    if (comboBox2.Text == "Trigliceride")
                                                                                    {
                                                                                        otherlistBox.Items.Add(row["Tg"]);
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                    }
                                                                                    if (comboBox2.Text == "Indice de masa corporala")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                                        imc = imcf.ToString();
                                                                                        imcf = (float)Convert.ToDouble(imc);
                                                                                        otherlistBox.Items.Add(imcf);
                                                                                    }
                                                                                    if (comboBox2.Text == "Varsta")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                                    }
                                                                                    if (comboBox2.Text == "Risc Cardiovascular")
                                                                                    {
                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                        otherlistBox.Items.Add(rcvs);
                                                                                    }
                                                                                    if (ok2 == true)
                                                                                    {
                                                                                        foreach (DataRow row2 in dt2.Rows)
                                                                                        {
                                                                                            if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                            {
                                                                                                if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["DZP"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["DZF"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                                {
                                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                                    otherlistBox.Items.Add(row2["HAFam"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Dislipidemie")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Obezitate")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Morti Subite")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Ocupatie")
                                                                                                {
                                                                                                    otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                }
                                                                                                if (comboBox2.Text == "Diabet Gestational")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                                {
                                                                                                    otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                                    otherlistBox.Items.Add(row2["HAPers"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                                {
                                                                                                    otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                                    otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                                }
                                                                                                if (comboBox2.Text == "Copil Macrosom")
                                                                                                {
                                                                                                    otherlabel.Text = comboBox2.Text;
                                                                                                    otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                    #endregion

                                                                                }
                                                                                else
                                                                                    if (from == 0 && to == 0)
                                                                                    {
                                                                                        indicelistBox.Items.Add(rcvs);
                                                                                        numelistBox.Items.Add(row["Nume"]);
                                                                                        datelistBox.Items.Add(row["Date"]);
                                                                                        ctr++;
                                                                                        paclabel.Text = "Numărul de valori găsite este de " + ctr.ToString();
                                                                                        #region Alte valori
                                                                                        if (comboBox2.Text == "CNP")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row["CNP"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Fumat")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            if (row["Fumat"].ToString() == "DA")
                                                                                                otherlistBox.Items.Add(row["Fumat"] + " ( " + row["Nrtigar"] + " )");
                                                                                            else
                                                                                                otherlistBox.Items.Add(row["Fumat"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Activitate Fizica")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row["ActFizica"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Masa Corporala")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row["G"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Inaltime")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row["H"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Circumferinta Abdominala")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row["Ca"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Tensiune Arteriala Sistolica")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row["TaSistolica"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Tensiune Arteriala Diastolica")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row["TaDiastolica"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Glicemie")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row["Glicemie"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "HDL Colesterol")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row["HDLCol"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "LDL Colesterol")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(row["LDLCol"]);
                                                                                        }
                                                                                        if (comboBox2.Text == "Trigliceride")
                                                                                        {
                                                                                            otherlistBox.Items.Add(row["Tg"]);
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                        }
                                                                                        if (comboBox2.Text == "Indice de masa corporala")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                                                            imc = imcf.ToString();
                                                                                            imcf = (float)Convert.ToDouble(imc);
                                                                                            otherlistBox.Items.Add(imcf);
                                                                                        }
                                                                                        if (comboBox2.Text == "Varsta")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(c.Varsta(row["CNP"].ToString(), now));
                                                                                        }
                                                                                        if (comboBox2.Text == "Risc Cardiovascular")
                                                                                        {
                                                                                            otherlabel.Text = comboBox2.Text;
                                                                                            otherlistBox.Items.Add(rcvs);
                                                                                        }
                                                                                        if (ok2 == true)
                                                                                        {
                                                                                            foreach (DataRow row2 in dt2.Rows)
                                                                                            {
                                                                                                if (row["CNP"].ToString() == row2["CNP"].ToString())
                                                                                                {
                                                                                                    if (comboBox2.Text == "Diabet Zaharat Parinti")
                                                                                                    {
                                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                                        otherlistBox.Items.Add(row2["DZP"]);
                                                                                                    }
                                                                                                    if (comboBox2.Text == "Diabet Zaharat Frati")
                                                                                                    {
                                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                                        otherlistBox.Items.Add(row2["DZF"]);
                                                                                                    }
                                                                                                    if (comboBox2.Text == "Boala Cardiovasculara")
                                                                                                    {
                                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                                        otherlistBox.Items.Add(row2["BoliCardio"]);
                                                                                                    }
                                                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(familie)")
                                                                                                    {
                                                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(familie)";
                                                                                                        otherlistBox.Items.Add(row2["HAFam"]);
                                                                                                    }
                                                                                                    if (comboBox2.Text == "Dislipidemie")
                                                                                                    {
                                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                                        otherlistBox.Items.Add(row2["Dislipidemie"]);
                                                                                                    }
                                                                                                    if (comboBox2.Text == "Obezitate")
                                                                                                    {
                                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                                        otherlistBox.Items.Add(row2["Obezitate"]);
                                                                                                    }
                                                                                                    if (comboBox2.Text == "Morti Subite")
                                                                                                    {
                                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                                        otherlistBox.Items.Add(row2["MortiSubite"]);
                                                                                                    }
                                                                                                    if (comboBox2.Text == "Ocupatie")
                                                                                                    {
                                                                                                        otherlistBox.Items.Add(row2["Ocupatie"]);
                                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                                    }
                                                                                                    if (comboBox2.Text == "Diabet Gestational")
                                                                                                    {
                                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                                        otherlistBox.Items.Add(row2["DiabetG"]);
                                                                                                    }
                                                                                                    if (comboBox2.Text == "Cardiopatie Ischemica")
                                                                                                    {
                                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                                        otherlistBox.Items.Add(row2["CardioIschemica"]);
                                                                                                    }
                                                                                                    if (comboBox2.Text == "Hipertensiune Arteriala(personala)")
                                                                                                    {
                                                                                                        otherlabel.Text = "Hipertensiune Arteriala" + "\n" + "(personala)";
                                                                                                        otherlistBox.Items.Add(row2["HAPers"]);
                                                                                                    }
                                                                                                    if (comboBox2.Text == "Infarct Miocardic/Accident Vascular Cerebral")
                                                                                                    {
                                                                                                        otherlabel.Text = "Infarct Miocardic" + "\n" + "Accident Vascular Cerebral";
                                                                                                        otherlistBox.Items.Add(row2["IMAVC"]);
                                                                                                    }
                                                                                                    if (comboBox2.Text == "Scaderea Tolerantei La Glucoza")
                                                                                                    {
                                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                                        otherlistBox.Items.Add(row2["STGlucoza"]);
                                                                                                    }
                                                                                                    if (comboBox2.Text == "Copil Macrosom")
                                                                                                    {
                                                                                                        otherlabel.Text = comboBox2.Text;
                                                                                                        otherlistBox.Items.Add(row2["CopilMacro"]);
                                                                                                    }
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                        #endregion
                                                                                    }
                                                                    }
                                                                    ctr = 0;
                                                                    }

                }
                else
                    MessageBox.Show("Selectati o valoare pentru a vedea statistica.");
            }
            int s=0;
            for (int i = 1; i <= numelistBox.Items.Count; i++)
                s += i;
            if(s==0)
                paclabel.Text = "";
        }
Beispiel #4
0
 private void chartcomboBox_SelectedIndexChanged(object sender, EventArgs e)
 {
     c = new Calcul();
     DataTable dt = dateMedDataSet.Statistica;
     chart1.ChartAreas["Default"].AxisX.IntervalType = DateTimeIntervalType.Days;
     if (usr == true)
     {
         if (chartcomboBox.Text == "Greutate")
         {
             listBox1.Items.Clear();
             listBox2.Items.Clear();
             textlabel.Text = "Greutate";
             chart1.Series["Greutate"].Points.Clear();
             chart1.Series["Circumferinta Abdominala"].Points.Clear();
             chart1.Series["Glicemie"].Points.Clear();
             chart1.Series["Trigliceride"].Points.Clear();
             chart1.Series["HDL Colesterol"].Points.Clear();
             chart1.Series["LDL Colesterol"].Points.Clear();
             chart1.Series["Control"].Points.Clear();
             chart1.Series["TAD"].Points.Clear();
             chart1.Series["TAS"].Points.Clear();
             chart1.Series["IMC"].Points.Clear();
             chart1.Series["RCV"].Points.Clear();
             foreach (DataRow row in dt.Rows)
             {
                 chart1.Series["Greutate"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["G"]);
                 chart1.Series["Control"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["G"]);
                 listBox1.Items.Add(row["G"]);
                 listBox2.Items.Add(row["Date"]);
             }
         }
         else
             if (chartcomboBox.Text == "Circumferinta abdominala")
             {
                 listBox1.Items.Clear();
                 listBox2.Items.Clear();
                 textlabel.Text = "Circumferinta abdominala";
                 chart1.Series["Circumferinta Abdominala"].Points.Clear();
                 chart1.Series["Control"].Points.Clear();
                 chart1.Series["Greutate"].Points.Clear();
                 chart1.Series["Glicemie"].Points.Clear();
                 chart1.Series["Trigliceride"].Points.Clear();
                 chart1.Series["HDL Colesterol"].Points.Clear();
                 chart1.Series["LDL Colesterol"].Points.Clear();
                 chart1.Series["TAD"].Points.Clear();
                 chart1.Series["TAS"].Points.Clear();
                 chart1.Series["IMC"].Points.Clear();
                 chart1.Series["RCV"].Points.Clear();
                 foreach (DataRow row in dt.Rows)
                 {
                     chart1.Series["Circumferinta Abdominala"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["CA"]);
                     chart1.Series["Control"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["CA"]);
                     listBox1.Items.Add(row["CA"]);
                     listBox2.Items.Add(row["Date"]);
                 }
             }
             else
                 if (chartcomboBox.Text == "Glicemie")
                 {
                     listBox1.Items.Clear();
                     listBox2.Items.Clear();
                     textlabel.Text = "Glicemie";
                     chart1.Series["Glicemie"].Points.Clear();
                     chart1.Series["Control"].Points.Clear();
                     chart1.Series["Greutate"].Points.Clear();
                     chart1.Series["Circumferinta Abdominala"].Points.Clear();
                     chart1.Series["Trigliceride"].Points.Clear();
                     chart1.Series["HDL Colesterol"].Points.Clear();
                     chart1.Series["LDL Colesterol"].Points.Clear();
                     chart1.Series["TAD"].Points.Clear();
                     chart1.Series["TAS"].Points.Clear();
                     chart1.Series["IMC"].Points.Clear();
                     chart1.Series["RCV"].Points.Clear();
                     foreach (DataRow row in dt.Rows)
                     {
                         chart1.Series["Glicemie"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["Glicemie"]);
                         chart1.Series["Control"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["Glicemie"]);
                         listBox1.Items.Add(row["Glicemie"]);
                         listBox2.Items.Add(row["Date"]);
                     }
                 }
                 else
                     if (chartcomboBox.Text == "Trigliceride")
                     {
                         listBox1.Items.Clear();
                         listBox2.Items.Clear();
                         textlabel.Text = "Trigliceride";
                         chart1.Series["Trigliceride"].Points.Clear();
                         chart1.Series["RCV"].Points.Clear();
                         chart1.Series["Control"].Points.Clear();
                         chart1.Series["Greutate"].Points.Clear();
                         chart1.Series["Circumferinta Abdominala"].Points.Clear();
                         chart1.Series["Glicemie"].Points.Clear();
                         chart1.Series["HDL Colesterol"].Points.Clear();
                         chart1.Series["LDL Colesterol"].Points.Clear();
                         chart1.Series["TAD"].Points.Clear();
                         chart1.Series["TAS"].Points.Clear();
                         chart1.Series["IMC"].Points.Clear();
                         foreach (DataRow row in dt.Rows)
                         {
                             chart1.Series["Trigliceride"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["Tg"]);
                             chart1.Series["Control"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["Tg"]);
                             listBox1.Items.Add(row["Tg"]);
                             listBox2.Items.Add(row["Date"]);
                         }
                     }
                     else
                         if (chartcomboBox.Text == "HDL Colesterol")
                         {
                             listBox1.Items.Clear();
                             listBox2.Items.Clear();
                             textlabel.Text = chartcomboBox.Text;
                             chart1.Series["HDL Colesterol"].Points.Clear();
                             chart1.Series["RCV"].Points.Clear();
                             chart1.Series["Control"].Points.Clear();
                             chart1.Series["Greutate"].Points.Clear();
                             chart1.Series["Circumferinta Abdominala"].Points.Clear();
                             chart1.Series["Glicemie"].Points.Clear();
                             chart1.Series["Trigliceride"].Points.Clear();
                             chart1.Series["LDL Colesterol"].Points.Clear();
                             chart1.Series["TAD"].Points.Clear();
                             chart1.Series["TAS"].Points.Clear();
                             chart1.Series["IMC"].Points.Clear();
                             foreach (DataRow row in dt.Rows)
                             {
                                 chart1.Series["HDL Colesterol"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["HDLCol"]);
                                 chart1.Series["Control"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["HDLCol"]);
                                 listBox1.Items.Add(row["HDLCol"]);
                                 listBox2.Items.Add(row["Date"]);
                             }
                         }
                         else
                             if (chartcomboBox.Text == "LDL Colesterol")
                             {
                                 listBox1.Items.Clear();
                                 listBox2.Items.Clear();
                                 textlabel.Text = chartcomboBox.Text;
                                 chart1.Series["LDL Colesterol"].Points.Clear();
                                 chart1.Series["RCV"].Points.Clear();
                                 chart1.Series["Control"].Points.Clear();
                                 chart1.Series["Greutate"].Points.Clear();
                                 chart1.Series["Circumferinta Abdominala"].Points.Clear();
                                 chart1.Series["Glicemie"].Points.Clear();
                                 chart1.Series["Trigliceride"].Points.Clear();
                                 chart1.Series["HDL Colesterol"].Points.Clear();
                                 chart1.Series["TAD"].Points.Clear();
                                 chart1.Series["TAS"].Points.Clear();
                                 chart1.Series["IMC"].Points.Clear();
                                 foreach (DataRow row in dt.Rows)
                                 {
                                     chart1.Series["LDL Colesterol"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["LDLCol"]);
                                     chart1.Series["Control"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["LDLCol"]);
                                     listBox1.Items.Add(row["LDLCol"]);
                                     listBox2.Items.Add(row["Date"]);
                                 }
                             }
                             else
                                 if (chartcomboBox.Text == "Tensiune arteriala sistolica")
                                 {
                                     listBox1.Items.Clear();
                                     listBox2.Items.Clear();
                                     textlabel.Text = chartcomboBox.Text;
                                     chart1.Series["TAS"].Points.Clear();
                                     chart1.Series["Control"].Points.Clear();
                                     chart1.Series["Greutate"].Points.Clear();
                                     chart1.Series["Circumferinta Abdominala"].Points.Clear();
                                     chart1.Series["Glicemie"].Points.Clear();
                                     chart1.Series["Trigliceride"].Points.Clear();
                                     chart1.Series["HDL Colesterol"].Points.Clear();
                                     chart1.Series["LDL Colesterol"].Points.Clear();
                                     chart1.Series["IMC"].Points.Clear();
                                     chart1.Series["TAD"].Points.Clear();
                                     chart1.Series["RCV"].Points.Clear();
                                     foreach (DataRow row in dt.Rows)
                                     {
                                         chart1.Series["TAS"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["TaSistolica"]);
                                         chart1.Series["Control"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["TaSistolica"]);
                                         listBox1.Items.Add(row["TaSistolica"]);
                                         listBox2.Items.Add(row["Date"]);
                                     }
                                 }
                                 else
                                     if (chartcomboBox.Text == "Tensiune arteriala diastolica")
                                     {
                                         listBox1.Items.Clear();
                                         listBox2.Items.Clear();
                                         textlabel.Text = chartcomboBox.Text;
                                         chart1.Series["TAD"].Points.Clear();
                                         chart1.Series["Control"].Points.Clear();
                                         chart1.Series["Greutate"].Points.Clear();
                                         chart1.Series["Circumferinta Abdominala"].Points.Clear();
                                         chart1.Series["Glicemie"].Points.Clear();
                                         chart1.Series["Trigliceride"].Points.Clear();
                                         chart1.Series["HDL Colesterol"].Points.Clear();
                                         chart1.Series["LDL Colesterol"].Points.Clear();
                                         chart1.Series["TAS"].Points.Clear();
                                         chart1.Series["IMC"].Points.Clear();
                                         chart1.Series["RCV"].Points.Clear();
                                         foreach (DataRow row in dt.Rows)
                                         {
                                             chart1.Series["TAD"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["TaDiastolica"]);
                                             chart1.Series["Control"].Points.AddXY(Convert.ToDateTime(row["Date"]), row["TaDiastolica"]);
                                             listBox1.Items.Add(row["TaDiastolica"]);
                                             listBox2.Items.Add(row["Date"]);
                                         }
                                     }
                                     else
                                         if (chartcomboBox.Text == "Indice De Masa Corporala")
                                         {
                                             float imcf;
                                             string imc;
                                             listBox1.Items.Clear();
                                             listBox2.Items.Clear();
                                             textlabel.Text = chartcomboBox.Text;
                                             chart1.Series["IMC"].Points.Clear();
                                             chart1.Series["Control"].Points.Clear();
                                             chart1.Series["Greutate"].Points.Clear();
                                             chart1.Series["Circumferinta Abdominala"].Points.Clear();
                                             chart1.Series["Glicemie"].Points.Clear();
                                             chart1.Series["Trigliceride"].Points.Clear();
                                             chart1.Series["HDL Colesterol"].Points.Clear();
                                             chart1.Series["LDL Colesterol"].Points.Clear();
                                             chart1.Series["TAS"].Points.Clear();
                                             chart1.Series["TAD"].Points.Clear();
                                             chart1.Series["RCV"].Points.Clear();
                                             foreach (DataRow row in dt.Rows)
                                             {
                                                 imcf = c.IMC(row["G"].ToString(), row["H"].ToString());
                                                 imc = imcf.ToString();
                                                 imcf = (float)Convert.ToDouble(imc);
                                                 chart1.Series["IMC"].Points.AddXY(Convert.ToDateTime(row["Date"]), imcf);
                                                 chart1.Series["Control"].Points.AddXY(Convert.ToDateTime(row["Date"]), imcf);
                                                 listBox1.Items.Add(imcf);
                                                 listBox2.Items.Add(row["Date"]);
                                             }
                                         }
                                         else
                                             if (chartcomboBox.Text == "Risc Cardiovascular")
                                             {
                                                 int rcv;
                                                 listBox1.Items.Clear();
                                                 listBox2.Items.Clear();
                                                 textlabel.Text = chartcomboBox.Text;
                                                 chart1.Series["IMC"].Points.Clear();
                                                 chart1.Series["Control"].Points.Clear();
                                                 chart1.Series["Greutate"].Points.Clear();
                                                 chart1.Series["Circumferinta Abdominala"].Points.Clear();
                                                 chart1.Series["Glicemie"].Points.Clear();
                                                 chart1.Series["Trigliceride"].Points.Clear();
                                                 chart1.Series["HDL Colesterol"].Points.Clear();
                                                 chart1.Series["LDL Colesterol"].Points.Clear();
                                                 chart1.Series["TAS"].Points.Clear();
                                                 chart1.Series["TAD"].Points.Clear();
                                                 chart1.Series["RCV"].Points.Clear();
                                                 foreach (DataRow row in dt.Rows)
                                                 {
                                                     rcv = c.RCV(row["LDLCol"].ToString(), row["CNP"].ToString(), row["TaSistolica"].ToString(), row["Fumat"].ToString(), Convert.ToDateTime(row["Date"]).ToShortDateString().ToString());
                                                     chart1.Series["RCV"].Points.AddXY(Convert.ToDateTime(row["Date"]), rcv);
                                                     chart1.Series["Control"].Points.AddXY(Convert.ToDateTime(row["Date"]), rcv);
                                                     listBox1.Items.Add(rcv);
                                                     listBox2.Items.Add(row["Date"]);
                                                 }
                                             }
                                             else
                                             {
                                                 listBox1.Items.Clear();
                                                 listBox2.Items.Clear();
                                                 textlabel.Text = "Valoare";
                                                 chart1.Series["IMC"].Points.Clear();
                                                 chart1.Series["Control"].Points.Clear();
                                                 chart1.Series["Greutate"].Points.Clear();
                                                 chart1.Series["Circumferinta Abdominala"].Points.Clear();
                                                 chart1.Series["Glicemie"].Points.Clear();
                                                 chart1.Series["Trigliceride"].Points.Clear();
                                                 chart1.Series["HDL Colesterol"].Points.Clear();
                                                 chart1.Series["LDL Colesterol"].Points.Clear();
                                                 chart1.Series["TAS"].Points.Clear();
                                                 chart1.Series["TAD"].Points.Clear();
                                                 chart1.Series["RCV"].Points.Clear();
                                             }
     }
 }
Beispiel #5
0
        private void pacbutton_Click(object sender, EventArgs e)
        {
            c = new Calcul();

            bool ok1 = true, ok2 = true, ok3 = true;
            if (cNPTextBox3.Text != "")
            {
                cnpf = cNPTextBox3.Text;
                okcnp = c.Cnpvalid(cnpf);
            }
            else
            {
                if (comboBox4.Text != "Cnp Pacient")
                    cnpf = comboBox4.Text;
            }
            if (cNPTextBox3.Text != "" && cNPTextBox3.Text != null)
            {
                if (okcnp == true)
                {
                    if (cnpf != null && cnpf != "")
                    {
                        try
                        {
                            exista = (int)datePersTableAdapter.ScalarQueryCnp2(cnpf);
                        }
                        catch
                        {
                            MessageBox.Show("Vă rugăm reîncercați");
                        }
                    }
                    if (cnpf != "" && cnpf != null)
                    {
                        if (exista == 1)
                        {
                            if (fumatComboBox.Text != "Selectati" && nrtigarTextBox2.Text != "" && actFizicaComboBox.Text != "Selectati" && gTextBoxa2.Text != "" && hTextBox2.Text != "" && caTextBox3.Text != "" && taSistolicaTextBox2.Text != "" && taSistolicaTextBox2.Text != "" && taDiastolicaTextBox2.Text != "" && glicemieTextBox2.Text != "" && hDLColTextBox2.Text != "" && lDLColTextBox2.Text != "" && tgTextBox3.Text != "" && dateTextBox2.Text != "")
                            {
                                fumf = fumatComboBox.Text;
                                tigarif = int.Parse(nrtigarTextBox2.Text);
                                fizicf = actFizicaComboBox.Text;
                                gf = int.Parse(gTextBoxa2.Text);
                                hf = int.Parse(hTextBox2.Text);
                                caf = int.Parse(caTextBox3.Text);
                                tasf = int.Parse(taSistolicaTextBox2.Text);
                                tadf = int.Parse(taDiastolicaTextBox2.Text);
                                glicemief = int.Parse(glicemieTextBox2.Text);
                                hdlf = int.Parse(hDLColTextBox2.Text);
                                ldlf = int.Parse(lDLColTextBox2.Text);
                                tgf = int.Parse(tgTextBox3.Text);
                                dtf = dateTextBox2.Text;
                                try
                                {
                                    evaluariTableAdapter1.InsertQueryEvaluari(fumf, tigarif, fizicf, gf, hf, caf, tasf, tadf, glicemief, hdlf, ldlf, tgf, cnpf, Convert.ToDateTime(dtf).ToString());
                                    ok1 = false;
                                }
                                catch
                                {
                                    MessageBox.Show("Am intampinat probleme la salvarea datelor. \n Vă rugăm să reîncercaţi.");

                                }
                                if (ok1 == false)
                                {
                                    MessageBox.Show("Salvare cu succes. Accesați pagina următoare pentru mai multe detalii.");
                                }
                            }
                            else
                                MessageBox.Show("Vă rugăm să completați toate rândurile.");
                        }
                        else
                        {
                            if (fumatComboBox.Text != "Selectati" && nrtigarTextBox2.Text != "" && actFizicaComboBox.Text != "Selectati" && gTextBoxa2.Text != "" && hTextBox2.Text != "" && caTextBox3.Text != "" && taSistolicaTextBox2.Text != "" && taSistolicaTextBox2.Text != "" && taDiastolicaTextBox2.Text != "" && glicemieTextBox2.Text != "" && hDLColTextBox2.Text != "" && lDLColTextBox2.Text != "" && tgTextBox3.Text != "" && dateTextBox2.Text != "" && numeTextBox1.Text != "" && sexComboBox.Text != "Selectati" && ocupatieTextBox.Text != "" && dZPComboBox.Text != "Selectati" && dZFComboBox.Text != "Selectati" && boliCardioComboBox.Text != "Selectati" && hAFamComboBox.Text != "Selectati" && dislipidemieComboBox.Text != "Selectati" && obezitateComboBox.Text != "Selectati" && mortiSubiteComboBox.Text != "Selectati" && copilMacroComboBox.Text != "Selectati" && diabetGComboBox.Text != "Selectati" && cardioIschemicaComboBox.Text != "Selectati" && hAPersComboBox.Text != "Selectati" && iMAVCComboBox.Text != "Selectati" && sTGlucozaComboBox.Text != "Selectati")
                            {
                                numef = numeTextBox1.Text;
                                sexf = sexComboBox.Text;
                                ocupatief = ocupatieTextBox.Text;
                                dzpf = dZPComboBox.Text;
                                dzff = dZFComboBox.Text;
                                bolicardiof = boliCardioComboBox.Text;
                                hafamf = hAFamComboBox.Text;
                                dislipif = dislipidemieComboBox.Text;
                                obezf = obezitateComboBox.Text;
                                msubitef = mortiSubiteComboBox.Text;
                                copilmacrof = copilMacroComboBox.Text;
                                diabetgf = diabetGComboBox.Text;
                                cardioischemf = cardioIschemicaComboBox.Text;
                                hapersf = hAPersComboBox.Text;
                                imavcf = iMAVCComboBox.Text;
                                stglucozaf = sTGlucozaComboBox.Text;
                                fumf = fumatComboBox.Text;
                                tigarif = int.Parse(nrtigarTextBox2.Text);
                                fizicf = actFizicaComboBox.Text;
                                gf = int.Parse(gTextBoxa2.Text);
                                hf = int.Parse(hTextBox2.Text);
                                caf = int.Parse(caTextBox3.Text);
                                tasf = int.Parse(taSistolicaTextBox2.Text);
                                tadf = int.Parse(taDiastolicaTextBox2.Text);
                                glicemief = int.Parse(glicemieTextBox2.Text);
                                hdlf = int.Parse(hDLColTextBox2.Text);
                                ldlf = int.Parse(lDLColTextBox2.Text);
                                tgf = int.Parse(tgTextBox3.Text);
                                dtf = dateTextBox2.Text;
                                try
                                {
                                    datePersTableAdapter1.InsertQueryDatePers(numef, sexf, cnpf, ocupatief, dzpf, dzpf, bolicardiof, hafamf, dislipif, obezf, msubitef, copilmacrof, diabetgf, cardioischemf, hapersf, imavcf, stglucozaf);
                                    ok2 = false;
                                }
                                catch
                                {
                                    MessageBox.Show("Am întampinat probleme la salvarea datelor. \n Vă rugăm să reîncercați.");

                                }
                                try
                                {
                                    evaluariTableAdapter1.InsertQueryEvaluari(fumf, tigarif, fizicf, gf, hf, caf, tasf, tadf, glicemief, hdlf, ldlf, tgf, cnpf, dtf);
                                    ok3 = false;
                                }
                                catch
                                {
                                    MessageBox.Show("Am întampinat probleme la salvarea datelor. \n Vă rugam să reincercaţi.");

                                }
                                if (ok2 == false && ok3 == false)
                                {
                                    MessageBox.Show("Salvare cu succes. Accesați pagina următoare pentru mai multe detalii.");
                                }
                            }
                            else
                                MessageBox.Show("Vă rugăm să completați toate rândurile.");
                        }
                    }
                    else
                        MessageBox.Show("Vă rugăm să încărcaţi un fişier pentru a putea salva datele în baza de date sau completati câmpurile după care salvați datele.");
                }
                else
                {
                    MessageBox.Show("CNP invalid");
                }
            }
            else//aici se face insertul pentru un pacient deja existenta
            {
                if (cnpf != null && cnpf != "")
                {
                    try
                    {
                        exista = (int)datePersTableAdapter.ScalarQueryCnp2(cnpf);
                    }
                    catch
                    {
                        MessageBox.Show("Vă rugăm reîncercați");
                    }
                }
                if (cnpf != "" && cnpf != null)
                {
                    if (exista == 1)
                    {
                        if (fumatComboBox.Text != "Selectati" && nrtigarTextBox2.Text != "" && actFizicaComboBox.Text != "Selectati" && gTextBoxa2.Text != "" && hTextBox2.Text != "" && caTextBox3.Text != "" && taSistolicaTextBox2.Text != "" && taSistolicaTextBox2.Text != "" && taDiastolicaTextBox2.Text != "" && glicemieTextBox2.Text != "" && hDLColTextBox2.Text != "" && lDLColTextBox2.Text != "" && tgTextBox3.Text != "" && dateTextBox2.Text != "")
                        {
                            fumf = fumatComboBox.Text;
                            tigarif = int.Parse(nrtigarTextBox2.Text);
                            fizicf = actFizicaComboBox.Text;
                            gf = int.Parse(gTextBoxa2.Text);
                            hf = int.Parse(hTextBox2.Text);
                            caf = int.Parse(caTextBox3.Text);
                            tasf = int.Parse(taSistolicaTextBox2.Text);
                            tadf = int.Parse(taDiastolicaTextBox2.Text);
                            glicemief = int.Parse(glicemieTextBox2.Text);
                            hdlf = int.Parse(hDLColTextBox2.Text);
                            ldlf = int.Parse(lDLColTextBox2.Text);
                            tgf = int.Parse(tgTextBox3.Text);
                            dtf = dateTextBox2.Text;
                            try
                            {
                                evaluariTableAdapter1.InsertQueryEvaluari(fumf, tigarif, fizicf, gf, hf, caf, tasf, tadf, glicemief, hdlf, ldlf, tgf, cnpf, Convert.ToDateTime(dtf).ToString());
                                ok1 = false;
                            }
                            catch
                            {

                                MessageBox.Show("Am intampinat probleme la salvarea datelor. \n Vă rugăm să reîncercaţi.");
                            }
                            if (ok1 == false)
                            {
                                MessageBox.Show("Salvare cu succes. Accesați pagina următoare pentru mai multe detalii.");
                            }
                        }
                        else
                            MessageBox.Show("Vă rugăm să completați toate rândurile.");
                    }
                    else
                    {
                        if (fumatComboBox.Text != "Selectati" && nrtigarTextBox2.Text != "" && actFizicaComboBox.Text != "Selectati" && gTextBoxa2.Text != "" && hTextBox2.Text != "" && caTextBox3.Text != "" && taSistolicaTextBox2.Text != "" && taSistolicaTextBox2.Text != "" && taDiastolicaTextBox2.Text != "" && glicemieTextBox2.Text != "" && hDLColTextBox2.Text != "" && lDLColTextBox2.Text != "" && tgTextBox3.Text != "" && dateTextBox2.Text != "" && numeTextBox1.Text != "" && sexComboBox.Text != "Selectati" && ocupatieTextBox.Text != "" && dZPComboBox.Text != "Selectati" && dZFComboBox.Text != "Selectati" && boliCardioComboBox.Text != "Selectati" && hAFamComboBox.Text != "Selectati" && dislipidemieComboBox.Text != "Selectati" && obezitateComboBox.Text != "Selectati" && mortiSubiteComboBox.Text != "Selectati" && copilMacroComboBox.Text != "Selectati" && diabetGComboBox.Text != "Selectati" && cardioIschemicaComboBox.Text != "Selectati" && hAPersComboBox.Text != "Selectati" && iMAVCComboBox.Text != "Selectati" && sTGlucozaComboBox.Text != "Selectati")
                        {
                            numef = numeTextBox1.Text;
                            sexf = sexComboBox.Text;
                            ocupatief = ocupatieTextBox.Text;
                            dzpf = dZPComboBox.Text;
                            dzff = dZFComboBox.Text;
                            bolicardiof = boliCardioComboBox.Text;
                            hafamf = hAFamComboBox.Text;
                            dislipif = dislipidemieComboBox.Text;
                            obezf = obezitateComboBox.Text;
                            msubitef = mortiSubiteComboBox.Text;
                            copilmacrof = copilMacroComboBox.Text;
                            diabetgf = diabetGComboBox.Text;
                            cardioischemf = cardioIschemicaComboBox.Text;
                            hapersf = hAPersComboBox.Text;
                            imavcf = iMAVCComboBox.Text;
                            stglucozaf = sTGlucozaComboBox.Text;
                            fumf = fumatComboBox.Text;
                            tigarif = int.Parse(nrtigarTextBox2.Text);
                            fizicf = actFizicaComboBox.Text;
                            gf = int.Parse(gTextBoxa2.Text);
                            hf = int.Parse(hTextBox2.Text);
                            caf = int.Parse(caTextBox3.Text);
                            tasf = int.Parse(taSistolicaTextBox2.Text);
                            tadf = int.Parse(taDiastolicaTextBox2.Text);
                            glicemief = int.Parse(glicemieTextBox2.Text);
                            hdlf = int.Parse(hDLColTextBox2.Text);
                            ldlf = int.Parse(lDLColTextBox2.Text);
                            tgf = int.Parse(tgTextBox3.Text);
                            dtf = dateTextBox2.Text;
                            try
                            {
                                datePersTableAdapter1.InsertQueryDatePers(numef, sexf, cnpf, ocupatief, dzpf, dzpf, bolicardiof, hafamf, dislipif, obezf, msubitef, copilmacrof, diabetgf, cardioischemf, hapersf, imavcf, stglucozaf);
                                ok2 = false;
                            }
                            catch
                            {
                                MessageBox.Show("Am întampinat probleme la salvarea datelor. \n Vă rugăm să reîncercați.");

                            }
                            try
                            {
                                evaluariTableAdapter1.InsertQueryEvaluari(fumf, tigarif, fizicf, gf, hf, caf, tasf, tadf, glicemief, hdlf, ldlf, tgf, cnpf, dtf);
                                ok3=false;
                            }
                            catch
                            {
                                MessageBox.Show("Am întampinat probleme la salvarea datelor. \n Vă rugam să reincercaţi.");

                            }
                            if (ok2 == false && ok3 == false)
                            {
                                MessageBox.Show("Salvare cu succes. Accesați pagina următoare pentru mai multe detalii.");
                            }
                        }
                        else
                            MessageBox.Show("Vă rugăm să completați toate rândurile.");
                    }
                }
                else
                    MessageBox.Show("Vă rugăm să încărcaţi un fişier pentru a putea salva datele în baza de date sau completati câmpurile după care salvați datele.");
            }
            if (ok1 == false || ok2 == false && ok3 == false)
            {
                dateTextBox2.Text=DateTime.Now.ToShortDateString();
                fumatComboBox.Text = "Selectati";
                nrtigarTextBox2.Clear();
                actFizicaComboBox.Text = "Selectati";
                gTextBoxa2.Clear();
                hTextBox2.Clear();
                caTextBox3.Clear();
                taSistolicaTextBox2.Clear();
                taDiastolicaTextBox2.Clear();
                glicemieTextBox2.Clear();
                hDLColTextBox2.Clear();
                lDLColTextBox2.Clear();
                tgTextBox3.Clear();
                numeTextBox1.Clear();
                sexComboBox.Text = "Selectati";
                cNPTextBox3.Clear();
                ocupatieTextBox.Clear();
                dZPComboBox.Text = dZFComboBox.Text = boliCardioComboBox.Text = "Selectati";
                hAFamComboBox.Text = dislipidemieComboBox.Text = obezitateComboBox.Text = "Selectati";
                mortiSubiteComboBox.Text = copilMacroComboBox.Text = diabetGComboBox.Text = "Selectati";
                cardioIschemicaComboBox.Text = "Selectati";
                hAPersComboBox.Text = "Selectati";
                iMAVCComboBox.Text = "Selectati";
                sTGlucozaComboBox.Text = "Selectati";
            }
        }
Beispiel #6
0
 private void button8_Click(object sender, EventArgs e)
 {
     Calcul c = new Calcul();
     string g, h;
     float imc;
     cnp = cNPTextBox.Text;
     if (cnp != "" && gTextBox.Text!="")
     {
         g = gTextBox.Text;
         h = hTextBox.Text;
         imc = c.IMC(g, h);
         string imcs = imc.ToString();
         if (imcs.Length == 2)
             imclabel.Text = imc.ToString().Substring(0, 2);
         else
             if (imcs.Length == 3)
                 imclabel.Text = imc.ToString().Substring(0, 3);
             else
                 if (imcs.Length == 4)
                     imclabel.Text = imc.ToString().Substring(0, 4);
                 else
                     imclabel.Text = imc.ToString().Substring(0, 5);
         imcok = true;
     }
 }
Beispiel #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            Calcul c = new Calcul();

            //aici pacientul isi introduce date pentru a utiliza aplicatia
            if (numetextBox.Text == "" || sexcomboBox.Text == "Selectati" || cnptextBox.Text == "" || ocupatietxtbox.Text == "")
                MessageBox.Show("Vă rugăm să completați toate rândurile");
            else
                if (cnptextBox.Text.Length != 13)
                {
                    MessageBox.Show("CNP-ul este incorect.");
                    cnptextBox.Clear();
                }
                else
                {

                    nume = numetextBox.Text;//atribuim valori pentru salvarea in baza de date pentru un pacient nou
                    cnp = cnptextBox.Text;
                    sex = sexcomboBox.Text;
                    ocupatie = ocupatietxtbox.Text;
                    if (c.Cnpvalid(cnp) == true)
                    {
                        int existac = 0;
                        try
                        {

                            existac = (int)datePersTableAdapter1.ScalarQueryCnp2(cnp);//verificam daca avem cnp-ul deja in baza de date
                            if (existac == 1)
                                MessageBox.Show("Acest Cnp există deja in baza de date. Dacă acuma utilizați prima data aplicația reverificati cnp. \n Dacă ați mai utilizat aplicația în trecut vă rugăm să apăsați butonul Înapoi pentru a intra");
                            else
                                tabControl1.SelectedIndex = tabControl1.SelectedIndex + 1;
                        }
                        catch
                        {
                            MessageBox.Show("Am întâmpinat probleme la verificarea datelor. \n Vă rugăm să reîncercaţi.");
                        }
                        dzpcombobox.Enabled = true;//permitem utilizarea controalelor pentru a introduce datele necesare in baza de date
                        dzfcombobox.Enabled = true; cardiocomboBox.Enabled = true; hipercomboBox.Enabled = true;
                        discomboBox.Enabled = true; obezcomboBox.Enabled = true; subitcomboBox.Enabled = true;
                        macrocomboBox.Enabled = true; diacomboBox.Enabled = true; cardcomboBox.Enabled = true;
                        button2.Enabled = true;
                        button3.Enabled = true;
                        artcomboBox.Enabled = true; crbcomboBox.Enabled = true; glucocomboBox.Enabled = true;
                        button6.Enabled = false;
                        button10.Enabled = true;
                        button11.Enabled = true;
                    }
                    else
                        MessageBox.Show("Cnp-ul nu este valid. Va rugam introduceti un Cnp valid.");

                }
        }
Beispiel #8
0
        public bool Cnpvalid(string cnp)
        {
            Calcul cs = new Calcul();

            string cnp2;//sex-prima cifra, an=toate cifrele din data nasterii, jud=cod judet, nnn-nr de ordin 001-999,cc-cifra control;
            int cc, cca, c, aa, ll, zz, jj, nnn, an, sex;
            bool bis;
            bool okz=true,okll=true,okjj,oknnn;
            sex = int.Parse(cnp.Substring(0, 1));
            cc = int.Parse(cnp.Substring(12));
            aa=int.Parse(cnp.Substring(1,2));
            ll = int.Parse(cnp.Substring(3, 2));
            zz = int.Parse(cnp.Substring(5, 2));
            jj = int.Parse(cnp.Substring(7, 2));
            nnn=int.Parse(cnp.Substring(9,3));
            if (sex == 5 || sex == 6)
                an = 2000 + aa;
            else
                an = 1900 + aa;
            bis = cs.Bisect(an);
            #region Verific anu
            if (bis == true)
            {
                if (ll == 1 || ll == 3 || ll == 5 || ll == 7 || ll == 8 || ll == 10 || ll == 12)
                {
                    if (zz>=01 && zz <= 31)
                        okz = true;
                    else
                        okz = false;
                }
                else
                    if (ll == 4 || ll == 6 || ll == 9 || ll == 11)
                    {
                        if (zz>=01&& zz<= 30)
                            okz = true;
                        else
                            okz = false;
                    }
                    else
                        if (ll == 2)
                        {
                            if (zz>=01&& zz<= 29)
                                okz = true;
                            else
                                okz = false;
                        }
                        else
                            okll = false;
                if (zz > 31 )
                    okz = false;
            }
            else
            {
                if (ll == 1 || ll == 3 || ll == 5 || ll == 7 || ll == 8 || ll == 10 || ll == 12)
                {
                    if (zz>=01&& zz<= 31)
                        okz = true;
                    else
                        okz = false;
                }
                else
                    if (ll == 4 || ll == 6 || ll == 9 || ll == 11)
                    {
                        if (zz >=01 && zz<= 30)
                            okz = true;
                        else
                            okz = false;
                    }
                    else
                        if (ll == 2)
                        {
                            if (zz>=01&& zz<= 28)
                                okz = true;
                            else
                                okz = false;
                        }
                        else
                            okll = false;
                if (zz > 31)
                    okz = false;
            }
            #endregion

            if (jj >= 01 && jj <= 52)
                okjj = true;
            else
                okjj = false;

            if (nnn != 000)
                oknnn = true;
            else
                oknnn = false;

            //alg de verificare
            cnp2 = cnp.Substring(0, 12);
            int[] a;
            a = new int[12];
            for (int i = 0; i < cnp2.Length; i++)
                a[i] = int.Parse(cnp2[i].ToString());

            int[] b = { 2, 7, 9, 1, 4, 6, 3, 5, 8, 2, 7, 9 };

            int[] rez = new int[12];
            for (int i = 0; i < a.Length; i++)
                rez[i] = a[i] * b[i];

            int sum = 0;
            for (int i = 0; i < rez.Length; i++)
                sum += rez[i];

            cca = sum % 11;

            if (cca == 10)
                c = 1;
            else
                c = cca;
            bool ok;
            if (okz == true && okll == true && okjj == true && oknnn == true)
            {
                if (c == cc)
                {
                    ok = true;
                }
                else
                {
                    ok = false;
                }
            }
            else
                ok = false;
            return ok;
        }
Beispiel #9
0
 public int RCV(string ldls, string cnps, string tass, string fums, string dates)
 {
     int rcv;
     c=new Calcul();
     int ldl, tas,fum,sex,varsta;
     ldl = int.Parse(ldls);
     tas = int.Parse(tass);
     if (fums == "DA")
         fum = 1;
     else
         fum = 0;
     sex = int.Parse(cnps.Substring(0, 1));
     varsta = c.Varsta(cnps, dates);
     if (sex == 2 ||  sex==6 || sex==8|| sex==4)
         rcv = c.Women(tas, ldl, varsta, fum);
     else
         rcv = c.Men(tas, ldl, varsta, fum);
     return rcv;
 }
Beispiel #10
0
        private void button1_Click(object sender, EventArgs e)
        {
            Calcul c=new Calcul();
            string smtp;
            bool conn;
            if (fromtxtbox.Text == "" || totxtbox.Text == "" || subjectxttbox.Text == "" ||passtxtbox.Text == "" )
                MessageBox.Show("Vă rugăm să completaţi toate câmpurile");
            else
            {
                conn = WebRequestTest();
                MailMessage mail = new MailMessage(fromtxtbox.Text, totxtbox.Text, subjectxttbox.Text, richTextBox1.Text);
                smtp=c.Smptadr(fromtxtbox.Text);

                SmtpClient client = new SmtpClient(smtp);
                client.Port = 587;
                client.Credentials = new System.Net.NetworkCredential(fromtxtbox.Text, passtxtbox.Text);
                if (smtp == "smtp.mail.yahoo.com")
                    client.EnableSsl = false;
                else
                    client.EnableSsl = true;
                System.Net.Mail.Attachment attachment;
                if (attach != null)
                {

                    attachment = new System.Net.Mail.Attachment(attach);
                    mail.Attachments.Add(attachment);
                    if (conn == true)
                    {
                        try
                        {
                            client.Send(mail);
                            MessageBox.Show("Email trimis cu succes.");
                            fromtxtbox.Clear();
                            totxtbox.Clear();
                            passtxtbox.Clear();
                            subjectxttbox.Clear();
                            richTextBox1.Clear();
                            button2.Visible = false;
                            pictureBox1.Visible = false;
                            attach = null;
                        }
                        catch
                        {
                            MessageBox.Show("Vă rugăm reîncercați.");
                        }
                    }
                    else
                        MessageBox.Show("Va rugam sa verificati conexiunea la internet");
                }
                else
                    if (conn == true)
                    {
                        try
                        {
                            client.Send(mail);
                            MessageBox.Show("Email trimis cu succes.");
                            fromtxtbox.Clear();
                            totxtbox.Clear();
                            passtxtbox.Clear();
                            subjectxttbox.Clear();
                            richTextBox1.Clear();
                            attach = null;
                            button2.Visible = false;
                            pictureBox1.Visible = false;
                            richTextBox1.Clear();
                            subjectxttbox.Clear();
                        }
                        catch
                        {
                            MessageBox.Show("Vă rugăm reîncercați.");
                        }
                    }
                    else
                        MessageBox.Show("Va rugam sa verificati conexiunea la internet");
            }
        }