Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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" };

Expand Down Expand Up @@ -204,7 +204,7 @@ public IHttpActionResult GetAssetAssetConnections([FromBody] PostData postData,
{
try
{
int recordsPerPage = Take ?? 50;
int recordsPerPage = PageSize ?? 50;

string[] sortFields = { "AssetName", "AssetKey", "Name" };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class OpenXDAMeterConfigurationController : ModelController<MeterConfigur
[HttpGet, Route("Meter/{meterID:int}/{page:int}")]
public IHttpActionResult GetMeterConfigurationsForMeter(int meterID, int page)
{
int recordsPerPage = 50;
int recordsPerPage = PageSize ?? 50;
if (GetRoles == string.Empty || User.IsInRole(GetRoles))
{
using (AdoDataConnection connection = new AdoDataConnection(Connection))
Expand Down Expand Up @@ -93,7 +93,7 @@ ORDER BY
[HttpGet, Route("{meterConfigurationID:int}/FilesProcessed/{page:int}")]
public IHttpActionResult GetFilesProcessedForMeterConfigurations(int meterConfigurationID, int page)
{
int recordsPerPage = 50;
int recordsPerPage = PageSize ?? 50;
if (GetRoles == string.Empty || User.IsInRole(GetRoles))
{
using (AdoDataConnection connection = new AdoDataConnection(Connection))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public IHttpActionResult RecentFailures([FromBody] PostData postData, [FromUri]
if (!GetAuthCheck())
return Unauthorized();

int recordsPerPage = Take ?? 50;
int recordsPerPage = PageSize ?? 50;

List<object> param = new();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>($@"
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -323,15 +323,15 @@ public IHttpActionResult GetImagesForLocation(int locationID, int page)
if (Directory.Exists(Path.Combine(path, key)))
{
IEnumerable<string> 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()
{
Data = JsonConvert.SerializeObject(new string[0]),
TotalRecords = 0,
NumberOfPages = 0,
RecordsPerPage = Take ?? 50
RecordsPerPage = PageSize ?? 50
});
}
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")}";
Expand Down
6 changes: 3 additions & 3 deletions Source/Applications/SystemCenter/Model/DataFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down
3 changes: 1 addition & 2 deletions Source/Applications/SystemCenter/Model/DeviceHealthReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ public class DeviceHealthReport
[RoutePrefix("api/DeviceHealthReport")]
public class DeviceHealthReportController : ModelController<DeviceHealthReport>
{
public int PagingAmount { get; set; } = 50;
public class DailyStatisticsRecord
{
[PrimaryKey(true)]
Expand Down Expand Up @@ -144,7 +143,7 @@ public override IHttpActionResult GetPagedList([FromBody] PostData postData, int
{
PagedResults pagedReports = new()
{
RecordsPerPage = 50
RecordsPerPage = PageSize ?? 50
};

PostData openMicRequestBody = new()
Expand Down
2 changes: 1 addition & 1 deletion Source/Applications/SystemCenter/Model/Node.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace SystemCenter.Model
{
[TableName("Node"), ReturnLimit(50),
[TableName("Node"),
CustomView(@"
SELECT
Node.ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<TimelineItem> timeline = GetEmailTimeline(postData, sentEmailID);
int totalRecords = timeline.Count;
Expand Down