public IActionResult ListApplications(string filter) { IEnumerable <VendorApplication> applications = null; if (String.IsNullOrEmpty(filter) || filter == "all") { applications = _vendorApplicationRepository.vendorApplications.Where(p => p.Status == "Pending"); } else { if (filter == "hour") { applications = _vendorApplicationRepository.vendorApplications.Where((p => p.ApplicationDate >= (DateTime.Now.AddHours(-1)) && p.Status == "Pending")); } if (filter == "day") { applications = _vendorApplicationRepository.vendorApplications.Where((p => p.ApplicationDate >= (DateTime.Now.AddDays(-1)) && p.Status == "Pending")); } if (filter == "week") { applications = _vendorApplicationRepository.vendorApplications.Where((p => p.ApplicationDate >= (DateTime.Now.AddDays(-7)) && p.Status == "Pending")); } } var vm = new ListApplicationsViewModel { Applications = applications }; return(View(vm)); }
public IActionResult MyApplications(string applicantId) { IEnumerable <VendorApplication> applications = _vendorApplicationRepository.vendorApplications.Where(p => p.ApplicantId == applicantId); var vm = new ListApplicationsViewModel { Applications = applications }; return(View(vm)); }