Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            /*InteresLotificadora interes = new InteresLotificadora(new InteresPerlas());
             * Console.WriteLine("Perlas: " + interes.calcularInteres());
             * interes = new InteresLotificadora(new InteresRefugio());
             * Console.WriteLine("Refugio: " + interes.calcularInteres());
             * interes = new InteresLotificadora(new InteresAmerica());
             * Console.WriteLine("America: " + interes.calcularInteres());
             * interes = new InteresLotificadora(new InteresCondado());
             * Console.WriteLine("Condado: " + interes.calcularInteres());//*/


            //double[] variablesCuotas = new double[3];
            Dictionary <string, double> dictionary = new Dictionary <string, double>();
            //enum la { x};

            //ILoteComponent lote = new Lote();
            ILoteComponent lote = new PrecioLote(65000);

            Console.WriteLine("Precio Total: " + lote.calcularCostoLote());
            lote = new EngancheLote(lote);
            Console.WriteLine("Enganche: " + lote.calcularCostoLote());
            Console.WriteLine("Precio Sin Enganche: " + lote.calcularSaldoLote());

            dictionary.Add("TiempoDeFinanciamiento", 12);
            dictionary.Add("SaldoSinInteres", lote.calcularSaldoLote());
            //Interes
            lote = new InteresLote(lote, new InteresPerlas(), (int)dictionary["TiempoDeFinanciamiento"]);
            Console.WriteLine("Interes: " + lote.calcularCostoLote());
            Console.WriteLine("Precio mas interes: " + lote.calcularSaldoLote());

            dictionary.Add("InteresTotal", lote.calcularCostoLote());
            dictionary.Add("SaldoConInteres", lote.calcularSaldoLote());
            CuotasLote cuotas = new CuotasLote(dictionary);


            foreach (CuotasViewModels cuota in cuotas.cuotas())
            {
                Console.WriteLine(cuota.CuotaSinInteres + "       " + cuota.InteresPorMes + "       "
                                  + cuota.CuotaConInteres + "        " + cuota.SaldoPrecioSinInteres
                                  + "         " + cuota.SaldoInteresTotal + "      " + cuota.SaldoPrecioConInteres);
            }
            //Console.WriteLine("Cuotas De: "+cuotas.cuotas());
            //cuotas.cuotas();

            //lote = new DescuentoLote(lote, new DescuentoPerlas());
            //Console.WriteLine("Descueto: "+lote.calcularCostoLote());
            //Console.WriteLine("Precio menos descuento: " + lote.calcularSaldoLote());

            Console.ReadKey();
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        public CuotaVentaViewModels CalcularSinDescuento(CuotaVentaViewModels datos)
        {
            var            cuota = new CuotaVentaViewModels();
            ILoteComponent lote  = new PrecioLote(datos.cantidad);

            //cuota.cantidad = lote.calcularMonto();

            lote           = new EngancheLote(lote, datos.enganche);
            cuota.enganche = lote.calcularMonto();

            cuota.cantidad = lote.calcularSaldo();

            lote          = new InteresLote(lote, datos.interes, datos.tiempo);
            cuota.interes = punto.dosDecimales(lote.calcularMonto());

            cuota.tiempo = datos.tiempo;
            cuota.cuota  = (cuota.cantidad + cuota.interes) / datos.tiempo;

            return(cuota);
        }