Пример #1
0
        public ActionResult Simulador(int pProductoId = 1, string pTipo = "V", decimal pMonto = 0, int pCuotas = 0, decimal pInteres = 0, string pFecha = "", string pModalidad = "", decimal?pGastosAdm = null)
        {
            ViewBag.pMonto        = pMonto;
            ViewBag.pCuotas       = pCuotas;
            ViewBag.pInteres      = pInteres;
            ViewBag.pProductoId   = pProductoId;
            ViewBag.pProducto     = ProductoBL.Obtener(pProductoId).Denominacion;
            ViewBag.pFecha        = pFecha;
            ViewBag.pModalidadVal = pModalidad;

            switch (pModalidad)
            {
            case "D": ViewBag.pModalidad = "DIARIO"; break;

            case "S": ViewBag.pModalidad = "SEMANAL"; break;

            case "Q": ViewBag.pModalidad = "QUINCENAL"; break;

            case "M": ViewBag.pModalidad = "MENSUAL"; break;
            }

            List <usp_SimuladorCredito_Result> oPlanPago = pMonto > 0
                    ? CreditoBL.SimuladorCredito(pProductoId, pTipo, pMonto, pModalidad, pCuotas, pInteres, DateTime.Parse(pFecha), pGastosAdm)
                    : new List <usp_SimuladorCredito_Result>();

            return(View(oPlanPago));
        }
Пример #2
0
        public ActionResult Simulador(int pProductoId = 1, string pTipo       = "V", decimal pMonto    = 0, int pCuotas   = 0, decimal pInteres = 0,
                                      string pFecha   = "", string pModalidad = "", decimal?pGastosAdm = null, string pGA = "CAP")
        {
            ViewBag.pMonto        = pMonto;
            ViewBag.pCuotas       = pCuotas;
            ViewBag.pInteres      = pInteres;
            ViewBag.pProductoId   = pProductoId;
            ViewBag.pProducto     = ProductoBL.Obtener(pProductoId).Denominacion;
            ViewBag.pFecha        = pFecha;
            ViewBag.pModalidadVal = pModalidad;

            var periodoAnio = 0.0;

            switch (pModalidad)
            {
            case "D": ViewBag.pModalidad = "DIARIO"; periodoAnio = 360.0; break;

            case "S": ViewBag.pModalidad = "SEMANAL"; periodoAnio = 52.0; break;

            case "Q": ViewBag.pModalidad = "QUINCENAL"; periodoAnio = 24.0; break;

            case "M": ViewBag.pModalidad = "MENSUAL"; periodoAnio = 12.0; break;
            }


            var pTem = pMonto > 0 ? Math.Pow(double.Parse((1 + pInteres / 100).ToString()), 1 / periodoAnio) - 1 : 0;

            ViewBag.TEM = Math.Round(pTem, 6);

            List <usp_SimuladorCredito_Result> oPlanPago = pMonto > 0
                    ? CreditoBL.SimuladorCredito(pMonto, pModalidad, pCuotas, pInteres, DateTime.Parse(pFecha), pGA == "CUO" ? pGastosAdm : 0)
                    : new List <usp_SimuladorCredito_Result>();

            return(View(oPlanPago));
        }
Пример #3
0
        public ActionResult ReportePlanPagos(int pCreditoId)
        {
            var credito   = CreditoBL.Obtener(x => x.CreditoId == pCreditoId, "Persona");
            var oPlanPago = CreditoBL.ReportePlanPago(pCreditoId);
            var rd        = new ReportDataSource("dsSimuladorPlanPago", oPlanPago);

            string pModalidad = string.Empty;

            switch (credito.FormaPago)
            {
            case "D": pModalidad = "DIARIO"; break;

            case "S": pModalidad = "SEMANAL"; break;

            case "Q": pModalidad = "QUINCENAL"; break;

            case "M": pModalidad = "MENSUAL"; break;
            }
            var parametros = new List <ReportParameter>
            {
                new ReportParameter("Monto", credito.MontoCredito.ToString()),
                new ReportParameter("Cuotas", credito.NumeroCuotas.ToString()),
                new ReportParameter("Producto", ProductoBL.Obtener(credito.ProductoId).Denominacion),
                new ReportParameter("Fecha", credito.FechaPrimerPago.ToShortDateString()),
                new ReportParameter("Modalidad", pModalidad),
                new ReportParameter("Cliente", credito.Persona.NombreCompleto)
            };

            return(Reporte("PDF", "rptSimuladorPlanPago.rdlc", rd, "A4Vertical0.25", parametros));
        }
