private void btnInserirGasto_Click(object sender, EventArgs e)
        {
            DateTime dataAtual = DateTime.Now;

            try
            {
                if (radioGastoReal.Checked == true && radioGastoTemp.Checked == false)
                {
                    format_campos.TirarMascara(txtValor);
                    ins_Dados.InserirGasto(dataAtual, txtProduto.Text, Convert.ToDecimal(txtValor.Text), 0);
                    MessageBox.Show("Sucesso!", "Sucesso!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    formLucros.PreencherTableConformCheck();
                }
                else if (radioGastoTemp.Checked == true && radioGastoReal.Checked == false)
                {
                    format_campos.TirarMascara(txtValor);
                    ins_Dados.InserirGasto(dataAtual, txtProduto.Text, Convert.ToDecimal(txtValor.Text), 1);
                    MessageBox.Show("Sucesso!, Pressione ESC para sair!", "Sucesso!", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    formLucros.PreencherTableConformCheck();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro: " + ex);
            }
        }
 private void gunaAdvenceButton1_Click(object sender, EventArgs e)
 {
     try
     {
         //Tirar o R$ do inicio do valor
         formatar.TirarMascara(txtValorGastosEditar);
         ad.AtualizarGastos(datePicker1.Value, txtProdutoGastosEditar.Text,
                            Convert.ToDecimal(txtValorGastosEditar.Text), Convert.ToInt32(lblID.Text));
         formLucros.PreencherTableConformCheck();
         this.Close();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private void tabelaGastos_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            int gastoID    = Convert.ToInt32(tabelaGastos.SelectedCells[0].Value);
            int realORtemp = Convert.ToInt32(tabelaGastos.SelectedCells[4].Value);

            if (realORtemp == 0)
            {
                DialogResult dialogTemp = MessageBox.Show("Produto: " + tabelaGastos.SelectedCells[2].Value.ToString() + "\n\nDeseja tornar um gasto temporario?", "ALERT", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (dialogTemp == DialogResult.Yes)
                {
                    ad.AlterarGastos(gastoID, 1);
                    tab_Gastos.Preencher(tabelaGastos, 0);
                    formLucros.PreencherTableConformCheck();
                }
                else
                {
                }
            }
            else if (realORtemp == 1)
            {
                DialogResult dialogTemp = MessageBox.Show("Produto: " + tabelaGastos.SelectedCells[2].Value.ToString() + "\n\nDeseja tornar um gasto real?", "ALERT", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
                if (dialogTemp == DialogResult.Yes)
                {
                    ad.AlterarGastos(gastoID, 0);
                    tab_Gastos.Preencher(tabelaGastos, 1);
                    formLucros.PreencherTableConformCheck();
                }
                else
                {
                }
            }
        }