예제 #1
0
        public DataSet ProcesarCobranzaPago(CobranzaPagoBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("CobranzaPago_Mnt");
                db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION);
                db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                db.AddInParameter(cmd, "IdCobranza", DbType.String, BE.IdCobranza);
                db.AddInParameter(cmd, "socioBancoID", DbType.String, BE.socioBancoID);
                db.AddInParameter(cmd, "ctasBancariaID", DbType.String, BE.ctasBancariaID);
                db.AddInParameter(cmd, "ctasBanNumCta", DbType.String, BE.ctasBanNumCta);
                db.AddInParameter(cmd, "nTotal", DbType.Decimal, BE.nTotal);
                db.AddInParameter(cmd, "IdOperacion_tt", DbType.String, BE.IdOperacion_tt);
                db.AddInParameter(cmd, "IdTipoAbono_tt", DbType.String, BE.IdTipoAbono_tt);
                dsResult = db.ExecuteDataSet(cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsResult);
        }
예제 #2
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                foreach (DataGridViewRow row in dgvDepositosxAplicar.Rows)
                {
                    DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["CheckSel"];
                    if (chk.Value.ToString() == "1")
                    {
                        if (_FlgOrigen.Equals("C"))
                        {
                            CobranzaPagoBE oEntity = new CobranzaPagoBE()
                            {
                                ctasBancariaID     = row.Cells["ctasBancariaID"].Value.ToString(),
                                ctasBanNumCta      = row.Cells["ctasBanNumCta"].Value.ToString(),
                                IdOperacion_tt     = row.Cells["IdOperacion_tt"].Value.ToString(),
                                IdOperacion_tt_Dsc = row.Cells["IdOperacion_tt_Dsc"].Value.ToString(),
                                nTotal             = Convert.ToDecimal(row.Cells["Saldo"].Value),
                                IdTipoAbono_tt     = row.Cells["IdTipoAbono_tt"].Value.ToString(),
                                IdTipoAbono_tt_Dsc = row.Cells["IdTipoAbono_tt_Dsc"].Value.ToString(),
                                socioBancoID       = row.Cells["socioBancoID"].Value.ToString(),
                                jSaldo             = Convert.ToDecimal(row.Cells["Saldo"].Value),
                                jImporte           = Convert.ToDecimal(row.Cells["sbImporte"].Value)
                            };
                            LstTmpCobranzaPago.Add(oEntity);
                        }
                        else //Renovación
                        {
                            RenovacionPagoBE oEntity = new RenovacionPagoBE()
                            {
                                ctasBancariaID     = row.Cells["ctasBancariaID"].Value.ToString(),
                                ctasBanNumCta      = row.Cells["ctasBanNumCta"].Value.ToString(),
                                IdOperacion_tt     = row.Cells["IdOperacion_tt"].Value.ToString(),
                                IdOperacion_tt_Dsc = row.Cells["IdOperacion_tt_Dsc"].Value.ToString(),
                                nTotal             = Convert.ToDecimal(row.Cells["Saldo"].Value),
                                IdTipoAbono_tt     = row.Cells["IdTipoAbono_tt"].Value.ToString(),
                                IdTipoAbono_tt_Dsc = row.Cells["IdTipoAbono_tt_Dsc"].Value.ToString(),
                                socioBancoID       = row.Cells["socioBancoID"].Value.ToString(),
                                jSaldo             = Convert.ToDecimal(row.Cells["Saldo"].Value),
                                jImporte           = Convert.ToDecimal(row.Cells["sbImporte"].Value)
                            };
                            LstTmpRenovacionPago.Add(oEntity);
                        }
                    }
                }

                if (_FlgOrigen.Equals("C"))
                {
                    if (LstTmpCobranzaPago.Count == 0)
                    {
                        MessageBox.Show("Debe seleccionar al menos un deposito.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }
                else
                {
                    if (LstTmpRenovacionPago.Count == 0)
                    {
                        MessageBox.Show("Debe seleccionar al menos un deposito.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        return;
                    }
                }

                Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private bool GrabarCobranza()
        {
            bool bResult = false;

            try
            {
                TotalizarImporteDoc();
                Decimal Total          = string.IsNullOrEmpty(lblSaltoXAplicar.Text) ? 0 : Convert.ToDecimal(lblSaltoXAplicar.Text);
                Decimal AcImporteTotal = string.IsNullOrEmpty(txtTotalImp.Text) ? 0 : Convert.ToDecimal(txtTotalImp.Text);

                if (AcImporteTotal != Total)
                {
                    MessageBox.Show("La distribución del depósito debe ser igual que el importe del depósito", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }

                if (dtRegistro.Value == DateTime.MinValue)
                {
                    MessageBox.Show("Se debe ingresar una fecha", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }

                CobranzaBE CobranzaBE = new CobranzaBE()
                {
                    USUARIO           = General.General.GetCodigoUsuario,
                    OPCION            = 2,
                    IdCobranza        = txtIdCobranza.Text,
                    dtRegistro        = General.General.gFechaOp,
                    dtValuta          = dtRegistro.Value,
                    IdTipoCobranza_tt = "00056", //Cobranza por Socio
                    IdMoneda_tt       = cboIdMoneda_tt.SelectedValue.ToString(),
                    nTotal            = String.IsNullOrEmpty(txtnTotal.Text.Trim()) ? 0 : Convert.ToDecimal(txtnTotal.Text),
                    DatosAdicionales  = txtDatosAdicionales.Text,
                };

                DataSet dsCobranza = new DataSet();
                dsCobranza = CobranzaBL.ProcesarCobranza(CobranzaBE);

                if (dsCobranza.Tables[0].Rows.Count > 0)
                {
                    CobranzaDetalleBE oCobranzaDetBE = new CobranzaDetalleBE()
                    {
                        USUARIO    = General.General.GetCodigoUsuario,
                        OPCION     = 3,
                        IdCobranza = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString(),
                        sdFechaOp  = dtRegistro.Value,  //General.General.gFechaOp
                    };
                    CobranzaDetalleBL.ProcesarCobranzaDetalle(oCobranzaDetBE);

                    /* Documentos */
                    foreach (var item in LstCobranzaDetalle)
                    {
                        item.USUARIO    = General.General.GetCodigoUsuario;
                        item.OPCION     = 2;
                        item.IdSocio    = txtIdSocio.Text;
                        item.IdCobranza = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString();
                        item.nvImporte  = item.nvImporte;
                        item.sdFechaOp  = dtRegistro.Value; //General.General.gFechaOp;
                        item.IdLote     = item.IdLote;
                        item.cItem      = item.cItem;
                        CobranzaDetalleBL.ProcesarCobranzaDetalle(item);
                    }

                    /* Depositos */
                    CobranzaPagoBE CobranzaPagoBE = new CobranzaPagoBE()
                    {
                        USUARIO    = General.General.GetCodigoUsuario,
                        OPCION     = 3,
                        IdCobranza = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString(),
                    };
                    new CobranzaPagoBL().ProcesarCobranzaPago(CobranzaPagoBE);

                    foreach (CobranzaPagoBE oEntity in LstCobranzaPago)
                    {
                        oEntity.USUARIO    = General.General.GetCodigoUsuario;
                        oEntity.OPCION     = 2;
                        oEntity.IdCobranza = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString();
                        new CobranzaPagoBL().ProcesarCobranzaPago(oEntity);
                    }
                    bResult = true;
                }
            }
            catch (Exception ex)
            {
                bResult = false;
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(bResult);
        }
        private void btnDepositosXAplicar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(cboIdMoneda_tt.SelectedValue.ToString()))
            {
                MessageBox.Show("Debe seleccionar un tipo de moneda", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            int iMonedaID = cboIdMoneda_tt.SelectedValue.Equals("00036") ? 1 : 2;
            List <CobranzaPagoBE> lstRetBus = new List <CobranzaPagoBE>();

            if (cboTipoDeposito.SelectedIndex == 0)
            {
                frmDespositosXAplicar ofrmDespositosXAplicar = new frmDespositosXAplicar();
                ofrmDespositosXAplicar._IdSocio        = txtIdSocio.Text;
                ofrmDespositosXAplicar._Opcion         = 4;
                ofrmDespositosXAplicar._pvalorMonedaID = iMonedaID;
                ofrmDespositosXAplicar.ShowDialog();
                if (ofrmDespositosXAplicar.LstTmpCobranzaPago != null && ofrmDespositosXAplicar.LstTmpCobranzaPago.Count() > 0)
                {
                    lstRetBus = ofrmDespositosXAplicar.LstTmpCobranzaPago.ToList();
                }
            }
            else
            {
                EfideFactoring.Formula.Consulta.frmBusquedaCtaAhorros frmBusAho = new EfideFactoring.Formula.Consulta.frmBusquedaCtaAhorros(2, 1, 1, txtIdSocio.Text, null, iMonedaID);
                frmBusAho.ShowDialog();
                if (frmBusAho.fbcsNumCuentaID != null && frmBusAho.fbcsNumCuentaID.Trim().Length >= 15)
                {
                    CobranzaPagoBE oEntity = new CobranzaPagoBE()
                    {
                        ctasBancariaID     = frmBusAho.fbcsNumCuentaID,
                        ctasBanNumCta      = frmBusAho.fbcsProdNombre,
                        IdOperacion_tt     = "00157",
                        IdOperacion_tt_Dsc = "Cuenta de Ahorro",
                        nTotal             = Convert.ToDecimal(0),
                        IdTipoAbono_tt     = "00158",
                        IdTipoAbono_tt_Dsc = "Ahorros",
                        socioBancoID       = frmBusAho.fbcsNumCuentaID,
                        jSaldo             = frmBusAho.fbcsSaldoTotal,
                        jImporte           = frmBusAho.fbcsSaldoTotal,
                    };
                    lstRetBus.Add(oEntity);
                }
            }
            bool bExiste = false;

            foreach (CobranzaPagoBE oCobranzaPagoTmpBE in lstRetBus)
            {
                bExiste = false;
                foreach (CobranzaPagoBE oCobranzaPagoBE in LstCobranzaPago)
                {
                    if (oCobranzaPagoTmpBE.socioBancoID == oCobranzaPagoBE.socioBancoID)
                    {
                        bExiste = true;
                        break;
                    }
                }

                if (!bExiste)
                {
                    LstCobranzaPago.Add(oCobranzaPagoTmpBE);
                    dgvDepositos.DataSource = LstCobranzaPago;
                    dgvDepositos.Refresh();
                }
            }

            TotalizarDepositos();
            TotalizarImporteDoc();
        }
        private void CargarDatos()
        {
            try
            {
                DataSet    dsCobranza = new DataSet();
                CobranzaBE CobranzaBE = new CobranzaBE()
                {
                    OPCION     = 4,
                    USUARIO    = General.General.GetCodigoUsuario,
                    IdCobranza = txtIdCobranza.Text,
                };

                dsCobranza = CobranzaBL.ProcesarCobranza(CobranzaBE);

                if (dsCobranza.Tables[0].Rows.Count > 0)
                {
                    txtIdSocio.Text     = dsCobranza.Tables[0].Rows[0]["IdSocio"].ToString();
                    txtDescripcion.Text = dsCobranza.Tables[0].Rows[0]["IdSocio_Dsc"].ToString();
                    //dtRegistro.Value = Convert.ToDateTime(dsCobranza.Tables[0].Rows[0]["dtRegistro"].ToString());
                    dtRegistro.Value             = Convert.ToDateTime(dsCobranza.Tables[0].Rows[0]["dtValuta"].ToString());
                    cboIdMoneda_tt.SelectedValue = dsCobranza.Tables[0].Rows[0]["IdMoneda_tt"].ToString();
                    cboIdMoneda_tt_SelectedIndexChanged(new object(), new EventArgs());
                    txtnTotal.Text           = Convert.ToDecimal(dsCobranza.Tables[0].Rows[0]["nTotal"]).ToString("N2");
                    lblSaltoXAplicar.Text    = Convert.ToDecimal(dsCobranza.Tables[0].Rows[0]["nTotal"]).ToString("N2");
                    txtDatosAdicionales.Text = dsCobranza.Tables[0].Rows[0]["DatosAdicionales"].ToString();
                    lblDiferencia.Text       = (Convert.ToDecimal(dsCobranza.Tables[0].Rows[0]["nTotal"]) - Convert.ToDecimal(dsCobranza.Tables[0].Rows[0]["nTotal"])).ToString("N2");

                    if (dsCobranza.Tables[0].Rows[0]["Status"].ToString() == "C")
                    {
                        btnDepositosXAplicar.Enabled = false;
                        btnQuitarDepositos.Enabled   = false;
                        btnAgregarDet.Enabled        = false;
                        btnQuitarDet.Enabled         = false;
                        btnAceptar.Enabled           = false;
                    }

                    DataSet           dsDetaLote         = new DataSet();
                    CobranzaDetalleBE oCobranzaDetalleBE = new CobranzaDetalleBE()
                    {
                        OPCION     = 1,
                        USUARIO    = General.General.GetCodigoUsuario,
                        sdFechaOp  = General.General.gFechaOp,
                        gSesionID  = General.General.gSesionID,
                        gPlazaID   = General.General.gPlazaID,
                        IdCobranza = txtIdCobranza.Text,
                    };
                    dsDetaLote = CobranzaDetalleBL.ProcesarCobranzaDetalle(oCobranzaDetalleBE);
                    if (dsDetaLote.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsDetaLote.Tables[0].Rows.Count; i++)
                        {
                            CobranzaDetalleBE oCobranzadetBE = new CobranzaDetalleBE()
                            {
                                IdLote            = dsDetaLote.Tables[0].Rows[i]["IdLote"].ToString(),
                                IdDocumento       = dsDetaLote.Tables[0].Rows[i]["IdDocumento"].ToString(),
                                cItem             = dsDetaLote.Tables[0].Rows[i]["cItem"].ToString(),
                                IdSocio           = dsDetaLote.Tables[0].Rows[i]["IdSocio"].ToString(),
                                IdSocio_Dsc       = dsDetaLote.Tables[0].Rows[i]["IdSocio_Dsc"].ToString(),
                                vDocumento        = dsDetaLote.Tables[0].Rows[i]["vDocumento"].ToString(),
                                cNumDoc           = dsDetaLote.Tables[0].Rows[i]["cNumDoc"].ToString(),
                                nvNominal         = Decimal.Parse(dsDetaLote.Tables[0].Rows[i]["nvNominal"].ToString()),
                                IdPagadora        = dsDetaLote.Tables[0].Rows[i]["IdPagadora"].ToString(),
                                IdPagadora_Dsc    = dsDetaLote.Tables[0].Rows[i]["IdPagadora_Dsc"].ToString(),
                                nvImporte         = Decimal.Parse(dsDetaLote.Tables[0].Rows[i]["nvImporte"].ToString()),
                                nvNegociable      = Decimal.Parse(dsDetaLote.Tables[0].Rows[i]["nvNegociable"].ToString()),
                                nvMontoCobrar     = Decimal.Parse(dsDetaLote.Tables[0].Rows[i]["nvMontoCobrar"].ToString()),
                                sdRecepcion       = DateTime.Parse(dsDetaLote.Tables[0].Rows[i]["sdRecepcion"].ToString()),
                                sdVencimiento     = DateTime.Parse(dsDetaLote.Tables[0].Rows[i]["sdVencimiento"].ToString()),
                                nTazaActiva       = decimal.Parse(dsDetaLote.Tables[0].Rows[i]["nTazaActiva"].ToString()),
                                nPorFondoGarantia = decimal.Parse(dsDetaLote.Tables[0].Rows[i]["nPorFondoGarantia"].ToString()),
                                nDias             = Convert.ToInt32((DateTime.Parse(dsDetaLote.Tables[0].Rows[i]["sdVencimiento"].ToString()) - DateTime.Parse(dsDetaLote.Tables[0].Rows[i]["sdRecepcion"].ToString())).TotalDays),
                                DifCobrada        = Decimal.Parse(dsDetaLote.Tables[0].Rows[i]["DifCobrada"].ToString()),
                                DiasMora          = int.Parse(dsDetaLote.Tables[0].Rows[i]["DiasMora"].ToString()),
                                Interes           = Decimal.Parse(dsDetaLote.Tables[0].Rows[i]["Interes"].ToString()),
                                Garantia          = Decimal.Parse(dsDetaLote.Tables[0].Rows[i]["Garantia"].ToString()),
                            };
                            LstCobranzaDetalle.Add(oCobranzadetBE);
                        }
                        dgvDocumentos.DataSource = LstCobranzaDetalle;
                        TotalizarImporteDoc();
                    }

                    DataSet        dsCobranzaPago  = new DataSet();
                    CobranzaPagoBE oCobranzaPagoBE = new CobranzaPagoBE()
                    {
                        OPCION     = 1,
                        USUARIO    = General.General.GetCodigoUsuario,
                        IdCobranza = txtIdCobranza.Text,
                    };
                    dsCobranzaPago = new CobranzaPagoBL().ProcesarCobranzaPago(oCobranzaPagoBE);

                    foreach (DataRow row in dsCobranzaPago.Tables[0].Rows)
                    {
                        CobranzaPagoBE oEntity = new CobranzaPagoBE()
                        {
                            IdCobranza         = row["IdCobranza"].ToString(),
                            socioBancoID       = row["socioBancoID"].ToString(),
                            ctasBancariaID     = row["ctasBancariaID"].ToString(),
                            ctasBanNumCta      = row["ctasBanNumCta"].ToString(),
                            jImporte           = string.IsNullOrEmpty(row["jImporte"].ToString()) ? 0 : decimal.Parse(row["jImporte"].ToString()),
                            jSaldo             = string.IsNullOrEmpty(row["jSaldo"].ToString()) ? 0 : decimal.Parse(row["jSaldo"].ToString()),
                            nTotal             = string.IsNullOrEmpty(row["nTotal"].ToString()) ? 0 : decimal.Parse(row["nTotal"].ToString()),
                            IdOperacion_tt     = row["IdOperacion_tt"].ToString(),
                            IdOperacion_tt_Dsc = row["IdOperacion_tt_Dsc"].ToString(),
                            IdTipoAbono_tt     = row["IdTipoAbono_tt"].ToString(),
                            IdTipoAbono_tt_Dsc = row["IdTipoAbono_tt_Dsc"].ToString(),
                        };
                        LstCobranzaPago.Add(oEntity);
                        dgvDepositos.DataSource = LstCobranzaPago;
                    }

                    TotalizarDepositos();
                    TotalizarImporteDoc();
                }
                else
                {
                    MessageBox.Show("Este .... no Existe", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                // Obtener la variable general de validación
                TableBaseBE oEntityTable = new TableBaseBE();
                oEntityTable.OPCION   = 1;
                oEntityTable.USUARIO  = General.General.GetUsuario;
                oEntityTable.Table_Id = "01175"; //Porcentaje Validacion Cobranzas
                DataSet ds = new TableBaseBL().ProcesarTableBase(oEntityTable);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    PrjLimiteVal = decimal.Parse(ds.Tables[0].Rows[0]["Table_Value"].ToString());
                }

                TotalizarDepositos();
                TotalizarImporteDoc();
                Decimal Total          = string.IsNullOrEmpty(lblSaltoXAplicar.Text) ? 0 : Convert.ToDecimal(lblSaltoXAplicar.Text);
                Decimal AcImporteTotal = string.IsNullOrEmpty(txtTotalImp.Text) ? 0 : Convert.ToDecimal(txtTotalImp.Text);

                //if (AcImporteTotal != Total)
                //{
                //    MessageBox.Show("La distribución del depósito debe ser igual que el importe del depósito", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                //    return;
                //}

                //Validacion, el monto a cancelar no debe ser menor igual del 90%
                Decimal AcnvImporte   = 0;
                Decimal AcMontoCobrar = 0;
                Decimal nMontoCobrar  = 0;
                Decimal nDifCobrada   = 0;

                bool IsError = false;
                foreach (DataGridViewRow row in dgvDocumentos.Rows)
                {
                    AcnvImporte   = AcnvImporte + (Decimal)row.Cells["nvImporte"].Value;
                    AcMontoCobrar = AcMontoCobrar + (Decimal)row.Cells["nvMontoCobrar"].Value;

                    nMontoCobrar = (Decimal)row.Cells["nvMontoCobrar"].Value;
                    nDifCobrada  = (Decimal)row.Cells["DifCobrada"].Value;
                    nDifCobrada  = Math.Abs(nDifCobrada);

                    //if (PrjLimiteVal > 0)
                    //{
                    //if (((AcnvImporte / AcMontoCobrar) * 100) < PrjLimiteVal)
                    //{
                    //    IsError = true;
                    //    break;
                    //}

                    // Modif 20190708
                    if (((nDifCobrada / nMontoCobrar) * 100) > PrjLimiteVal)
                    {
                        IsError = true;
                        break;
                    }
                    //}
                }

                if (IsError)
                {
                    MessageBox.Show("El importe a cancelar excede el " + PrjLimiteVal.ToString() + "% de lo permitido, por favor verifique.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    //MessageBox.Show("El importe a cancelar es mayor al 10% de lo permitido, por favor verifique.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }


                if (dtRegistro.Value == DateTime.MinValue)
                {
                    MessageBox.Show("Se debe ingresar una fecha", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                //Comentado por Rq. 20181012 para los previos se puede crear cobranzas con fecha futura pero al confirmar validar que la fecha sea igual al del día
                //if (dtRegistro.Value > DateTime.Now)
                //{
                //    MessageBox.Show("La fecha de cancelación no puede ser mayor a la fecha actual", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                //    return;
                //}

                CobranzaBE CobranzaBE = new CobranzaBE()
                {
                    USUARIO           = General.General.GetCodigoUsuario,
                    OPCION            = 2,
                    IdCobranza        = txtIdCobranza.Text,
                    dtValuta          = dtRegistro.Value,
                    dtRegistro        = General.General.gFechaOp,                                                                //dtRegistro.Value,
                    IdTipoCobranza_tt = "00056",                                                                                 //Cobranza por Socio
                    IdMoneda_tt       = cboIdMoneda_tt.SelectedValue.ToString(),
                    nTotal            = String.IsNullOrEmpty(txtTotalImp.Text.Trim()) ? 0 : Convert.ToDecimal(txtTotalImp.Text), //lblSaltoXAplicar
                    DatosAdicionales  = txtDatosAdicionales.Text,
                };

                DataSet dsCobranza = new DataSet();
                dsCobranza = CobranzaBL.ProcesarCobranza(CobranzaBE);

                if (dsCobranza.Tables[0].Rows.Count > 0)
                {
                    this.txtIdCobranza.Text = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString();
                    CobranzaDetalleBE oCobranzaDetBE = new CobranzaDetalleBE()
                    {
                        USUARIO    = General.General.GetCodigoUsuario,
                        OPCION     = 3,
                        IdCobranza = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString(),
                        sdFechaOp  = General.General.gFechaOp
                    };
                    CobranzaDetalleBL.ProcesarCobranzaDetalle(oCobranzaDetBE);

                    /* Documentos */
                    foreach (var item in LstCobranzaDetalle)
                    {
                        item.USUARIO    = General.General.GetCodigoUsuario;
                        item.OPCION     = 2;
                        item.IdSocio    = txtIdSocio.Text;
                        item.IdCobranza = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString();
                        item.nvImporte  = item.nvImporte;
                        item.sdFechaOp  = General.General.gFechaOp;
                        item.IdLote     = item.IdLote;
                        item.cItem      = item.cItem;
                        CobranzaDetalleBL.ProcesarCobranzaDetalle(item);
                    }

                    /* Depositos */
                    CobranzaPagoBE CobranzaPagoBE = new CobranzaPagoBE()
                    {
                        USUARIO    = General.General.GetCodigoUsuario,
                        OPCION     = 3,
                        IdCobranza = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString(),
                    };
                    new CobranzaPagoBL().ProcesarCobranzaPago(CobranzaPagoBE);

                    foreach (CobranzaPagoBE oEntity in LstCobranzaPago)
                    {
                        oEntity.USUARIO    = General.General.GetCodigoUsuario;
                        oEntity.OPCION     = 2;
                        oEntity.IdCobranza = dsCobranza.Tables[0].Rows[0]["IdCobranza"].ToString();
                        new CobranzaPagoBL().ProcesarCobranzaPago(oEntity);
                    }
                }

                this.btnImprimir.PerformClick();
                MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
예제 #7
0
 public DataSet ProcesarCobranzaPago(CobranzaPagoBE BE)
 {
     return(CobranzaPagoDA.ProcesarCobranzaPago(BE));
 }