Пример #4
0
        public ActionResult ReporteSimuladorPlanPagos(int pProductoId, string pTipo, decimal pMonto, int pCuotas, decimal pInteres, string pFecha, string pModalidad, decimal?pGastosAdm = null)
        {
            var oPlanPago = CreditoBL.SimuladorCredito(pProductoId, pTipo, pMonto, pModalidad, pCuotas, pInteres, DateTime.Parse(pFecha), pGastosAdm);
            var rd        = new ReportDataSource("dsSimuladorPlanPago", oPlanPago);

            switch (pModalidad)
            {
            case "D": pModalidad = "DIARIO"; break;

            case "S": pModalidad = "SEMANAL"; break;

            case "Q": pModalidad = "QUINCENAL"; break;

            case "M": pModalidad = "MENSUAL"; break;
            }
            var parametros = new List <ReportParameter>
            {
                new ReportParameter("Monto", pMonto.ToString()),
                new ReportParameter("Cuotas", pCuotas.ToString()),
                new ReportParameter("Producto", ProductoBL.Obtener(pProductoId).Denominacion),
                new ReportParameter("Fecha", pFecha),
                new ReportParameter("Modalidad", pModalidad),
                new ReportParameter("Cliente", string.Empty)
            };

            return(Reporte("PDF", "rptSimuladorPlanPago.rdlc", rd, "A4Vertical0.25", parametros));
        }
Пример #5
0
        public ActionResult Editar(int id)
        {
            var obtener = _bl.Obtener(id);

            if (!obtener.Success)
            {
                ModelState.AddModelError("Error", obtener.Message);
                return(PartialView());
            }

            return(PartialView(obtener.Data));
        }
Пример #6
0
 public List <ProductoBE> Get(string sProducto)
 {
     try
     {
         var bl        = new ProductoBL();
         var respuesta = bl.Obtener(sProducto);
         return(respuesta);
     }
     catch (Exception error)
     {
         throw error;
     }
 }
Пример #7
0
        public ActionResult ReporteSimuladorPlanPagos(int pProductoId, decimal pMonto, int pCuotas, decimal pInteres,
                                                      string pFecha, string pModalidad, decimal?pGastosAdm = null, string pGA = "CAP", string pCliente = "")
        {
            decimal desemb = pMonto;
            decimal pga    = 0;

            if (pGA == "CAP")
            {
                desemb = pMonto - (pGastosAdm.HasValue ? pGastosAdm.Value : 0);
            }

            if (pGA == "CUO")
            {
                pga = pGastosAdm.Value;
            }


            var oPlanPago = CreditoBL.SimuladorCredito(pMonto, pModalidad, pCuotas, pInteres, DateTime.Parse(pFecha), pga);
            var rd        = new ReportDataSource("dsSimuladorPlanPago", oPlanPago);


            switch (pModalidad)
            {
            case "D": pModalidad = "DIARIO";  break;

            case "S": pModalidad = "SEMANAL"; break;

            case "Q": pModalidad = "QUINCENAL";  break;

            case "M": pModalidad = "MENSUAL";  break;
            }

            //var pTem = CreditoBL.ObtenerTEM(pInteres, pModalidad); // Math.Round(Math.Pow(double.Parse((1 + pInteres/100).ToString()), 1/periodoAnio) - 1, 6);


            var parametros = new List <ReportParameter>
            {
                new ReportParameter("Monto", "S/. " + pMonto),
                new ReportParameter("Cuotas", pCuotas.ToString()),
                new ReportParameter("Producto", ProductoBL.Obtener(pProductoId).Denominacion),
                new ReportParameter("Fecha", pFecha),
                new ReportParameter("Modalidad", pModalidad),
                new ReportParameter("Cliente", pCliente),
                new ReportParameter("TEM", pInteres + " %"),
                //new ReportParameter("TEM","-"),
                new ReportParameter("Desembolso", "S/. " + desemb),
                new ReportParameter("GastosAdm", "S/. " + Math.Round(pGastosAdm.Value, 2).ToString("0.00", CultureInfo.InvariantCulture))
            };

            return(Reporte("PDF", "rptSimuladorPlanPago.rdlc", rd, "A4Vertical0.25", parametros));
        }
Пример #8
0
        public ActionResult ObtenerProducto(int pProductoId)
        {
            var rpta = ProductoBL.Obtener(pProductoId);

            return(Json(rpta, JsonRequestBehavior.AllowGet));
        }