1.2.11.12 Online Events

This commit is contained in:
2024-08-20 17:51:32 +01:00
parent 780e6778e5
commit 41db4e63d4
158 changed files with 6945 additions and 666 deletions
+1 -1
View File
@@ -176,7 +176,7 @@ namespace Saxonite.Net.Standard.Base.App
public static class UsgaGolfDataLookup
{
public static bool Enabled { get; set; } = SacsSystem.DebugMode ? true : true;
public static int MinsBetweenExecution { get; set; } = SacsSystem.DebugMode ? 8 : 15;
public static int MinsBetweenExecution { get; set; } = SacsSystem.DebugMode ? 8 : 12;
public static int HoursBetweenCountryLookup { get; set; } = SacsSystem.DebugMode ? 24 : 24 * 5;
}
}
+2 -1
View File
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
//-------------------------------------------------------------------
public static class Version
{
private static String version { get; } = "1.2.11.11";
private static String version { get; } = "1.2.11.12";
// Retrieve version.
public static String GetFullVersion () { return version; }
public static String GetAppVersion ()
@@ -44,6 +44,7 @@ namespace Saxonite.Net.Standard.Base.App
// - Organisation associations, admin download. [Feb24]
// - Basic Api app. [Apr24]
// - Admin Database and logs pages evolved. [May24]
// - Online events upgraded. [Aug24]
// 1.2.10 11-Oct-2022
// - Online organisations display issue fixed.
// - User Sport 'Preparing' options.
+11
View File
@@ -19,6 +19,7 @@ namespace Saxonite.Net.Standard.Base.App
YesNo,
DataItemType,
Gender,
SportGrouping,
SportSpecialityLabel,
SportContactType,
SportParticipating,
@@ -187,6 +188,16 @@ namespace Saxonite.Net.Standard.Base.App
SystemReviewer,
}
//-------------------------------------------------------------------
/// <summary>Sport Grouping</summary>
public enum SportGrouping
{
/* Do not change the values/codes - tied to database. */
Specific = 10,
Banner = 20,
Group = 30,
}
//-------------------------------------------------------------------
/// <summary>Sport Speciality Label</summary>
public enum SportSpecialityLabel
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Tue 18-Jun-2024 10:19:29
// Code generated by Sarand Database Utilities Tue 6-Aug-2024 14:50:13
//---------------------------------------------------------------------------
namespace Saxonite.Base.App
{
@@ -197,6 +197,7 @@ namespace Saxonite.Base.App
OrganisationEvent_SportIdPrimary,
OrganisationEvent_RegionIdCountry,
OrganisationEvent_EventAt,
OrganisationEvent_EventTo,
OrganisationEvent_EventTypeCode,
OrganisationEvent_Summary,
OrganisationEvent_Details,
@@ -248,6 +249,7 @@ namespace Saxonite.Base.App
Region_UpdateBy,
Region_UpdateHost,
Sport_Id,
Sport_Grouping,
Sport_SportIdParent,
Sport_Name,
Sport_SpecialityLabel,
@@ -422,7 +424,7 @@ namespace Saxonite.Base.App
//-------------------------------------------------------------------
// Data members.
private static readonly int tableCount = 22;
private static readonly int columnCount = 371;
private static readonly int columnCount = 373;
private static ulong maxTextLen = 0;
//-------------------------------------------------------------------
@@ -791,6 +793,7 @@ namespace Saxonite.Base.App
new ColumnDfn(9,"SportIdPrimary",4,4,false,10),
new ColumnDfn(9,"RegionIdCountry",4,4,false,10),
new ColumnDfn(9,"EventAt",9,93,false,16),
new ColumnDfn(9,"EventTo",9,93,false,16),
new ColumnDfn(9,"EventTypeCode",0,12,false,3),
new ColumnDfn(9,"Summary",0,-9,false,200),
new ColumnDfn(9,"Details",0,-9,false,2000),
@@ -842,6 +845,7 @@ namespace Saxonite.Base.App
new ColumnDfn(11,"UpdateBy",4,4,false,10),
new ColumnDfn(11,"UpdateHost",0,12,false,100),
new ColumnDfn(12,"Id",4,4,true,10),
new ColumnDfn(12,"Grouping",3,5,false,5),
new ColumnDfn(12,"SportIdParent",4,4,false,10),
new ColumnDfn(12,"Name",0,-9,false,100),
new ColumnDfn(12,"SpecialityLabel",3,5,false,5),
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Tue 18-Jun-2024 10:19:29
// Code generated by Sarand Database Utilities Tue 6-Aug-2024 14:50:13
//---------------------------------------------------------------------------
namespace Saxonite.Base.App
{
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Tue 18-Jun-2024 10:19:30
// Code generated by Sarand Database Utilities Tue 6-Aug-2024 14:50:13
//---------------------------------------------------------------------------
namespace Saxonite.Base.App
{
@@ -105,6 +105,7 @@ namespace Saxonite.Net.Standard.Base.App
public List<TypeCodeDesc> DataItemTypeCodes { get { return GetCodesOfType(Sax.CodeType.DataItemType); } }
public List<TypeCodeDesc> YesNoCodes { get { return GetCodesOfType(Sax.CodeType.YesNo); } }
public List<TypeCodeDesc> GenderCodes { get { return GetCodesOfType(Sax.CodeType.Gender); } }
public List<TypeCodeDesc> SportGroupingCodes { get { return GetCodesOfType(Sax.CodeType.SportGrouping); } }
public List<TypeCodeDesc> SportSpecialityLabelCodes { get { return GetCodesOfType(Sax.CodeType.SportSpecialityLabel); } }
public List<TypeCodeDesc> SportContactTypeCodes { get { return GetCodesOfType(Sax.CodeType.SportContactType); } }
public List<TypeCodeDesc> SportParticipatingCodes { get { return GetCodesOfType(Sax.CodeType.SportParticipating); } }
@@ -16,6 +16,7 @@ namespace Saxonite.Net.Standard.Base.App
private static readonly List<TypeCodeDesc> yesNoCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> dataItemTypeCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> genderCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> sportGroupingCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> sportSpecialityLabelCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> sportContactCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> sportParticipatingCodes = new List<TypeCodeDesc>();
@@ -52,6 +53,8 @@ namespace Saxonite.Net.Standard.Base.App
return new List<TypeCodeDesc>(dataItemTypeCodes);
case Sax.CodeType.Gender:
return new List<TypeCodeDesc>(genderCodes);
case Sax.CodeType.SportGrouping:
return new List<TypeCodeDesc>(sportGroupingCodes);
case Sax.CodeType.SportSpecialityLabel:
return new List<TypeCodeDesc>(sportSpecialityLabelCodes);
case Sax.CodeType.SportContactType:
@@ -139,6 +142,12 @@ namespace Saxonite.Net.Standard.Base.App
genderCodes.Add(Sax.Gender.Nonconforming, "Nonconforming", "Nonconforming");
genderCodes.Add(Sax.Gender.PreferNotToSay, "PreferNotToSay", "Prefer not to say");
//---------------------------------------------------------------
// Sport grouping.
sportGroupingCodes.Add(Sax.SportGrouping.Specific, "SPC", "Specific");
sportGroupingCodes.Add(Sax.SportGrouping.Banner, "BNR", "Banner");
sportGroupingCodes.Add(Sax.SportGrouping.Group, "GRP", "Group");
//---------------------------------------------------------------
// Sport speciality label.
sportSpecialityLabelCodes.Add(Sax.SportSpecialityLabel.Positon, "POS", "Positon");
@@ -2,6 +2,7 @@
using NPOI.SS.Formula.Functions;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -156,10 +157,9 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
this.data.PopulateFrom(data);
}
public String CountryCode
@@ -218,7 +218,8 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
public List<SysId> IdsExcluded { get; } = new List<SysId>();
/// <summary>Generic filter - partial country code or name.</summary>
public String CountryFilter { get; set; }
public String CountryCodeFull { get; set; }
/// <summary>Restrict the results by code.</summary>
public HashSet<String> CountryCodesIncluded { get; } = new HashSet<String>(StringComparer.OrdinalIgnoreCase);
public String CountryNameFull { get; set; }
public String CountryNamePartial { get; set; }
// Flags.
@@ -1,6 +1,7 @@
using NPOI.SS.Formula.Functions;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -261,10 +262,9 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
this.data.PopulateFrom(data);
}
public SysId FacilityId
@@ -1,6 +1,7 @@
using NPOI.SS.Formula.Functions;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -213,10 +214,9 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
this.data.PopulateFrom(data);
}
public SysId ProvinceId
@@ -1,6 +1,7 @@
using NPOI.SS.Formula.Functions;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -229,10 +230,9 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
this.data.PopulateFrom(data);
}
public SysId CourseId
@@ -1,6 +1,7 @@
using NPOI.SS.Formula.Functions;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -165,10 +166,9 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
this.data.PopulateFrom(data);
}
public SysId CountryId
@@ -134,12 +134,11 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (ItemId.IsValid(ItemId) && ItemId.Type != data.ItemId.Type && SysId.ToInt(ItemId.Id) != SysId.ToInt(data.ItemId.Id))
throw new NotSupportedException(fn + " Item Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Item Id cannot be changed");
this.data.PopulateFrom(data);
}
public ItemId ItemId
@@ -220,16 +220,15 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (ItemId.IsValid(ItemId) && ItemId.Type != data.ItemId.Type && SysId.ToInt(ItemId.Id) != SysId.ToInt(data.ItemId.Id))
throw new NotSupportedException(fn + " Item Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Item Id cannot be changed");
if (SysId.IsValid(SportId) && SysId.ToInt(SportId) != SysId.ToInt(data.SportId))
throw new NotSupportedException(fn + " Sport Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Sport Id cannot be changed");
if (SysId.IsValid(RegionId) && SysId.ToInt(RegionId) != SysId.ToInt(data.RegionId))
throw new NotSupportedException(fn + " Region Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Region Id cannot be changed");
this.data.PopulateFrom(data);
}
public ItemId ItemId
@@ -80,7 +80,6 @@ namespace Saxonite.Net.Standard.Base.Bus
/// </summary>
public static ContentData ExtractContent(String contentData)
{
String fn = typeof(ContentData).FullName + ".ExtractContent";
ContentData content = new ContentData();
if (StringUtil.IsEmpty(contentData)) return content;
@@ -120,7 +119,7 @@ namespace Saxonite.Net.Standard.Base.Bus
XElement htmlElement = bodyChildElement;
segment.Body.Html = htmlElement.Value;
}
else SaLogger.Warn(fn + " Unexpected 'Segment' child element: " + segmentChildElementName);
else SaLogger.Warn($"{SysUtil.Fn} Unexpected 'Segment' child element: " + segmentChildElementName);
}
}
else if (segmentChildElementName.EqualsCI(ElementName_Image))
@@ -136,24 +135,24 @@ namespace Saxonite.Net.Standard.Base.Bus
XElement imageIdElement = imageChildElement;
segment.Image.ItemImageId = imageIdElement.Value.ToSysId();
}
else SaLogger.Warn(fn + " Unexpected 'Segment' child element: " + segmentChildElementName);
else SaLogger.Warn($"{SysUtil.Fn} Unexpected 'Segment' child element: " + segmentChildElementName);
}
}
else SaLogger.Warn(fn + " Unexpected 'Segment' child element: " + segmentChildElementName);
else SaLogger.Warn($"{SysUtil.Fn} Unexpected 'Segment' child element: " + segmentChildElementName);
}
// Add this segment to the list.
if (segment.IsValid())
content.Segments.Add(segment);
}
else SaLogger.Warn(fn + " Unexpected 'Segments' child element: " + segmentsChildElementName);
else SaLogger.Warn($"{SysUtil.Fn} Unexpected 'Segments' child element: " + segmentsChildElementName);
}
}
else SaLogger.Warn(fn + " Unexpected 'Root' child element: " + rootChildElementName);
else SaLogger.Warn($"{SysUtil.Fn} Unexpected 'Root' child element: " + rootChildElementName);
}
}
catch (Exception exc)
{
SaLogger.Warn(fn + " " + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn} " + ExceptionUtil.GetLogMessage(exc));
}
return content;
@@ -165,8 +164,6 @@ namespace Saxonite.Net.Standard.Base.Bus
/// </summary>
public static String GetContentData(ContentData content)
{
String fn = typeof(ContentData).FullName + ".GetContentData";
try
{
XDocument doc = new XDocument();
@@ -195,7 +192,7 @@ namespace Saxonite.Net.Standard.Base.Bus
}
catch (Exception exc)
{
SaLogger.Warn(fn + " " + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn} " + ExceptionUtil.GetLogMessage(exc));
}
return "";
+4 -4
View File
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -210,14 +211,13 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (SysId.IsValid(UserAccountIdAuthor) && SysId.ToInt(UserAccountIdAuthor) != SysId.ToInt(data.UserAccountIdAuthor))
throw new NotSupportedException(fn + " UserAccountIdAuthor cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} UserAccountIdAuthor cannot be changed");
if (SysId.IsValid(OrganisationId) && SysId.ToInt(OrganisationId) != SysId.ToInt(data.OrganisationId))
throw new NotSupportedException(fn + " OrganisationId cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} OrganisationId cannot be changed");
this.data.PopulateFrom(data);
}
public SysId UserAccountIdAuthor
@@ -82,7 +82,6 @@ namespace Saxonite.Net.Standard.Base.Bus
/// </summary>
private void ExtractContactData(String contactData)
{
String fn = typeof(SaxContactData).FullName + ".ExtractContent";
contactMethods.Clear();
if (StringUtil.IsEmpty(contactData)) return;
@@ -108,14 +107,14 @@ namespace Saxonite.Net.Standard.Base.Bus
};
contactMethods.Add(method, contactMethod);
}
else SaLogger.Warn(fn + " Unrecognised contact method: " + methodValue);
else SaLogger.Warn($"{SysUtil.Fn} Unrecognised contact method: " + methodValue);
}
else SaLogger.Warn(fn + " Unexpected 'Root' child element: " + rootChildElementName);
else SaLogger.Warn($"{SysUtil.Fn} Unexpected 'Root' child element: " + rootChildElementName);
}
}
catch (Exception exc)
{
SaLogger.Warn(fn + " " + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn} " + ExceptionUtil.GetLogMessage(exc));
}
}
@@ -125,7 +124,6 @@ namespace Saxonite.Net.Standard.Base.Bus
/// </summary>
public String GetContactData()
{
String fn = typeof(SaxContactData).FullName + ".GetContactData";
try
{
XDocument doc = new XDocument();
@@ -140,7 +138,7 @@ namespace Saxonite.Net.Standard.Base.Bus
}
catch (Exception exc)
{
SaLogger.Warn(fn + " " + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn} " + ExceptionUtil.GetLogMessage(exc));
}
return "";
}
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -311,14 +312,13 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (ItemId.IsValid(ItemId) && ItemId.Type != data.ItemId.Type && SysId.ToInt(ItemId.Id) != SysId.ToInt(data.ItemId.Id))
throw new NotSupportedException(fn + " Item Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Item Id cannot be changed");
if (SysId.IsValid(RegionIdProvince) && SysId.ToInt(RegionIdProvince) != SysId.ToInt(data.RegionIdProvince))
throw new NotSupportedException(fn + " Address Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Address Id cannot be changed");
this.data.PopulateFrom(data);
}
public ItemId ItemId
@@ -238,14 +238,13 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (ItemId.IsValid(ItemIdFrom) && ItemIdFrom.Type != data.ItemIdFrom.Type && SysId.ToInt(ItemIdFrom.Id) != SysId.ToInt(data.ItemIdFrom.Id))
throw new NotSupportedException(fn + " From Item Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} From Item Id cannot be changed");
if (ItemId.IsValid(ItemIdTo) && ItemIdTo.Type != data.ItemIdTo.Type && SysId.ToInt(ItemIdTo.Id) != SysId.ToInt(data.ItemIdTo.Id))
throw new NotSupportedException(fn + " To Item Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} To Item Id cannot be changed");
this.data.PopulateFrom(data);
}
public ItemId ItemIdFrom
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -226,7 +227,7 @@ namespace Saxonite.Net.Standard.Base.Bus
case Sax.DataItemType.UserAccount:
case Sax.DataItemType.Organisation:
case Sax.DataItemType.Article:
return new List<Sacs.MimeType> { Sacs.MimeType.Jpeg, Sacs.MimeType.Webp, Sacs.MimeType.Png };
return new List<Sacs.MimeType> { Sacs.MimeType.Jpeg, Sacs.MimeType.Webp, Sacs.MimeType.Png, Sacs.MimeType.Svg };
}
return new List<Sacs.MimeType>();
}
@@ -237,7 +238,7 @@ namespace Saxonite.Net.Standard.Base.Bus
case Sax.DataItemType.UserAccount:
case Sax.DataItemType.Organisation:
case Sax.DataItemType.Article:
return new List<string> { "image/jpg", "image/jpeg", "image/webp", "image/png" };
return new List<string> { "image/jpg", "image/jpeg", "image/webp", "image/png", "image/svg+xml" };
}
return new List<string>();
}
@@ -247,14 +248,13 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (ItemId.IsValid(ItemId) && ItemId.Type != data.ItemId.Type && SysId.ToInt(ItemId.Id) != SysId.ToInt(data.ItemId.Id))
throw new NotSupportedException(fn + " Item Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Item Id cannot be changed");
if (ImageType > 0 && ImageType != data.ImageType)
throw new NotSupportedException(fn + " Image Type cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Image Type cannot be changed");
this.data.PopulateFrom(data);
}
public ItemId ItemId
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -144,14 +145,13 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (ItemId.IsValid(ItemId) && ItemId.Type != data.ItemId.Type && SysId.ToInt(ItemId.Id) != SysId.ToInt(data.ItemId.Id))
throw new NotSupportedException(fn + " Item Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Item Id cannot be changed");
if (SysId.IsValid(SportId) && SysId.ToInt(SportId) != SysId.ToInt(data.SportId))
throw new NotSupportedException(fn + " Sport Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Sport Id cannot be changed");
this.data.PopulateFrom(data);
}
public ItemId ItemId
@@ -220,10 +220,9 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
this.data.PopulateFrom(data);
}
public String Name
@@ -293,17 +292,17 @@ namespace Saxonite.Net.Standard.Base.Bus
public new class Params : SacsHierarchyItem.Params
{
// List filtering.
public List<SysId> IdsIncluded { get; } = new List<SysId>();
public List<SysId> IdsExcluded { get; } = new List<SysId>();
public HashSet<SysId> IdsIncluded { get; } = new HashSet<SysId>();
public HashSet<SysId> IdsExcluded { get; } = new HashSet<SysId>();
public String NameFull { get; set; }
public String NamePartial { get; set; }
public Sax.OrganisationCategory OrganisationCategory { get; set; } = Sax.OrganisationCategory.Unknown;
public List<Sax.OrganisationCategory> OrganisationCategoriesExcluded { get; } = new List<Sax.OrganisationCategory>();
public HashSet<Sax.OrganisationCategory> OrganisationCategoriesExcluded { get; } = new HashSet<Sax.OrganisationCategory>();
public Sax.OrganisationType OrganisationType { get; set; } = Sax.OrganisationType.Unknown;
/// <summary>Partial match on a number of fields, including name, sport, address, etc.</summary>
public String OrganisationFilter { get; set; }
public List<SysId> SportIdsIncluded { get; } = new List<SysId>();
public List<SysId> RegionIdsIncluded { get; } = new List<SysId>();
public HashSet<SysId> SportIdsIncluded { get; } = new HashSet<SysId>();
public HashSet<SysId> RegionIdsIncluded { get; } = new HashSet<SysId>();
// Common properties.
public String NotesPartial { get; set; }
public StatusCat StatusCat { get; set; } = StatusCat.ActiveOnly;
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -31,6 +32,8 @@ namespace Saxonite.Net.Standard.Base.Bus
// Event.
EventAt_Date,
EventAt_DateTime,
EventTo_Date,
EventTo_DateTime,
EventTypeCode,
EventType_Desc,
Summary,
@@ -58,6 +61,7 @@ namespace Saxonite.Net.Standard.Base.Bus
public SysId SportIdPrimary { get; set; }
public SysId RegionIdCountry { get; set; }
public DateTime EventAt { get; set; }
public DateTime? EventTo { get; set; }
public Sax.EventType EventType { get; set; }
public String Summary { get; set; } = String.Empty;
public String Details { get; set; } = String.Empty;
@@ -98,6 +102,11 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.EventAt; }
set { CheckChanged(data.EventAt, value); data.EventAt = value; }
}
public DateTime? EventTo
{
get { return data.EventTo; }
set { CheckChangedNullable(data.EventTo, value); data.EventTo = value; }
}
public Sax.EventType EventType
{
get { return data.EventType; }
@@ -135,6 +144,7 @@ namespace Saxonite.Net.Standard.Base.Bus
SportIdPrimary = data.SportIdPrimary;
RegionIdCountry = data.RegionIdCountry;
EventAt = data.EventAt;
EventTo = data.EventTo;
EventType = data.EventType;
Summary = data.Summary;
Details = data.Details;
@@ -160,6 +170,7 @@ namespace Saxonite.Net.Standard.Base.Bus
public ValidValue SportIdPrimary { get; set; } = ValidValue.Valid;
public ValidValue RegionIdCountry { get; set; } = ValidValue.Valid;
public ValidValue EventAt { get; set; } = ValidValue.Valid;
public ValidValue EventTo { get; set; } = ValidValue.Valid;
public ValidValue EventType { get; set; } = ValidValue.Valid;
public ValidValue Summary { get; set; } = ValidValue.Valid;
public ValidValue Details { get; set; } = ValidValue.Valid;
@@ -206,17 +217,35 @@ namespace Saxonite.Net.Standard.Base.Bus
return new ItemId((short)Sax.DataItemType.OrganisationEvent, Id);
}
/// <summary>
/// Time of exactly midnight is treated as invalid.
/// <para>- Valid start time of midnight is stored with at least +1 minute (00:01:00).</para>
/// </summary>
public static bool HasValidEventTime(DateTime? eventDateTime)
{
return DateUtil.IsValid(eventDateTime) && DateUtil.Format(eventDateTime, "HH:mm:ss") != "00:00:00";
}
public bool HasValidEventAtTime()
{
return HasValidEventTime(EventAt);
}
public bool HasValidEventToTime()
{
return HasValidEventTime(EventTo);
}
//-------------------------------------------------------------------
// Properties.
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (SysId.IsValid(OrganisationId) && SysId.ToInt(OrganisationId) != SysId.ToInt(data.OrganisationId))
throw new NotSupportedException(fn + " Organisation Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Organisation Id cannot be changed");
this.data.PopulateFrom(data);
}
public SysId OrganisationId
@@ -239,6 +268,11 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.EventAt; }
set { data.EventAt = value; }
}
public DateTime? EventTo
{
get { return data.EventTo; }
set { data.EventTo = value; }
}
public Sax.EventType EventType
{
get { return data.EventType; }
@@ -303,7 +337,7 @@ namespace Saxonite.Net.Standard.Base.Bus
public List<SysId> SportIdsIncluded { get; set; } = new List<SysId>();
public List<SysId> RegionIdsIncluded { get; } = new List<SysId>();
public DateTime EventFrom { get; set; }
public DateTime EventTo{ get; set; }
public DateTime EventTo { get; set; }
public String SummaryPartial { get; set; }
/// <summary>General filter value - position, outline, sport, body etc. </summary>
public String EventFilter { get; set; }
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -201,12 +202,11 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (SysId.IsValid(OrganisationId) && SysId.ToInt(OrganisationId) != SysId.ToInt(data.OrganisationId))
throw new NotSupportedException(fn + " Organisation Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Organisation Id cannot be changed");
this.data.PopulateFrom(data);
}
public SysId OrganisationId
+2 -2
View File
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -206,10 +207,9 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
this.data.PopulateFrom(data);
}
public Sax.RegionType RegionType
+26 -2
View File
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -18,6 +19,8 @@ namespace Saxonite.Net.Standard.Base.Bus
{
Pos,
Id,
Grouping,
Grouping_Desc,
SportIdParent,
ParentSport_Name,
Name,
@@ -38,6 +41,7 @@ namespace Saxonite.Net.Standard.Base.Bus
/// <summary>Properties other than common.</summary>
public class DataProperties
{
public Sax.SportGrouping Grouping { get; set; }
public SysId SportIdParent { get; set; }
public String Name { get; set; } = String.Empty;
public Sax.SportSpecialityLabel SpecialityLabel { get; set; }
@@ -55,6 +59,11 @@ namespace Saxonite.Net.Standard.Base.Bus
Status = DefaultStatus;
}
// Properties.
public Sax.SportGrouping Grouping
{
get { return data.Grouping; }
set { CheckChanged((short)data.Grouping, (short)value); data.Grouping = value; }
}
public SysId SportIdParent
{
get { return data.SportIdParent; }
@@ -73,6 +82,7 @@ namespace Saxonite.Net.Standard.Base.Bus
// Population.
internal void PopulateFrom(Data data)
{
Grouping = data.Grouping;
SportIdParent = data.SportIdParent;
Name = data.Name;
SpecialityLabel = data.SpecialityLabel;
@@ -91,6 +101,7 @@ namespace Saxonite.Net.Standard.Base.Bus
public new class ErrField : SacsHierarchyItem.ErrField
{
// Identifies the field that has invalid data.
public ValidValue Grouping { get; set; } = ValidValue.Valid;
public ValidValue SportIdParent { get; set; } = ValidValue.Valid;
public ValidValue Name { get; set; } = ValidValue.Valid;
public ValidValue SpecialityLabel { get; set; } = ValidValue.Valid;
@@ -138,12 +149,16 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
this.data.PopulateFrom(data);
}
public Sax.SportGrouping Grouping
{
get { return data.Grouping; }
set { data.Grouping = value; }
}
public SysId SportIdParent
{
get { return data.SportIdParent; }
@@ -171,6 +186,14 @@ namespace Saxonite.Net.Standard.Base.Bus
// P a r a m s
//-------------------------------------------------------------------
// List parameters.
public enum SportGroupingCat
{
Any,
Specific,
Banner,
BannerOrSpecific,
Group,
}
public enum StatusCat
{
Any,
@@ -187,6 +210,7 @@ namespace Saxonite.Net.Standard.Base.Bus
// List filtering.
public List<SysId> IdsIncluded { get; } = new List<SysId>();
public List<SysId> IdsExcluded { get; } = new List<SysId>();
public SportGroupingCat SportGroupingCat { get; set; } = SportGroupingCat.BannerOrSpecific;
public SysId SportIdParent { get; set; }
/// <summary>Generic filter - partial sport name, or other matching value (tbd).</summary>
public String SportFilter { get; set; }
@@ -152,7 +152,6 @@ namespace Saxonite.Net.Standard.Base.Bus
/// <summary>Serialise as XML.</summary>
public String ToXml()
{
String fn = typeof(SaxContactData).FullName + ".ToXml";
try
{
XDocument doc = new XDocument();
@@ -178,7 +177,7 @@ namespace Saxonite.Net.Standard.Base.Bus
}
catch (Exception exc)
{
SaLogger.Warn(fn + " " + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn} " + ExceptionUtil.GetLogMessage(exc));
}
return "";
}
@@ -187,7 +186,6 @@ namespace Saxonite.Net.Standard.Base.Bus
/// <summary>Deserialise from XML data.</summary>
private void FromXml(String contactsData)
{
String fn = typeof(SaxContactData).FullName + ".FromXml";
contacts.Clear();
if (StringUtil.IsEmpty(contactsData)) return;
@@ -218,14 +216,14 @@ namespace Saxonite.Net.Standard.Base.Bus
};
contacts.Add(contactType, contactData);
}
else SaLogger.Warn(fn + " Unrecognised contact type: " + contactType);
else SaLogger.Warn($"{SysUtil.Fn} Unrecognised contact type: " + contactType);
}
else SaLogger.Warn(fn + " Unexpected 'Root' child element: " + rootChildElementName);
else SaLogger.Warn($"{SysUtil.Fn} Unexpected 'Root' child element: " + rootChildElementName);
}
}
catch (Exception exc)
{
SaLogger.Warn(fn + " " + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn} " + ExceptionUtil.GetLogMessage(exc));
}
}
@@ -350,10 +350,9 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
this.data.PopulateFrom(data);
}
public String EmailAddress
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -218,14 +219,13 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (SysId.IsValid(UserAccountId) && SysId.ToInt(UserAccountId) != SysId.ToInt(data.UserAccountId))
throw new NotSupportedException(fn + " User Account Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} User Account Id cannot be changed");
if (ItemId.IsValid(ItemId) && ItemId.Type != data.ItemId.Type && SysId.ToInt(ItemId.Id) != SysId.ToInt(data.ItemId.Id))
throw new NotSupportedException(fn + " Item Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Item Id cannot be changed");
this.data.PopulateFrom(data);
}
public SysId UserAccountId
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -122,14 +123,13 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (SysId.IsValid(UserAccountId) && SysId.ToInt(UserAccountId) != SysId.ToInt(data.UserAccountId))
throw new NotSupportedException(fn + " User Account Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} User Account Id cannot be changed");
if (ConfigType != data.ConfigType)
throw new NotSupportedException(fn + " Config Type cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Config Type cannot be changed");
this.data.PopulateFrom(data);
}
public SysId UserAccountId
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Base.App;
using Saxonite.Net.Standard.Base.App;
using System;
@@ -204,16 +205,15 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (SysId.IsValid(UserAccountId) && SysId.ToInt(UserAccountId) != SysId.ToInt(data.UserAccountId))
throw new NotSupportedException(fn + " User Account Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} User Account Id cannot be changed");
if (SysId.IsValid(RegionId) && SysId.ToInt(RegionId) != SysId.ToInt(data.RegionId))
throw new NotSupportedException(fn + " Region Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Region Id cannot be changed");
if (EligibilityType == 0 && (int)EligibilityType != (int)EligibilityType)
throw new NotSupportedException(fn + " User Eligibility cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} User Eligibility cannot be changed");
this.data.PopulateFrom(data);
}
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -100,10 +101,9 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(UserAccountId) && SysId.ToInt(UserAccountId) != SysId.ToInt(data.UserAccountId))
throw new NotSupportedException(fn + " User Account Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} User Account Id cannot be changed");
this.data.PopulateFrom(data);
}
/// <summary>User Account Id. NB Can only be set where previously invalid.</summary>
@@ -259,14 +259,13 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (SysId.IsValid(UserAccountId) && SysId.ToInt(UserAccountId) != SysId.ToInt(data.UserAccountId))
throw new NotSupportedException(fn + " User Account Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} User Account Id cannot be changed");
if (SysId.IsValid(OrganisationId) && SysId.ToInt(OrganisationId) != SysId.ToInt(data.OrganisationId))
throw new NotSupportedException(fn + " Organisation Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Organisation Id cannot be changed");
this.data.PopulateFrom(data);
}
/// <summary>User Account Id. NB Can only be set where previously invalid.</summary>
@@ -347,20 +346,28 @@ namespace Saxonite.Net.Standard.Base.Bus
public new class Params : SacsHierarchyItem.Params
{
// List filtering.
public List<SysId> IdsIncluded { get; } = new List<SysId>();
public List<SysId> IdsExcluded { get; } = new List<SysId>();
public List<SysId> UserAccountIdsIncluded { get; } = new List<SysId>();
public HashSet<SysId> IdsIncluded { get; } = new HashSet<SysId>();
public HashSet<SysId> IdsExcluded { get; } = new HashSet<SysId>();
// User Account properties.
public HashSet<SysId> UserAccountIdsIncluded { get; } = new HashSet<SysId>();
public SaxUserAccount.StatusCat UserAccountStatusCat { get; set; } = SaxUserAccount.StatusCat.NotDeleted;
public List<SysId> OrganisationIdsIncluded { get; } = new List<SysId>();
public SaxOrganisation.StatusCat OrganisationStatusCat { get; set; } = SaxOrganisation.StatusCat.NotDeleted;
/// <summary>Set true to restruct to User Organisations with at least one Organisation Role.</summary>
public bool OrganisationMembersOnly { get; set; }
public List<Sax.OrganisationRole> OrganisationRoles { get; } = new List<Sax.OrganisationRole>();
public List<Sax.OrganisationRole> OrganisationRolesAny { get; } = new List<Sax.OrganisationRole>();
/// <summary>Exact match on various user account properties including name, email etc.</summary>
public String UserFilter { get; set; }
/// <summary>Partial match on various user account properties including name, countries etc.</summary>
public String UserFilterPartial { get; set; }
// Organisation properties.
public HashSet<SysId> OrganisationIdsIncluded { get; } = new HashSet<SysId>();
/// <summary>Exclude organisations with no upcoming events (from 7 days ago).</summary>
public bool OrganisationHasScheduledEvents { get; set; }
public SaxOrganisation.StatusCat OrganisationStatusCat { get; set; } = SaxOrganisation.StatusCat.NotDeleted;
// Organisation User properties.
/// <summary>Set true to restruct to User Organisations with at least one Organisation Role.</summary>
public bool OrganisationMembersOnly { get; set; }
public HashSet<Sax.OrganisationRole> OrganisationRoles { get; } = new HashSet<Sax.OrganisationRole>();
public HashSet<Sax.OrganisationRole> OrganisationRolesAny { get; } = new HashSet<Sax.OrganisationRole>();
// Common properties.
public String NotesPartial { get; set; }
public StatusCat StatusCat { get; set; } = StatusCat.NotDeleted;
+4 -4
View File
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -170,14 +171,13 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (SysId.IsValid(UserAccountId) && SysId.ToInt(UserAccountId) != SysId.ToInt(data.UserAccountId))
throw new NotSupportedException(fn + " User Account Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} User Account Id cannot be changed");
if (UserRole == 0 && (int)UserRole != (int)UserRole)
throw new NotSupportedException(fn + " User Role cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} User Role cannot be changed");
this.data.PopulateFrom(data);
}
/// <summary>User Account Id. NB Can only be set where previously invalid.</summary>
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -120,10 +121,9 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(UserAccountId) && SysId.ToInt(UserAccountId) != SysId.ToInt(data.UserAccountId))
throw new NotSupportedException(fn + " User Account Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} User Account Id cannot be changed");
this.data.PopulateFrom(data);
}
public SysId UserAccountId
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -196,14 +197,13 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (SysId.IsValid(UserAccountId) && SysId.ToInt(UserAccountId) != SysId.ToInt(data.UserAccountId))
throw new NotSupportedException(fn + " User Account Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} User Account Id cannot be changed");
if (SysId.IsValid(SportId) && SysId.ToInt(SportId) != SysId.ToInt(data.SportId))
throw new NotSupportedException(fn + " Sport Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Sport Id cannot be changed");
this.data.PopulateFrom(data);
}
public SysId UserAccountId
@@ -259,12 +259,11 @@ namespace Saxonite.Net.Standard.Base.Bus
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (SysId.IsValid(UserSportId) && SysId.ToInt(UserSportId) != SysId.ToInt(data.UserSportId))
throw new NotSupportedException(fn + " User Sport Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} User Sport Id cannot be changed");
this.data.PopulateFrom(data);
}
public SysId UserSportId
@@ -1,5 +1,6 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
@@ -169,12 +170,11 @@ namespace Saxonite.Net.Standard.Base.Bus.Support
public Data GetData() { return data.Clone(); }
public void SetData(Data data)
{
String fn = GetType().Name + ".SetData";
// Properties that cannot be changed if previously specified.
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
throw new NotSupportedException(fn + " Id cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
if (SysId.IsValid(UserAccountId) && SysId.ToInt(UserAccountId) != SysId.ToInt(data.UserAccountId))
throw new NotSupportedException(fn + " UserAccountId cannot be changed");
throw new NotSupportedException($"{SysUtil.Fn} UserAccountId cannot be changed");
this.data.PopulateFrom(data);
}
public SysId UserAccountId
@@ -165,7 +165,7 @@ namespace Saxonite.Net.Standard.Base.Consoles
indexData.OrganisationIdOwner = article.OrganisationId;
indexData.SportIds.Add(article.SportIdPrimary);
indexData.RegionIds.Add(article.RegionIdPrimary);
indexData.EffectiveOn = DateUtil.OnInvalid(article.PublishedAt?.Date, article.CreateStamp.On.Date);
indexData.EffectiveOn = DateUtil.OnInvalid(article.PublishedAt, article.CreateStamp.On).Date;
return StoreActivityIndexData(indexData, dbUpdateInfo);
}
return ClearActivityIndex(article.GetItemId(), dbUpdateInfo);
@@ -193,8 +193,8 @@ namespace Saxonite.Net.Standard.Base.Consoles
indexData.OrganisationIdOwner = organisationEvent.OrganisationId;
indexData.SportIds.Add(organisationEvent.SportIdPrimary);
indexData.RegionIds.Add(organisationEvent.RegionIdCountry);
indexData.EffectiveOn = DateUtil.OnInvalid(organisationEvent.PublishedAt?.Date, organisationEvent.CreateStamp.On.Date);
indexData.ExpiresOn = DateUtil.OnInvalid(organisationEvent.ExpiresAt?.Date, DateUtil.IncrementDate(indexData.EffectiveOn, 7));
indexData.EffectiveOn = organisationEvent.EventAt.Date;
indexData.ExpiresOn = DateUtil.OnInvalid(organisationEvent.ExpiresAt, DateUtil.IncrementDate(DateUtil.OnInvalid(organisationEvent.EventTo, organisationEvent.EventAt), 2)).Date;
return StoreActivityIndexData(indexData, dbUpdateInfo);
}
public bool ClearActivityIndex(SaxOrganisationEvent organisationEvent, DbUpdateInfo dbUpdateInfo)
@@ -220,8 +220,8 @@ namespace Saxonite.Net.Standard.Base.Consoles
indexData.OrganisationIdOwner = opportunity.OrganisationId;
indexData.SportIds.Add(opportunity.SportIdPrimary);
indexData.RegionIds.Add(opportunity.RegionIdPrimary);
indexData.EffectiveOn = DateUtil.OnInvalid(opportunity.PublishedAt?.Date, opportunity.CreateStamp.On.Date);
indexData.ExpiresOn = DateUtil.OnInvalid(opportunity.ExpiresAt?.Date, DateUtil.IncrementDate(indexData.EffectiveOn, 28));
indexData.EffectiveOn = DateUtil.OnInvalid(opportunity.PublishedAt, opportunity.CreateStamp.On).Date;
indexData.ExpiresOn = DateUtil.OnInvalid(opportunity.ExpiresAt, DateUtil.IncrementDate(indexData.EffectiveOn, 28)).Date;
return StoreActivityIndexData(indexData, dbUpdateInfo);
}
public bool ClearActivityIndex(SaxOrganisationOpportunity opportunity, DbUpdateInfo dbUpdateInfo)
@@ -74,7 +74,7 @@ namespace Saxonite.Net.Standard.Base.Mgr.Reference
return false;
}
// ENT Province code.
if (errField.EntProvinceCode != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.EntProvinceCode, "ENT code", (long)SaxDbDfn_Reference.GetColTextLen(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_EntProvinceCode), true))
if (errField.EntProvinceCode != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.EntProvinceCode, "ENT code", (long)SaxDbDfn_Reference.GetColTextLen(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_EntProvinceCode)))
{
errField.EntProvinceCode = SacsHierarchyItem.ValidValue.Invalid;
return false;
@@ -93,7 +93,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
prmUserOrganisation.UserAccountIdsIncluded.Add(userAccountId);
prmUserOrganisation.OrganisationStatusCat = SaxOrganisation.StatusCat.ActiveOnly;
prmUserOrganisation.OrganisationMembersOnly = true;
prmUserOrganisation.OrganisationRolesAny.AddRange(organisationRoles);
prmUserOrganisation.OrganisationRolesAny.UnionWith(organisationRoles);
prmUserOrganisation.StatusCat = statusCat;
return GetOrganisations(prmUserOrganisation);
}
@@ -42,14 +42,13 @@ namespace Saxonite.Net.Standard.Base.Mgr
//-------------------------------------------------------------------
public Boolean UpdateActivityFeedback(ItemId itemId, int viewCountIncrement, int feedbackCountIncrement, int feedbackTotalIncrement, DbUpdateInfo dbUpdateInfo)
{
String fn = "UpdateActivityFeedback";
ClearErrorState();
if (!ItemId.IsValid(itemId))
return SetErrorState("Unable to update activity feedback - Item Id must be supplied");
if (viewCountIncrement == 0 && feedbackCountIncrement == 0 && feedbackTotalIncrement == 0)
return true;
if (DebugMode)
SaLogger.Info(fn + " View count incr: " + viewCountIncrement + ". Feedback count incr: " + feedbackCountIncrement + ". Feedback total incr: " + feedbackTotalIncrement);
SaLogger.Info($"{SysUtil.Fn} View count incr: {viewCountIncrement}. Feedback count incr: {feedbackCountIncrement}. Feedback total incr: {feedbackTotalIncrement}.");
using (DisposableCollection<SacsDisposable> disposableItems = new DisposableCollection<SacsDisposable>())
{
bool activityFeedbackCreated = false;
@@ -67,6 +67,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
public SaxItemDataMgr ItemDataMgr { get { return Internals.ItemDataMgr; } }
// Application codes.
public List<TypeCodeDesc> DataItemTypeCodes { get { return Internals.DataItemTypeCodes; } }
public List<TypeCodeDesc> SportGroupingCodes { get { return Internals.SportGroupingCodes; } }
public List<TypeCodeDesc> SportSpecialityLabelCodes { get { return Internals.SportSpecialityLabelCodes; } }
public List<TypeCodeDesc> SportContactTypeCodes { get { return Internals.SportContactTypeCodes; } }
public List<TypeCodeDesc> SportParticipatingCodes { get { return Internals.SportParticipatingCodes; } }
@@ -169,6 +169,12 @@ namespace Saxonite.Net.Standard.Base.Mgr
DataValue value = new DataValue();
switch ((SaxSport.Column)column.Id)
{
//-----------------------------------------------------------
// Grouping.
case SaxSport.Column.Grouping_Desc:
value = new DataValue(Internals.SportGroupingCodes.GetDescForType(values.GetValue(column.DataName).AsLong()));
break;
//-----------------------------------------------------------
// Speciality label.
case SaxSport.Column.SpecialityLabel_Desc: