private bool PassesFilterValidation(BugSubmission sub, List <string> listCategoryFilters, List <string> listSelectedPatNames, List <string> listStackFilters, List <string> listPatNumFilters, List <string> listSelectedVersions, string grouping95, string msgText, string devNoteFilter, DateTime dateTimeFrom, DateTime dateTimeTo) { bool hasMobileSelected = listSelectedVersions.Count(x => x == "Mobile") != 0; bool hasVersionsSelected = listSelectedVersions.Count(x => x != "Mobile") != 0; if (_viewMode != FormBugSubmissionMode.ValidationMode && ((!string.IsNullOrWhiteSpace(msgText) && !sub.ExceptionMessageText.ToLower().Contains(msgText.ToLower())) || (listSelectedPatNames.Count != 0 && !listSelectedPatNames.Contains(_dictPatients.ContainsKey(sub.RegKey)?_dictPatients[sub.RegKey].GetNameLF():sub.RegKey)) || (listStackFilters.Count != 0 && !listStackFilters.Exists(x => sub.ExceptionStackTrace.ToLower().Contains(x))) || (listPatNumFilters.Count != 0 && (!_dictPatients.ContainsKey(sub.RegKey) || !listPatNumFilters.Exists(x => x == _dictPatients[sub.RegKey].PatNum.ToString()))) || (sub.BugId != 0 && !listShowHideOptions.GetSelected(1)) || (!listShowHideOptions.GetSelected(0) && _dictPatients.ContainsKey(sub.RegKey) && (_dictPatients[sub.RegKey].BillingType == 436 || _dictPatients[sub.RegKey].PatNum == 1486)) || //436 is "Internal Use" def, 1486 is HQ patNum. (hasVersionsSelected && !sub.IsMobileSubmission && !listSelectedVersions.Contains(sub.ProgramVersion.SubstringBefore('.', 2))) || (hasMobileSelected && !hasVersionsSelected && !sub.IsMobileSubmission) || (!hasMobileSelected && sub.IsMobileSubmission) || (!sub.SubmissionDateTime.Between(dateTimeFrom, dateTimeTo)) || (!string.IsNullOrWhiteSpace(devNoteFilter) && !sub.DevNote.ToLower().Contains(devNoteFilter.ToLower())) || (!string.IsNullOrEmpty(grouping95) && BugSubmissionL.CalculateSimilarity(grouping95, sub.ExceptionStackTrace) < 95)) || (!listShowHideOptions.GetSelected(2) && sub.IsHidden) || (listCategoryFilters.Count > 0 && listCategoryFilters.All(x => !sub.ListCategoryTags.Any(y => y.ToLower().Contains(x.ToLower()))))) { return(false); } return(true); }
private bool PassesFilterValidation(BugSubmission sub, List <string> listSelectedRegKeys, List <string> listStackFilters, List <string> listPatNumFilters, List <string> listSelectedVersions, string grouping95) { if (!_viewMode.In(FormBugSubmissionMode.ValidationMode, FormBugSubmissionMode.ViewOnly) && ((!string.IsNullOrWhiteSpace(textMsgText.Text) && !sub.ExceptionMessageText.ToLower().Contains(textMsgText.Text.ToLower())) || (listSelectedRegKeys.Count != 0 && !listSelectedRegKeys.Contains(sub.RegKey)) || (listStackFilters.Count != 0 && !listStackFilters.Exists(x => sub.ExceptionStackTrace.ToLower().Contains(x))) || (listPatNumFilters.Count != 0 && !listPatNumFilters.Exists(x => x == _dictPatients[sub.RegKey].PatNum.ToString())) || (sub.BugId != 0 && !checkShowAttached.Checked) || (checkExcludeHQ.Checked && (_dictPatients[sub.RegKey].BillingType == 436 || _dictPatients[sub.RegKey].PatNum == 1486)) || //436 is "Internal Use" def, 1486 is HQ patNum. (listSelectedVersions.Count != 0 && !listSelectedVersions.Contains(sub.Info.DictPrefValues[PrefName.ProgramVersion])) || (!sub.SubmissionDateTime.Between(dateRangePicker.GetDateTimeFrom(), dateRangePicker.GetDateTimeTo())) || (!string.IsNullOrWhiteSpace(textDevNoteFilter.Text) && !sub.DevNote.ToLower().Contains(textDevNoteFilter.Text.ToLower())) || (!string.IsNullOrEmpty(grouping95) && BugSubmissionL.CalculateSimilarity(grouping95, sub.ExceptionStackTrace) < 95))) { return(false); } return(true); }