public GroupReport Search(string SearchTerm) { GroupReport Output = new GroupReport(search(SearchTerm).ConvertAll(c => (GroupResult)c), flipOrdering(order), lastPropertyQueried); if (Output.QRList.Count > 0) { Output.sortByPropertyValue(lastPropertyQueried); } return(Output); }
public QueryDetailsForm(QueryResult InputQR, RBAC SourceRBAC) : this() { thisFormResult = InputQR; thisBindingSourceGroups = new BindingSource(); parentReference = SourceRBAC; if (InputQR.GetType() == typeof(RBACS.UserQueryResult)) { UserQueryResult UQR = (UserQueryResult)InputQR; qRName = UQR.AccountName; string QRScrip = UQR.Description; string QRTitle = UQR.Title; Text = $"{qRName} Query Details"; titlingRichTextBox.Text = $"Name:\t{qRName}\r\nTitle:\t{QRTitle}\r\nDescription:\t{QRScrip}"; thisGroupsReport = new GroupReport(HelperFunctions.QueryResultToGroupResults(UQR, parentReference.GroupNamesAndDescriptionsAll), Ordering.Ascending); GroupReport GR2 = (GroupReport)thisGroupsReport; thisBindingSourceGroups.DataSource = GR2.QRList; groupsDataGridView.DataSource = thisBindingSourceGroups; //summaryTextBox.Text = FileHelperFuctions.ReturnFormattedPersonInfo((UserQueryResult)InputQR, SourceRBAC.GroupNamesAndDescriptionsAll, SourceRBAC.ByTitle); } else if (InputQR.GetType() == typeof(RBACS.GroupingQueryResult)) { GroupingQueryResult GQR = (GroupingQueryResult)InputQR; qRName = GQR.GroupingName; Text = $"{qRName} Query Details"; titlingRichTextBox.Text = $"{GQR.GroupingType}:\t{GQR.GroupingName}\r\nMember Count:\t{GQR.MemberCount}"; List <UserQueryResult> TempUQRList = new List <UserQueryResult>(); foreach (string Mem in GQR.Members.Split(',')) { if (Mem != null) { string MemTrim = Mem.Trim(); Parallel.ForEach(parentReference.UserQueryResults, UQR => { if (UQR.AccountName == MemTrim) { TempUQRList.Add(UQR); } }); } } thisGroupsReport = new GroupRepresentationTFIDFReport(HelperFunctions.QueryListToGroupRepresentationTFIDFList(GQR, parentReference.GroupingQueryResults, parentReference.GroupNamesAndDescriptionsAll), Ordering.Ascending); GroupRepresentationTFIDFReport GRR2 = (GroupRepresentationTFIDFReport)thisGroupsReport; thisBindingSourceGroups.DataSource = GRR2.QRList; groupsDataGridView.DataSource = thisBindingSourceGroups; //summaryTextBox.Text = FileHelperFuctions.ReturnFormattedGroupSummary((GroupingQueryResult)InputQR, SourceRBAC.GroupNamesAndDescriptionsAll); } else { } thisFormResultType = InputQR.GetType(); thisBindingSource = new BindingSource(); parentReference = SourceRBAC; //InitializeComponent(); }
private void groupsDataGridView_ColumnHeaderMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (thisGroupsReport.GetType() == typeof(RBACS.GroupReport)) { GroupReport Shadow = (GroupReport)thisGroupsReport; Shadow.SortByProperty(groupsDataGridView.Columns[e.ColumnIndex].HeaderText); thisBindingSourceGroups.DataSource = Shadow.QRList; groupsDataGridView.DataSource = thisBindingSourceGroups; } else if (thisGroupsReport.GetType() == typeof(RBACS.GroupRepresentationTFIDFReport)) { GroupRepresentationTFIDFReport Shadow = (GroupRepresentationTFIDFReport)thisGroupsReport; Shadow.SortByProperty(groupsDataGridView.Columns[e.ColumnIndex].HeaderText); thisBindingSourceGroups.DataSource = Shadow.QRList; groupsDataGridView.DataSource = thisBindingSourceGroups; } }