Exemplo n.º 1
0
        public IActionResult Search(Period period)
        {
            List <Operation> filteredByDate = _operationRepository.GetAllOperations().Where(x => x.Date >= period.StartDate && x.Date <= period.EndDate).ToList();

            ViewBag.StartDate = period.StartDate;
            ViewBag.EndDate   = period.EndDate;
            return(View("SearchResults", filteredByDate));
        }
        public async Task CleanUpExpiryOperation()
        {
            var currentDate = DateTime.Now;

            var enumerable = await _operationRepository.GetAllOperations();

            foreach (var operation in enumerable)
            {
                if (operation.ExpiryDate < currentDate)
                {
                    await RemoveAction(operation.OperationId);
                }
            }
        }
Exemplo n.º 3
0
        public IActionResult Index()
        {
            var model = _operationRepository.GetAllOperations();

            return(View(model));
        }