Esempio n. 1
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(lblSaltoXAplicar.Text))
                {
                    MessageBox.Show("Debe seleccionar un depósito", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                Decimal Total          = string.IsNullOrEmpty(lblSaltoXAplicar.Text) ? 0 : Convert.ToDecimal(lblSaltoXAplicar.Text);
                Decimal AcImporteTotal = string.IsNullOrEmpty(txtTotal.Text) ? 0 : Convert.ToDecimal(txtTotal.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;
                }

                /* Grabar Depositos */
                RenovacionPagoBE RenovacionPagoBE = new RenovacionPagoBE()
                {
                    USUARIO      = General.General.GetCodigoUsuario,
                    OPCION       = 3,
                    IdRenovacion = txtdtRenovacion.Text,
                };
                new RenovacionPagoBL().ProcesarRenovacionPago(RenovacionPagoBE);

                foreach (RenovacionPagoBE oEntity in LstRenovacionPago)
                {
                    oEntity.USUARIO      = General.General.GetCodigoUsuario;
                    oEntity.OPCION       = 2;
                    oEntity.IdRenovacion = txtIdRenovacion.Text;
                    new RenovacionPagoBL().ProcesarRenovacionPago(oEntity);
                }
                //General.General.gFechaOp

                RenovacionBE RenovacionBE = new RenovacionBE()
                {
                    USUARIO      = General.General.GetCodigoUsuario,
                    gSesionID    = General.General.gSesionID,
                    gPlazaID     = General.General.gPlazaID,
                    gFechaOp     = General.General.gFechaOp,
                    OPCION       = 4,
                    IdRenovacion = txtIdRenovacion.Text,
                };

                DataSet dsRenovacion = new DataSet();
                dsRenovacion = RenovacionBL.ProcesarRenovacion(RenovacionBE);

                Imprimir();
                MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        public DataSet ProcesarRenovacionPago(RenovacionPagoBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("RenovacionPago_Mnt");
                db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION);
                db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                db.AddInParameter(cmd, "IdRenovacion", DbType.String, BE.IdRenovacion);
                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);
        }
Esempio n. 3
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);
            }
        }
