Example #1
0
        private void Confirma_Click(object sender, EventArgs e)
        {
            try
            {
                //TODO: Parei aqui, pegar valor do radio button checado
                string          Query = "update eleicao.bg set qtdVotos= qtdVotos+1 where candidato='" + voto + "';";
                MySqlDataReader Voto;
                Voto = consulta(Query);
                string log = "insert into eleicao.log(candidato) values ('" + voto + "')";
                Voto = consulta(log);
                MessageBox.Show("Voto realizado, Obrigado!");
                SoundPlayer simpleSound = new SoundPlayer(@"c:\Windows\Media\chimes.wav");
                simpleSound.Play();
                Voto.Dispose();
                //precisa da biblioteca media em system

                //Console.Beep(777, 300);
                //Console.Beep(888, 300);
                //Console.Beep(999, 300);
                //Console.Beep(777, 300);
                Thread.Sleep(10000);
                this.Hide();
                //while (UpdateData.Read())
                //{
                //
                //}
                //fechar
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #2
0
        //Adiciona um voto a Urna
        public void addVoto(string numPrefeito, string numVereador)
        {
            Voto v = new Voto(numPrefeito, numVereador);

            votos.Add(v);
        }