Exemplo n.º 1
0
        public void CarregaItensTipoRecebimento(int codigo)
        {
            DataTable dt = new DataTable();
            ItemContaReceberFormaRecebimentoBO itemFormaRecebimentoBO = new ItemContaReceberFormaRecebimentoBO();

            dt = itemFormaRecebimentoBO.CriaDataTableSelecionaItemContasReceberFormaRecebimenoto(codigo);

            if (dt.Rows.Count > 0)
            {
                listItenFormaRecebimento.Items.Clear();

                foreach (DataRow row in dt.Rows)
                {
                    //Adiciona os itens do list view
                    listItenFormaRecebimento.Items.Add(row["formaRecebimento"].ToString());
                    listItenFormaRecebimento.Items[countRow].SubItems.Add(Convert.ToDateTime(row["dataHora"] == DBNull.Value ? Convert.ToDateTime(DateTime.MinValue) : row["dataHora"]).ToString("dd/MM/yyyy"));
                    listItenFormaRecebimento.Items[countRow].SubItems.Add(Convert.ToDecimal(row["vlrPago"]).ToString("C"));

                    countRow++;

                    totalRecebimento += Convert.ToDecimal(row["vlrPago"]);
                }
                countRow           = 0;
                txtTotal.Text      = totalRecebimento.ToString("C");
                txtTotalHaver.Text = txtTotal.Text;
            }
            else
            {
                listItenFormaRecebimento.Enabled = false;
            }
        }
Exemplo n.º 2
0
        public string IncluirItensFormaRecebimento()
        {
            DataTable dt = new DataTable();
            ItemContaReceberFormaRecebimentoBO itemContaReceberFormaRecebimentoBO = new ItemContaReceberFormaRecebimentoBO();

            dt = itemContaReceberFormaRecebimentoBO.CriaDataTableSelecionaItemContasReceberFormaRecebimenoto(parametroCod);

            sb = new StringBuilder();

            foreach (DataRow row in dt.Rows)
            {
                DateTime dataHora = row["dataHora"] == DBNull.Value ? Convert.ToDateTime(DateTime.MinValue.ToString("dd/MM/yyyy")) : Convert.ToDateTime(row["dataHora"]);
                sb.AppendLine("  " + row.ItemArray[3].ToString() + "            " + row.ItemArray[4].ToString() + "         " + dataHora.ToString("dd/MM/yyyy") + "      " + Convert.ToDecimal(row.ItemArray[5]).ToString("C").Substring(3));
            }

            return(sb.ToString());
        }
Exemplo n.º 3
0
        public void CarregaItensTipoRecebimento(string tipo, int codigo)
        {
            DataTable dt = new DataTable();
            ItemContaReceberFormaRecebimentoBO itemFormaRecebimentoBO     = new ItemContaReceberFormaRecebimentoBO();
            ItemTipoRecebimentoVendaBO         itemTipoRecebimentoVendaBO = new ItemTipoRecebimentoVendaBO();

            if (tipo.StartsWith("contaRecebida"))
            {
                dt = itemFormaRecebimentoBO.CriaDataTableSelecionaItemContasReceberFormaRecebimenoto(codigo);
            }
            else
            {
                dt = itemTipoRecebimentoVendaBO.CriaDataTableSelecionaItemVendaFormaRecebimenoto(codigo);
            }

            if (dt.Rows.Count > 0)
            {
                listItenFormaRecebimento.Items.Clear();

                foreach (DataRow row in dt.Rows)
                {
                    //Adiciona os itens do list view
                    listItenFormaRecebimento.Items.Add(row["formaRecebimento"].ToString());
                    listItenFormaRecebimento.Items[countRow].SubItems.Add(Convert.ToDecimal(row["vlrPago"]).ToString("C"));

                    countRow++;

                    totalRecebimento += Convert.ToDecimal(row["vlrPago"]);
                }
                countRow      = 0;
                txtTotal.Text = totalRecebimento.ToString("C");
            }
            else
            {
                listItenFormaRecebimento.Items.Add("Crédiario Loja");
            }
        }