public async Task <IActionResult> GetAuctionsStatistics(GetStatisticsViewModel getStatisticsViewModel) { var viewModel = await _statisticsService.GetAuctionsStatistics(groupCode, getStatisticsViewModel.StartDate.Value, getStatisticsViewModel.EndDate.Value, User, getStatisticsViewModel.SelectedAuctionType == 1?false : true); return(Ok(viewModel)); }
public IActionResult GetStatistics() { int ideas = _context.Ideas.Count(); int events = _context.Events.Count(); int users = _context.Users.Count(); int tags = _context.Tags.Count(); int categories = _context.Categories.Count(); var viewModel = new GetStatisticsViewModel(); viewModel.Ideas = ideas; viewModel.Events = events; viewModel.Users = users; viewModel.Tags = tags; viewModel.Categories = categories; return(Ok(viewModel)); }
public IActionResult Index() { var currentDateTime = DateTime.UtcNow.AddHours(2); var StartDate = new DateTime(currentDateTime.Year, currentDateTime.Month, currentDateTime.Day, currentDateTime.Hour, currentDateTime.Minute, 0); var vm = new GetStatisticsViewModel { SelectedAuctionType = 1, StartDate = StartDate, EndDate = StartDate.AddMonths(1), AuctionTypes = new List <AuctionTypeViewModel> { new AuctionTypeViewModel { Id = 1, Type = "Alla auktioner" }, new AuctionTypeViewModel { Id = 2, Type = "Egna auktioner" } } }; return(View(vm)); }