Example #1
0
        public IActionResult Index()
        {
            int month = DateTime.Now.Month;
            int year  = DateTime.Now.Year;

            RentCollectedIndexModel model = new RentCollectedIndexModel()
            {
                MonthlyProfits = _payments.GetAmountFromMonth(month),
                YearlyProfits  = _payments.GetAmountFromYear(year),
                AllTimeProfits = _payments.GetAmountFromAllTime()
            };

            return(View(model));
        }
Example #2
0
        public IActionResult Index()
        {
            int           month = DateTime.Now.Month;
            HomeViewModel model = new HomeViewModel
            {
                PropertyCount          = _properties.GetNumberOfProperties(),
                TenantCount            = _tenants.GetNumberOfTenants(),
                RentCollectedThisMonth = _payments.GetAmountFromMonth(month),
                PaymentsThisMonth      = _payments.GetAllFromMonth(month).Select(p => new PaymentItemModel()
                {
                    TenantId   = p.Tenant.Id,
                    TenantName = p.Tenant.FullName,
                    Amount     = p.Amount,
                    Date       = p.Date.ToString("dd/MM/yyyy")
                })
            };

            return(View(model));
        }