Exemplo n.º 1
0
        public string CarregaContasRecebidas(DateTime dataInicio, DateTime dataFim)
        {
            DataSet ds = new DataSet();
            ItemContaReceberFormaRecebimentoBO itemContaReceberFormaRecebimentoBO = new ItemContaReceberFormaRecebimentoBO();

            sb = new StringBuilder();

            ds = itemContaReceberFormaRecebimentoBO.RetornaDataSetContaReceberFormaRecebimento(dataInicio, dataFim);

            if (ds != null)
            {
                string nRecebimento, vlorRecebido;
                totalRecebido = 0;

                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    nRecebimento   = row["itemContarReceberID"].ToString();
                    vlorRecebido   = Convert.ToDecimal(row["vlrPago"]).ToString("C");
                    totalRecebido += Convert.ToDecimal(row["vlrPago"]);
                    sb.AppendLine(" " + nRecebimento + "                                " + vlorRecebido + " ");
                }
            }

            return(sb.ToString());
        }
Exemplo n.º 2
0
        public void CarregaItemContasRecebidasFormaRecebimento()
        {
            if (ckbContasRecebidas.Checked == true)
            {
                DataSet dsItemCR = new DataSet();
                ItemContaReceberFormaRecebimentoBO itemContaReceberFRBO = new ItemContaReceberFormaRecebimentoBO();

                dsItemCR = itemContaReceberFRBO.RetornaDataSetContaReceberFormaRecebimento(DateTime.Parse(txtDateInicial.Text), DateTime.Parse(txtDataFinal.Text));


                if (dsItemCR != null)
                {
                    listViewItensContaReceber.Items.Clear();
                    countRowItemCR             = 0;
                    totalContaRecebidaDinheiro = 0;
                    totalContaRecebidaCartao   = 0;

                    foreach (DataRow row in dsItemCR.Tables[0].Rows)
                    {
                        listViewItensContaReceber.Items.Add(row["itemContarReceberID"].ToString());
                        listViewItensContaReceber.Items[countRowItemCR].SubItems.Add(string.Format("{0:dd/MM/yyyy}", row["dataHora"]));
                        listViewItensContaReceber.Items[countRowItemCR].SubItems.Add(string.Format("{0:C2}", row["vlrPago"]));
                        countRowItemCR++;

                        if (row["formaRecebimento"].ToString().StartsWith("01 - Dinheiro"))
                        {
                            totalContaRecebidaDinheiro += Convert.ToDecimal(row["vlrPago"]);
                        }
                        else
                        {
                            totalContaRecebidaCartao += Convert.ToDecimal(row["vlrPago"]);
                        }
                    }

                    countRowItemCR = 0;

                    txtTotalContasRecebidasEmBanco.Text    = Convert.ToDecimal("0.00").ToString("C");
                    txtTotalContasRecebidasEmCartoes.Text  = totalContaRecebidaCartao.ToString("C");
                    txtTotalContasRecebidasEmCheque.Text   = Convert.ToDecimal("0.00").ToString("C");
                    txtTotalContasRecebidasEmDinheiro.Text = totalContaRecebidaDinheiro.ToString("C");
                }
            }
            else
            {
                listViewItensContaReceber.Items.Clear();
            }
        }