This commit is contained in:
2021-07-10 14:23:14 +01:00
parent 03ea1058be
commit 10907d3aff
97 changed files with 2048 additions and 521 deletions
+13 -8
View File
@@ -87,7 +87,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
{
return Internals.GetUserAccountDisplayName(userAccountId);
}
// User Accounts.
// Organisations.
public SaxOrganisation GetOrganisation(SysId organisationId)
{
return Internals.GetOrganisation(organisationId);
@@ -292,15 +292,20 @@ namespace Saxonite.Net.Core.Web.Base.Models
public ushort PageLength { get { return paging.PageLength; } set { paging.PageLength = value; } }
public uint PageCount { get { return (PageLength > 0 ? (uint)Math.Ceiling((decimal)ItemTotal / PageLength) : 0); } }
public ushort ItemCount { get; set; }
public ulong ItemTotal { get; set; }
private ulong itemTotal = 0;
public ulong ItemTotal
{
get { return itemTotal; }
set
{
itemTotal = value;
// Check whether the total number of items is less than the current page and reduce page no if needed.
if (IsPaged && (PageNo - 1) * PageLength > itemTotal)
PageNo = (uint)((itemTotal - 1) / PageLength + 1);
}
}
}
public DataPaging Paging { get; } = new DataPaging();
public bool DataPaged { get { return Paging.IsPaged; } }
public uint DataPageNo { get { return Paging.PageNo; } set { Paging.PageNo = value; } }
public ushort DataPageLength { get { return Paging.PageLength; } set { Paging.PageLength = value; } }
public uint DataPageCount { get { return (DataPageLength > 0 ? (uint)Math.Ceiling((decimal)DataItemTotal / DataPageLength) : 0); } }
public ushort DataItemCount { get; set; }
public ulong DataItemTotal { get; set; }
public void PopulatePagingTo(DbQuery.Paging resultsPaging)
{
Paging.PopulatePagingTo(resultsPaging);