示例#1
0
        // GET: Gastos
        public ActionResult Index()
        {
            var gastos        = manager.GetAllGastos();
            var proximosPagos = servicioManager.GetServiciosWithinNextFiveDays();

            var lista = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Text = "Elija un servicio", Value = "-1"
                }
            };

            lista.AddRange(serviciosDisponibles.Select(f => new SelectListItem()
            {
                Text  = f.Nombre,
                Value = f.Id.ToString()
            }).ToList());

            var newGastos = new SearchViewModel <GastoDto>()
            {
                Transacciones = gastos,
                FuentesServiciosDisponibles = lista,
                ProximosPagos = proximosPagos
            };

            return(View(newGastos));
        }
示例#2
0
        // GET: Home
        public ActionResult Index()
        {
            var ingresos = ingresoManager.GetAllIngresos();
            var gastos   = gastoManager.GetAllGastos();

            var montoReal = ingresos.Sum(i => i.Monto) - gastos.Sum(g => g.Monto);

            ViewBag.Billetera = string.Format("{0:n0}", montoReal);

            return(View());
        }