Esempio n. 4
0
        private void CargarDatos()
        {
            try
            {
                DataSet      dsRenovacion = new DataSet();
                RenovacionBE RenovacionBE = new RenovacionBE()
                {
                    OPCION       = 1,
                    USUARIO      = General.General.GetCodigoUsuario,
                    gSesionID    = General.General.gSesionID,
                    gPlazaID     = General.General.gPlazaID,
                    gFechaOp     = General.General.gFechaOp,
                    IdRenovacion = txtIdRenovacion.Text.Trim()
                };

                dsRenovacion = RenovacionBL.ProcesarRenovacion(RenovacionBE);

                if (dsRenovacion.Tables[0].Rows.Count > 0)
                {
                    string IdEstado_tt = dsRenovacion.Tables[0].Rows[0]["IdEstado_tt"].ToString();
                    cboIdMoneda_tt.SelectedValue = dsRenovacion.Tables[0].Rows[0]["IdMoneda_tt"].ToString();
                    txtdtRenovacion.Text         = dsRenovacion.Tables[0].Rows[0]["dtRenovacion"].ToString();
                    txtIdEntidad.Text            = dsRenovacion.Tables[0].Rows[0]["Entidad_Id"].ToString();
                    txtIdEntidad_Dsc.Text        = dsRenovacion.Tables[0].Rows[0]["Entidad"].ToString();
                    TipoRenovacion = dsRenovacion.Tables[0].Rows[0]["TipoRenovacion"].ToString();

                    if (TipoRenovacion == "S")
                    {
                        @IdsocioB = txtIdEntidad.Text.Trim();
                        cboTipoDeposito.Enabled = true;
                    }
                    else
                    {
                        cboTipoDeposito.Enabled = false;
                    }

                    DataSet         dsDet           = new DataSet();
                    RenovacionDetBE RenovacionDetBE = new RenovacionDetBE()
                    {
                        OPCION       = 1,
                        USUARIO      = General.General.GetCodigoUsuario,
                        gSesionID    = General.General.gSesionID,
                        gPlazaID     = General.General.gPlazaID,
                        gFechaOp     = General.General.gFechaOp,
                        IdRenovacion = txtIdRenovacion.Text,
                    };
                    dsDet = RenovacionDetBL.ProcesarRenovacionDet(RenovacionDetBE);
                    if (dsDet.Tables[0].Rows.Count > 0)
                    {
                        for (int i = 0; i < dsDet.Tables[0].Rows.Count; i++)
                        {
                            RenovacionDetBE oRenovacionDetBE = new RenovacionDetBE()
                            {
                                IdRenovacion       = dsDet.Tables[0].Rows[i]["IdRenovacion"].ToString(),
                                IdEntidad          = dsDet.Tables[0].Rows[i]["IdEntidad"].ToString(),
                                IdEntidad_Dsc      = dsDet.Tables[0].Rows[i]["IdEntidad_Dsc"].ToString(),
                                IdLote             = dsDet.Tables[0].Rows[i]["IdLote"].ToString(),
                                cItem              = dsDet.Tables[0].Rows[i]["cItem"].ToString(),
                                IdDocumento        = dsDet.Tables[0].Rows[i]["IdDocumento"].ToString(),
                                cNumDoc            = dsDet.Tables[0].Rows[i]["cNumDoc"].ToString(),
                                IdPagadora         = dsDet.Tables[0].Rows[i]["IdPagadora"].ToString(),
                                IdSocio            = dsDet.Tables[0].Rows[i]["IdSocio"].ToString(),
                                sdVencimiento      = !string.IsNullOrEmpty(dsDet.Tables[0].Rows[i]["sdVencimiento"].ToString()) ? DateTime.Parse(dsDet.Tables[0].Rows[i]["sdVencimiento"].ToString()) : DateTime.MinValue,
                                iVencimiento       = int.Parse(dsDet.Tables[0].Rows[i]["iVencimiento"].ToString()),
                                nvNominal          = Decimal.Parse(dsDet.Tables[0].Rows[i]["nvNominal"].ToString()),
                                nPorAmortizacion   = Decimal.Parse(dsDet.Tables[0].Rows[i]["nPorAmortizacion"].ToString()),
                                nvImporteAm        = Decimal.Parse(dsDet.Tables[0].Rows[i]["nvImporteAm"].ToString()),
                                nvImporteN         = !string.IsNullOrEmpty(dsDet.Tables[0].Rows[i]["nvImporteN"].ToString()) ? decimal.Parse(dsDet.Tables[0].Rows[i]["nvImporteN"].ToString()) : 0,
                                iPlazoVencimientoN = int.Parse(dsDet.Tables[0].Rows[i]["iPlazoVencimientoN"].ToString()),
                                sdVencimientoN     = !string.IsNullOrEmpty(dsDet.Tables[0].Rows[i]["sdVencimientoN"].ToString()) ? DateTime.Parse(dsDet.Tables[0].Rows[i]["sdVencimientoN"].ToString()) : DateTime.MinValue,
                                nPorTEA            = !string.IsNullOrEmpty(dsDet.Tables[0].Rows[i]["nPorTEA"].ToString()) ? decimal.Parse(dsDet.Tables[0].Rows[i]["nPorTEA"].ToString()) : 0,
                                nGastosAdm         = !string.IsNullOrEmpty(dsDet.Tables[0].Rows[i]["nGastosAdm"].ToString()) ? decimal.Parse(dsDet.Tables[0].Rows[i]["nGastosAdm"].ToString()) : 0,
                                nGastosReno        = !string.IsNullOrEmpty(dsDet.Tables[0].Rows[i]["nGastosReno"].ToString()) ? decimal.Parse(dsDet.Tables[0].Rows[i]["nGastosReno"].ToString()) : 0,
                                nInteresVencidos   = Double.Parse(dsDet.Tables[0].Rows[i]["nInteresVencidos"].ToString()),
                                nInteresReno       = Double.Parse(dsDet.Tables[0].Rows[i]["nInteresReno"].ToString()),
                                nImporte           = !string.IsNullOrEmpty(dsDet.Tables[0].Rows[i]["nImporte"].ToString()) ? decimal.Parse(dsDet.Tables[0].Rows[i]["nImporte"].ToString()) : 0,
                                IdEstado_tt        = dsDet.Tables[0].Rows[i]["IdEstado_tt"].ToString(),
                            };
                            LstRenovacionDet.Add(oRenovacionDetBE);
                        }
                        dgvRenovacionDet.DataSource = LstRenovacionDet;
                        Totalizar();
                    }

                    DataSet          dsRenovacionPago  = new DataSet();
                    RenovacionPagoBE oRenovacionPagoBE = new RenovacionPagoBE()
                    {
                        OPCION       = 1,
                        USUARIO      = General.General.GetCodigoUsuario,
                        IdRenovacion = txtIdRenovacion.Text,
                    };
                    dsRenovacionPago = new RenovacionPagoBL().ProcesarRenovacionPago(oRenovacionPagoBE);

                    foreach (DataRow row in dsRenovacionPago.Tables[0].Rows)
                    {
                        RenovacionPagoBE oEntity = new RenovacionPagoBE()
                        {
                            IdRenovacion       = row["IdRenovacion"].ToString(),
                            socioBancoID       = row["socioBancoID"].ToString(),
                            ctasBancariaID     = row["ctasBancariaID"].ToString(),
                            ctasBanNumCta      = row["ctasBanNumCta"].ToString(),
                            nTotal             = 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(),
                        };
                        LstRenovacionPago.Add(oEntity);
                        dgvDepositos.DataSource = LstRenovacionPago;
                    }
                    TotalizarDepositos();
                    if (IdEstado_tt != "00111") //Aprobado
                    {
                        btnBuscarPagadora.Enabled    = false;
                        btnDepositosXAplicar.Enabled = false;
                        btnQuitarDepositos.Enabled   = false;
                        btnAceptar.Enabled           = false;
                    }

                    if (IdEstado_tt == "00112") //Renovado
                    {
                        btnImprimir.Visible = true;
                    }
                }
                else
                {
                    MessageBox.Show("Este Grupo no existe", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Esempio n. 5
0
        private void btnDepositosXAplicar_Click_1(object sender, EventArgs e)
        {
            try
            {
                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;
                BindingList <RenovacionPagoBE> lstRetBus = new BindingList <RenovacionPagoBE>();
                if (cboTipoDeposito.SelectedIndex == 0)
                {
                    Formula.Cobranza.frmDespositosXAplicar ofrmDespositosXAplicar = new Formula.Cobranza.frmDespositosXAplicar();
                    ofrmDespositosXAplicar._IdPagadora     = txtIdEntidad.Text;
                    ofrmDespositosXAplicar._IdSocio        = txtIdEntidad.Text;
                    ofrmDespositosXAplicar._Opcion         = TipoRenovacion.Equals("P")? 1 : 2;
                    ofrmDespositosXAplicar._pvalorMonedaID = iMonedaID;
                    ofrmDespositosXAplicar._FlgOrigen      = "R";
                    ofrmDespositosXAplicar.ShowDialog();
                    if (ofrmDespositosXAplicar.LstTmpRenovacionPago != null && ofrmDespositosXAplicar.LstTmpRenovacionPago.Count > 0)
                    {
                        lstRetBus = ofrmDespositosXAplicar.LstTmpRenovacionPago;
                    }
                }
                else
                {
                    EfideFactoring.Formula.Consulta.frmBusquedaCtaAhorros frmBusAho = new EfideFactoring.Formula.Consulta.frmBusquedaCtaAhorros(2, 1, 1, @IdsocioB, null, iMonedaID);
                    frmBusAho.ShowDialog();
                    if (frmBusAho.fbcsNumCuentaID != null && frmBusAho.fbcsNumCuentaID.Trim().Length >= 15)
                    {
                        RenovacionPagoBE oEntity = new RenovacionPagoBE()
                        {
                            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 (RenovacionPagoBE oRenovacionPagoTmpBE in lstRetBus)
                {
                    bExiste = false;
                    foreach (RenovacionPagoBE ooRenovacionPagoBE in LstRenovacionPago)
                    {
                        if (oRenovacionPagoTmpBE.socioBancoID == ooRenovacionPagoBE.socioBancoID)
                        {
                            bExiste = true;
                            break;
                        }
                    }

                    if (!bExiste)
                    {
                        LstRenovacionPago.Add(oRenovacionPagoTmpBE);
                        dgvDepositos.DataSource = LstRenovacionPago;
                        dgvDepositos.Refresh();
                    }
                }

                TotalizarDepositos();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public DataSet ProcesarRenovacionPago(RenovacionPagoBE BE)
 {
     return(RenovacionPagoDA.ProcesarRenovacionPago(BE));
 }