Exemplo n.º 1
0
        public IActionResult ViewAllRequests()
        {
            List <OffRosterRequest> allRequests      = _offRosterRequestRepository.GetOffRosterBetweenDates(DateTime.Now.AddMonths(-1), DateTime.Now.AddMonths(2)).Result;
            List <OffRosterRequest> awaitingRequests = _offRosterRequestRepository.GetRequestsToAction().Result;

            foreach (var request in awaitingRequests)
            {
                if (allRequests.Contains(request) == false)
                {
                    allRequests.Add(request);
                }
            }


            OffRosterListViewModel offRosterListViewModel = new OffRosterListViewModel
            {
                AwaitingRequests  = allRequests.Where(n => n.IsActioned == false).ToList(),
                ActiveRequests    = allRequests.Where(n => n.IsActive && n.IsActioned).ToList(),
                OpenEndedRequests = allRequests.Where(n => n.IsOpenEnded && n.IsActioned).ToList(),
                FutureRequests    = allRequests.Where(n => n.IsFuture && n.IsActioned).ToList(),
                HistoricRequests  = allRequests.Where(n => n.IsHistoric && n.IsActioned).OrderBy(n => n.StartDate).ToList()
            };

            return(View(offRosterListViewModel));
        }
Exemplo n.º 2
0
        public IActionResult RequestsToAction()
        {
            List <OffRosterRequest> openRequests = _offRosterRequestRepository.GetRequestsToAction().Result;

            return(View(openRequests));
        }