diff --git a/Source/Applications/SystemCenter/Controllers/OpenXDA/Assets/OpenXDAAssetController.cs b/Source/Applications/SystemCenter/Controllers/OpenXDA/Assets/OpenXDAAssetController.cs index 3779cb019..0edc75bf6 100644 --- a/Source/Applications/SystemCenter/Controllers/OpenXDA/Assets/OpenXDAAssetController.cs +++ b/Source/Applications/SystemCenter/Controllers/OpenXDA/Assets/OpenXDAAssetController.cs @@ -71,7 +71,7 @@ public IHttpActionResult GetAssetLocationsPaged([FromBody] PostData postData, [F if (!GetAuthCheck()) return Unauthorized(); - int recordsPerPage = Take ?? 50; + int recordsPerPage = PageSize ?? 50; PagedResults results = new PagedResults(); @@ -164,7 +164,7 @@ public IHttpActionResult GetAssetMetersPaged([FromBody] PostData postData, [From { try { - int recordsPerPage = Take ?? 50; + int recordsPerPage = PageSize ?? 50; string[] sortFields = { "AssetKey", "Name", "Make", "Model" }; @@ -204,7 +204,7 @@ public IHttpActionResult GetAssetAssetConnections([FromBody] PostData postData, { try { - int recordsPerPage = Take ?? 50; + int recordsPerPage = PageSize ?? 50; string[] sortFields = { "AssetName", "AssetKey", "Name" }; diff --git a/Source/Applications/SystemCenter/Controllers/OpenXDA/Meters/OpenXDAMeterConfigurationController.cs b/Source/Applications/SystemCenter/Controllers/OpenXDA/Meters/OpenXDAMeterConfigurationController.cs index 2e0704853..bbfe79f3f 100644 --- a/Source/Applications/SystemCenter/Controllers/OpenXDA/Meters/OpenXDAMeterConfigurationController.cs +++ b/Source/Applications/SystemCenter/Controllers/OpenXDA/Meters/OpenXDAMeterConfigurationController.cs @@ -45,7 +45,7 @@ public class OpenXDAMeterConfigurationController : ModelController param = new(); diff --git a/Source/Applications/SystemCenter/Controllers/OpenXDA/OpenXDALocationController.cs b/Source/Applications/SystemCenter/Controllers/OpenXDA/OpenXDALocationController.cs index 9038b85ca..bc943e78c 100644 --- a/Source/Applications/SystemCenter/Controllers/OpenXDA/OpenXDALocationController.cs +++ b/Source/Applications/SystemCenter/Controllers/OpenXDA/OpenXDALocationController.cs @@ -217,7 +217,7 @@ public IHttpActionResult GetMetersForLocation(int locationID, int page, int asc, if (!string.IsNullOrEmpty(GetRoles) && User.IsInRole(GetRoles)) return Unauthorized(); - int recordsPerPage = 50; + int recordsPerPage = PageSize ?? 50; using (AdoDataConnection connection = new AdoDataConnection(Connection)) { int totalRecords = connection.ExecuteScalar($@" @@ -256,7 +256,7 @@ FROM Meter [HttpGet, Route("{locationID:int}/Assets/{page:int}/{asc:int}/{orderBy}")] public IHttpActionResult GetAssetsForLocation(int locationID, int page, int asc, string orderBy) { - int recordsPerPage = 50; + int recordsPerPage = PageSize ?? 50; if (!string.IsNullOrEmpty(GetRoles) && User.IsInRole(GetRoles)) return Unauthorized(); @@ -323,7 +323,7 @@ public IHttpActionResult GetImagesForLocation(int locationID, int page) if (Directory.Exists(Path.Combine(path, key))) { IEnumerable imagePaths = Directory.GetFiles(Path.Combine(path, key)).Select(fp => new FileInfo(fp).Name); - return Ok(PageImagePaths(imagePaths, page, Take ?? 50)); + return Ok(PageImagePaths(imagePaths, page, PageSize ?? 50)); } else return Ok(new PagedResults() @@ -331,7 +331,7 @@ public IHttpActionResult GetImagesForLocation(int locationID, int page) Data = JsonConvert.SerializeObject(new string[0]), TotalRecords = 0, NumberOfPages = 0, - RecordsPerPage = Take ?? 50 + RecordsPerPage = PageSize ?? 50 }); } else diff --git a/Source/Applications/SystemCenter/Controllers/SystemCenter/SystemCenterController.cs b/Source/Applications/SystemCenter/Controllers/SystemCenter/SystemCenterController.cs index 563d97416..3b5ff0f9b 100644 --- a/Source/Applications/SystemCenter/Controllers/SystemCenter/SystemCenterController.cs +++ b/Source/Applications/SystemCenter/Controllers/SystemCenter/SystemCenterController.cs @@ -633,7 +633,7 @@ public IHttpActionResult GetAdditionalFieldsForTable(string openXDAParentTable, { string orderByExpression = DefaultSort; - int recordsPerPage = Take ?? 50; + int recordsPerPage = PageSize ?? 50; if (sort != null && sort != string.Empty) orderByExpression = $"{sort} {(ascending == 1 ? "ASC" : "DESC")}"; diff --git a/Source/Applications/SystemCenter/Model/DataFile.cs b/Source/Applications/SystemCenter/Model/DataFile.cs index cc3dd6d1c..5aa8a8857 100644 --- a/Source/Applications/SystemCenter/Model/DataFile.cs +++ b/Source/Applications/SystemCenter/Model/DataFile.cs @@ -321,7 +321,7 @@ public override IHttpActionResult GetPagedList([FromBody] PostData postData, int }).ToArray(); int recordCount = CountSearchResults(postData); - int recordPerPage = Take ?? 50; + int recordPerPage = PageSize ?? 50; return Ok(new PagedResults() { Data = JsonConvert.SerializeObject(results), @@ -360,7 +360,7 @@ public override IHttpActionResult GetPagedList([FromBody] PostData postData, int }).ToArray(); int recordCount = CountSearchResults(postData); - int recordPerPage = Take ?? 50; + int recordPerPage = PageSize ?? 50; return Ok(new PagedResults() { Data = JsonConvert.SerializeObject(results), @@ -398,7 +398,7 @@ public override IHttpActionResult GetPagedList([FromBody] PostData postData, int }).ToArray(); int recordCount = CountSearchResults(postData); - int recordPerPage = Take ?? 50; + int recordPerPage = PageSize ?? 50; return Ok(new PagedResults() { Data = JsonConvert.SerializeObject(results), diff --git a/Source/Applications/SystemCenter/Model/DeviceHealthReport.cs b/Source/Applications/SystemCenter/Model/DeviceHealthReport.cs index b74dc2bec..a5a7bebc8 100644 --- a/Source/Applications/SystemCenter/Model/DeviceHealthReport.cs +++ b/Source/Applications/SystemCenter/Model/DeviceHealthReport.cs @@ -111,7 +111,6 @@ public class DeviceHealthReport [RoutePrefix("api/DeviceHealthReport")] public class DeviceHealthReportController : ModelController { - public int PagingAmount { get; set; } = 50; public class DailyStatisticsRecord { [PrimaryKey(true)] @@ -144,7 +143,7 @@ public override IHttpActionResult GetPagedList([FromBody] PostData postData, int { PagedResults pagedReports = new() { - RecordsPerPage = 50 + RecordsPerPage = PageSize ?? 50 }; PostData openMicRequestBody = new() diff --git a/Source/Applications/SystemCenter/Model/Node.cs b/Source/Applications/SystemCenter/Model/Node.cs index 2ecac66e8..4b94d86db 100644 --- a/Source/Applications/SystemCenter/Model/Node.cs +++ b/Source/Applications/SystemCenter/Model/Node.cs @@ -30,7 +30,7 @@ namespace SystemCenter.Model { - [TableName("Node"), ReturnLimit(50), + [TableName("Node"), CustomView(@" SELECT Node.ID, diff --git a/Source/Applications/SystemCenter/Model/Security/SecurityGroup.cs b/Source/Applications/SystemCenter/Model/Security/SecurityGroup.cs index 2906643a6..857fc7711 100644 --- a/Source/Applications/SystemCenter/Model/Security/SecurityGroup.cs +++ b/Source/Applications/SystemCenter/Model/Security/SecurityGroup.cs @@ -274,7 +274,7 @@ protected override DataTable GetSearchResults(PostData postData, int? page) if (page is int p) // page manually, because filtering post-search requires it. { - int recordsPerPage = Take ?? 50; + int recordsPerPage = PageSize ?? 50; DataRow[] rows = dataTable.AsEnumerable() .Skip((p) * recordsPerPage) .Take(recordsPerPage) diff --git a/Source/Applications/SystemCenter/Model/Security/UserAccount.cs b/Source/Applications/SystemCenter/Model/Security/UserAccount.cs index 438efbf73..d5ee735dc 100644 --- a/Source/Applications/SystemCenter/Model/Security/UserAccount.cs +++ b/Source/Applications/SystemCenter/Model/Security/UserAccount.cs @@ -242,7 +242,7 @@ protected override DataTable GetSearchResults(PostData postData, int? page) if (page is int p)// page manually, because filtering post-search requires it. { - int recordsPerPage = Take ?? 50; + int recordsPerPage = PageSize ?? 50; DataRow[] rows = dataTable.AsEnumerable() .Skip((p) * recordsPerPage) .Take(recordsPerPage) diff --git a/Source/Applications/SystemCenterNotification/Controllers/EmailTypeController.cs b/Source/Applications/SystemCenterNotification/Controllers/EmailTypeController.cs index 152d413c3..69a729bcd 100644 --- a/Source/Applications/SystemCenterNotification/Controllers/EmailTypeController.cs +++ b/Source/Applications/SystemCenterNotification/Controllers/EmailTypeController.cs @@ -440,7 +440,7 @@ public IHttpActionResult SentEmailTimeline([FromBody] PostData postData, int Sen public IHttpActionResult SentEmailTimelinePaged([FromBody] PostData postData, [FromUri] int sentEmailID, [FromUri] int page) { PagedResults pagedResults = new PagedResults(); - int recordsPerPage = Take ?? 50; + int recordsPerPage = PageSize ?? 50; List timeline = GetEmailTimeline(postData, sentEmailID); int totalRecords = timeline.Count;