public static List<EmployeeModel> FindByEmploymentStatusFilter(EmploymentStatusFilter? filterList, string path) { var dataStore = new DataStore { Path = path }; var employeeModels = dataStore.GetAllRecords(); if (filterList.HasValue && filterList != EmploymentStatusFilter.All) { var removeStatus = (filterList.Value == EmploymentStatusFilter.No); employeeModels.RemoveAll(employee => employee.IsCurrentEmployee == removeStatus); } return employeeModels; }
// // POST: /Employee/Create public ActionResult Index(EmploymentStatusFilter? filterList) { var employeeModels = EmployeeModel.FindByEmploymentStatusFilter(filterList, Path); return View(employeeModels); }