Ejemplo n.º 1
0
        private void AnularAprobacion()
        {
            try
            {
                DialogResult dialogResult = 0;
                if (gvRenovacion.CurrentRow.Cells["IdEstado_tt"].Value.ToString() != "00111") //Aprobado
                {
                    MessageBox.Show("Este registro no se puede anular la aprobación", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                dialogResult = MessageBox.Show("Seguro de anular el registro Nro. " + gvRenovacion.CurrentRow.Cells["IdRenovacion"].Value.ToString().Trim(), "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (dialogResult == DialogResult.Yes)
                {
                    RenovacionBE RenovacionBE = new RenovacionBE()
                    {
                        OPCION       = 3,
                        USUARIO      = General.General.GetUsuario,
                        gSesionID    = General.General.gSesionID,
                        gPlazaID     = General.General.gPlazaID,
                        gFechaOp     = General.General.gFechaOp,
                        IdRenovacion = gvRenovacion.CurrentRow.Cells["IdRenovacion"].Value.ToString(),
                        IdEstado_tt  = "00113", //Anular
                    };

                    RenovacionBL.ProcesarRenovacion(RenovacionBE);
                    MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    btnBuscar.PerformClick();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void cargarRenovacion(string idRenovacion)
        {
            RenovacionBE oRenovacionBE = new RenovacionBE();

            this.Invoke((MethodInvoker) delegate
            {
                oRenovacionBE = oRenovacionBL.getRenovacion(idRenovacion);
                cargarAdeudo(oRenovacionBE.idAdeudo);
                cboTipoRenovacion.SelectedValue = oRenovacionBE.idTipoRenovacion;

                if (oRenovacionBE.porcenImporte > 0)
                {
                    txtPorcenImporte.Text = Convert.ToString(oRenovacionBE.porcenImporte);
                }

                txtTasaInversionNew.Text = Convert.ToString(oRenovacionBE.tasa);
                txtTasaRescisionNew.Text = Convert.ToString(oRenovacionBE.tasaRescision);
                cboPlazoNew.Text         = Convert.ToString(oRenovacionBE.plazo);
                cboPlazoMinimoNew.Text   = Convert.ToString(oRenovacionBE.plazoRescision);

                if (Convert.ToString(cboTipoRenovacion.SelectedValue) == "1")
                {
                    txtImporteInversionNew.Text = txtImporteInversion.Text;
                }
                else
                {
                    txtImporteInversionNew.Text = txtTotalCobrar.Text;
                }
            });
        }
Ejemplo n.º 3
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         RenovacionBE RenovacionBE = new RenovacionBE()
         {
             USUARIO      = General.General.GetCodigoUsuario,
             OPCION       = 1,
             gSesionID    = General.General.gSesionID,
             gPlazaID     = General.General.gPlazaID,
             gFechaOp     = General.General.gFechaOp,
             dtRegistro   = dtRegistro.Value,
             dtRenovacion = dtRenovacion.Value,
             IdMoneda_tt  = cboIdMoneda_tt.SelectedValue.ToString(),
             IdEstado_tt  = cboIdEstado_tt.SelectedValue.ToString(),
             IdSocio      = txtIdSocio.Text,
             IdPagadora   = txtIdPagadora.Text
         };
         DataSet dsRenovacion;
         dsRenovacion            = RenovacionBL.ProcesarRenovacion(RenovacionBE);
         gvRenovacion.DataSource = dsRenovacion.Tables[0];
         lblRegistros.Text       = dsRenovacion.Tables[0].Rows.Count + " registro(s)";
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Ejemplo n.º 4
0
        public void listRenovacion()
        {
            List <RenovacionBE> lstRenovacionBE = new List <RenovacionBE>();
            RenovacionBE        oRenovacionBE   = null;

            this.Invoke((MethodInvoker) delegate
            {
                if (!string.IsNullOrEmpty(txtCodigo.Text))
                {
                    txtCodigo.Text = txtCodigo.Text.PadLeft(10, '0');
                }

                oRenovacionBE = new RenovacionBE()
                {
                    idRenovacion = txtCodigo.Text,
                    oInversionBE = new InversionBE()
                    {
                        idTipoInversion         = cboTipoInversion.SelectedValue.ToString(),
                        idTipoEntidadFinanciera = Convert.ToInt32(cboTipoEntidadFinanciera.SelectedValue),
                        idEntidadFinanciera     = Convert.ToString(cboBanco.SelectedValue),
                        idMoneda = Convert.ToInt32(cboMoneda.SelectedValue)
                    },
                    idEstado         = Convert.ToString(cboEstado.SelectedValue),
                    idTipoRenovacion = Convert.ToInt32(cboTipoRenovacion.SelectedValue)
                };

                if (chkFiltroFecha.Checked)
                {
                    if (cboTipoFecha.SelectedIndex == Convert.ToInt32(TipoFecha.fechaInicio))
                    {
                        if (!string.IsNullOrEmpty(dtpInicio.Text))
                        {
                            oRenovacionBE.iniciofechaInicio = Convert.ToDateTime(dtpInicio.Text);
                        }
                        if (!string.IsNullOrEmpty(dtpFin.Text))
                        {
                            oRenovacionBE.finfechaInicio = Convert.ToDateTime(dtpFin.Text);
                        }
                    }
                    else
                    {
                        if (!string.IsNullOrEmpty(dtpInicio.Text))
                        {
                            oRenovacionBE.iniciofechaVencimiento = Convert.ToDateTime(dtpInicio.Text);
                        }
                        if (!string.IsNullOrEmpty(dtpFin.Text))
                        {
                            oRenovacionBE.finfechaVencimiento = Convert.ToDateTime(dtpFin.Text);
                        }
                    }
                }
            });

            lstRenovacionBE = oRenovacionBL.listRenovacion(oRenovacionBE);

            this.Invoke((MethodInvoker) delegate
            {
                dgvRenovacion.DataSource = lstRenovacionBE;
            });
        }
Ejemplo n.º 5
0
        public RenovacionBE getRenovacion(string idRenovacion)
        {
            RenovacionBE oRenovacionBE = null;
            IDataReader  dr            = null;

            try
            {
                using (DbCommand cmd = dbAdeudosInversiones.GetStoredProcCommand(GetNameStoreProcedure.uspGetRenovacion))
                {
                    //cmd.CommandTimeout = 0;
                    dbAdeudosInversiones.AddInParameter(cmd, "idRenovacion", DbType.String, idRenovacion);

                    dr = dbAdeudosInversiones.ExecuteReader(cmd);

                    while (dr.Read())
                    {
                        oRenovacionBE = RenovacionP.getRenovacion(dr);
                    }
                }
            }
            catch (Exception)
            {
                if (dr != null && !dr.IsClosed)
                {
                    dr.Close();
                }
                throw;
            }

            return(oRenovacionBE);
        }
Ejemplo n.º 6
0
        public string insertRenovacion(RenovacionBE pRenovacionBE)
        {
            string idRenovacion = string.Empty;

            using (DbCommand cmd = dbAdeudosInversiones.GetStoredProcCommand(GetNameStoreProcedure.uspInsertRenovacion))
            {
                //cmd.CommandTimeout = 0;
                dbAdeudosInversiones.AddInParameter(cmd, "idAdeudo", DbType.String, pRenovacionBE.idAdeudo);
                dbAdeudosInversiones.AddInParameter(cmd, "tasa", DbType.Decimal, pRenovacionBE.tasa);
                dbAdeudosInversiones.AddInParameter(cmd, "plazo", DbType.Decimal, pRenovacionBE.plazo);
                dbAdeudosInversiones.AddInParameter(cmd, "idTipoRenovacion", DbType.String, pRenovacionBE.idTipoRenovacion);
                dbAdeudosInversiones.AddInParameter(cmd, "porcentaje", DbType.Decimal, pRenovacionBE.porcenImporte);
                dbAdeudosInversiones.AddInParameter(cmd, "tasaRescision", DbType.Decimal, pRenovacionBE.tasaRescision);
                dbAdeudosInversiones.AddInParameter(cmd, "plazoMinimo", DbType.Decimal, pRenovacionBE.plazoRescision);

                dbAdeudosInversiones.AddInParameter(cmd, "fechaRenovacion", DbType.DateTime, pRenovacionBE.fechaRenovacion);

                dbAdeudosInversiones.AddInParameter(cmd, "idEstado", DbType.String, pRenovacionBE.idEstado);
                dbAdeudosInversiones.AddInParameter(cmd, "usuCreacion", DbType.String, pRenovacionBE.usuCreacion);
                dbAdeudosInversiones.AddOutParameter(cmd, "idRenovacion", DbType.String, 10);

                dbAdeudosInversiones.ExecuteNonQuery(cmd);

                if (dbAdeudosInversiones.GetParameterValue(cmd, "idRenovacion") != DBNull.Value)
                {
                    idRenovacion = dbAdeudosInversiones.GetParameterValue(cmd, "idRenovacion").ToString();
                }

                return(idRenovacion);
            }
        }
Ejemplo n.º 7
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);
            }
        }
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                if (!ValidadDatos())
                {
                    return;
                }
                RenovacionBE RenovacionBE = new RenovacionBE()
                {
                    USUARIO        = General.General.GetCodigoUsuario,
                    OPCION         = 2,
                    gSesionID      = General.General.gSesionID,
                    gPlazaID       = General.General.gPlazaID,
                    gFechaOp       = General.General.gFechaOp,
                    IdRenovacion   = txtIdRenovacion.Text,
                    dtRenovacion   = dtRenovacion.Value,
                    IdMoneda_tt    = cboIdMoneda_tt.SelectedValue.ToString(),
                    TipoRenovacion = Tipo
                };

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

                if (dsRenovacion.Tables[0].Rows.Count > 0)
                {
                    this.txtIdRenovacion.Text = dsRenovacion.Tables[0].Rows[0]["IdRenovacion"].ToString();

                    /* Deshabilita los registros */
                    RenovacionDetBE oRenovacionDetBE = new RenovacionDetBE()
                    {
                        USUARIO      = General.General.GetCodigoUsuario,
                        OPCION       = 3,
                        IdRenovacion = txtIdRenovacion.Text
                    };
                    RenovacionDetBL.ProcesarRenovacionDet(oRenovacionDetBE);

                    /* Documentos */
                    foreach (var item in LstRenovacionDet)
                    {
                        item.USUARIO      = General.General.GetCodigoUsuario;
                        item.OPCION       = 2;
                        item.IdRenovacion = txtIdRenovacion.Text;
                        item.IdEstado_tt  = "00110"; //Pendiente
                        item.IdPagadora   = Tipo.Equals("P") ? txtIdPagadora.Text : item.IdEntidad;
                        item.IdSocio      = Tipo.Equals("S") ? txtIdSocio.Text : item.IdEntidad;
                        RenovacionDetBL.ProcesarRenovacionDet(item);
                    }
                }
                MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void saveConfirmacion()
        {
            this.Invoke((MethodInvoker) delegate
            {
                string idAdeudoNew         = "";
                RenovacionBE oRenovacionBE = new RenovacionBE();
                ContactoBE oContactoBE     = new ContactoBE();
                oRenovacionBE = oRenovacionBL.getRenovacion(idRenovacion);

                oRenovacionBE.idEstado              = Util.EstadoInversion.Aplicada;
                oRenovacionBE.usuUltActualizacion   = General.GetCodigoUsuario;
                oRenovacionBE.fechaUltActualizacion = Util.General.GetFechaGlobal;
                oRenovacionBL.updateRenovacion(oRenovacionBE);

                AdeudoBE oAdeudoBE = new AdeudoBE();
                oAdeudoBE          = oAdeudoBL.getAdeudo(oRenovacionBE.idAdeudo, Util.General.GetFechaGlobal);

                oAdeudoBE.idEstado              = Util.EstadoInversion.Renovado;
                oAdeudoBE.usuUltActualizacion   = General.GetCodigoUsuario;
                oAdeudoBE.fechaUltActualizacion = Util.General.GetFechaGlobal;
                oAdeudoBL.updateAdeudo(oAdeudoBE);

                oAdeudoBE.plazo              = Convert.ToInt32(cboPlazoNew.Text);
                oAdeudoBE.plazoRescision     = Convert.ToInt32(cboPlazoMinimoNew.Text);
                oAdeudoBE.tasa               = Convert.ToDecimal(txtTasaInversionNew.Text);
                oAdeudoBE.tasaRescision      = Convert.ToDecimal(txtTasaRescisionNew.Text);
                oAdeudoBE.importe            = Convert.ToDecimal(txtImporteInversionNew.Text);
                oAdeudoBE.idEstado           = Util.EstadoInversion.Registrado; //registrado
                oAdeudoBE.IdAdeudoRenovacion = oRenovacionBE.idAdeudo;
                oAdeudoBE.usuCreacion        = General.GetCodigoUsuario;
                oAdeudoBE.fechaCreacion      = Util.General.GetFechaGlobal;
                oAdeudoBE.fechaInicio        = Util.General.GetFechaGlobal;
                oAdeudoBE.fechaVencimiento   = Util.General.GetFechaGlobal.AddDays(Convert.ToInt32(cboPlazo.Text));
                idAdeudoNew = oAdeudoBL.insertAdeudo(oAdeudoBE);

                oContactoBE          = oContactoBL.getContacto(oRenovacionBE.idAdeudo);
                oContactoBE.idAdeudo = idAdeudoNew;
                oContactoBL.insertContato(oContactoBE);

                ucMsgBox1.ShowMessageSuccess("Se renovó satisfactoriamente le inversión");
            });
        }
Ejemplo n.º 10
0
        public DataSet ProcesarRenovacion(RenovacionBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("Renovacion_Mnt");
                db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION);
                db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                db.AddInParameter(cmd, "gSesionID", DbType.String, BE.gSesionID);
                db.AddInParameter(cmd, "gPlazaID", DbType.String, BE.gPlazaID);
                if (BE.gFechaOp != DateTime.MinValue || BE.gFechaOp != null)
                {
                    db.AddInParameter(cmd, "gFechaOp", DbType.DateTime, BE.gFechaOp);
                }
                db.AddInParameter(cmd, "IdRenovacion", DbType.String, BE.IdRenovacion);
                if (BE.dtRenovacion != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "dtRenovacion", DbType.DateTime, BE.dtRenovacion);
                }
                if (BE.dtRegistro != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "dtRegistro", DbType.DateTime, BE.dtRegistro);
                }
                db.AddInParameter(cmd, "IdMoneda_tt", DbType.String, BE.IdMoneda_tt);
                db.AddInParameter(cmd, "TipoRenovacion", DbType.String, BE.TipoRenovacion);
                db.AddInParameter(cmd, "CtasBancariasID", DbType.String, BE.CtasBancariasID);
                db.AddInParameter(cmd, "IdOperacion_tt", DbType.String, BE.IdOperacion_tt);
                db.AddInParameter(cmd, "IdTipoAbono_tt", DbType.String, BE.IdTipoAbono_tt);
                db.AddInParameter(cmd, "socioBancoID", DbType.String, BE.socioBancoID);
                db.AddInParameter(cmd, "IdSocio", DbType.String, BE.IdSocio);
                db.AddInParameter(cmd, "IdPagadora", DbType.String, BE.IdPagadora);
                db.AddInParameter(cmd, "IdEstado_tt", DbType.String, BE.IdEstado_tt);
                dsResult = db.ExecuteDataSet(cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsResult);
        }
