private void ApplyFiltersToCaseListAndRefresh() { var listFilteredCases = listAllCaseEntry.ToList(); if (chkOnlyShowUncompleted.IsChecked == true) { listFilteredCases = listAllCaseEntry.Where(x => !(IsCaseEvaluated(x))).ToList(); } // Filter by date listFilteredCases = dtFilterDate.Text != "" ? listFilteredCases.Where(x => x.DateTimeModifiedObject.Date >= dtFilterDate.Value).ToList() : listFilteredCases.ToList(); var listResults = new List <CaseEntry>(); // Filter by Author ID if (cmbAuthor.SelectedIndex != -1) { var listFilter = SqliteDataAcces.GetCaseEntryFilterAuthorID(cmbAuthor.SelectedValue.ToString()); listFilteredCases = listFilteredCases.Where(x => listFilter.ToList() .FindIndex(c => c.CaseNumber == x.CaseNumber) != -1).ToList(); } // Filter by case number, this trumps all filters and will return even if the case does not satisfy the other filters var stCaseNum = txtFilterCaseNumber.Text; if (stCaseNum != "") { listFilteredCases = listAllCaseEntry.Where(x => x.CaseNumber == stCaseNum).ToList(); } RefreshCaseListUI(listFilteredCases); }
private List <CaseEntry> SearchByAuthor(string authorID) { return(SqliteDataAcces.GetCaseEntryFilterAuthorID(authorID)); }