public List <CuotasPorFinanciamientoViewModels> listaPorFinanciamiento(CalcularCuotaViewModels data) { var listaDeCuotas = new List <CuotasPorFinanciamientoViewModels>(); ILoteComponent lote = new PrecioLote(data.cantidad); lote = new EngancheLote(lote, data.enganche); ILoteComponent loteInteres = new EngancheLote(lote, data.enganche); double enganche = punto.dosDecimales(data.enganche); double precioNeto = punto.dosDecimales(lote.calcularSaldo()); while (data.tiempo <= 120) { //loteInteres = new InteresLote(lote, new InteresPerlas(), data.tiempo); loteInteres = new InteresLote(lote, data.interes, data.tiempo); listaDeCuotas.Add( new CuotasPorFinanciamientoViewModels() { PrecioBruto = data.cantidad, Meses = data.tiempo, Enganche = enganche, PrecioNeto = precioNeto, InteresTotal = punto.dosDecimales(loteInteres.calcularMonto()), PrecioTotal = punto.dosDecimales(loteInteres.calcularSaldo()), Cuotas = punto.dosDecimales(loteInteres.calcularSaldo() / data.tiempo) }); data.tiempo += 12; } return(listaDeCuotas); }
public void setDataToDictionary(CalcularCuotaViewModels data) { cantidad.Add("TiempoDeFinanciamiento", data.tiempo); ILoteComponent lote = new PrecioLote(data.cantidad); lote = new EngancheLote(lote, data.enganche); cantidad.Add("SaldoSinInteres", lote.calcularSaldo()); //lote = new InteresLote(lote, new InteresPerlas(), (int)cantidad["TiempoDeFinanciamiento"]); lote = new InteresLote(lote, data.interes, data.tiempo); cantidad.Add("InteresTotal", lote.calcularMonto()); cantidad.Add("SaldoConInteres", lote.calcularSaldo()); addCuotaConInteres(); addCuotaSinInteres(); addInteresPorMes(); }