public MappedDrive[] GetEnterpriseDriveMapsPaged(int itemId, string filterValue, int maximumRows, int startRowIndex, string sortColumn) { filterValue = filterValue ?? string.Empty; mappedDrives = ES.Services.EnterpriseStorage.GetDriveMapsPaged(itemId, filterValue, sortColumn, startRowIndex, maximumRows); return mappedDrives.PageItems; }
protected static MappedDrivesPaged GetDriveMapsPagedInternal(int itemId, string filterValue, string sortColumn, int startRow, int maximumRows) { MappedDrivesPaged result = new MappedDrivesPaged(); try { // load organization Organization org = OrganizationController.GetOrganization(itemId); if (org == null) { return null; } List<SystemFile> folders = GetEnterpriseFolders(itemId).ToList(); Organizations orgProxy = OrganizationController.GetOrganizationProxy(org.ServiceId); List<MappedDrive> mappedDrives = orgProxy.GetDriveMaps(org.OrganizationId).Where(x => x.LabelAs.Contains(filterValue)).ToList(); var resultItems = new List<MappedDrive>(); foreach (var folder in folders) { var drive = GetFolderMappedDrive(mappedDrives, folder); if (drive != null) { resultItems.Add(drive); } } mappedDrives = resultItems; switch (sortColumn) { case "Label": mappedDrives = mappedDrives.OrderBy(x => x.LabelAs).ToList(); break; default: mappedDrives = mappedDrives.OrderBy(x => x.DriveLetter).ToList(); break; } result.RecordsCount = mappedDrives.Count; result.PageItems = mappedDrives.Skip(startRow).Take(maximumRows).ToArray(); } catch (Exception ex) { throw ex; } return result; }