Ejemplo n.º 1
0
        // GET: AppAbonament
        public async Task <IActionResult> Index()
        {
            // Refresh Status for each not Finalised Abonament
            _antrenamentService.RefreshStatusAbonamentsActive(_context);

            ViewBag.DataStart = DateTime.Now.ToString("yyyy-MM");
            var reportDbContext = _context.AbonamentModels.Include(t => t.TipAbonament).Include(a => a.PersoanaModel).Where(m => m.DataStart.Year == DateTime.Now.Year && m.DataStart.Month == DateTime.Now.Month);

            ViewBag.dataSource = reportDbContext.ToList();
            return(View(await reportDbContext.ToListAsync()));
        }
        public async Task <IActionResult> RaportLunar()
        {
            // Refresh Status for each not Finalised Abonament
            _antrenamentService.RefreshStatusAbonamentsActive(_context);

            ViewBag.DataStart = DateTime.Now.ToString("yyyy-MM");

            ReportViewModel reportViewModel = new ReportViewModel();

            reportViewModel.ListaAbonamente   = _reportService.GetListReportAbViewModelsPerMonth(_context, DateTime.Now);
            reportViewModel.ListaAntrenamente = _reportService.GetListReportAntrViewModelsPerMonth(_context, DateTime.Now);
            return(View(reportViewModel));
        }
Ejemplo n.º 3
0
        public HomeController(ILogger <HomeController> logger, AntrenamentService antrenamentService, ReportDbContext context)
        {
            _logger             = logger;
            _antrenamentService = antrenamentService;
            _context            = context;

            // Refresh Status for each not Finalised Abonament
            _antrenamentService.RefreshStatusAbonamentsActive(_context);
        }