Ejemplo n.º 11
0
        private void cargarRenovacion(string idRenovacion)
        {
            RenovacionBE oRenovacionBE = new RenovacionBE();

            this.Invoke((MethodInvoker) delegate
            {
                oRenovacionBE = oRenovacionBL.getRenovacion(idRenovacion);
                cargarInversion(oRenovacionBE.idInversion);
                cboTipoRenovacion.SelectedValue = oRenovacionBE.idTipoRenovacion;

                if (oRenovacionBE.porcenImporte > 0)
                {
                    txtPorcenImporte.Text = Convert.ToString(oRenovacionBE.porcenImporte);
                }

                txtTasaInversionNew.Text = Convert.ToString(oRenovacionBE.tasa);
                txtTasaRescisionNew.Text = Convert.ToString(oRenovacionBE.tasaRescision);
                cboPlazoNew.Text         = Convert.ToString(oRenovacionBE.plazo);
                cboPlazoMinimoNew.Text   = Convert.ToString(oRenovacionBE.plazoRescision);
            });
        }
        private bool saveRenovacion(string pIdAdeudo)
        {
            if (string.IsNullOrEmpty(txtBusqueda.Text))
            {
                ucMsgBox1.ShowMessageWarnnig("Debe seleccionar una inversión para guardar la renovación");
                return(false);
            }

            this.Invoke((MethodInvoker) delegate
            {
                RenovacionBE oRenovacionBE = new RenovacionBE();

                oRenovacionBE.idAdeudo         = idAdeudo;
                oRenovacionBE.idTipoRenovacion = Convert.ToInt32(cboTipoRenovacion.SelectedValue);

                if (string.IsNullOrEmpty(txtPorcenImporte.Text))
                {
                    oRenovacionBE.porcenImporte = 0;
                }
                else
                {
                    oRenovacionBE.porcenImporte = Convert.ToDecimal(txtPorcenImporte.Text);
                }

                oRenovacionBE.plazo           = Convert.ToDecimal(cboPlazo.Text);
                oRenovacionBE.plazoRescision  = Convert.ToInt32(cboPlazoMinimoNew.Text);
                oRenovacionBE.tasa            = Convert.ToDecimal(txtTasaInversionNew.Text);
                oRenovacionBE.tasaRescision   = Convert.ToDecimal(txtTasaRescisionNew.Text);
                oRenovacionBE.idEstado        = Util.EstadoInversion.Registrado;
                oRenovacionBE.fechaRenovacion = Util.General.GetFechaGlobal;
                oRenovacionBE.usuCreacion     = General.GetCodigoUsuario;

                oRenovacionBL.insertRenovacion(oRenovacionBE);
                ucMsgBox1.ShowMessageSuccess("Se renovó satisfactoriamente le inversión");
            });

            return(true);
        }
