Пример #1
0
        public Movimentações()
        {
            InitializeComponent();

            DAO.CaixaDAO cDAO = new DAO.CaixaDAO();

            dinheiroLb.Text = "R$" + String.Format("{0:0.00}", cDAO.ConsultarSaldo());
        }
Пример #2
0
        private void updateTable()
        {
            DAO.EntradaDAO eDAO = new DAO.EntradaDAO();
            DAO.CaixaDAO   cDAO = new DAO.CaixaDAO();

            dataGridView1.DataSource = eDAO.ConsultarEntrada();
            dataGridView1.Sort(this.dataGridView1.Columns["DataHoraRegistro"], ListSortDirection.Descending);
            dinheiroEntradaLb.Text = "R$" + String.Format("{0:0.00}", cDAO.ConsultarSaldo());
        }
Пример #3
0
        public Saída()
        {
            InitializeComponent();

            Objetos.Saida  saida = new Objetos.Saida();
            DAO.SaidaDAO   sDAO  = new DAO.SaidaDAO();
            DAO.CaixaDAO   cDAO  = new DAO.CaixaDAO();
            DAO.UsuarioDAO uDAO  = new DAO.UsuarioDAO();

            tipoDp.SelectedItem  = "Fixa";
            respDp.DataSource    = uDAO.NomesColaboradores();
            respDp.DisplayMember = "Nome";
            respDp.SelectedItem  = saida.FkNomeColaboradorResponsavel;

            dataGridView1.DataSource = sDAO.ConsultarSaida();
            dataGridView1.Sort(this.dataGridView1.Columns["DataHoraRegistro"], ListSortDirection.Descending);
            dinheiroSaidaLb.Text = "R$" + String.Format("{0:0.00}", cDAO.ConsultarSaldo());
            switchTabela();
        }
Пример #4
0
        private void deleteBt_Click(object sender, EventArgs e)
        {
            DAO.CaixaDAO cDAO = new DAO.CaixaDAO();
            DAO.SaidaDAO sDAO = new DAO.SaidaDAO();

            DataGridViewRow row         = dataGridView1.Rows[dataGridView1.CurrentCell.RowIndex];
            int             valorCelula = Int16.Parse(row.Cells[0].Value.ToString());
            //string verif = InputDialogBox.Show("Tem certeza que deseja fazer isso?\n(Digite 'SIM' para confirmar)");


            var confirmResult = MessageBox.Show("Tem certeza que deseja excluir essa saída?", "Confirmação", MessageBoxButtons.YesNo);

            if (confirmResult == DialogResult.Yes)
            {
                sDAO.ExcluirSaida(valorCelula);
                dataGridView1.DataSource = sDAO.ConsultarSaida();
                dataGridView1.Sort(this.dataGridView1.Columns["DataHoraRegistro"], ListSortDirection.Descending);
                dinheiroSaidaLb.Text = "R$" + String.Format("{0:0.00}", cDAO.ConsultarSaldo());
            }
        }
Пример #5
0
        private void saveBt_Click(object sender, EventArgs e)
        {
            Objetos.Saida saida = new Objetos.Saida();
            DAO.SaidaDAO  sDAO  = new DAO.SaidaDAO();
            DAO.CaixaDAO  cDAO  = new DAO.CaixaDAO();

            saida.IdMovimentacao = id;

            saida.Valor       = Convert.ToDouble(saqueTb.Text);
            saida.TipoDespesa = tipoDp.Text;
            saida.FkNomeColaboradorResponsavel = respDp.Text;
            saida.NotaFiscal = notaTb.Text;
            saida.Descricao  = descripTb.Text;

            sDAO.AlterarSaida(saida);

            dataGridView1.DataSource = sDAO.ConsultarSaida();
            dataGridView1.Sort(this.dataGridView1.Columns["DataHoraRegistro"], ListSortDirection.Descending);
            dinheiroSaidaLb.Text = "R$" + String.Format("{0:0.00}", cDAO.ConsultarSaldo());
            switchTabela();
        }
Пример #6
0
        private void enviarSaida()
        {
            if (saqueTb.Text == "")
            {
                MessageBox.Show("Insira um valor!");
                saqueTb.Focus();
            }
            else if (tipoDp.Text == "")
            {
                MessageBox.Show("Escolha o tipo da despesa!");
                tipoDp.Focus();
            }
            else if (respDp.Text == "")
            {
                MessageBox.Show("Escolha o colaborador responsável!");
                respDp.Focus();
            }
            else
            {
                Objetos.Saida saida = new Objetos.Saida();
                DAO.SaidaDAO  sDAO  = new DAO.SaidaDAO();
                DAO.CaixaDAO  cDAO  = new DAO.CaixaDAO();

                saida.Valor       = Convert.ToDouble(saqueTb.Text);
                saida.TipoDespesa = tipoDp.Text;
                saida.FkNomeColaboradorResponsavel = respDp.Text;
                saida.NotaFiscal = notaTb.Text;
                saida.Descricao  = descripTb.Text;

                clear();
                switchTabela();

                sDAO.IncluirSaida(saida);
                dataGridView1.DataSource = sDAO.ConsultarSaida();
                dataGridView1.Sort(this.dataGridView1.Columns["DataHoraRegistro"], ListSortDirection.Descending);
                dinheiroSaidaLb.Text = "R$" + String.Format("{0:0.00}", cDAO.ConsultarSaldo());
            }
        }