public ItemContaReceberFormaRecebimento SelecionarItemFormaRecebimentoId(int itemContarReceberID) { ConexaoBanco conexao = new ConexaoBanco(); sb = new StringBuilder(); ItemContaReceberFormaRecebimento itemContaFR = new ItemContaReceberFormaRecebimento(); sb.Append("SELECT * FROM tblItemConta_a_Receber_FormaRecebimento WHERE itemContarReceberID = " + itemContarReceberID); OleDbDataReader leitor = conexao.selectDR(sb.ToString()); if (leitor.HasRows) { leitor.Read(); itemContaFR._ItemContaReceberFRID = (int)leitor["itemContaReceberFRID"]; itemContaFR._ItenContaReceber._ItemContaReceberID = (int)leitor["itemContarReceberID"]; itemContaFR._DataHora = (DateTime)leitor["dataHora"]; itemContaFR._Item = (int)leitor["Item"]; itemContaFR._FormaRecebimento = (string)leitor["formaRecebimento"]; itemContaFR._VlrPago = (decimal)leitor["vlrPago"]; } else { itemContaFR = null; } leitor.Close(); return(itemContaFR); }
public void EstornaRecebimento() { ItemContaReceberFormaRecebimento itemContaReceberFR = new ItemContaReceberFormaRecebimento(); ItemContaReceberFormaRecebimentoBO itemContaReceberFRBO = new ItemContaReceberFormaRecebimentoBO(); ItemContaReceber itemContaReceber = new ItemContaReceber(); ItemContaReceberBO itemContaReceberBo = new ItemContaReceberBO(); ContasReceber contaReceber = new ContasReceber(); ContasReceberBO contaReceberBO = new ContasReceberBO(); itemContaReceberFR = itemContaReceberFRBO.SelecionarItemFormaRecebimentoId(itemContaReceberID); itemContaReceber = itemContaReceberBo.SelecionarItemContaReceberID(itemContaReceberFR._ItenContaReceber._ItemContaReceberID); decimal vlrPago = itemContaReceberFR._VlrPago; decimal vlrAbert = itemContaReceber.ValorAberto; itemContaReceberBo.EstornarRecebimento(itemContaReceber._ItemContaReceberID, vlrPago, vlrAbert, "Prevista"); itemContaReceberFRBO.ExcluirItemFormaRecebimentoContaReceberId(itemContaReceberFR._ItemContaReceberFRID); MessageBox.Show("Recebimento estornado com sucesso", "OK", MessageBoxButtons.OK, MessageBoxIcon.Information); CarregaItemContasRecebidasFormaRecebimento(); }
//Salva informações pertinente ao item conta receber private void GravarItemFormaRecebimento() { ItemContaReceberFormaRecebimento itemContaReceberFR = new ItemContaReceberFormaRecebimento(); ItemContaReceberFormaRecebimentoBO itemContaReceberFRDAO = new ItemContaReceberFormaRecebimentoBO(); for (int i = 0; i < listFormaRecebimento.Items.Count; i++) { itemContaReceberFR._ItenContaReceber._ItemContaReceberID = parametroCod; itemContaReceberFR._Item = int.Parse(listFormaRecebimento.Items[i].SubItems[0].Text); itemContaReceberFR._FormaRecebimento = listFormaRecebimento.Items[i].SubItems[1].Text; itemContaReceberFR._VlrPago = decimal.Parse(listFormaRecebimento.Items[i].SubItems[2].Text.Substring(3)); itemContaReceberFR._DataHora = DateTime.Parse(DateTime.Now.ToString("dd/MM/yyyy")); itemContaReceberFRDAO.Gravar(itemContaReceberFR); AtualizaSaldoContaCorrenteCaixaEmpresa(itemContaReceberFR._FormaRecebimento, itemContaReceberFR._VlrPago); } }
public void Gravar(ItemContaReceberFormaRecebimento itemRCFR) { sb = new StringBuilder(); ConexaoBanco conexao = new ConexaoBanco(); sb.Append("INSERT INTO tblItemConta_a_Receber_FormaRecebimento(itemContarReceberID,item,formaRecebimento,vlrPago,dataHora)VALUES('"); sb.Append(itemRCFR._ItenContaReceber._ItemContaReceberID); sb.Append("','"); sb.Append(itemRCFR._Item); sb.Append("','"); sb.Append(itemRCFR._FormaRecebimento); sb.Append("','"); sb.Append(itemRCFR._VlrPago); sb.Append("','"); sb.Append(itemRCFR._DataHora); sb.Append("')"); conexao.manterCRUD(sb.ToString()); }
public void Gravar(ItemContaReceberFormaRecebimento itemRCFR) { ItemContaReceberFormaRecebimentoDAO itemContaRFRDAO = new ItemContaReceberFormaRecebimentoDAO(); itemContaRFRDAO.Gravar(itemRCFR); }