Exemple #1
0
        private void exportar_Click(object sender, RoutedEventArgs e)
        {
            preparaTela();
            try
            {
                Arquivo arq = new Arquivo();
                arq.exportaVotos();
            }
            catch
            {
                lblErroExportacao.Visibility = Visibility.Visible;
            }
            Sucesso s = new Sucesso();

            s.Show();
            this.Hide();
        }
Exemple #2
0
 private void btnCadastrar_Click(object sender, RoutedEventArgs e)
 {
     if (verificaCampos())
     {
         Arquivo arq = new Arquivo();
         if (arq.existeCandidato(codigoCandidato))
         {
             lblCandidatoCadastrado.Visibility = Visibility.Visible;
         }
         else
         {
             arq.escreveCandidato(codigoCandidato, txtNome.Text.ToString(), codigoPartdo);
             Sucesso sucess = new Sucesso();
             sucess.Show();
             this.Close();
         }
     }
 }
Exemple #3
0
 private void btnOK_Click(object sender, RoutedEventArgs e)
 {
     preparaTela();
     if (!int.TryParse(txtNumero.Text, out number))
     {
         lblInvalido.Visibility = Visibility.Visible;
     }
     else
     {
         Arquivo arq = new Arquivo();
         try
         {
             arq.multiplicaVotos(number);
         }
         catch (Exception ex)
         {
             lblErro.Visibility = Visibility.Visible;
         }
         Sucesso s = new Sucesso();
         s.Show();
         this.Hide();
     }
 }