Ejemplo n.º 13
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = 0;

            try
            {
                if (gvRenovacion.RowCount > 0)
                {
                    if (gvRenovacion.CurrentRow.Cells["IdEstado_tt"].Value.ToString() != "00110") //Pendiente
                    {
                        MessageBox.Show("Esta renovacion no se eliminar", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }
                    dialogResult = MessageBox.Show("Seguro de eliminar el registro Nro. " + gvRenovacion.CurrentRow.Cells["IdRenovacion"].Value.ToString().Trim(), "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                    if (dialogResult == DialogResult.Yes)
                    {
                        RenovacionBE RenovacionBE = new RenovacionBE()
                        {
                            OPCION       = 5,
                            USUARIO      = General.General.GetUsuario,
                            gSesionID    = General.General.gSesionID,
                            gPlazaID     = General.General.gPlazaID,
                            gFechaOp     = General.General.gFechaOp,
                            IdRenovacion = gvRenovacion.CurrentRow.Cells["IdRenovacion"].Value.ToString()
                        };

                        RenovacionBL.ProcesarRenovacion(RenovacionBE);
                        MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        btnBuscar.PerformClick();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 14
0
        public void updateRenovacion(RenovacionBE pRenovacionBE)
        {
            string idRenovacion = string.Empty;

            using (DbCommand cmd = dbAdeudosInversiones.GetStoredProcCommand(GetNameStoreProcedure.uspUpdateRenovacion))
            {
                //cmd.CommandTimeout = 0;
                dbAdeudosInversiones.AddInParameter(cmd, "idRenovacion", DbType.String, pRenovacionBE.idRenovacion);
                //dbAdeudosInversiones.AddInParameter(cmd, "idInversion", DbType.String, pRenovacionBE.idInversion);
                //dbAdeudosInversiones.AddInParameter(cmd, "tasa", DbType.Decimal, pRenovacionBE.tasa);
                //dbAdeudosInversiones.AddInParameter(cmd, "plazo", DbType.Decimal, pRenovacionBE.plazo);
                //dbAdeudosInversiones.AddInParameter(cmd, "idTipoRenovacion", DbType.String, pRenovacionBE.importe);
                //dbAdeudosInversiones.AddInParameter(cmd, "porcentaje", DbType.Decimal, pRenovacionBE.interes);
                //dbAdeudosInversiones.AddInParameter(cmd, "tasaRescision", DbType.Decimal, pRenovacionBE.ITF);
                //dbAdeudosInversiones.AddInParameter(cmd, "plazoMinimo", DbType.Decimal, pRenovacionBE.total);
                dbAdeudosInversiones.AddInParameter(cmd, "idEstado", DbType.String, pRenovacionBE.idEstado);
                //dbAdeudosInversiones.AddInParameter(cmd, "fechaRenovacion", DbType.DateTime, pRenovacionBE.fechaRenovacion);
                dbAdeudosInversiones.AddInParameter(cmd, "usuUltActualizacion", DbType.String, pRenovacionBE.usuUltActualizacion);
                dbAdeudosInversiones.AddInParameter(cmd, "fechaUltActualizacion", DbType.DateTime, pRenovacionBE.fechaUltActualizacion);

                dbAdeudosInversiones.ExecuteNonQuery(cmd);
            }
        }
Ejemplo n.º 15
0
 public void updateRenovacion(RenovacionBE pRenovacionBE)
 {
     oRenovacionDA.updateRenovacion(pRenovacionBE);
 }
Ejemplo n.º 16
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);
            }
        }
Ejemplo n.º 17
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();
                    dtRenovacion.Value           = !String.IsNullOrEmpty(dsRenovacion.Tables[0].Rows[0]["dtRenovacion"].ToString()) ? Convert.ToDateTime(dsRenovacion.Tables[0].Rows[0]["dtRenovacion"]) : Convert.ToDateTime("01/01/1900");
                    if (dsRenovacion.Tables[0].Rows[0]["TipoRenovacion"].ToString().Equals("P"))
                    {
                        rdbPagadora.Checked    = true;
                        txtIdPagadora.Text     = dsRenovacion.Tables[0].Rows[0]["Entidad_Id"].ToString();
                        txtIdPagadora_Dsc.Text = dsRenovacion.Tables[0].Rows[0]["Entidad"].ToString();
                    }
                    else
                    {
                        rdbSocio.Checked    = true;
                        txtIdSocio.Text     = dsRenovacion.Tables[0].Rows[0]["Entidad_Id"].ToString();
                        txtIdSocio_Dsc.Text = dsRenovacion.Tables[0].Rows[0]["Entidad"].ToString();
                    }

                    DataSet         dsDet           = new DataSet();
                    RenovacionDetBE RenovacionDetBE = new RenovacionDetBE()
                    {
                        OPCION       = 1,
                        USUARIO      = General.General.GetCodigoUsuario,
                        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()),
                                nvNegociable       = Decimal.Parse(dsDet.Tables[0].Rows[i]["nvNegociable"].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            = Decimal.Parse(dsDet.Tables[0].Rows[i]["nPorTEA"].ToString()),
                                nGastosAdm         = Decimal.Parse(dsDet.Tables[0].Rows[i]["nGastosAdm"].ToString()),
                                nGastosReno        = Decimal.Parse(dsDet.Tables[0].Rows[i]["nGastosReno"].ToString()),
                                nInteresVencidos   = Double.Parse(dsDet.Tables[0].Rows[i]["nInteresVencidos"].ToString()),
                                nInteresReno       = Double.Parse(dsDet.Tables[0].Rows[i]["nInteresReno"].ToString()),
                                nImporte           = Decimal.Parse(dsDet.Tables[0].Rows[i]["nImporte"].ToString()),
                                IdEstado_tt        = dsDet.Tables[0].Rows[i]["IdEstado_tt"].ToString(),
                                TEAOrigen          = Decimal.Parse(dsDet.Tables[0].Rows[i]["TEAOrigen"].ToString()),
                            };
                            LstRenovacionDet.Add(oRenovacionDetBE);
                        }
                        dgvRenovacionDet.DataSource = LstRenovacionDet;
                        Totalizar();
                    }

                    if (IdEstado_tt != "00110") //Pendiente
                    {
                        btnBusquedaPagadora.Enabled = false;
                        btnBusquedaSocio.Enabled    = false;
                        btnAgregar.Enabled          = false;
                        btnEliminar.Enabled         = false;
                        btnAceptar.Enabled          = false;
                    }
                }
                else
                {
                    MessageBox.Show("Este Grupo no existe", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 18
0
 public string insertRenovacion(RenovacionBE pRenovacionBE)
 {
     return(oRenovacionDA.insertRenovacion(pRenovacionBE));
 }
Ejemplo n.º 19
0
        public static RenovacionBE getRenovacion(IDataReader dr)
        {
            RenovacionBE oRenovacionBE = new RenovacionBE();

            oRenovacionBE.oInversionBE = new InversionBE();

            if (!dr.IsDBNull(dr.GetOrdinal("idRenovacion")))
            {
                oRenovacionBE.idRenovacion = dr.GetString(dr.GetOrdinal("idRenovacion"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("idInversion")))
            {
                oRenovacionBE.idInversion = dr.GetString(dr.GetOrdinal("idInversion"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("idTipoInversion")))
            {
                oRenovacionBE.idTipoInversion = dr.GetString(dr.GetOrdinal("idTipoInversion"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("nomTipoInversion")))
            {
                oRenovacionBE.nomTipoInversion = dr.GetString(dr.GetOrdinal("nomTipoInversion"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("idEntidadFinanciera")))
            {
                oRenovacionBE.idEntidadFinanciera = dr.GetString(dr.GetOrdinal("idEntidadFinanciera"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("nomEntidadFinanciera")))
            {
                oRenovacionBE.nomEntidadFinanciera = dr.GetString(dr.GetOrdinal("nomEntidadFinanciera"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("idTipoEntidadFinanciera")))
            {
                oRenovacionBE.idTipoEntidadFinanciera = dr.GetDecimal(dr.GetOrdinal("idTipoEntidadFinanciera"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("idMoneda")))
            {
                oRenovacionBE.idMoneda = dr.GetDecimal(dr.GetOrdinal("idMoneda"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("nomMoneda")))
            {
                oRenovacionBE.nomMoneda = dr.GetString(dr.GetOrdinal("nomMoneda"));
            }


            if (!dr.IsDBNull(dr.GetOrdinal("tasa")))
            {
                oRenovacionBE.tasa = dr.GetDecimal(dr.GetOrdinal("tasa"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("plazoRescision")))
            {
                oRenovacionBE.plazo = dr.GetInt32(dr.GetOrdinal("plazoRescision"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("tasaRescision")))
            {
                oRenovacionBE.tasaRescision = dr.GetDecimal(dr.GetOrdinal("tasaRescision"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("plazoMinimo")))
            {
                oRenovacionBE.plazoRescision = dr.GetInt32(dr.GetOrdinal("plazoMinimo"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("nomTipoRenovacion")))
            {
                oRenovacionBE.nomTipoRenovacion = dr.GetString(dr.GetOrdinal("nomTipoRenovacion"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("idTipoRenovacion")))
            {
                oRenovacionBE.idTipoRenovacion = Convert.ToInt32(dr.GetString(dr.GetOrdinal("idTipoRenovacion")));
            }


            if (!dr.IsDBNull(dr.GetOrdinal("importe")))
            {
                oRenovacionBE.importe = dr.GetDecimal(dr.GetOrdinal("importe"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("idEstado")))
            {
                oRenovacionBE.idEstado = dr.GetString(dr.GetOrdinal("idEstado"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("nomEstado")))
            {
                oRenovacionBE.nomEstado = dr.GetString(dr.GetOrdinal("nomEstado"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("usuCreacion")))
            {
                oRenovacionBE.usuCreacion = dr.GetString(dr.GetOrdinal("usuCreacion"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("fechaCreacion")))
            {
                oRenovacionBE.fechaCrecion = dr.GetDateTime(dr.GetOrdinal("fechaCreacion"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("usuUltActualizacion")))
            {
                oRenovacionBE.usuUltActualizacion = dr.GetString(dr.GetOrdinal("usuUltActualizacion"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("fechaUltActualizacion")))
            {
                oRenovacionBE.fechaUltActualizacion = dr.GetDateTime(dr.GetOrdinal("fechaUltActualizacion"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("fechaRenovacion")))
            {
                oRenovacionBE.fechaRenovacion = dr.GetDateTime(dr.GetOrdinal("fechaRenovacion"));
            }

            if (!dr.IsDBNull(dr.GetOrdinal("porcentaje")))
            {
                oRenovacionBE.porcenImporte = dr.GetDecimal(dr.GetOrdinal("porcentaje"));
            }

            return(oRenovacionBE);
        }
Ejemplo n.º 20
0
 public DataSet ProcesarRenovacion(RenovacionBE BE)
 {
     return(RenovacionDAL.ProcesarRenovacion(BE));
 }
Ejemplo n.º 21
0
        public List <RenovacionBE> listRenovacion(RenovacionBE pRenovacionBE)
        {
            List <RenovacionBE> lstRenovacionBE = new List <RenovacionBE>();
            IDataReader         dr = null;

            try
            {
                using (DbCommand cmd = dbAdeudosInversiones.GetStoredProcCommand(GetNameStoreProcedure.uspListRenovacion))
                {
                    //cmd.CommandTimeout = 0;

                    if (!string.IsNullOrEmpty(pRenovacionBE.idRenovacion))
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idRenovacion", DbType.String, pRenovacionBE.idRenovacion);
                    }
                    else
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idRenovacion", DbType.String, DBNull.Value);
                    }

                    if (!string.IsNullOrEmpty(pRenovacionBE.oAdeudoBE.idTipoAdeudo))
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idTipoAdeudo", DbType.String, pRenovacionBE.oAdeudoBE.idTipoAdeudo);
                    }
                    else
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idTipoAdeudo", DbType.String, DBNull.Value);
                    }

                    if (pRenovacionBE.oAdeudoBE.idTipoEntidadFinanciera != 0)
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idTipoEntidadFinanciera", DbType.Int32, pRenovacionBE.oAdeudoBE.idTipoEntidadFinanciera);
                    }
                    else
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idTipoEntidadFinanciera", DbType.Int32, DBNull.Value);
                    }

                    if (!string.IsNullOrEmpty(pRenovacionBE.oAdeudoBE.idEntidadFinanciera))
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idEntidadFinanciera", DbType.String, pRenovacionBE.oAdeudoBE.idEntidadFinanciera);
                    }
                    else
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idEntidadFinanciera", DbType.String, DBNull.Value);
                    }

                    if (pRenovacionBE.oAdeudoBE.idMoneda != 0)
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idMoneda", DbType.Int32, pRenovacionBE.oAdeudoBE.idMoneda);
                    }
                    else
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idMoneda", DbType.Int32, DBNull.Value);
                    }

                    if (pRenovacionBE.iniciofechaInicio != DateTime.MinValue)
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "iniciofechaInicio", DbType.DateTime, pRenovacionBE.iniciofechaInicio);
                    }
                    else
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "iniciofechaInicio", DbType.DateTime, DBNull.Value);
                    }

                    if (pRenovacionBE.finfechaInicio != DateTime.MinValue)
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "finfechaInicio", DbType.DateTime, pRenovacionBE.finfechaInicio);
                    }
                    else
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "finfechaInicio", DbType.DateTime, DBNull.Value);
                    }

                    if (pRenovacionBE.iniciofechaVencimiento != DateTime.MinValue)
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "iniciofechaVencimiento", DbType.DateTime, pRenovacionBE.iniciofechaVencimiento);
                    }
                    else
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "iniciofechaVencimiento", DbType.DateTime, DBNull.Value);
                    }

                    if (pRenovacionBE.finfechaVencimiento != DateTime.MinValue)
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "finfechaVencimiento", DbType.DateTime, pRenovacionBE.finfechaVencimiento);
                    }
                    else
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "finfechaVencimiento", DbType.DateTime, DBNull.Value);
                    }

                    if (!string.IsNullOrEmpty(pRenovacionBE.idEstado))
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idEstado", DbType.String, pRenovacionBE.idEstado);
                    }
                    else
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idEstado", DbType.String, DBNull.Value);
                    }

                    if (pRenovacionBE.idTipoRenovacion > 0)
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idTipoRenovacion", DbType.String, pRenovacionBE.idTipoRenovacion);
                    }
                    else
                    {
                        dbAdeudosInversiones.AddInParameter(cmd, "idTipoRenovacion", DbType.String, DBNull.Value);
                    }

                    dr = dbAdeudosInversiones.ExecuteReader(cmd);

                    while (dr.Read())
                    {
                        lstRenovacionBE.Add(RenovacionP.getRenovacion(dr));
                    }
                }
            }
            catch (Exception)
            {
                if (dr != null && !dr.IsClosed)
                {
                    dr.Close();
                }
                throw;
            }

            return(lstRenovacionBE);
        }
Ejemplo n.º 22
0
 public List <RenovacionBE> listRenovacion(RenovacionBE pRenovacionBE)
 {
     return(oRenovacionDA.listRenovacion(pRenovacionBE));
 }