Esempio n. 1
0
 /*
  * [ INICIO ] VERIFICAR SE COMBOS DE ANO E MES ESTÂO ATIVOS
  */
 private void comboBox_ano_TextChanged(object sender, EventArgs e)
 {
     if (comboBox_ano.Text == "" || comboBox_ano.Text.Length == 0)
     {
         RelatoriosController relatorioController = new RelatoriosController();
         relatorioController.comboBoxesMesEAnoAtual(comboBox_mes, comboBox_ano);
     }
 }
Esempio n. 2
0
        /*
         * ---------------------------------------------------------------
         */

        /*
         * [ INICIO ] METODO PARA DELETAR O SERVIÇO NO BD
         */
        public void deletarServico(int idParaExcluir, ListView listView)
        {
            try
            {
                MySqlConnection conn = conexao.conectarBD();
                if (!conn.Ping())
                {
                    conn.Open();
                }
                MySqlCommand bdcommand = new MySqlCommand("DELETE FROM tb_servicos WHERE id = " + idParaExcluir + "", conn);

                bdcommand.ExecuteNonQuery();
                MessageBox.Show("item excluido com sucesso!");
                RelatoriosController relatoriosController = new RelatoriosController();
                relatoriosController.listarMesAtual(listView);
                conn.Close();
            }
            catch (Exception error)
            {
                MessageBox.Show("Erro (DeletarServico): " + error);
            }
        }