Beispiel #1
0
        public decimal totalCaixa(int idcaixa)
        {
            decimal total = 0;
            //decimal valorfinal = 0;
            //CTransacao ct = new CTransacao();
            //total = ct.totalTransacaoIdCaixa(idcaixa);

            DataTable dt = pegacaixa(idcaixa);

            if (dt.Rows.Count > 0)
            {
                total += decimal.Parse(dt.Rows[0]["cai_valorinicial"].ToString());
            }

            /*try
             * {
             *  valorfinal = decimal.Parse(dt.Rows[0]["cai_valorfinal"].ToString());
             * }
             * catch { }
             * total += valorfinal;*/

            //CContaPagar cp = new CContaPagar();
            //total -= cp.totalPacelaContaPagar(idcaixa);

            CContaReceber cr = new CContaReceber();

            total += cr.totalPacelaContaReceber(idcaixa);

            CTransacao ct = new CTransacao();

            total += ct.totalTransacaoIdCaixa(idcaixa);

            return(total);
        }
Beispiel #2
0
        private void FRCaixa_Load(object sender, EventArgs e)
        {
            reportViewer1.LocalReport.DataSources.Clear();

            CCaixa           c  = new CCaixa();
            DataTable        dt = c.relatorioCaixa(idcaixa);
            ReportDataSource MyReportDataSource = new ReportDataSource("dscaixa", dt);

            reportViewer1.LocalReport.DataSources.Add(MyReportDataSource);

            CTransacao tran   = new CTransacao();
            DataTable  dttran = tran.pegaTransacao(idcaixa);

            MyReportDataSource = new ReportDataSource("dstransacao", dttran);
            reportViewer1.LocalReport.DataSources.Add(MyReportDataSource);

            CContaReceber creceber  = new CContaReceber();
            DataTable     dtreceber = creceber.carregarParcelasCaixaRelatorio(idcaixa);

            MyReportDataSource = new ReportDataSource("dsreceber", dtreceber);
            reportViewer1.LocalReport.DataSources.Add(MyReportDataSource);

            decimal         saldofinal = c.totalCaixa(idcaixa);
            ReportParameter parametro  = new ReportParameter("saldofinal", saldofinal.ToString("00.00"));

            reportViewer1.LocalReport.SetParameters(parametro);

            decimal sangria = tran.totalSangriaIdCaixa(idcaixa);

            parametro = new ReportParameter("sangria", sangria.ToString("00.00"));
            reportViewer1.LocalReport.SetParameters(parametro);

            decimal suprimento = tran.totalSuprimentoIdCaixa(idcaixa);

            parametro = new ReportParameter("suprimento", suprimento.ToString("00.00"));
            reportViewer1.LocalReport.SetParameters(parametro);

            decimal totalreceber = creceber.totalPacelaContaReceber(idcaixa);

            parametro = new ReportParameter("totalreceber", totalreceber.ToString("00.00"));
            reportViewer1.LocalReport.SetParameters(parametro);

            this.reportViewer1.RefreshReport();
        }