This commit is contained in:
2022-07-16 13:30:57 +01:00
parent 5fc6389af2
commit dc431e1634
79 changed files with 3570 additions and 310 deletions
+3 -1
View File
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
//-------------------------------------------------------------------
public static class Version
{
private static String version { get; } = "1.2.7.0";
private static String version { get; } = "1.2.8.0";
// Retrieve version.
public static String GetFullVersion () { return version; }
public static String GetAppVersion ()
@@ -40,6 +40,8 @@ namespace Saxonite.Net.Standard.Base.App
//-------------------------------------------------------------------
// Version history.
//-------------------------------------------------------------------
// 1.2.8 ?-Jul-2022
// -
// 1.2.7 9-Jun-2022 Online Activty list images
// - Organisation logo and article thumbnail in article list.
// 1.2.6 16-May-2022 Image resizing
+13
View File
@@ -29,6 +29,7 @@ namespace Saxonite.Net.Standard.Base.App
OrganisationType,
OrganisationCategory,
OrganisationRole,
AssociationType,
AddressType,
ContactMethod,
EventType,
@@ -85,6 +86,7 @@ namespace Saxonite.Net.Standard.Base.App
// Item link components.
ItemImage = 400,
ItemAddress = 405,
ItemAssociation = 410,
ItemSport = 420,
}
@@ -247,6 +249,17 @@ namespace Saxonite.Net.Standard.Base.App
ArticleAdmin,
}
//-------------------------------------------------------------------
public enum AssociationType
{
Unknown = 0,
/* Do not change the numeric values - tied to database. */
/// <summary>'To' Affiliated to 'From' item. From/To: Organisation.</summary>
Affiliate = 10,
/// <summary>Partner items. From/To: Organisation.</summary>
Partner = 20,
}
//-------------------------------------------------------------------
public enum AddressType
{
+163 -131
View File
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 8-Jun-2022 09:36:43
// Code generated by Sarand Database Utilities Fri 10-Jun-2022 07:59:42
//---------------------------------------------------------------------------
namespace Saxonite.Base.App
{
@@ -21,6 +21,7 @@ namespace Saxonite.Base.App
ActivityIndex,
Article,
ItemAddress,
ItemAssociation,
ItemImage,
ItemSport,
Organisation,
@@ -119,6 +120,21 @@ namespace Saxonite.Base.App
ItemAddress_UpdateOn,
ItemAddress_UpdateBy,
ItemAddress_UpdateHost,
ItemAssociation_Id,
ItemAssociation_ItemTypeFrom,
ItemAssociation_ItemIdFrom,
ItemAssociation_ItemTypeTo,
ItemAssociation_ItemIdTo,
ItemAssociation_AssociationType,
ItemAssociation_Notes,
ItemAssociation_Flags,
ItemAssociation_Status,
ItemAssociation_CreateOn,
ItemAssociation_CreateBy,
ItemAssociation_CreateHost,
ItemAssociation_UpdateOn,
ItemAssociation_UpdateBy,
ItemAssociation_UpdateHost,
ItemImage_Id,
ItemImage_ItemType,
ItemImage_ItemId,
@@ -378,8 +394,8 @@ namespace Saxonite.Base.App
//-------------------------------------------------------------------
// Data members.
private static readonly int tableCount = 19;
private static readonly int columnCount = 331;
private static readonly int tableCount = 20;
private static readonly int columnCount = 346;
private static ulong maxTextLen = 0;
//-------------------------------------------------------------------
@@ -529,6 +545,7 @@ namespace Saxonite.Base.App
"ActivityIndex",
"Article",
"ItemAddress",
"ItemAssociation",
"ItemImage",
"ItemSport",
"Organisation",
@@ -647,18 +664,11 @@ namespace Saxonite.Base.App
new ColumnDfn(4,"UpdateBy",4,4,false,10),
new ColumnDfn(4,"UpdateHost",0,12,false,100),
new ColumnDfn(5,"Id",5,-5,true,19),
new ColumnDfn(5,"ItemType",3,5,false,5),
new ColumnDfn(5,"ItemId",4,4,false,10),
new ColumnDfn(5,"ImageType",3,5,false,5),
new ColumnDfn(5,"ImageSeq",2,-6,false,3),
new ColumnDfn(5,"SessionUid",5,-5,false,19),
new ColumnDfn(5,"ImageUid",4,4,false,10),
new ColumnDfn(5,"Filename",0,-9,false,1024),
new ColumnDfn(5,"Mime",0,12,false,64),
new ColumnDfn(5,"ContentType",0,12,false,128),
new ColumnDfn(5,"Width",4,4,false,10),
new ColumnDfn(5,"Height",4,4,false,10),
new ColumnDfn(5,"ImageData",10,-3,false,0),
new ColumnDfn(5,"ItemTypeFrom",3,5,false,5),
new ColumnDfn(5,"ItemIdFrom",4,4,false,10),
new ColumnDfn(5,"ItemTypeTo",3,5,false,5),
new ColumnDfn(5,"ItemIdTo",4,4,false,10),
new ColumnDfn(5,"AssociationType",3,5,false,5),
new ColumnDfn(5,"Notes",0,-9,false,2000),
new ColumnDfn(5,"Flags",3,5,false,5),
new ColumnDfn(5,"Status",0,12,false,3),
@@ -668,11 +678,19 @@ namespace Saxonite.Base.App
new ColumnDfn(5,"UpdateOn",9,93,false,23),
new ColumnDfn(5,"UpdateBy",4,4,false,10),
new ColumnDfn(5,"UpdateHost",0,12,false,100),
new ColumnDfn(6,"Id",4,4,true,10),
new ColumnDfn(6,"Id",5,-5,true,19),
new ColumnDfn(6,"ItemType",3,5,false,5),
new ColumnDfn(6,"ItemId",4,4,false,10),
new ColumnDfn(6,"SportId",4,4,false,10),
new ColumnDfn(6,"ItemSportData",0,-9,false,0),
new ColumnDfn(6,"ImageType",3,5,false,5),
new ColumnDfn(6,"ImageSeq",2,-6,false,3),
new ColumnDfn(6,"SessionUid",5,-5,false,19),
new ColumnDfn(6,"ImageUid",4,4,false,10),
new ColumnDfn(6,"Filename",0,-9,false,1024),
new ColumnDfn(6,"Mime",0,12,false,64),
new ColumnDfn(6,"ContentType",0,12,false,128),
new ColumnDfn(6,"Width",4,4,false,10),
new ColumnDfn(6,"Height",4,4,false,10),
new ColumnDfn(6,"ImageData",10,-3,false,0),
new ColumnDfn(6,"Notes",0,-9,false,2000),
new ColumnDfn(6,"Flags",3,5,false,5),
new ColumnDfn(6,"Status",0,12,false,3),
@@ -683,15 +701,10 @@ namespace Saxonite.Base.App
new ColumnDfn(6,"UpdateBy",4,4,false,10),
new ColumnDfn(6,"UpdateHost",0,12,false,100),
new ColumnDfn(7,"Id",4,4,true,10),
new ColumnDfn(7,"Name",0,-9,false,100),
new ColumnDfn(7,"OrganisationType",0,12,false,3),
new ColumnDfn(7,"OrganisationCategory",0,12,false,3),
new ColumnDfn(7,"SportIdPrimary",4,4,false,10),
new ColumnDfn(7,"RegionIdPrimary",4,4,false,10),
new ColumnDfn(7,"About",0,-9,false,2000),
new ColumnDfn(7,"Facilities",0,-9,false,2000),
new ColumnDfn(7,"ContactData",0,-9,false,0),
new ColumnDfn(7,"CountryIso2Code",0,12,false,2),
new ColumnDfn(7,"ItemType",3,5,false,5),
new ColumnDfn(7,"ItemId",4,4,false,10),
new ColumnDfn(7,"SportId",4,4,false,10),
new ColumnDfn(7,"ItemSportData",0,-9,false,0),
new ColumnDfn(7,"Notes",0,-9,false,2000),
new ColumnDfn(7,"Flags",3,5,false,5),
new ColumnDfn(7,"Status",0,12,false,3),
@@ -702,16 +715,15 @@ namespace Saxonite.Base.App
new ColumnDfn(7,"UpdateBy",4,4,false,10),
new ColumnDfn(7,"UpdateHost",0,12,false,100),
new ColumnDfn(8,"Id",4,4,true,10),
new ColumnDfn(8,"OrganisationId",4,4,false,10),
new ColumnDfn(8,"Name",0,-9,false,100),
new ColumnDfn(8,"OrganisationType",0,12,false,3),
new ColumnDfn(8,"OrganisationCategory",0,12,false,3),
new ColumnDfn(8,"SportIdPrimary",4,4,false,10),
new ColumnDfn(8,"RegionIdCountry",4,4,false,10),
new ColumnDfn(8,"EventAt",9,93,false,16),
new ColumnDfn(8,"EventTypeCode",0,12,false,3),
new ColumnDfn(8,"Summary",0,-9,false,200),
new ColumnDfn(8,"Details",0,-9,false,2000),
new ColumnDfn(8,"EventData",0,-9,false,0),
new ColumnDfn(8,"PublishedAt",9,93,false,16),
new ColumnDfn(8,"ExpiresAt",9,93,false,16),
new ColumnDfn(8,"RegionIdPrimary",4,4,false,10),
new ColumnDfn(8,"About",0,-9,false,2000),
new ColumnDfn(8,"Facilities",0,-9,false,2000),
new ColumnDfn(8,"ContactData",0,-9,false,0),
new ColumnDfn(8,"CountryIso2Code",0,12,false,2),
new ColumnDfn(8,"Notes",0,-9,false,2000),
new ColumnDfn(8,"Flags",3,5,false,5),
new ColumnDfn(8,"Status",0,12,false,3),
@@ -724,11 +736,12 @@ namespace Saxonite.Base.App
new ColumnDfn(9,"Id",4,4,true,10),
new ColumnDfn(9,"OrganisationId",4,4,false,10),
new ColumnDfn(9,"SportIdPrimary",4,4,false,10),
new ColumnDfn(9,"RegionIdPrimary",4,4,false,10),
new ColumnDfn(9,"OpportunityTypeCode",0,12,false,3),
new ColumnDfn(9,"Position",0,-9,false,200),
new ColumnDfn(9,"Outline",0,-9,false,2000),
new ColumnDfn(9,"OpportunityData",0,-9,false,0),
new ColumnDfn(9,"RegionIdCountry",4,4,false,10),
new ColumnDfn(9,"EventAt",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),
new ColumnDfn(9,"EventData",0,-9,false,0),
new ColumnDfn(9,"PublishedAt",9,93,false,16),
new ColumnDfn(9,"ExpiresAt",9,93,false,16),
new ColumnDfn(9,"Notes",0,-9,false,2000),
@@ -741,12 +754,15 @@ namespace Saxonite.Base.App
new ColumnDfn(9,"UpdateBy",4,4,false,10),
new ColumnDfn(9,"UpdateHost",0,12,false,100),
new ColumnDfn(10,"Id",4,4,true,10),
new ColumnDfn(10,"RegionType",3,5,false,5),
new ColumnDfn(10,"CountryIso2Code",0,12,false,2),
new ColumnDfn(10,"Name",0,-9,false,100),
new ColumnDfn(10,"Latitude",8,3,false,9),
new ColumnDfn(10,"Longitude",8,3,false,9),
new ColumnDfn(10,"RegionIdParent",4,4,false,10),
new ColumnDfn(10,"OrganisationId",4,4,false,10),
new ColumnDfn(10,"SportIdPrimary",4,4,false,10),
new ColumnDfn(10,"RegionIdPrimary",4,4,false,10),
new ColumnDfn(10,"OpportunityTypeCode",0,12,false,3),
new ColumnDfn(10,"Position",0,-9,false,200),
new ColumnDfn(10,"Outline",0,-9,false,2000),
new ColumnDfn(10,"OpportunityData",0,-9,false,0),
new ColumnDfn(10,"PublishedAt",9,93,false,16),
new ColumnDfn(10,"ExpiresAt",9,93,false,16),
new ColumnDfn(10,"Notes",0,-9,false,2000),
new ColumnDfn(10,"Flags",3,5,false,5),
new ColumnDfn(10,"Status",0,12,false,3),
@@ -757,9 +773,12 @@ namespace Saxonite.Base.App
new ColumnDfn(10,"UpdateBy",4,4,false,10),
new ColumnDfn(10,"UpdateHost",0,12,false,100),
new ColumnDfn(11,"Id",4,4,true,10),
new ColumnDfn(11,"SportIdParent",4,4,false,10),
new ColumnDfn(11,"RegionType",3,5,false,5),
new ColumnDfn(11,"CountryIso2Code",0,12,false,2),
new ColumnDfn(11,"Name",0,-9,false,100),
new ColumnDfn(11,"SpecialityLabel",3,5,false,5),
new ColumnDfn(11,"Latitude",8,3,false,9),
new ColumnDfn(11,"Longitude",8,3,false,9),
new ColumnDfn(11,"RegionIdParent",4,4,false,10),
new ColumnDfn(11,"Notes",0,-9,false,2000),
new ColumnDfn(11,"Flags",3,5,false,5),
new ColumnDfn(11,"Status",0,12,false,3),
@@ -770,29 +789,9 @@ 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,"EmailAddress",0,-9,false,200),
new ColumnDfn(12,"Title",0,-9,false,20),
new ColumnDfn(12,"FirstName",0,-9,false,100),
new ColumnDfn(12,"Initials",0,-9,false,10),
new ColumnDfn(12,"LastName",0,-9,false,100),
new ColumnDfn(12,"About",0,-9,false,2000),
new ColumnDfn(12,"PhoneMain",0,-9,false,50),
new ColumnDfn(12,"PhoneMobile",0,-9,false,50),
new ColumnDfn(12,"PhoneAlt",0,-9,false,50),
new ColumnDfn(12,"Gender",2,-6,false,3),
new ColumnDfn(12,"DateOfBirthDay",2,-6,false,3),
new ColumnDfn(12,"DateOfBirthMonth",2,-6,false,3),
new ColumnDfn(12,"DateOfBirthYear",3,5,false,5),
new ColumnDfn(12,"RegionIdCountry",4,4,false,10),
new ColumnDfn(12,"RegionIdProvince",4,4,false,10),
new ColumnDfn(12,"JournalistData",0,-9,false,0),
new ColumnDfn(12,"PasswordToken",0,12,false,32),
new ColumnDfn(12,"PasswordHashed",0,-9,false,100),
new ColumnDfn(12,"PasswordHistory",0,-9,false,0),
new ColumnDfn(12,"PasswordChangedAt",9,93,false,16),
new ColumnDfn(12,"LastLoginAt",9,93,false,16),
new ColumnDfn(12,"LastInvalidLoginAt",9,93,false,16),
new ColumnDfn(12,"InvalidLoginCount",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),
new ColumnDfn(12,"Notes",0,-9,false,2000),
new ColumnDfn(12,"Flags",3,5,false,5),
new ColumnDfn(12,"Status",0,12,false,3),
@@ -802,19 +801,30 @@ namespace Saxonite.Base.App
new ColumnDfn(12,"UpdateOn",9,93,false,23),
new ColumnDfn(12,"UpdateBy",4,4,false,10),
new ColumnDfn(12,"UpdateHost",0,12,false,100),
new ColumnDfn(13,"Id",5,-5,true,19),
new ColumnDfn(13,"UserAccountId",4,4,false,10),
new ColumnDfn(13,"ItemType",3,5,false,5),
new ColumnDfn(13,"ItemId",5,-5,false,19),
new ColumnDfn(13,"CurrentlyListed",1,-7,false,1),
new ColumnDfn(13,"ListedAtFirst",9,93,false,16),
new ColumnDfn(13,"ListedAtLast",9,93,false,16),
new ColumnDfn(13,"ViewedAtFirst",9,93,false,16),
new ColumnDfn(13,"ViewedAtLast",9,93,false,16),
new ColumnDfn(13,"Reaction",3,5,false,5),
new ColumnDfn(13,"ReactedAtFirst",9,93,false,16),
new ColumnDfn(13,"ReactedAtLast",9,93,false,16),
new ColumnDfn(13,"UserActivityData",0,-9,false,0),
new ColumnDfn(13,"Id",4,4,true,10),
new ColumnDfn(13,"EmailAddress",0,-9,false,200),
new ColumnDfn(13,"Title",0,-9,false,20),
new ColumnDfn(13,"FirstName",0,-9,false,100),
new ColumnDfn(13,"Initials",0,-9,false,10),
new ColumnDfn(13,"LastName",0,-9,false,100),
new ColumnDfn(13,"About",0,-9,false,2000),
new ColumnDfn(13,"PhoneMain",0,-9,false,50),
new ColumnDfn(13,"PhoneMobile",0,-9,false,50),
new ColumnDfn(13,"PhoneAlt",0,-9,false,50),
new ColumnDfn(13,"Gender",2,-6,false,3),
new ColumnDfn(13,"DateOfBirthDay",2,-6,false,3),
new ColumnDfn(13,"DateOfBirthMonth",2,-6,false,3),
new ColumnDfn(13,"DateOfBirthYear",3,5,false,5),
new ColumnDfn(13,"RegionIdCountry",4,4,false,10),
new ColumnDfn(13,"RegionIdProvince",4,4,false,10),
new ColumnDfn(13,"JournalistData",0,-9,false,0),
new ColumnDfn(13,"PasswordToken",0,12,false,32),
new ColumnDfn(13,"PasswordHashed",0,-9,false,100),
new ColumnDfn(13,"PasswordHistory",0,-9,false,0),
new ColumnDfn(13,"PasswordChangedAt",9,93,false,16),
new ColumnDfn(13,"LastLoginAt",9,93,false,16),
new ColumnDfn(13,"LastInvalidLoginAt",9,93,false,16),
new ColumnDfn(13,"InvalidLoginCount",3,5,false,5),
new ColumnDfn(13,"Notes",0,-9,false,2000),
new ColumnDfn(13,"Flags",3,5,false,5),
new ColumnDfn(13,"Status",0,12,false,3),
@@ -824,29 +834,36 @@ namespace Saxonite.Base.App
new ColumnDfn(13,"UpdateOn",9,93,false,23),
new ColumnDfn(13,"UpdateBy",4,4,false,10),
new ColumnDfn(13,"UpdateHost",0,12,false,100),
new ColumnDfn(14,"Id",5,-5,true,19),
new ColumnDfn(14,"UserAccountId",4,4,false,10),
new ColumnDfn(14,"OnlineAt",9,93,false,16),
new ColumnDfn(15,"Id",5,-5,true,19),
new ColumnDfn(14,"ItemType",3,5,false,5),
new ColumnDfn(14,"ItemId",5,-5,false,19),
new ColumnDfn(14,"CurrentlyListed",1,-7,false,1),
new ColumnDfn(14,"ListedAtFirst",9,93,false,16),
new ColumnDfn(14,"ListedAtLast",9,93,false,16),
new ColumnDfn(14,"ViewedAtFirst",9,93,false,16),
new ColumnDfn(14,"ViewedAtLast",9,93,false,16),
new ColumnDfn(14,"Reaction",3,5,false,5),
new ColumnDfn(14,"ReactedAtFirst",9,93,false,16),
new ColumnDfn(14,"ReactedAtLast",9,93,false,16),
new ColumnDfn(14,"UserActivityData",0,-9,false,0),
new ColumnDfn(14,"Notes",0,-9,false,2000),
new ColumnDfn(14,"Flags",3,5,false,5),
new ColumnDfn(14,"Status",0,12,false,3),
new ColumnDfn(14,"CreateOn",9,93,false,23),
new ColumnDfn(14,"CreateBy",4,4,false,10),
new ColumnDfn(14,"CreateHost",0,12,false,100),
new ColumnDfn(14,"UpdateOn",9,93,false,23),
new ColumnDfn(14,"UpdateBy",4,4,false,10),
new ColumnDfn(14,"UpdateHost",0,12,false,100),
new ColumnDfn(15,"UserAccountId",4,4,false,10),
new ColumnDfn(15,"OrganisationId",4,4,false,10),
new ColumnDfn(15,"OrganisationRoleCodes",0,12,false,256),
new ColumnDfn(15,"OrganisationRoleCount",2,-6,false,3),
new ColumnDfn(15,"AdminComment",0,-9,false,2000),
new ColumnDfn(15,"Notes",0,-9,false,2000),
new ColumnDfn(15,"Flags",3,5,false,5),
new ColumnDfn(15,"Status",0,12,false,3),
new ColumnDfn(15,"CreateOn",9,93,false,23),
new ColumnDfn(15,"CreateBy",4,4,false,10),
new ColumnDfn(15,"CreateHost",0,12,false,100),
new ColumnDfn(15,"UpdateOn",9,93,false,23),
new ColumnDfn(15,"UpdateBy",4,4,false,10),
new ColumnDfn(15,"UpdateHost",0,12,false,100),
new ColumnDfn(15,"OnlineAt",9,93,false,16),
new ColumnDfn(16,"Id",5,-5,true,19),
new ColumnDfn(16,"UserAccountId",4,4,false,10),
new ColumnDfn(16,"UserRoleCode",0,12,false,16),
new ColumnDfn(16,"LastLoginAt",9,93,false,16),
new ColumnDfn(16,"LastInvalidLoginAt",9,93,false,16),
new ColumnDfn(16,"InvalidLoginCount",3,5,false,5),
new ColumnDfn(16,"OrganisationId",4,4,false,10),
new ColumnDfn(16,"OrganisationRoleCodes",0,12,false,256),
new ColumnDfn(16,"OrganisationRoleCount",2,-6,false,3),
new ColumnDfn(16,"AdminComment",0,-9,false,2000),
new ColumnDfn(16,"Notes",0,-9,false,2000),
new ColumnDfn(16,"Flags",3,5,false,5),
new ColumnDfn(16,"Status",0,12,false,3),
@@ -856,42 +873,34 @@ namespace Saxonite.Base.App
new ColumnDfn(16,"UpdateOn",9,93,false,23),
new ColumnDfn(16,"UpdateBy",4,4,false,10),
new ColumnDfn(16,"UpdateHost",0,12,false,100),
new ColumnDfn(17,"Id",5,-5,true,19),
new ColumnDfn(17,"UserAccountId",4,4,false,10),
new ColumnDfn(17,"ActivityIndexIds",0,-9,false,0),
new ColumnDfn(17,"UserSessionData",0,-9,false,0),
new ColumnDfn(17,"UserRoleCode",0,12,false,16),
new ColumnDfn(17,"LastLoginAt",9,93,false,16),
new ColumnDfn(17,"LastInvalidLoginAt",9,93,false,16),
new ColumnDfn(17,"InvalidLoginCount",3,5,false,5),
new ColumnDfn(17,"Notes",0,-9,false,2000),
new ColumnDfn(17,"Flags",3,5,false,5),
new ColumnDfn(17,"Status",0,12,false,3),
new ColumnDfn(17,"CreateOn",9,93,false,23),
new ColumnDfn(17,"CreateBy",4,4,false,10),
new ColumnDfn(17,"CreateHost",0,12,false,100),
new ColumnDfn(17,"UpdateOn",9,93,false,23),
new ColumnDfn(18,"Id",5,-5,true,19),
new ColumnDfn(17,"UpdateBy",4,4,false,10),
new ColumnDfn(17,"UpdateHost",0,12,false,100),
new ColumnDfn(18,"UserAccountId",4,4,false,10),
new ColumnDfn(18,"SportId",4,4,false,10),
new ColumnDfn(18,"About",0,-9,false,2000),
new ColumnDfn(18,"Participation",3,5,false,5),
new ColumnDfn(18,"Officiating",3,5,false,5),
new ColumnDfn(18,"UserSportData",0,-9,false,0),
new ColumnDfn(18,"Notes",0,-9,false,2000),
new ColumnDfn(18,"ActivityIndexIds",0,-9,false,0),
new ColumnDfn(18,"UserSessionData",0,-9,false,0),
new ColumnDfn(18,"Flags",3,5,false,5),
new ColumnDfn(18,"Status",0,12,false,3),
new ColumnDfn(18,"CreateOn",9,93,false,23),
new ColumnDfn(18,"CreateBy",4,4,false,10),
new ColumnDfn(18,"CreateHost",0,12,false,100),
new ColumnDfn(18,"UpdateOn",9,93,false,23),
new ColumnDfn(18,"UpdateBy",4,4,false,10),
new ColumnDfn(18,"UpdateHost",0,12,false,100),
new ColumnDfn(19,"Id",5,-5,true,19),
new ColumnDfn(19,"UserSportId",5,-5,false,19),
new ColumnDfn(19,"PeriodFrom",9,93,false,16),
new ColumnDfn(19,"PeriodTo",9,93,false,16),
new ColumnDfn(19,"OrganisationId",4,4,false,10),
new ColumnDfn(19,"OrganisationName",0,-9,false,200),
new ColumnDfn(19,"Summary",0,-9,false,2000),
new ColumnDfn(19,"Team",0,-9,false,64),
new ColumnDfn(19,"League",0,-9,false,64),
new ColumnDfn(19,"Speciality",0,-9,false,64),
new ColumnDfn(19,"SpecialitiesOther",0,-9,false,1000),
new ColumnDfn(19,"RegionIdNation",4,4,false,10),
new ColumnDfn(19,"RegionIdProvince",4,4,false,10),
new ColumnDfn(19,"UserSportExperienceData",0,-9,false,0),
new ColumnDfn(19,"UserAccountId",4,4,false,10),
new ColumnDfn(19,"SportId",4,4,false,10),
new ColumnDfn(19,"About",0,-9,false,2000),
new ColumnDfn(19,"Participation",3,5,false,5),
new ColumnDfn(19,"Officiating",3,5,false,5),
new ColumnDfn(19,"UserSportData",0,-9,false,0),
new ColumnDfn(19,"Notes",0,-9,false,2000),
new ColumnDfn(19,"Flags",3,5,false,5),
new ColumnDfn(19,"Status",0,12,false,3),
@@ -901,6 +910,29 @@ namespace Saxonite.Base.App
new ColumnDfn(19,"UpdateOn",9,93,false,23),
new ColumnDfn(19,"UpdateBy",4,4,false,10),
new ColumnDfn(19,"UpdateHost",0,12,false,100),
new ColumnDfn(20,"Id",5,-5,true,19),
new ColumnDfn(20,"UserSportId",5,-5,false,19),
new ColumnDfn(20,"PeriodFrom",9,93,false,16),
new ColumnDfn(20,"PeriodTo",9,93,false,16),
new ColumnDfn(20,"OrganisationId",4,4,false,10),
new ColumnDfn(20,"OrganisationName",0,-9,false,200),
new ColumnDfn(20,"Summary",0,-9,false,2000),
new ColumnDfn(20,"Team",0,-9,false,64),
new ColumnDfn(20,"League",0,-9,false,64),
new ColumnDfn(20,"Speciality",0,-9,false,64),
new ColumnDfn(20,"SpecialitiesOther",0,-9,false,1000),
new ColumnDfn(20,"RegionIdNation",4,4,false,10),
new ColumnDfn(20,"RegionIdProvince",4,4,false,10),
new ColumnDfn(20,"UserSportExperienceData",0,-9,false,0),
new ColumnDfn(20,"Notes",0,-9,false,2000),
new ColumnDfn(20,"Flags",3,5,false,5),
new ColumnDfn(20,"Status",0,12,false,3),
new ColumnDfn(20,"CreateOn",9,93,false,23),
new ColumnDfn(20,"CreateBy",4,4,false,10),
new ColumnDfn(20,"CreateHost",0,12,false,100),
new ColumnDfn(20,"UpdateOn",9,93,false,23),
new ColumnDfn(20,"UpdateBy",4,4,false,10),
new ColumnDfn(20,"UpdateHost",0,12,false,100),
};
//-------------------------------------------------------------------
@@ -99,6 +99,7 @@ namespace Saxonite.Net.Standard.Base.App
public List<TypeCodeDesc> OrganisationTypeCodes { get { return GetCodesOfType(Sax.CodeType.OrganisationType); } }
public List<TypeCodeDesc> OrganisationCategoryCodes { get { return GetCodesOfType(Sax.CodeType.OrganisationCategory); } }
public List<TypeCodeDesc> OrganisationRoleCodes { get { return GetCodesOfType(Sax.CodeType.OrganisationRole); } }
public List<TypeCodeDesc> AssociationTypeCodes { get { return GetCodesOfType(Sax.CodeType.AssociationType); } }
public List<TypeCodeDesc> AddressTypeCodes { get { return GetCodesOfType(Sax.CodeType.AddressType); } }
public List<TypeCodeDesc> ContactMethodCodes { get { return GetCodesOfType(Sax.CodeType.ContactMethod); } }
public List<TypeCodeDesc> EventTypeCodes { get { return GetCodesOfType(Sax.CodeType.EventType); } }
@@ -26,6 +26,7 @@ namespace Saxonite.Net.Standard.Base.App
private static readonly List<TypeCodeDesc> organisationTypeCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> organisationCategoryCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> organisationRoleCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> associationTypeCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> addressTypeCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> contactMethodCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> eventTypeCodes = new List<TypeCodeDesc>();
@@ -66,6 +67,8 @@ namespace Saxonite.Net.Standard.Base.App
return new List<TypeCodeDesc>(organisationCategoryCodes);
case Sax.CodeType.OrganisationRole:
return new List<TypeCodeDesc>(organisationRoleCodes);
case Sax.CodeType.AssociationType:
return new List<TypeCodeDesc>(associationTypeCodes);
case Sax.CodeType.AddressType:
return new List<TypeCodeDesc>(addressTypeCodes);
case Sax.CodeType.ContactMethod:
@@ -205,6 +208,11 @@ namespace Saxonite.Net.Standard.Base.App
organisationRoleCodes.Add(Sax.OrganisationRole.OpportunityAdmin, "OPA", "Opportunities");
organisationRoleCodes.Add(Sax.OrganisationRole.ArticleAdmin, "ARA", "Articles");
//---------------------------------------------------------------
// Association Types.
associationTypeCodes.Add(Sax.AssociationType.Affiliate, "Affiliate", "Affiliate");
associationTypeCodes.Add(Sax.AssociationType.Partner, "Partner", "Partner");
//---------------------------------------------------------------
// Address Types.
addressTypeCodes.Add(Sax.AddressType.Location, "Location", "Location");
@@ -0,0 +1,254 @@
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Saxonite.Net.Standard.Base.App;
using System;
using System.Collections.Generic;
using System.Text;
namespace Saxonite.Net.Standard.Base.Bus
{
//=======================================================================
// ItemSport.
//=======================================================================
public abstract class SaxItemAssociation : SacsHierarchyItem
{
//-------------------------------------------------------------------
// Columns.
public enum Column
{
Pos,
Id,
// Item From.
ItemTypeFrom,
ItemTypeFrom_Code,
ItemTypeFrom_Desc,
ItemIdFrom,
ItemFrom_Caption,
// Item To.
ItemTypeTo,
ItemTypeTo_Code,
ItemTypeTo_Desc,
ItemIdTo,
ItemTo_Caption,
// Association type.
AssociationType,
AssociationType_Code,
AssociationType_Desc,
// Associated data.
// Common.
Notes,
Flags,
Status,
Status_Desc,
Status_Ind,
CreateOn_Date,
UpdateOn_Date,
}
//-------------------------------------------------------------------
/// <summary>Properties other than common.</summary>
public class DataProperties
{
public ItemId ItemIdFrom { get; set; } = new ItemId();
public ItemId ItemIdTo { get; set; } = new ItemId();
public Sax.AssociationType AssociationType { get; set; }
}
//-------------------------------------------------------------------
// Data.
public new class Data : SacsHierarchyItem.Data
{
// Data members.
private readonly DataProperties data = new DataProperties();
// Construction.
public Data()
{
Status = DefaultStatus;
}
// Properties.
public ItemId ItemIdFrom
{
get { return data.ItemIdFrom; }
set { value = ItemId.InvalidOnNull(value); CheckChanged(data.ItemIdFrom, value); data.ItemIdFrom = value; }
}
public ItemId ItemIdTo
{
get { return data.ItemIdTo; }
set { value = ItemId.InvalidOnNull(value); CheckChanged(data.ItemIdTo, value); data.ItemIdTo = value; }
}
public Sax.AssociationType AssociationType
{
get { return data.AssociationType; }
set { CheckChanged((int)data.AssociationType, (int)value); data.AssociationType = value; }
}
// Population.
internal void PopulateFrom(Data data)
{
ItemIdFrom = data.ItemIdFrom;
ItemIdTo = data.ItemIdTo;
AssociationType = data.AssociationType;
base.PopulateFrom(data);
}
public Data Clone()
{
Data data = new Data();
data.PopulateFrom(this);
return data;
}
}
//-------------------------------------------------------------------
// Error field - identify properties with validation error.
public new class ErrField : SacsHierarchyItem.ErrField
{
// Identifies the field that has invalid data.
public ValidValue ItemIdFrom { get; set; } = ValidValue.Valid;
public ValidValue ItemIdTo { get; set; } = ValidValue.Valid;
public ValidValue AssociationType { get; set; } = ValidValue.Valid;
}
//-------------------------------------------------------------------
// Data members.
private readonly Data data = new Data();
//-------------------------------------------------------------------
// Construction.
protected SaxItemAssociation(SysId id, ItemId itemIdFrom, ItemId itemIdTo, Sax.AssociationType associationType) : base(id)
{
base.SetData(data);
ItemIdFrom = itemIdFrom;
ItemIdTo = itemIdTo;
AssociationType = associationType;
Status = DefaultStatus;
}
//-------------------------------------------------------------------
// Status.
private static readonly List<SaStatus> validStatuses = new List<SaStatus>()
{
SaStatus.Active,
SaStatus.Inactive,
SaStatus.Deleted,
};
public static SaStatus DefaultStatus { get { return SaStatus.Active; } }
public static List<SaStatus> ValidStatuses { get { return new List<SaStatus>(validStatuses); } }
public static DataValue.TriStateType GetStatusTriState(SaStatus status)
{
if (status == SaStatus.Active) return DataValue.TriStateType.Green;
if (status == SaStatus.Inactive) return DataValue.TriStateType.Red;
if (status == SaStatus.Deleted) return DataValue.TriStateType.Purple;
return DataValue.TriStateType.Unknown;
}
//-------------------------------------------------------------------
// Utilities.
public ItemId GetItemId()
{
return new ItemId((short)Sax.DataItemType.ItemAssociation, Id);
}
/// <summary>Valid 'From' item types for Association type.</summary>
public static List<Sax.DataItemType> GetValidFromItemTypesForAssociation(Sax.AssociationType associationType)
{
List<Sax.DataItemType> itemTypes = new List<Sax.DataItemType>();
switch (associationType)
{
case Sax.AssociationType.Affiliate:
case Sax.AssociationType.Partner:
itemTypes.Add(Sax.DataItemType.Organisation);
break;
}
return itemTypes;
}
/// <summary>Valid 'To' item types for Association type.</summary>
public static List<Sax.DataItemType> GetValidToItemTypesForAssociation(Sax.AssociationType associationType)
{
List<Sax.DataItemType> itemTypes = new List<Sax.DataItemType>();
switch (associationType)
{
case Sax.AssociationType.Affiliate:
case Sax.AssociationType.Partner:
itemTypes.Add(Sax.DataItemType.Organisation);
break;
}
return itemTypes;
}
//-------------------------------------------------------------------
// 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");
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");
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");
this.data.PopulateFrom(data);
}
public ItemId ItemIdFrom
{
get { return data.ItemIdFrom; }
protected set { data.ItemIdFrom = value; }
}
public ItemId ItemIdTo
{
get { return data.ItemIdTo; }
protected set { data.ItemIdTo = value; }
}
public Sax.AssociationType AssociationType
{
get { return data.AssociationType; }
protected set { data.AssociationType = value; }
}
//-------------------------------------------------------------------
// Flags - positions 1-16 available.
//-------------------------------------------------------------------
// A s s o c i a t e d D a t a
//-------------------------------------------------------------------
//-------------------------------------------------------------------
// P a r a m s
//-------------------------------------------------------------------
// List parameters.
public enum StatusCat
{
Any,
ActiveOnly,
InactiveOnly,
NotDeleted,
DeletedOnly,
}
/// <summary>
/// Item list parameters.
/// </summary>
public new class Params : SacsHierarchyItem.Params
{
// List filtering.
public List<SysId> IdsIncluded { get; } = new List<SysId>();
public List<SysId> IdsExcluded { get; } = new List<SysId>();
/// <summary>Items that can be eitehr 'From' or 'To'.</summary>
public List<ItemId> ItemIdsIncluded { get; } = new List<ItemId>();
/// <summary>Items that can only be the 'From' item.</summary>
public List<ItemId> ItemIdsFromIncluded { get; } = new List<ItemId>();
/// <summary>Items that can only be the 'To' item.</summary>
public List<ItemId> ItemIdsToIncluded { get; } = new List<ItemId>();
public List<Sax.AssociationType> AssociationTypesIncluded { get; } = new List<Sax.AssociationType>();
// Common properties.
public StatusCat StatusCat { get; set; } = StatusCat.NotDeleted;
}
//-------------------------------------------------------------------
}
//=======================================================================
// Item list extension methods.
public static class SaxAssociationList
{
}
//=======================================================================
}
@@ -334,6 +334,15 @@ namespace Saxonite.Net.Standard.Base.Bus
return values.Find(item => item.Id.Equals(organisationId));
}
//-------------------------------------------------------------------
/// <summary>
/// Get the name of the first Organisation in list with the specified Id.
/// </summary>
public static String GetOrganisationName(this List<SaxOrganisation> values, SysId organisationId)
{
return values.Find(item => item.Id.Equals(organisationId))?.Name ?? "";
}
//-------------------------------------------------------------------
}
@@ -0,0 +1,214 @@
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Dbas;
using Saxonite.Base.App;
using Saxonite.Net.Standard.Base.App;
using Saxonite.Net.Standard.Base.Bus;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Saxonite.Net.Standard.Base.Mgr
{
//=======================================================================
partial class SaxItemDataMgr
{
//*******************************************************************
// Item Data Mgr - Item Sport
//*******************************************************************
// Utilities.
//-------------------------------------------------------------------
// Create item.
public abstract SaxItemAssociation CreateItemAssociation(ItemId itemIdFrom, ItemId itemIdTo, Sax.AssociationType associationType);
//-------------------------------------------------------------------
// Item exists.
public bool ItemAssociationExistsById(SysId id)
{
ClearErrorState();
if (!SysId.IsValid(id)) return false;
SaxItemAssociation.Params prmItemAssociation = new SaxItemAssociation.Params();
prmItemAssociation.IdsIncluded.Add(id);
prmItemAssociation.StatusCat = SaxItemAssociation.StatusCat.Any;
return GetItemAssociationCount(prmItemAssociation) == 1;
}
//-------------------------------------------------------------------
// Retrieve individual items.
public abstract SaxItemAssociation GetItemAssociation(SaxItemAssociation.Params prmItemAssociation);
public SaxItemAssociation GetItemAssociationById(SysId id)
{
ClearErrorState();
if (!SysId.IsValid(id)) return null;
SaxItemAssociation.Params prmItemAssociation = new SaxItemAssociation.Params();
prmItemAssociation.IdsIncluded.Add(id);
prmItemAssociation.StatusCat = SaxItemAssociation.StatusCat.Any;
return GetItemAssociation(prmItemAssociation);
}
//-------------------------------------------------------------------
// Validate item data.
public bool IsValidItemAssociation(SaxItemAssociation itemAssociation)
{
ClearErrorState();
if (itemAssociation == null) return SetErrorState(ErrorMessage.ItemNotSpecified);
return IsValidItemAssociationData(itemAssociation.GetData(), new SaxItemAssociation.ErrField());
}
public virtual bool IsValidItemAssociationData(SaxItemAssociation.Data data, SaxItemAssociation.ErrField errField)
{
ClearErrorState();
//---------------------------------------------------------------
// Item Id From.
if (errField.ItemIdFrom != SacsHierarchyItem.ValidValue.Ignore && !ItemId.IsValid(data.ItemIdFrom))
{
errField.ItemIdFrom = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Item Id From must be specified");
}
// Item Id To.
if (errField.ItemIdTo != SacsHierarchyItem.ValidValue.Ignore && !ItemId.IsValid(data.ItemIdTo))
{
errField.ItemIdTo = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Item Id To must be specified");
}
// Item Ids must differ.
if (errField.ItemIdFrom != SacsHierarchyItem.ValidValue.Ignore && errField.ItemIdTo != SacsHierarchyItem.ValidValue.Ignore)
{
if (data.ItemIdFrom.Equals(data.ItemIdTo))
{
errField.ItemIdTo = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Item Ids must differ");
}
}
// Association type.
if (errField.AssociationType != SacsHierarchyItem.ValidValue.Ignore && (int)data.AssociationType < 1)
{
errField.AssociationType = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Association type must be specified");
}
//---------------------------------------------------------------
// Common properties.
if (errField.Notes != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Notes, "notes", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAssociation_Notes)))
{
errField.Notes = SacsHierarchyItem.ValidValue.Invalid;
return false;
}
if (errField.Status != SacsHierarchyItem.ValidValue.Ignore)
{
if (!IsValidValue(data.StatusCode, "status", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAssociation_Status), true, true))
{
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
return false;
}
if (!SaxItemAssociation.ValidStatuses.Contains(data.Status))
{
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState(ErrorMessage.InvalidStatus);
}
}
//---------------------------------------------------------------
return true;
}
//-------------------------------------------------------------------
// Item database interface.
public abstract bool InsertItemAssociation(SaxItemAssociation itemAssociation, DbUpdateInfo dbUpdateInfo);
public abstract bool UpdateItemAssociation(SaxItemAssociation itemAssociation, DbUpdateInfo dbUpdateInfo);
public virtual bool ItemAssociationCanBeDeleted(SaxItemAssociation itemAssociation)
{
ClearErrorState();
return true;
}
public abstract bool DeleteItemAssociation(SaxItemAssociation itemAssociation, DbUpdateInfo dbUpdateInfo);
//-------------------------------------------------------------------
// Item list.
public abstract ColumnDfn GetItemAssociationColumnDfn(SaxItemAssociation.Column columnId, String caption = "", int width = 0);
public abstract List<String> GetItemAssociationQueryFilter(SaxItemAssociation.Params prmItemAssociation);
public abstract long GetItemAssociationCount(SaxItemAssociation.Params prmItemAssociation);
public abstract List<SaxItemAssociation> GetItemAssociationList(SaxItemAssociation.Params prmItemAssociation);
public abstract DbResultSet ExecuteItemAssociationQuery(List<ColumnDfn> columns, SaxItemAssociation.Params prmItemAssociation);
//-------------------------------------------------------------------
/// <summary>
/// Extract and format result set data value where specific handling is required.
/// <para>Where response is an invalid data value, format value using column.FormatValue(values).</para>
/// </summary>
public virtual DataValue GetItemAssociationDataValue(ColumnDfn column, NamedValue.Map values)
{
DataValue value = new DataValue();
switch ((SaxItemAssociation.Column)column.Id)
{
//-----------------------------------------------------------
// From item type.
case SaxItemAssociation.Column.ItemTypeFrom_Code:
{
value = new DataValue(DataItemTypeCodes.GetCodeForType(values.GetLong(column.DataName)));
}
break;
case SaxItemAssociation.Column.ItemTypeFrom_Desc:
{
value = new DataValue(DataItemTypeCodes.GetDescForType(values.GetLong(column.DataName)));
}
break;
//-----------------------------------------------------------
// To item type.
case SaxItemAssociation.Column.ItemTypeTo_Code:
{
value = new DataValue(DataItemTypeCodes.GetCodeForType(values.GetLong(column.DataName)));
}
break;
case SaxItemAssociation.Column.ItemTypeTo_Desc:
{
value = new DataValue(DataItemTypeCodes.GetDescForType(values.GetLong(column.DataName)));
}
break;
//-----------------------------------------------------------
// Association type.
case SaxItemAssociation.Column.AssociationType_Code:
case SaxItemAssociation.Column.AssociationType_Desc:
{
Sax.AssociationType associationType = (Sax.AssociationType)values.GetLong(column.DataName);
if (column.Id == (int)SaxItemAssociation.Column.AssociationType_Code)
value = new DataValue(AssociationTypeCodes.GetCodeForType(associationType));
else
value = new DataValue(AssociationTypeCodes.GetDescForType(associationType));
}
break;
//-----------------------------------------------------------
// Notes.
case SaxItemAssociation.Column.Notes:
value = new DataValue(SacsHierarchyItem.FormatForDisplay(values.GetValue(column.DataName).ToString(), 200));
break;
//-----------------------------------------------------------
// Status.
case SaxItemAssociation.Column.Status_Desc:
case SaxItemAssociation.Column.Status_Ind:
{
String statusCode = values.GetValue(column.DataName).ToString();
SaStatus status = SacsSystem.GetStatusForCode(statusCode);
if (column.Id == (int)SaxItemAssociation.Column.Status_Desc)
value = new DataValue(SacsSystem.GetStatusDesc(status));
else if (column.Id == (int)SaxItemAssociation.Column.Status_Ind)
value = new DataValue(SaxItemAssociation.GetStatusTriState(status));
}
break;
//-----------------------------------------------------------
}
return value;
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -75,6 +75,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
public List<TypeCodeDesc> OrganisationTypeCodes { get { return Internals.OrganisationTypeCodes; } }
public List<TypeCodeDesc> OrganisationCategoryCodes { get { return Internals.OrganisationCategoryCodes; } }
public List<TypeCodeDesc> OrganisationRoleCodes { get { return Internals.OrganisationRoleCodes; } }
public List<TypeCodeDesc> AssociationTypeCodes { get { return Internals.AssociationTypeCodes; } }
public List<TypeCodeDesc> AddressTypeCodes { get { return Internals.AddressTypeCodes; } }
public List<TypeCodeDesc> ContactMethodCodes { get { return Internals.ContactMethodCodes; } }
public List<TypeCodeDesc> EventTypeCodes { get { return Internals.EventTypeCodes; } }