This commit is contained in:
2021-11-20 15:17:48 +00:00
parent 806ebb4024
commit 74fb9448ec
68 changed files with 4117 additions and 794 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.0.0";
private static String version { get; } = "1.2.1.1";
// 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.1 20-Nov-2021 Online Profile.
// - Online Organisation edit.
// 1.2.0 1-Nov-2021 'Admin' Organisation role
// - 'Admin' Organisation role
// - Azure App Service configuration.
+12
View File
@@ -30,6 +30,7 @@ namespace Saxonite.Net.Standard.Base.App
OrganisationCategory,
OrganisationRole,
AddressType,
EventType,
OpportunityType,
ActivityReaction,
};
@@ -250,6 +251,17 @@ namespace Saxonite.Net.Standard.Base.App
Delivery = 60,
}
//-------------------------------------------------------------------
/// <summary>Event Type</summary>
public enum EventType
{
Unknown = 0,
/* Do not change the values or codes - tied to database. */
Playing,
Training,
Social,
}
//-------------------------------------------------------------------
/// <summary>Opportunity Type</summary>
public enum OpportunityType
+122 -82
View File
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Thu 26-Aug-2021 12:36:27
// Code generated by Sarand Database Utilities Sat 20-Nov-2021 14:44:06
//---------------------------------------------------------------------------
namespace Saxonite.Base.App
{
@@ -23,6 +23,7 @@ namespace Saxonite.Base.App
ItemImage,
ItemSport,
Organisation,
OrganisationEvent,
OrganisationOpportunity,
Region,
Sport,
@@ -158,6 +159,25 @@ namespace Saxonite.Base.App
Organisation_UpdateOn,
Organisation_UpdateBy,
Organisation_UpdateHost,
OrganisationEvent_Id,
OrganisationEvent_OrganisationId,
OrganisationEvent_SportIdPrimary,
OrganisationEvent_RegionIdCountry,
OrganisationEvent_EventAt,
OrganisationEvent_EventTypeCode,
OrganisationEvent_About,
OrganisationEvent_EventData,
OrganisationEvent_PublishedAt,
OrganisationEvent_ExpiresAt,
OrganisationEvent_Notes,
OrganisationEvent_Flags,
OrganisationEvent_Status,
OrganisationEvent_CreateOn,
OrganisationEvent_CreateBy,
OrganisationEvent_CreateHost,
OrganisationEvent_UpdateOn,
OrganisationEvent_UpdateBy,
OrganisationEvent_UpdateHost,
OrganisationOpportunity_Id,
OrganisationOpportunity_OrganisationId,
OrganisationOpportunity_SportIdPrimary,
@@ -335,8 +355,8 @@ namespace Saxonite.Base.App
//-------------------------------------------------------------------
// Data members.
private static readonly int tableCount = 16;
private static readonly int columnCount = 291;
private static readonly int tableCount = 17;
private static readonly int columnCount = 310;
private static ulong maxTextLen = 0;
//-------------------------------------------------------------------
@@ -488,6 +508,7 @@ namespace Saxonite.Base.App
"ItemImage",
"ItemSport",
"Organisation",
"OrganisationEvent",
"OrganisationOpportunity",
"Region",
"Sport",
@@ -645,11 +666,11 @@ namespace Saxonite.Base.App
new ColumnDfn(7,"Id",4,4,true,10),
new ColumnDfn(7,"OrganisationId",4,4,false,10),
new ColumnDfn(7,"SportIdPrimary",4,4,false,10),
new ColumnDfn(7,"RegionIdPrimary",4,4,false,10),
new ColumnDfn(7,"OpportunityTypeCode",0,12,false,3),
new ColumnDfn(7,"Position",0,-9,false,200),
new ColumnDfn(7,"Outline",0,-9,false,2000),
new ColumnDfn(7,"OpportunityData",0,-9,false,0),
new ColumnDfn(7,"RegionIdCountry",4,4,false,10),
new ColumnDfn(7,"EventAt",9,93,false,16),
new ColumnDfn(7,"EventTypeCode",0,12,false,3),
new ColumnDfn(7,"About",0,-9,false,2000),
new ColumnDfn(7,"EventData",0,-9,false,0),
new ColumnDfn(7,"PublishedAt",9,93,false,16),
new ColumnDfn(7,"ExpiresAt",9,93,false,16),
new ColumnDfn(7,"Notes",0,-9,false,2000),
@@ -662,12 +683,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,"RegionType",3,5,false,5),
new ColumnDfn(8,"CountryIso2Code",0,12,false,2),
new ColumnDfn(8,"Name",0,-9,false,100),
new ColumnDfn(8,"Latitude",8,3,false,9),
new ColumnDfn(8,"Longitude",8,3,false,9),
new ColumnDfn(8,"RegionIdParent",4,4,false,10),
new ColumnDfn(8,"OrganisationId",4,4,false,10),
new ColumnDfn(8,"SportIdPrimary",4,4,false,10),
new ColumnDfn(8,"RegionIdPrimary",4,4,false,10),
new ColumnDfn(8,"OpportunityTypeCode",0,12,false,3),
new ColumnDfn(8,"Position",0,-9,false,200),
new ColumnDfn(8,"Outline",0,-9,false,2000),
new ColumnDfn(8,"OpportunityData",0,-9,false,0),
new ColumnDfn(8,"PublishedAt",9,93,false,16),
new ColumnDfn(8,"ExpiresAt",9,93,false,16),
new ColumnDfn(8,"Notes",0,-9,false,2000),
new ColumnDfn(8,"Flags",3,5,false,5),
new ColumnDfn(8,"Status",0,12,false,3),
@@ -678,8 +702,12 @@ namespace Saxonite.Base.App
new ColumnDfn(8,"UpdateBy",4,4,false,10),
new ColumnDfn(8,"UpdateHost",0,12,false,100),
new ColumnDfn(9,"Id",4,4,true,10),
new ColumnDfn(9,"RegionType",3,5,false,5),
new ColumnDfn(9,"CountryIso2Code",0,12,false,2),
new ColumnDfn(9,"Name",0,-9,false,100),
new ColumnDfn(9,"SpecialityLabel",3,5,false,5),
new ColumnDfn(9,"Latitude",8,3,false,9),
new ColumnDfn(9,"Longitude",8,3,false,9),
new ColumnDfn(9,"RegionIdParent",4,4,false,10),
new ColumnDfn(9,"Notes",0,-9,false,2000),
new ColumnDfn(9,"Flags",3,5,false,5),
new ColumnDfn(9,"Status",0,12,false,3),
@@ -690,28 +718,8 @@ 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,"EmailAddress",0,-9,false,200),
new ColumnDfn(10,"Title",0,-9,false,20),
new ColumnDfn(10,"FirstName",0,-9,false,100),
new ColumnDfn(10,"Initials",0,-9,false,10),
new ColumnDfn(10,"LastName",0,-9,false,100),
new ColumnDfn(10,"About",0,-9,false,2000),
new ColumnDfn(10,"PhoneMain",0,-9,false,50),
new ColumnDfn(10,"PhoneMobile",0,-9,false,50),
new ColumnDfn(10,"PhoneAlt",0,-9,false,50),
new ColumnDfn(10,"Gender",2,-6,false,3),
new ColumnDfn(10,"DateOfBirthDay",2,-6,false,3),
new ColumnDfn(10,"DateOfBirthMonth",2,-6,false,3),
new ColumnDfn(10,"DateOfBirthYear",3,5,false,5),
new ColumnDfn(10,"RegionIdCountry",4,4,false,10),
new ColumnDfn(10,"RegionIdProvince",4,4,false,10),
new ColumnDfn(10,"PasswordToken",0,12,false,32),
new ColumnDfn(10,"PasswordHashed",0,-9,false,100),
new ColumnDfn(10,"PasswordHistory",0,-9,false,0),
new ColumnDfn(10,"PasswordChangedAt",9,93,false,16),
new ColumnDfn(10,"LastLoginAt",9,93,false,16),
new ColumnDfn(10,"LastInvalidLoginAt",9,93,false,16),
new ColumnDfn(10,"InvalidLoginCount",3,5,false,5),
new ColumnDfn(10,"Name",0,-9,false,100),
new ColumnDfn(10,"SpecialityLabel",3,5,false,5),
new ColumnDfn(10,"Notes",0,-9,false,2000),
new ColumnDfn(10,"Flags",3,5,false,5),
new ColumnDfn(10,"Status",0,12,false,3),
@@ -721,19 +729,29 @@ namespace Saxonite.Base.App
new ColumnDfn(10,"UpdateOn",9,93,false,23),
new ColumnDfn(10,"UpdateBy",4,4,false,10),
new ColumnDfn(10,"UpdateHost",0,12,false,100),
new ColumnDfn(11,"Id",5,-5,true,19),
new ColumnDfn(11,"UserAccountId",4,4,false,10),
new ColumnDfn(11,"ItemType",3,5,false,5),
new ColumnDfn(11,"ItemId",5,-5,false,19),
new ColumnDfn(11,"CurrentlyListed",1,-7,false,1),
new ColumnDfn(11,"ListedAtFirst",9,93,false,16),
new ColumnDfn(11,"ListedAtLast",9,93,false,16),
new ColumnDfn(11,"ViewedAtFirst",9,93,false,16),
new ColumnDfn(11,"ViewedAtLast",9,93,false,16),
new ColumnDfn(11,"Reaction",3,5,false,5),
new ColumnDfn(11,"ReactedAtFirst",9,93,false,16),
new ColumnDfn(11,"ReactedAtLast",9,93,false,16),
new ColumnDfn(11,"UserActivityData",0,-9,false,0),
new ColumnDfn(11,"Id",4,4,true,10),
new ColumnDfn(11,"EmailAddress",0,-9,false,200),
new ColumnDfn(11,"Title",0,-9,false,20),
new ColumnDfn(11,"FirstName",0,-9,false,100),
new ColumnDfn(11,"Initials",0,-9,false,10),
new ColumnDfn(11,"LastName",0,-9,false,100),
new ColumnDfn(11,"About",0,-9,false,2000),
new ColumnDfn(11,"PhoneMain",0,-9,false,50),
new ColumnDfn(11,"PhoneMobile",0,-9,false,50),
new ColumnDfn(11,"PhoneAlt",0,-9,false,50),
new ColumnDfn(11,"Gender",2,-6,false,3),
new ColumnDfn(11,"DateOfBirthDay",2,-6,false,3),
new ColumnDfn(11,"DateOfBirthMonth",2,-6,false,3),
new ColumnDfn(11,"DateOfBirthYear",3,5,false,5),
new ColumnDfn(11,"RegionIdCountry",4,4,false,10),
new ColumnDfn(11,"RegionIdProvince",4,4,false,10),
new ColumnDfn(11,"PasswordToken",0,12,false,32),
new ColumnDfn(11,"PasswordHashed",0,-9,false,100),
new ColumnDfn(11,"PasswordHistory",0,-9,false,0),
new ColumnDfn(11,"PasswordChangedAt",9,93,false,16),
new ColumnDfn(11,"LastLoginAt",9,93,false,16),
new ColumnDfn(11,"LastInvalidLoginAt",9,93,false,16),
new ColumnDfn(11,"InvalidLoginCount",3,5,false,5),
new ColumnDfn(11,"Notes",0,-9,false,2000),
new ColumnDfn(11,"Flags",3,5,false,5),
new ColumnDfn(11,"Status",0,12,false,3),
@@ -745,10 +763,17 @@ namespace Saxonite.Base.App
new ColumnDfn(11,"UpdateHost",0,12,false,100),
new ColumnDfn(12,"Id",5,-5,true,19),
new ColumnDfn(12,"UserAccountId",4,4,false,10),
new ColumnDfn(12,"OrganisationId",4,4,false,10),
new ColumnDfn(12,"OrganisationRoleCodes",0,12,false,256),
new ColumnDfn(12,"OrganisationRoleCount",2,-6,false,3),
new ColumnDfn(12,"AdminComment",0,-9,false,2000),
new ColumnDfn(12,"ItemType",3,5,false,5),
new ColumnDfn(12,"ItemId",5,-5,false,19),
new ColumnDfn(12,"CurrentlyListed",1,-7,false,1),
new ColumnDfn(12,"ListedAtFirst",9,93,false,16),
new ColumnDfn(12,"ListedAtLast",9,93,false,16),
new ColumnDfn(12,"ViewedAtFirst",9,93,false,16),
new ColumnDfn(12,"ViewedAtLast",9,93,false,16),
new ColumnDfn(12,"Reaction",3,5,false,5),
new ColumnDfn(12,"ReactedAtFirst",9,93,false,16),
new ColumnDfn(12,"ReactedAtLast",9,93,false,16),
new ColumnDfn(12,"UserActivityData",0,-9,false,0),
new ColumnDfn(12,"Notes",0,-9,false,2000),
new ColumnDfn(12,"Flags",3,5,false,5),
new ColumnDfn(12,"Status",0,12,false,3),
@@ -760,7 +785,10 @@ namespace Saxonite.Base.App
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,"UserRoleCode",0,12,false,16),
new ColumnDfn(13,"OrganisationId",4,4,false,10),
new ColumnDfn(13,"OrganisationRoleCodes",0,12,false,256),
new ColumnDfn(13,"OrganisationRoleCount",2,-6,false,3),
new ColumnDfn(13,"AdminComment",0,-9,false,2000),
new ColumnDfn(13,"Notes",0,-9,false,2000),
new ColumnDfn(13,"Flags",3,5,false,5),
new ColumnDfn(13,"Status",0,12,false,3),
@@ -770,42 +798,31 @@ 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,"ActivityIndexIds",0,-9,false,0),
new ColumnDfn(14,"UserSessionData",0,-9,false,0),
new ColumnDfn(14,"UserRoleCode",0,12,false,16),
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(15,"Id",5,-5,true,19),
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,"SportId",4,4,false,10),
new ColumnDfn(15,"About",0,-9,false,2000),
new ColumnDfn(15,"Participation",3,5,false,5),
new ColumnDfn(15,"Officiating",3,5,false,5),
new ColumnDfn(15,"UserSportData",0,-9,false,0),
new ColumnDfn(15,"Notes",0,-9,false,2000),
new ColumnDfn(15,"ActivityIndexIds",0,-9,false,0),
new ColumnDfn(15,"UserSessionData",0,-9,false,0),
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(16,"Id",5,-5,true,19),
new ColumnDfn(16,"UserSportId",5,-5,false,19),
new ColumnDfn(16,"PeriodFrom",9,93,false,16),
new ColumnDfn(16,"PeriodTo",9,93,false,16),
new ColumnDfn(16,"OrganisationId",4,4,false,10),
new ColumnDfn(16,"OrganisationName",0,-9,false,200),
new ColumnDfn(16,"Summary",0,-9,false,2000),
new ColumnDfn(16,"Team",0,-9,false,64),
new ColumnDfn(16,"League",0,-9,false,64),
new ColumnDfn(16,"Speciality",0,-9,false,64),
new ColumnDfn(16,"SpecialitiesOther",0,-9,false,1000),
new ColumnDfn(16,"RegionIdNation",4,4,false,10),
new ColumnDfn(16,"RegionIdProvince",4,4,false,10),
new ColumnDfn(16,"UserSportExperienceData",0,-9,false,0),
new ColumnDfn(16,"UserAccountId",4,4,false,10),
new ColumnDfn(16,"SportId",4,4,false,10),
new ColumnDfn(16,"About",0,-9,false,2000),
new ColumnDfn(16,"Participation",3,5,false,5),
new ColumnDfn(16,"Officiating",3,5,false,5),
new ColumnDfn(16,"UserSportData",0,-9,false,0),
new ColumnDfn(16,"Notes",0,-9,false,2000),
new ColumnDfn(16,"Flags",3,5,false,5),
new ColumnDfn(16,"Status",0,12,false,3),
@@ -815,6 +832,29 @@ 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,"UserSportId",5,-5,false,19),
new ColumnDfn(17,"PeriodFrom",9,93,false,16),
new ColumnDfn(17,"PeriodTo",9,93,false,16),
new ColumnDfn(17,"OrganisationId",4,4,false,10),
new ColumnDfn(17,"OrganisationName",0,-9,false,200),
new ColumnDfn(17,"Summary",0,-9,false,2000),
new ColumnDfn(17,"Team",0,-9,false,64),
new ColumnDfn(17,"League",0,-9,false,64),
new ColumnDfn(17,"Speciality",0,-9,false,64),
new ColumnDfn(17,"SpecialitiesOther",0,-9,false,1000),
new ColumnDfn(17,"RegionIdNation",4,4,false,10),
new ColumnDfn(17,"RegionIdProvince",4,4,false,10),
new ColumnDfn(17,"UserSportExperienceData",0,-9,false,0),
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(17,"UpdateBy",4,4,false,10),
new ColumnDfn(17,"UpdateHost",0,12,false,100),
};
//-------------------------------------------------------------------
@@ -99,6 +99,7 @@ namespace Saxonite.Net.Standard.Base.App
public List<TypeCodeDesc> OrganisationCategoryCodes { get { return GetCodesOfType(Sax.CodeType.OrganisationCategory); } }
public List<TypeCodeDesc> OrganisationRoleCodes { get { return GetCodesOfType(Sax.CodeType.OrganisationRole); } }
public List<TypeCodeDesc> AddressTypeCodes { get { return GetCodesOfType(Sax.CodeType.AddressType); } }
public List<TypeCodeDesc> EventTypeCodes { get { return GetCodesOfType(Sax.CodeType.EventType); } }
public List<TypeCodeDesc> OpportunityTypeCodes { get { return GetCodesOfType(Sax.CodeType.OpportunityType); } }
public List<TypeCodeDesc> ActivityReactionCodes { get { return GetCodesOfType(Sax.CodeType.ActivityReaction); } }
public List<TypeCodeDesc> GetCodesOfType(Sax.CodeType codeType)
@@ -28,6 +28,7 @@ namespace Saxonite.Net.Standard.Base.App
private static readonly List<TypeCodeDesc> organisationCategoryCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> organisationRoleCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> addressTypeCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> eventTypeCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> opportunityTypeCodes = new List<TypeCodeDesc>();
private static readonly List<TypeCodeDesc> activityReactionCodes = new List<TypeCodeDesc>();
@@ -150,6 +151,12 @@ namespace Saxonite.Net.Standard.Base.App
organisationRoleCodes.Add(Sax.OrganisationRole.OpportunityAdmin, "OPA", "Opportunities");
organisationRoleCodes.Add(Sax.OrganisationRole.ArticleAdmin, "ARA", "Articles");
//---------------------------------------------------------------
// Event types.
eventTypeCodes.Add(Sax.EventType.Playing, "PLG", "Playing");
eventTypeCodes.Add(Sax.EventType.Playing, "TRN", "Training");
eventTypeCodes.Add(Sax.EventType.Playing, "SCL", "Social");
//---------------------------------------------------------------
// Opportunity types.
opportunityTypeCodes.Add(Sax.OpportunityType.Playing, "PLG", "Playing");
@@ -64,6 +64,8 @@ namespace Saxonite.Net.Standard.Base.App
return new List<TypeCodeDesc>(organisationRoleCodes);
case Sax.CodeType.AddressType:
return new List<TypeCodeDesc>(addressTypeCodes);
case Sax.CodeType.EventType:
return new List<TypeCodeDesc>(eventTypeCodes);
case Sax.CodeType.OpportunityType:
return new List<TypeCodeDesc>(opportunityTypeCodes);
case Sax.CodeType.ActivityReaction:
@@ -303,6 +303,8 @@ namespace Saxonite.Net.Standard.Base.Bus
{
return new ItemId((short)Sax.DataItemType.ItemAddress, Id);
}
// Address types.
public static Sax.AddressType DefaultOrganisationAddressType { get { return Sax.AddressType.Office; } }
//-------------------------------------------------------------------
// Properties.
@@ -0,0 +1,312 @@
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
{
//=======================================================================
// Organisation Event.
//=======================================================================
public abstract class SaxOrganisationEvent : SacsHierarchyItem
{
//-------------------------------------------------------------------
// Columns.
public enum Column
{
Pos,
Id,
// Organisation.
OrganisationId,
Organisation_Name,
// Sport.
SportIdPrimary,
Sport_Name,
// Region.
RegionIdCountry,
Region_Name,
// Event.
EventAt_Date,
EventAt_DateTime,
EventTypeCode,
EventType_Desc,
About,
PublishedAt_Date,
PublishedAt_DateTime,
ExpiresAt_Date,
ExpiresAt_DateTime,
// Associated data.
// Common.
Notes,
Flags,
Status,
Status_Desc,
Status_Ind,
CreateOn_Date,
UpdateOn_Date,
}
//-------------------------------------------------------------------
/// <summary>Properties other than common.</summary>
public class DataProperties
{
public SysId OrganisationId { get; set; }
public SysId SportIdPrimary { get; set; }
public SysId RegionIdCountry { get; set; }
public DateTime EventAt { get; set; }
public Sax.EventType EventType { get; set; }
public String About { get; set; } = String.Empty;
public String EventData { get; set; } = String.Empty;
public DateTime PublishedAt { get; set; }
public DateTime ExpiresAt { get; set; }
}
//-------------------------------------------------------------------
// Data.
public new class Data : SacsHierarchyItem.Data
{
// Data members.
private readonly DataProperties data = new DataProperties();
// Construction.
public Data()
{
Status = DefaultStatus;
}
// Properties.
public SysId OrganisationId
{
get { return data.OrganisationId; }
set { CheckChanged(data.OrganisationId, value); data.OrganisationId = value; }
}
public SysId SportIdPrimary
{
get { return data.SportIdPrimary; }
set { CheckChanged(data.SportIdPrimary, value); data.SportIdPrimary = value; }
}
public SysId RegionIdCountry
{
get { return data.RegionIdCountry; }
set { CheckChanged(data.RegionIdCountry, value); data.RegionIdCountry = value; }
}
public DateTime EventAt
{
get { return data.EventAt; }
set { CheckChanged(data.EventAt, value); data.EventAt = value; }
}
public Sax.EventType EventType
{
get { return data.EventType; }
set { CheckChanged((int)data.EventType, (int)value); data.EventType = value; }
}
public String About
{
get { return data.About; }
set { CheckChanged(data.About, value); data.About = value; }
}
public String EventData
{
get { return data.EventData; }
set { CheckChanged(data.EventData, value); data.EventData = value; }
}
public DateTime PublishedAt
{
get { return data.PublishedAt; }
set { CheckChanged(data.PublishedAt, value); data.PublishedAt = value; }
}
public DateTime ExpiresAt
{
get { return data.ExpiresAt; }
set { CheckChanged(data.ExpiresAt, value); data.ExpiresAt = value; }
}
// Population.
internal void PopulateFrom(Data data)
{
OrganisationId = data.OrganisationId;
SportIdPrimary = data.SportIdPrimary;
RegionIdCountry = data.RegionIdCountry;
EventAt = data.EventAt;
EventType = data.EventType;
About = data.About;
EventData = data.EventData;
PublishedAt = data.PublishedAt;
ExpiresAt = data.ExpiresAt;
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 OrganisationId { get; set; } = ValidValue.Valid;
public ValidValue SportIdPrimary { get; set; } = ValidValue.Valid;
public ValidValue RegionIdCountry { get; set; } = ValidValue.Valid;
public ValidValue EventAt { get; set; } = ValidValue.Valid;
public ValidValue EventType { get; set; } = ValidValue.Valid;
public ValidValue About { get; set; } = ValidValue.Valid;
public ValidValue EventData { get; set; } = ValidValue.Valid;
public ValidValue PublishedAt { get; set; } = ValidValue.Valid;
public ValidValue ExpiresAt { get; set; } = ValidValue.Valid;
}
//-------------------------------------------------------------------
// Data members.
private readonly Data data = new Data();
//-------------------------------------------------------------------
// Construction.
protected SaxOrganisationEvent(SysId id, SysId OrganisationId) : base(id)
{
base.SetData(data);
this.OrganisationId = OrganisationId;
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.OrganisationEvent, Id);
}
//-------------------------------------------------------------------
// 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 (SysId.IsValid(OrganisationId) && SysId.ToInt(OrganisationId) != SysId.ToInt(data.OrganisationId))
throw new NotSupportedException(fn + " Organisation Id cannot be changed");
this.data.PopulateFrom(data);
}
public SysId OrganisationId
{
get { return data.OrganisationId; }
protected set { data.OrganisationId = value; }
}
public SysId SportIdPrimary
{
get { return data.SportIdPrimary; }
set { data.SportIdPrimary = value; }
}
public SysId RegionIdCountry
{
get { return data.RegionIdCountry; }
set { data.RegionIdCountry = value; }
}
public DateTime EventAt
{
get { return data.EventAt; }
set { data.EventAt = value; }
}
public Sax.EventType EventType
{
get { return data.EventType; }
set { data.EventType = value; }
}
public String About
{
get { return data.About; }
set { data.About = value; }
}
public String EventData
{
get { return data.EventData; }
set { data.EventData = value; }
}
public DateTime PublishedAt
{
get { return data.PublishedAt; }
set { data.PublishedAt = value; }
}
public DateTime ExpiresAt
{
get { return data.ExpiresAt; }
set { data.ExpiresAt = 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>Restrict to User Account via User Organisations and Organisations.</summary>
public List<SysId> UserAccountIdsIncluded { get; } = new List<SysId>();
public List<SysId> OrganisationIdsIncluded { get; } = new List<SysId>();
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 String AboutPartial { get; set; }
/// <summary>General filter value - position, outline, sport, body etc. </summary>
public String EventFilter { get; set; }
public String NotesPartial { get; set; }
public StatusCat StatusCat { get; set; } = StatusCat.ActiveOnly;
// Table aliases - blank if not linked.
public String Alias_Organisation { get; set; }
public String Alias_UserOrganisation { get; set; }
public String Alias_UserAccount { get; set; }
}
//-------------------------------------------------------------------
}
//=======================================================================
// Item list extension methods.
public static class SaxOrganisationEventList
{
}
//=======================================================================
}
@@ -36,6 +36,8 @@ namespace Saxonite.Net.Standard.Base.Bus
User_Status_Desc,
// Organisation.
Organisation_Name,
Organisation_Category,
Organisation_Type,
Organisation_RegionId,
Organisation_Region_Name,
Organisation_SportId,
@@ -0,0 +1,246 @@
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 Sarand.Net.Standard.Base.Utils;
using Saxonite.Base.App;
using Saxonite.Net.Standard.Base.Bus;
using System;
using System.Collections.Generic;
using System.Text;
namespace Saxonite.Net.Standard.Base.Mgr
{
//=======================================================================
partial class SaxActivityMgr
{
//*******************************************************************
// Activity Mgr - Organisation Event
//*******************************************************************
// Utilities.
//-------------------------------------------------------------------
// Create item.
public abstract SaxOrganisationEvent CreateOrganisationEvent(SysId organisationId);
//-------------------------------------------------------------------
// Item exists.
public bool OrganisationEventExistsById(SysId id)
{
ClearErrorState();
if (!SysId.IsValid(id)) return false;
SaxOrganisationEvent.Params prmOrganisationEvent = new SaxOrganisationEvent.Params();
prmOrganisationEvent.IdsIncluded.Add(id);
prmOrganisationEvent.StatusCat = SaxOrganisationEvent.StatusCat.Any;
return GetOrganisationEventCount(prmOrganisationEvent) == 1;
}
//-------------------------------------------------------------------
// Retrieve individual items.
public abstract SaxOrganisationEvent GetOrganisationEvent(SaxOrganisationEvent.Params prmOrganisationEvent);
public SaxOrganisationEvent GetOrganisationEventById(SysId id)
{
ClearErrorState();
if (!SysId.IsValid(id)) return null;
SaxOrganisationEvent.Params prmOrganisationEvent = new SaxOrganisationEvent.Params();
prmOrganisationEvent.IdsIncluded.Add(id);
prmOrganisationEvent.StatusCat = SaxOrganisationEvent.StatusCat.Any;
return GetOrganisationEvent(prmOrganisationEvent);
}
//-------------------------------------------------------------------
// Validate item data.
public bool IsValidOrganisationEvent(SaxOrganisationEvent organisationEvent)
{
ClearErrorState();
if (organisationEvent == null) return SetErrorState(ErrorMessage.ItemNotSpecified);
return IsValidOrganisationEventData(organisationEvent.GetData(), new SaxOrganisationEvent.ErrField());
}
public virtual bool IsValidOrganisationEventData(SaxOrganisationEvent.Data data, SaxOrganisationEvent.ErrField errField)
{
ClearErrorState();
// Organisation.
if (errField.OrganisationId != SacsHierarchyItem.ValidValue.Ignore && !SysId.IsValid(data.OrganisationId))
{
errField.OrganisationId = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Organisation must be specified");
}
// Primary Sport.
if (errField.SportIdPrimary != SacsHierarchyItem.ValidValue.Ignore && !SysId.IsValid(data.SportIdPrimary))
{
errField.SportIdPrimary = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Sport must be specified");
}
// Country Region.
if (errField.RegionIdCountry != SacsHierarchyItem.ValidValue.Ignore && !SysId.IsValid(data.RegionIdCountry))
{
errField.RegionIdCountry = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Country Region must be specified");
}
// Event date and time.
if (errField.EventAt != SacsHierarchyItem.ValidValue.Ignore && !DateUtil.IsValid(data.EventAt))
{
errField.EventType = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Event data and time must be specified.");
}
// Event type.
if (errField.EventType != SacsHierarchyItem.ValidValue.Ignore && data.EventType <= 0)
{
errField.EventType = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Event type must be specified.");
}
// About.
if (errField.About != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.About, "outline", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.OrganisationEvent_About), true))
{
errField.About = SacsHierarchyItem.ValidValue.Invalid;
return false;
}
// Common properties.
if (errField.Notes != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Notes, "notes", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.OrganisationEvent_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.OrganisationEvent_Status), true, true))
{
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
return false;
}
if (!SaxOrganisationEvent.ValidStatuses.Contains(data.Status))
{
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState(ErrorMessage.InvalidStatus);
}
}
//---------------------------------------------------------------
// Associated data - ignore for deleted items.
if (!data.IsStatusDeleted)
{
// Organisation.
if (errField.OrganisationId != SacsHierarchyItem.ValidValue.Ignore && SysId.IsValid(data.OrganisationId))
{
SaxOrganisation.Params prmOrganisation = new SaxOrganisation.Params();
prmOrganisation.IdsIncluded.Add(data.OrganisationId);
prmOrganisation.StatusCat = SaxOrganisation.StatusCat.NotDeleted;
if (AccountMgr.GetOrganisationCount(prmOrganisation) < 1)
{
errField.OrganisationId = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Invalid organisation specified");
}
}
// Primary Sport.
if (errField.SportIdPrimary != SacsHierarchyItem.ValidValue.Ignore && SysId.IsValid(data.SportIdPrimary))
{
SaxSport.Params prmSport = new SaxSport.Params();
prmSport.IdsIncluded.Add(data.SportIdPrimary);
prmSport.StatusCat = SaxSport.StatusCat.NotDeleted;
if (ReferenceMgr.GetSportCount(prmSport) < 1)
{
errField.SportIdPrimary = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Invalid sport specified");
}
}
// Country Region.
if (errField.RegionIdCountry != SacsHierarchyItem.ValidValue.Ignore && SysId.IsValid(data.RegionIdCountry))
{
SaxRegion.Params prmRegion = new SaxRegion.Params();
prmRegion.IdsIncluded.Add(data.RegionIdCountry);
prmRegion.StatusCat = SaxRegion.StatusCat.NotDeleted;
if (ReferenceMgr.GetRegionCount(prmRegion) < 1)
{
errField.RegionIdCountry = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Invalid region specified");
}
}
}
//---------------------------------------------------------------
return true;
}
//-------------------------------------------------------------------
// OrganisationEvent database interface.
public abstract bool InsertOrganisationEvent(SaxOrganisationEvent organisationEvent, DbUpdateInfo dbUpdateInfo);
public abstract bool UpdateOrganisationEvent(SaxOrganisationEvent organisationEvent, DbUpdateInfo dbUpdateInfo);
public virtual bool OrganisationEventCanBeDeleted(SaxOrganisationEvent organisationEvent)
{
ClearErrorState();
return true;
}
public abstract bool DeleteOrganisationEvent(SaxOrganisationEvent organisationEvent, DbUpdateInfo dbUpdateInfo);
//-------------------------------------------------------------------
// OrganisationEvent list:
public abstract ColumnDfn GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column columnId, String caption = "", int width = 0);
public abstract List<String> GetOrganisationEventQueryFilter(SaxOrganisationEvent.Params prmOrganisationEvent);
public abstract long GetOrganisationEventCount(SaxOrganisationEvent.Params prmOrganisationEvent);
public abstract List<SaxOrganisationEvent> GetOrganisationEventList(SaxOrganisationEvent.Params prmOrganisationEvent);
public abstract DbResultSet ExecuteOrganisationEventQuery(List<ColumnDfn> columns, SaxOrganisationEvent.Params prmOrganisationEvent);
//-------------------------------------------------------------------
/// <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 GetOrganisationEventDataValue(ColumnDfn column, NamedValue.Map values)
{
DataValue value = new DataValue();
switch ((SaxOrganisationEvent.Column)column.Id)
{
//-----------------------------------------------------------
// Event type desc.
case SaxOrganisationEvent.Column.EventType_Desc:
{
String code = values.GetValue(column.DataName).ToString();
value = new DataValue(EventTypeCodes.GetDescForCode(code, code));
}
break;
//-----------------------------------------------------------
// Summary - limit to 200 chars.
case SaxOrganisationEvent.Column.About:
{
value = new DataValue(SacsHierarchyItem.FormatForDisplay(values.GetValue(column.DataName).ToString(), 200));
}
break;
//-----------------------------------------------------------
// Notes - limit to 200 chars.
case SaxOrganisationEvent.Column.Notes:
{
value = new DataValue(SacsHierarchyItem.FormatForDisplay(values.GetValue(column.DataName).ToString(), 200));
}
break;
//-----------------------------------------------------------
// Status.
case SaxOrganisationEvent.Column.Status_Desc:
case SaxOrganisationEvent.Column.Status_Ind:
{
String statusCode = values.GetValue(column.DataName).ToString();
SaStatus status = SacsSystem.GetStatusForCode(statusCode);
if (column.Id == (int)SaxOrganisationEvent.Column.Status_Desc)
value = new DataValue(SacsSystem.GetStatusDesc(status));
else if (column.Id == (int)SaxOrganisationEvent.Column.Status_Ind)
value = new DataValue(SaxOrganisationEvent.GetStatusTriState(status));
}
break;
//-----------------------------------------------------------
}
return value;
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -82,7 +82,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
// Opportunity type.
if (errField.OpportunityType != SacsHierarchyItem.ValidValue.Ignore && data.OpportunityType <= 0)
{
errField.Position = SacsHierarchyItem.ValidValue.Invalid;
errField.OpportunityType = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Opportunity type must be specified.");
}
// Position.
@@ -76,6 +76,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
public List<TypeCodeDesc> OrganisationCategoryCodes { get { return Internals.OrganisationCategoryCodes; } }
public List<TypeCodeDesc> OrganisationRoleCodes { get { return Internals.OrganisationRoleCodes; } }
public List<TypeCodeDesc> AddressTypeCodes { get { return Internals.AddressTypeCodes; } }
public List<TypeCodeDesc> EventTypeCodes { get { return Internals.EventTypeCodes; } }
public List<TypeCodeDesc> OpportunityTypeCodes { get { return Internals.OpportunityTypeCodes; } }
public List<TypeCodeDesc> ActivityReactionCodes { get { return Internals.ActivityReactionCodes; } }