public static string GetOtherRequests(ADUser user, Guid?requestGuid) { IEnumerable <IRequestIndexEntry> requestIndexEntries = MailboxRequestIndexEntryHandler.GetRequestIndexEntries(user, null); IEnumerable <IRequestIndexEntry> source = from r in requestIndexEntries where !MailboxRelocationRequestStatistics.IsTerminalState(r.Status) && (requestGuid == null || r.RequestGuid != requestGuid) select r; List <IRequestIndexEntry> list = new List <IRequestIndexEntry>(); foreach (IGrouping <ADObjectId, IRequestIndexEntry> grouping in from r in source group r by r.StorageMDB) { using (RequestJobProvider requestJobProvider = new RequestJobProvider(grouping.Key.ObjectGuid)) { foreach (IRequestIndexEntry requestIndexEntry in grouping) { TransactionalRequestJob transactionalRequestJob = (TransactionalRequestJob)requestJobProvider.Read <TransactionalRequestJob>(requestIndexEntry.GetRequestJobId(), ReadJobFlags.SkipValidation | ReadJobFlags.SkipReadingMailboxRequestIndexEntries); if (transactionalRequestJob != null && !MailboxRelocationRequestStatistics.IsTerminalState(transactionalRequestJob)) { list.Add(requestIndexEntry); } } } } return(string.Join <Guid>(", ", from r in list select r.RequestGuid)); }
public override IEnumerable <MRSRequestMailboxEntry> FindPaged(RequestIndexEntryProvider requestIndexEntryProvider, QueryFilter filter, ObjectId rootId, bool deepSearch, SortBy sortBy, int pageSize) { RequestIndexEntryQueryFilter requestIndexEntryQueryFilter = filter as RequestIndexEntryQueryFilter; ADUser aduser = requestIndexEntryProvider.ReadADUser(requestIndexEntryQueryFilter.MailboxId, Guid.Empty); if (aduser == null) { return(null); } List <MRSRequestMailboxEntry> list = new List <MRSRequestMailboxEntry>(MailboxRequestIndexEntryHandler.GetRequestIndexEntries(aduser, requestIndexEntryQueryFilter)); foreach (MRSRequestMailboxEntry mrsrequestMailboxEntry in list) { mrsrequestMailboxEntry.RequestIndexId = new RequestIndexId(requestIndexEntryQueryFilter.MailboxId); mrsrequestMailboxEntry.OrganizationId = aduser.OrganizationId; } return(list); }