Example #1
0
        private void Form6_Load(object sender, EventArgs e)
        {
            Conexao comb3 = new Conexao();

            comb3.sql = "select count(tb07_tipo) from tb07_urgencias where tb07_ong = " + CNPJ + "";
            comb3.open();
            MySqlDataReader dados2 = comb3.Execsql();

            if (dados2.HasRows)
            {
                while (dados2.Read())
                {
                    qtde = int.Parse(dados2["count(tb07_tipo)"].ToString());
                }
            }


            Conexao comb2 = new Conexao();

            comb2.sql = "select tb07_tipo from tb07_urgencias where tb07_ong = " + CNPJ + "";
            comb2.open();
            MySqlDataReader dados3 = comb2.Execsql();

            if (dados3.HasRows)
            {
                while (dados3.Read())
                {
                    //MessageBox.Show(dados3["tb06_tipo"].ToString());

                    if (dados3["tb07_tipo"].ToString().Equals("1"))
                    {
                        tipo1.Checked = true;
                    }
                    if (dados3["tb07_tipo"].ToString().Equals("2"))
                    {
                        tipo2.Checked = true;
                    }
                    if (dados3["tb07_tipo"].ToString().Equals("3"))
                    {
                        tipo3.Checked = true;
                    }
                    if (dados3["tb07_tipo"].ToString().Equals("4"))
                    {
                        tipo4.Checked = true;
                    }
                    if (dados3["tb07_tipo"].ToString().Equals("5"))
                    {
                        tipo5.Checked = true;
                    }
                    if (dados3["tb07_tipo"].ToString().Equals("6"))
                    {
                        tipo6.Checked = true;
                    }
                    if (dados3["tb07_tipo"].ToString().Equals("7"))
                    {
                        tipo7.Checked = true;
                    }
                    if (dados3["tb07_tipo"].ToString().Equals("8"))
                    {
                        tipo8.Checked = true;
                    }
                }
                comb2.close();
            }
        }