Esempio n. 1
0
        public void CalculaSaldoEmDinheiro(DateTime dataInicio, DateTime dataFim)
        {
            //Pega vendas em dinheiro
            DataSet          ds = new DataSet();
            RealizarVendasBO realizaVendasBO = new RealizarVendasBO();
            int vendaID;

            ds = realizaVendasBO.Vendas(dataInicio, dataFim);

            if (ds != null)
            {
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    vendaID = Convert.ToInt32(row["NumeroVenda"].ToString());

                    ItemTipoRecebimentoVendaBO tipoRecebimentoVendaBO = new ItemTipoRecebimentoVendaBO();
                    DataTable dt = new DataTable();
                    dt = tipoRecebimentoVendaBO.CriaDataTableSelecionaItemVendaFormaRecebimenoto(vendaID);

                    if (dt != null)
                    {
                        foreach (DataRow rowDt in dt.Rows)
                        {
                            if (rowDt["formaRecebimento"].ToString().StartsWith("01 - Dinheiro"))
                            {
                                saldoCaixa += Convert.ToDecimal(rowDt["vlrPago"].ToString());
                            }
                        }
                    }
                }
            }
            //Pega recebimento em dinheiro
        }
Esempio n. 2
0
        public string CarregaVendasRealizadas()
        {
            if (listViewCaixaDiarios.Items.Count > 0)
            {
                DataSet          ds = new DataSet();
                RealizarVendasBO realizaVendasBO = new RealizarVendasBO();
                sb = new StringBuilder();

                DateTime dataAbertura = DateTime.Parse(DateTime.Now.ToString("dd/MM/yyyy"));

                ds = realizaVendasBO.Vendas(dataAbertura, dataAbertura);

                if (ds != null)
                {
                    string numeroVenda, valorVenda;
                    totalVenda = 0;

                    foreach (DataRow row in ds.Tables[0].Rows)
                    {
                        numeroVenda = row["NumeroVenda"].ToString();
                        valorVenda  = Convert.ToDecimal(row["TotalPagar"]).ToString("C");
                        totalVenda += Convert.ToDecimal(row["TotalPagar"]);
                        sb.AppendLine(" " + numeroVenda + "                                  " + valorVenda + " ");
                    }
                }
            }
            return(sb.ToString());
        }
Esempio n. 3
0
        public void CarregaVendasRealizadas()
        {
            if (ckbVendasRealizadas.Checked == true)
            {
                DataSet          ds = new DataSet();
                DataTable        dt = new DataTable();
                RealizarVendasBO realizaVendasBO = new RealizarVendasBO();

                ds = realizaVendasBO.Vendas(DateTime.Parse(txtDateInicial.Text), DateTime.Parse(txtDataFinal.Text));

                totalVendasRealizadasDinheiro = 0;
                totalVendasRealizadasBancos   = 0;
                totalVendasRealizadasCartao   = 0;
                totalVendasRealizadasCheque   = 0;

                if (ds != null)
                {
                    listViewVendas.Items.Clear();
                    countRow = 0;
                    dt       = ds.Tables[0];

                    if (dt.Rows.Count > 0)
                    {
                        foreach (DataRow row in dt.Rows)
                        {
                            listViewVendas.Items.Add(row.ItemArray[0].ToString());
                            listViewVendas.Items[countRow].SubItems.Add(string.Format("{0:dd/MM/yyyy}", row.ItemArray[1]));
                            listViewVendas.Items[countRow].SubItems.Add(string.Format("{0:C2}", row.ItemArray[7]));
                            countRow++;

                            CalcularComposicaoVenda(Convert.ToInt32(row["NumeroVenda"]));
                        }
                        countRow = 0;
                    }
                    else
                    {
                        txtTotalVendasRealizadasEmDinheiro.Text = string.Format("{0:C2}", totalVendasRealizadasDinheiro);
                        txtTotalVendasRealizadasEmCartoes.Text  = string.Format("{0:C2}", totalVendasRealizadasCartao);
                        txtTotalVendasRealizadasEmCheque.Text   = Convert.ToDecimal("0.00").ToString("C");
                        txtTotalVendasRealizadasEmBancos.Text   = Convert.ToDecimal("0.00").ToString("C");
                    }
                }
            }
            else
            {
                listViewVendas.Items.Clear();
            }
        }
Esempio n. 4
0
        public string CarregaVendasRealizadas(DateTime dataInicio, DateTime dataFim)
        {
            DataSet          ds = new DataSet();
            RealizarVendasBO realizaVendasBO = new RealizarVendasBO();

            sb = new StringBuilder();

            ds = realizaVendasBO.Vendas(dataInicio, dataFim);

            if (ds != null)
            {
                string numeroVenda, valorVenda;
                totalVenda = 0;

                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    numeroVenda = row["NumeroVenda"].ToString();
                    valorVenda  = Convert.ToDecimal(row["TotalPagar"]).ToString("C");
                    totalVenda += Convert.ToDecimal(row["TotalPagar"]);
                    sb.AppendLine(" " + numeroVenda + "                                  " + valorVenda + " ");
                }
            }
            return(sb.ToString());
        }