v1.0.7.0
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
public static class Version
|
||||
{
|
||||
private static String version { get; } = "1.0.6.2";
|
||||
private static String version { get; } = "1.0.7.0";
|
||||
// Retrieve version.
|
||||
public static String GetFullVersion () { return version; }
|
||||
public static String GetAppVersion ()
|
||||
@@ -40,6 +40,9 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
// Version history.
|
||||
//-------------------------------------------------------------------
|
||||
// 1.0.7 8-Jun-2021 Online Activities & Profile
|
||||
// - Style Online Activities by type.
|
||||
// - Profile Contact Image upload.
|
||||
// 1.0.6 2-Jun-2021 Online Profile
|
||||
// - Refresh Online Session with profile region and sport changes.
|
||||
// - Profile Sport - participation and officiating dropdowns.
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
public static class RefreshIntervalSecs
|
||||
{
|
||||
public static int Initial { get; } = SacsSystem.DebugMode ? 2 : 5;
|
||||
public static int Periodic{ get; } = SacsSystem.DebugMode ? 60 : 1800;
|
||||
public static int Periodic { get; } = SacsSystem.DebugMode ? 60 : 1800;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -93,6 +93,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
RegionType,
|
||||
UserRole,
|
||||
Title,
|
||||
ImageType,
|
||||
OrganisationType,
|
||||
OrganisationCategory,
|
||||
OrganisationRole,
|
||||
@@ -136,7 +137,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
OrganisationOpportunity = 220,
|
||||
OrganisationEvent = 225,
|
||||
// Item link components.
|
||||
ItemSport = 400,
|
||||
ItemImage = 400,
|
||||
ItemSport = 420,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -216,6 +218,17 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
Lady
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Image Types.</summary>
|
||||
public enum ImageType
|
||||
{
|
||||
Unknown,
|
||||
/// <summary>User's profile image.</summary>
|
||||
Avatar = 100,
|
||||
/// <summary>User's new profile image awaiting confirmation.</summary>
|
||||
AvatarUpload = 101,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Organisation Types.</summary>
|
||||
public enum OrganisationType
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Wed 2-Jun-2021 17:55:46
|
||||
// Code generated by Sarand Database Utilities Fri 4-Jun-2021 17:09:14
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Base.App
|
||||
{
|
||||
@@ -18,6 +18,7 @@ namespace Saxonite.Base.App
|
||||
{
|
||||
Unknown = 0,
|
||||
ActivityIndex,
|
||||
ItemImage,
|
||||
ItemSport,
|
||||
JournalistArticle,
|
||||
Organisation,
|
||||
@@ -50,6 +51,26 @@ namespace Saxonite.Base.App
|
||||
ActivityIndex_UpdateOn,
|
||||
ActivityIndex_UpdateBy,
|
||||
ActivityIndex_UpdateHost,
|
||||
ItemImage_Id,
|
||||
ItemImage_ItemType,
|
||||
ItemImage_ItemId,
|
||||
ItemImage_ImageType,
|
||||
ItemImage_ImageSeq,
|
||||
ItemImage_Filename,
|
||||
ItemImage_Mime,
|
||||
ItemImage_ContentType,
|
||||
ItemImage_Width,
|
||||
ItemImage_Height,
|
||||
ItemImage_ImageData,
|
||||
ItemImage_Notes,
|
||||
ItemImage_Flags,
|
||||
ItemImage_Status,
|
||||
ItemImage_CreateOn,
|
||||
ItemImage_CreateBy,
|
||||
ItemImage_CreateHost,
|
||||
ItemImage_UpdateOn,
|
||||
ItemImage_UpdateBy,
|
||||
ItemImage_UpdateHost,
|
||||
ItemSport_Id,
|
||||
ItemSport_ItemType,
|
||||
ItemSport_ItemId,
|
||||
@@ -224,8 +245,8 @@ namespace Saxonite.Base.App
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private static readonly int tableCount = 12;
|
||||
private static readonly int columnCount = 184;
|
||||
private static readonly int tableCount = 13;
|
||||
private static readonly int columnCount = 204;
|
||||
private static ulong maxTextLen = 0;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -372,6 +393,7 @@ namespace Saxonite.Base.App
|
||||
private static readonly String[] tables =
|
||||
{
|
||||
"ActivityIndex",
|
||||
"ItemImage",
|
||||
"ItemSport",
|
||||
"JournalistArticle",
|
||||
"Organisation",
|
||||
@@ -423,11 +445,17 @@ namespace Saxonite.Base.App
|
||||
new ColumnDfn(1,"UpdateOn",9,93,false,23),
|
||||
new ColumnDfn(1,"UpdateBy",4,4,false,10),
|
||||
new ColumnDfn(1,"UpdateHost",0,12,false,100),
|
||||
new ColumnDfn(2,"Id",4,4,true,10),
|
||||
new ColumnDfn(2,"Id",5,-5,true,19),
|
||||
new ColumnDfn(2,"ItemType",3,5,false,5),
|
||||
new ColumnDfn(2,"ItemId",4,4,false,10),
|
||||
new ColumnDfn(2,"SportId",4,4,false,10),
|
||||
new ColumnDfn(2,"ItemSportData",0,-9,false,0),
|
||||
new ColumnDfn(2,"ImageType",3,5,false,5),
|
||||
new ColumnDfn(2,"ImageSeq",2,-6,false,3),
|
||||
new ColumnDfn(2,"Filename",0,-9,false,1024),
|
||||
new ColumnDfn(2,"Mime",0,12,false,64),
|
||||
new ColumnDfn(2,"ContentType",0,12,false,128),
|
||||
new ColumnDfn(2,"Width",4,4,false,10),
|
||||
new ColumnDfn(2,"Height",4,4,false,10),
|
||||
new ColumnDfn(2,"ImageData",10,-3,false,0),
|
||||
new ColumnDfn(2,"Notes",0,-9,false,2000),
|
||||
new ColumnDfn(2,"Flags",3,5,false,5),
|
||||
new ColumnDfn(2,"Status",0,12,false,3),
|
||||
@@ -438,13 +466,10 @@ namespace Saxonite.Base.App
|
||||
new ColumnDfn(2,"UpdateBy",4,4,false,10),
|
||||
new ColumnDfn(2,"UpdateHost",0,12,false,100),
|
||||
new ColumnDfn(3,"Id",4,4,true,10),
|
||||
new ColumnDfn(3,"UserAccountIdJournalist",4,4,false,10),
|
||||
new ColumnDfn(3,"SportIdPrimary",4,4,false,10),
|
||||
new ColumnDfn(3,"RegionIdPrimary",4,4,false,10),
|
||||
new ColumnDfn(3,"Headline",0,-9,false,200),
|
||||
new ColumnDfn(3,"Summary",0,-9,false,2000),
|
||||
new ColumnDfn(3,"BodyData",0,-9,false,0),
|
||||
new ColumnDfn(3,"PublishedAt",9,93,false,16),
|
||||
new ColumnDfn(3,"ItemType",3,5,false,5),
|
||||
new ColumnDfn(3,"ItemId",4,4,false,10),
|
||||
new ColumnDfn(3,"SportId",4,4,false,10),
|
||||
new ColumnDfn(3,"ItemSportData",0,-9,false,0),
|
||||
new ColumnDfn(3,"Notes",0,-9,false,2000),
|
||||
new ColumnDfn(3,"Flags",3,5,false,5),
|
||||
new ColumnDfn(3,"Status",0,12,false,3),
|
||||
@@ -455,14 +480,13 @@ namespace Saxonite.Base.App
|
||||
new ColumnDfn(3,"UpdateBy",4,4,false,10),
|
||||
new ColumnDfn(3,"UpdateHost",0,12,false,100),
|
||||
new ColumnDfn(4,"Id",4,4,true,10),
|
||||
new ColumnDfn(4,"Name",0,-9,false,100),
|
||||
new ColumnDfn(4,"OrganisationType",0,12,false,3),
|
||||
new ColumnDfn(4,"OrganisationCategory",0,12,false,3),
|
||||
new ColumnDfn(4,"UserAccountIdJournalist",4,4,false,10),
|
||||
new ColumnDfn(4,"SportIdPrimary",4,4,false,10),
|
||||
new ColumnDfn(4,"RegionIdPrimary",4,4,false,10),
|
||||
new ColumnDfn(4,"CountryIso2Code",0,12,false,2),
|
||||
new ColumnDfn(4,"PhoneMain",0,-9,false,50),
|
||||
new ColumnDfn(4,"PhoneAlt",0,-9,false,50),
|
||||
new ColumnDfn(4,"Headline",0,-9,false,200),
|
||||
new ColumnDfn(4,"Summary",0,-9,false,2000),
|
||||
new ColumnDfn(4,"BodyData",0,-9,false,0),
|
||||
new ColumnDfn(4,"PublishedAt",9,93,false,16),
|
||||
new ColumnDfn(4,"Notes",0,-9,false,2000),
|
||||
new ColumnDfn(4,"Flags",3,5,false,5),
|
||||
new ColumnDfn(4,"Status",0,12,false,3),
|
||||
@@ -473,15 +497,14 @@ namespace Saxonite.Base.App
|
||||
new ColumnDfn(4,"UpdateBy",4,4,false,10),
|
||||
new ColumnDfn(4,"UpdateHost",0,12,false,100),
|
||||
new ColumnDfn(5,"Id",4,4,true,10),
|
||||
new ColumnDfn(5,"OrganisationId",4,4,false,10),
|
||||
new ColumnDfn(5,"Name",0,-9,false,100),
|
||||
new ColumnDfn(5,"OrganisationType",0,12,false,3),
|
||||
new ColumnDfn(5,"OrganisationCategory",0,12,false,3),
|
||||
new ColumnDfn(5,"SportIdPrimary",4,4,false,10),
|
||||
new ColumnDfn(5,"RegionIdPrimary",4,4,false,10),
|
||||
new ColumnDfn(5,"OpportunityTypeCode",0,12,false,3),
|
||||
new ColumnDfn(5,"Position",0,-9,false,200),
|
||||
new ColumnDfn(5,"Outline",0,-9,false,2000),
|
||||
new ColumnDfn(5,"OpportunityData",0,-9,false,0),
|
||||
new ColumnDfn(5,"PublishedAt",9,93,false,16),
|
||||
new ColumnDfn(5,"ExpiresAt",9,93,false,16),
|
||||
new ColumnDfn(5,"CountryIso2Code",0,12,false,2),
|
||||
new ColumnDfn(5,"PhoneMain",0,-9,false,50),
|
||||
new ColumnDfn(5,"PhoneAlt",0,-9,false,50),
|
||||
new ColumnDfn(5,"Notes",0,-9,false,2000),
|
||||
new ColumnDfn(5,"Flags",3,5,false,5),
|
||||
new ColumnDfn(5,"Status",0,12,false,3),
|
||||
@@ -492,12 +515,15 @@ namespace Saxonite.Base.App
|
||||
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,"RegionType",3,5,false,5),
|
||||
new ColumnDfn(6,"CountryIso2Code",0,12,false,2),
|
||||
new ColumnDfn(6,"Name",0,-9,false,100),
|
||||
new ColumnDfn(6,"Latitude",8,3,false,9),
|
||||
new ColumnDfn(6,"Longitude",8,3,false,9),
|
||||
new ColumnDfn(6,"RegionIdParent",4,4,false,10),
|
||||
new ColumnDfn(6,"OrganisationId",4,4,false,10),
|
||||
new ColumnDfn(6,"SportIdPrimary",4,4,false,10),
|
||||
new ColumnDfn(6,"RegionIdPrimary",4,4,false,10),
|
||||
new ColumnDfn(6,"OpportunityTypeCode",0,12,false,3),
|
||||
new ColumnDfn(6,"Position",0,-9,false,200),
|
||||
new ColumnDfn(6,"Outline",0,-9,false,2000),
|
||||
new ColumnDfn(6,"OpportunityData",0,-9,false,0),
|
||||
new ColumnDfn(6,"PublishedAt",9,93,false,16),
|
||||
new ColumnDfn(6,"ExpiresAt",9,93,false,16),
|
||||
new ColumnDfn(6,"Notes",0,-9,false,2000),
|
||||
new ColumnDfn(6,"Flags",3,5,false,5),
|
||||
new ColumnDfn(6,"Status",0,12,false,3),
|
||||
@@ -508,7 +534,12 @@ 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,"RegionType",3,5,false,5),
|
||||
new ColumnDfn(7,"CountryIso2Code",0,12,false,2),
|
||||
new ColumnDfn(7,"Name",0,-9,false,100),
|
||||
new ColumnDfn(7,"Latitude",8,3,false,9),
|
||||
new ColumnDfn(7,"Longitude",8,3,false,9),
|
||||
new ColumnDfn(7,"RegionIdParent",4,4,false,10),
|
||||
new ColumnDfn(7,"Notes",0,-9,false,2000),
|
||||
new ColumnDfn(7,"Flags",3,5,false,5),
|
||||
new ColumnDfn(7,"Status",0,12,false,3),
|
||||
@@ -519,24 +550,7 @@ 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,"EmailAddress",0,-9,false,200),
|
||||
new ColumnDfn(8,"Title",0,-9,false,20),
|
||||
new ColumnDfn(8,"FirstName",0,-9,false,100),
|
||||
new ColumnDfn(8,"Initials",0,-9,false,10),
|
||||
new ColumnDfn(8,"LastName",0,-9,false,100),
|
||||
new ColumnDfn(8,"PhoneMain",0,-9,false,50),
|
||||
new ColumnDfn(8,"PhoneMobile",0,-9,false,50),
|
||||
new ColumnDfn(8,"PhoneAlt",0,-9,false,50),
|
||||
new ColumnDfn(8,"DateOfBirth",9,93,false,16),
|
||||
new ColumnDfn(8,"RegionIdCountry",4,4,false,10),
|
||||
new ColumnDfn(8,"RegionIdProvince",4,4,false,10),
|
||||
new ColumnDfn(8,"PasswordToken",0,12,false,32),
|
||||
new ColumnDfn(8,"PasswordHashed",0,-9,false,100),
|
||||
new ColumnDfn(8,"PasswordHistory",0,-9,false,0),
|
||||
new ColumnDfn(8,"PasswordChangedAt",9,93,false,16),
|
||||
new ColumnDfn(8,"LastLoginAt",9,93,false,16),
|
||||
new ColumnDfn(8,"LastInvalidLoginAt",9,93,false,16),
|
||||
new ColumnDfn(8,"InvalidLoginCount",3,5,false,5),
|
||||
new ColumnDfn(8,"Name",0,-9,false,100),
|
||||
new ColumnDfn(8,"Notes",0,-9,false,2000),
|
||||
new ColumnDfn(8,"Flags",3,5,false,5),
|
||||
new ColumnDfn(8,"Status",0,12,false,3),
|
||||
@@ -546,11 +560,25 @@ namespace Saxonite.Base.App
|
||||
new ColumnDfn(8,"UpdateOn",9,93,false,23),
|
||||
new ColumnDfn(8,"UpdateBy",4,4,false,10),
|
||||
new ColumnDfn(8,"UpdateHost",0,12,false,100),
|
||||
new ColumnDfn(9,"Id",5,-5,true,19),
|
||||
new ColumnDfn(9,"UserAccountId",4,4,false,10),
|
||||
new ColumnDfn(9,"OrganisationId",4,4,false,10),
|
||||
new ColumnDfn(9,"OrganisationRoleCodes",0,12,false,256),
|
||||
new ColumnDfn(9,"OrganisationRoleCount",2,-6,false,3),
|
||||
new ColumnDfn(9,"Id",4,4,true,10),
|
||||
new ColumnDfn(9,"EmailAddress",0,-9,false,200),
|
||||
new ColumnDfn(9,"Title",0,-9,false,20),
|
||||
new ColumnDfn(9,"FirstName",0,-9,false,100),
|
||||
new ColumnDfn(9,"Initials",0,-9,false,10),
|
||||
new ColumnDfn(9,"LastName",0,-9,false,100),
|
||||
new ColumnDfn(9,"PhoneMain",0,-9,false,50),
|
||||
new ColumnDfn(9,"PhoneMobile",0,-9,false,50),
|
||||
new ColumnDfn(9,"PhoneAlt",0,-9,false,50),
|
||||
new ColumnDfn(9,"DateOfBirth",9,93,false,16),
|
||||
new ColumnDfn(9,"RegionIdCountry",4,4,false,10),
|
||||
new ColumnDfn(9,"RegionIdProvince",4,4,false,10),
|
||||
new ColumnDfn(9,"PasswordToken",0,12,false,32),
|
||||
new ColumnDfn(9,"PasswordHashed",0,-9,false,100),
|
||||
new ColumnDfn(9,"PasswordHistory",0,-9,false,0),
|
||||
new ColumnDfn(9,"PasswordChangedAt",9,93,false,16),
|
||||
new ColumnDfn(9,"LastLoginAt",9,93,false,16),
|
||||
new ColumnDfn(9,"LastInvalidLoginAt",9,93,false,16),
|
||||
new ColumnDfn(9,"InvalidLoginCount",3,5,false,5),
|
||||
new ColumnDfn(9,"Notes",0,-9,false,2000),
|
||||
new ColumnDfn(9,"Flags",3,5,false,5),
|
||||
new ColumnDfn(9,"Status",0,12,false,3),
|
||||
@@ -562,7 +590,9 @@ namespace Saxonite.Base.App
|
||||
new ColumnDfn(9,"UpdateHost",0,12,false,100),
|
||||
new ColumnDfn(10,"Id",5,-5,true,19),
|
||||
new ColumnDfn(10,"UserAccountId",4,4,false,10),
|
||||
new ColumnDfn(10,"UserRoleCode",0,12,false,16),
|
||||
new ColumnDfn(10,"OrganisationId",4,4,false,10),
|
||||
new ColumnDfn(10,"OrganisationRoleCodes",0,12,false,256),
|
||||
new ColumnDfn(10,"OrganisationRoleCount",2,-6,false,3),
|
||||
new ColumnDfn(10,"Notes",0,-9,false,2000),
|
||||
new ColumnDfn(10,"Flags",3,5,false,5),
|
||||
new ColumnDfn(10,"Status",0,12,false,3),
|
||||
@@ -572,27 +602,39 @@ 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,"ActivityIndexIds",0,-9,false,0),
|
||||
new ColumnDfn(11,"UserSessionData",0,-9,false,0),
|
||||
new ColumnDfn(11,"UserRoleCode",0,12,false,16),
|
||||
new ColumnDfn(11,"Notes",0,-9,false,2000),
|
||||
new ColumnDfn(11,"Flags",3,5,false,5),
|
||||
new ColumnDfn(11,"Status",0,12,false,3),
|
||||
new ColumnDfn(11,"CreateOn",9,93,false,23),
|
||||
new ColumnDfn(11,"CreateBy",4,4,false,10),
|
||||
new ColumnDfn(11,"CreateHost",0,12,false,100),
|
||||
new ColumnDfn(11,"UpdateOn",9,93,false,23),
|
||||
new ColumnDfn(12,"Id",4,4,true,10),
|
||||
new ColumnDfn(11,"UpdateBy",4,4,false,10),
|
||||
new ColumnDfn(11,"UpdateHost",0,12,false,100),
|
||||
new ColumnDfn(12,"UserAccountId",4,4,false,10),
|
||||
new ColumnDfn(12,"SportId",4,4,false,10),
|
||||
new ColumnDfn(12,"Participation",3,5,false,5),
|
||||
new ColumnDfn(12,"Officiating",3,5,false,5),
|
||||
new ColumnDfn(12,"UserSportData",0,-9,false,0),
|
||||
new ColumnDfn(12,"Notes",0,-9,false,2000),
|
||||
new ColumnDfn(12,"ActivityIndexIds",0,-9,false,0),
|
||||
new ColumnDfn(12,"UserSessionData",0,-9,false,0),
|
||||
new ColumnDfn(12,"Flags",3,5,false,5),
|
||||
new ColumnDfn(12,"Status",0,12,false,3),
|
||||
new ColumnDfn(12,"CreateOn",9,93,false,23),
|
||||
new ColumnDfn(12,"CreateBy",4,4,false,10),
|
||||
new ColumnDfn(12,"CreateHost",0,12,false,100),
|
||||
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",4,4,true,10),
|
||||
new ColumnDfn(13,"UserAccountId",4,4,false,10),
|
||||
new ColumnDfn(13,"SportId",4,4,false,10),
|
||||
new ColumnDfn(13,"Participation",3,5,false,5),
|
||||
new ColumnDfn(13,"Officiating",3,5,false,5),
|
||||
new ColumnDfn(13,"UserSportData",0,-9,false,0),
|
||||
new ColumnDfn(13,"Notes",0,-9,false,2000),
|
||||
new ColumnDfn(13,"Flags",3,5,false,5),
|
||||
new ColumnDfn(13,"Status",0,12,false,3),
|
||||
new ColumnDfn(13,"CreateOn",9,93,false,23),
|
||||
new ColumnDfn(13,"CreateBy",4,4,false,10),
|
||||
new ColumnDfn(13,"CreateHost",0,12,false,100),
|
||||
new ColumnDfn(13,"UpdateOn",9,93,false,23),
|
||||
new ColumnDfn(13,"UpdateBy",4,4,false,10),
|
||||
new ColumnDfn(13,"UpdateHost",0,12,false,100),
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
private static readonly List<TypeCodeDesc> regionTypeCodes = new List<TypeCodeDesc>();
|
||||
private static readonly List<TypeCodeDesc> userRoleCodes = new List<TypeCodeDesc>();
|
||||
private static readonly List<TypeCodeDesc> titleCodes = new List<TypeCodeDesc>();
|
||||
private static readonly List<TypeCodeDesc> imageTypeCodes = new List<TypeCodeDesc>();
|
||||
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>();
|
||||
@@ -71,6 +72,11 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
titleCodes.Add(Sax.Title.Lord, "Lord", "Lord");
|
||||
titleCodes.Add(Sax.Title.Lady, "Lady", "Lady");
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Image types.
|
||||
imageTypeCodes.Add(Sax.ImageType.Avatar, "Avatar", "Avatar");
|
||||
imageTypeCodes.Add(Sax.ImageType.AvatarUpload, "AvatarUpload", "Avatar - upload");
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Organisation types.
|
||||
organisationTypeCodes.Add(Sax.OrganisationType.SocialEnterprise, "SEN", "Social Enterprise");
|
||||
|
||||
@@ -48,6 +48,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
return new List<TypeCodeDesc>(userRoleCodes);
|
||||
case Sax.CodeType.Title:
|
||||
return new List<TypeCodeDesc>(titleCodes);
|
||||
case Sax.CodeType.ImageType:
|
||||
return new List<TypeCodeDesc>(imageTypeCodes);
|
||||
case Sax.CodeType.OrganisationType:
|
||||
return new List<TypeCodeDesc>(organisationTypeCodes);
|
||||
case Sax.CodeType.OrganisationCategory:
|
||||
|
||||
@@ -0,0 +1,300 @@
|
||||
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
|
||||
{
|
||||
//=======================================================================
|
||||
// ItemImage.
|
||||
//=======================================================================
|
||||
public abstract class SaxItemImage : SacsHierarchyItem
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Columns.
|
||||
public enum Column
|
||||
{
|
||||
Pos,
|
||||
Id,
|
||||
// Item.
|
||||
ItemType,
|
||||
ItemType_Code,
|
||||
ItemType_Desc,
|
||||
ItemId,
|
||||
Item_Caption,
|
||||
// Image.
|
||||
ImageType,
|
||||
ImageType_Code,
|
||||
ImageType_Desc,
|
||||
ImageSeq,
|
||||
Filename,
|
||||
Mime,
|
||||
ContentType,
|
||||
Width,
|
||||
Height,
|
||||
DataSize,
|
||||
// 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 ItemId { get; set; }
|
||||
public Sax.ImageType ImageType { get; set; }
|
||||
public byte ImageSeq { get; set; }
|
||||
public String Filename { get; set; }
|
||||
public String Mime { get; set; }
|
||||
public String ContentType { get; set; }
|
||||
public int Width { get; set; }
|
||||
public int Height { get; set; }
|
||||
public byte[] ImageData { 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 ItemId
|
||||
{
|
||||
get { return data.ItemId; }
|
||||
set { CheckChanged(data.ItemId, value); data.ItemId = value; }
|
||||
}
|
||||
public Sax.ImageType ImageType
|
||||
{
|
||||
get { return data.ImageType; }
|
||||
set { CheckChanged((int)data.ImageType, (int)value); data.ImageType = value; }
|
||||
}
|
||||
public byte ImageSeq
|
||||
{
|
||||
get { return data.ImageSeq; }
|
||||
set { CheckChanged(data.ImageSeq, value); data.ImageSeq = value; }
|
||||
}
|
||||
public String Filename
|
||||
{
|
||||
get { return data.Filename; }
|
||||
set { CheckChanged(data.Filename, value); data.Filename = value; }
|
||||
}
|
||||
public String Mime
|
||||
{
|
||||
get { return data.Mime; }
|
||||
set { CheckChanged(data.Mime, value); data.Mime = value; }
|
||||
}
|
||||
public String ContentType
|
||||
{
|
||||
get { return data.ContentType; }
|
||||
set { CheckChanged(data.ContentType, value); data.ContentType = value; }
|
||||
}
|
||||
public int Width
|
||||
{
|
||||
get { return data.Width; }
|
||||
set { CheckChanged(data.Width, value); data.Width = value; }
|
||||
}
|
||||
public int Height
|
||||
{
|
||||
get { return data.Height; }
|
||||
set { CheckChanged(data.Height, value); data.Height = value; }
|
||||
}
|
||||
public byte[] ImageData
|
||||
{
|
||||
get { return data.ImageData; }
|
||||
set { CheckChanged(data.ImageData, value); data.ImageData = value; }
|
||||
}
|
||||
// Population.
|
||||
internal void PopulateFrom(Data data)
|
||||
{
|
||||
ItemId = data.ItemId;
|
||||
ImageType = data.ImageType;
|
||||
ImageSeq = data.ImageSeq;
|
||||
Filename = data.Filename;
|
||||
Mime = data.Mime;
|
||||
ContentType = data.ContentType;
|
||||
Width = data.Width;
|
||||
Height = data.Height;
|
||||
ImageData = data.ImageData;
|
||||
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 ItemId { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ImageType { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ImageSeq { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Filename { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Mime { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ContentType { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Width { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Height { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ImageData { get; set; } = ValidValue.Valid;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private readonly Data data = new Data();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected SaxItemImage(SysId id, ItemId itemId, Sax.ImageType imageType) : base(id)
|
||||
{
|
||||
base.SetData(data);
|
||||
ItemId = itemId;
|
||||
ImageType = imageType;
|
||||
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.ItemImage, 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 (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");
|
||||
if (ImageType > 0 && ImageType != data.ImageType)
|
||||
throw new NotSupportedException(fn + " Image Type cannot be changed");
|
||||
this.data.PopulateFrom(data);
|
||||
}
|
||||
public ItemId ItemId
|
||||
{
|
||||
get { return data.ItemId; }
|
||||
protected set { data.ItemId = value; }
|
||||
}
|
||||
public Sax.ImageType ImageType
|
||||
{
|
||||
get { return data.ImageType; }
|
||||
protected set { data.ImageType = value; }
|
||||
}
|
||||
public byte ImageSeq
|
||||
{
|
||||
get { return data.ImageSeq; }
|
||||
set { data.ImageSeq = value; }
|
||||
}
|
||||
public String Filename
|
||||
{
|
||||
get { return data.Filename; }
|
||||
set { data.Filename = value; }
|
||||
}
|
||||
public String Mime
|
||||
{
|
||||
get { return data.Mime; }
|
||||
set { data.Mime = value; }
|
||||
}
|
||||
public String ContentType
|
||||
{
|
||||
get { return data.ContentType; }
|
||||
set { data.ContentType = value; }
|
||||
}
|
||||
public int Width
|
||||
{
|
||||
get { return data.Width; }
|
||||
set { data.Width = value; }
|
||||
}
|
||||
public int Height
|
||||
{
|
||||
get { return data.Height; }
|
||||
set { data.Height = value; }
|
||||
}
|
||||
public byte[] ImageData
|
||||
{
|
||||
get { return data.ImageData; }
|
||||
set { data.ImageData = 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,
|
||||
NotDeleted,
|
||||
ActiveOnly,
|
||||
InctiveOnly,
|
||||
}
|
||||
/// <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>();
|
||||
public List<ItemId> ItemIdsIncluded { get; } = new List<ItemId>();
|
||||
public List<Sax.ImageType> ImageTypesIncluded { get; } = new List<Sax.ImageType>();
|
||||
public String NotesPartial { get; set; }
|
||||
public StatusCat StatusCat { get; set; } = StatusCat.NotDeleted;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
// Item list extension methods.
|
||||
public static class SaxItemImageList
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -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 Image
|
||||
//*******************************************************************
|
||||
// Utilities.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Create item.
|
||||
public abstract SaxItemImage CreateItemImage(ItemId itemId, Sax.ImageType imageType);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item exists.
|
||||
public bool ItemImageExistsById(SysId id)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return false;
|
||||
SaxItemImage.Params prmItemImage = new SaxItemImage.Params();
|
||||
prmItemImage.IdsIncluded.Add(id);
|
||||
prmItemImage.StatusCat = SaxItemImage.StatusCat.Any;
|
||||
return GetItemImageCount(prmItemImage) == 1;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Retrieve individual items.
|
||||
public abstract SaxItemImage GetItemImage(SaxItemImage.Params prmItemImage);
|
||||
public SaxItemImage GetItemImageById(SysId id)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return null;
|
||||
SaxItemImage.Params prmItemImage = new SaxItemImage.Params();
|
||||
prmItemImage.IdsIncluded.Add(id);
|
||||
prmItemImage.StatusCat = SaxItemImage.StatusCat.Any;
|
||||
return GetItemImage(prmItemImage);
|
||||
}
|
||||
public SaxItemImage GetItemImage(ItemId itemId, Sax.ImageType imageType, SaxItemImage.StatusCat statusCat)
|
||||
{
|
||||
if (!ItemId.IsValid(itemId) || imageType <= 0) return null;
|
||||
SaxItemImage.Params prmItemImage = new SaxItemImage.Params();
|
||||
prmItemImage.ItemIdsIncluded.Add(itemId);
|
||||
prmItemImage.ImageTypesIncluded.Add(imageType);
|
||||
prmItemImage.StatusCat = statusCat;
|
||||
return GetItemImage(prmItemImage);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate item data.
|
||||
public bool IsValidItemImage(SaxItemImage itemImage)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (itemImage == null) return SetErrorState(ErrorMessage.ItemNotSpecified);
|
||||
return IsValidItemImageData(itemImage.GetData(), new SaxItemImage.ErrField());
|
||||
}
|
||||
public virtual bool IsValidItemImageData(SaxItemImage.Data data, SaxItemImage.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Item Id.
|
||||
if (errField.ItemId != SacsHierarchyItem.ValidValue.Ignore && !ItemId.IsValid(data.ItemId))
|
||||
{
|
||||
errField.ItemId = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState("Item Id must be specified");
|
||||
}
|
||||
// Image type.
|
||||
if (errField.ImageType != SacsHierarchyItem.ValidValue.Ignore && (int)data.ImageType < 1)
|
||||
{
|
||||
errField.ImageType = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState("Image type must be specified");
|
||||
}
|
||||
// Filename
|
||||
if (errField.Filename != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Filename, "filename", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemImage_Filename), true))
|
||||
{
|
||||
errField.Filename = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
// Mime
|
||||
if (errField.Mime != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Mime, "mime", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemImage_Mime), true))
|
||||
{
|
||||
errField.Mime = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
// Content Type
|
||||
if (errField.ContentType != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.ContentType, "content type", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemImage_ContentType), true))
|
||||
{
|
||||
errField.ContentType = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
// Image data.
|
||||
if (errField.ImageData != SacsHierarchyItem.ValidValue.Ignore && (data.ImageData == null || data.ImageData.Length < 1))
|
||||
{
|
||||
errField.ImageData = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState("Image data must be specified");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Common properties.
|
||||
if (errField.Notes != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Notes, "notes", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemImage_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.ItemImage_Status), true, true))
|
||||
{
|
||||
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
if (!SaxItemImage.ValidStatuses.Contains(data.Status))
|
||||
{
|
||||
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState(ErrorMessage.InvalidStatus);
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Dependencies - only tested if not deleted.
|
||||
if (data.Status != SaStatus.Deleted)
|
||||
{
|
||||
// Item must exist.
|
||||
// ...
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item database interface.
|
||||
public abstract bool InsertItemImage(SaxItemImage itemImage, DbUpdateInfo dbUpdateInfo);
|
||||
public abstract bool UpdateItemImage(SaxItemImage itemImage, DbUpdateInfo dbUpdateInfo);
|
||||
public virtual bool ItemImageCanBeDeleted(SaxItemImage itemImage)
|
||||
{
|
||||
ClearErrorState();
|
||||
return true;
|
||||
}
|
||||
public abstract bool DeleteItemImage(SaxItemImage itemImage, DbUpdateInfo dbUpdateInfo);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item list.
|
||||
public abstract ColumnDfn GetItemImageColumnDfn(SaxItemImage.Column columnId, String caption = "", int width = 0);
|
||||
public abstract List<String> GetItemImageQueryFilter(SaxItemImage.Params prmItemImage);
|
||||
public abstract long GetItemImageCount(SaxItemImage.Params prmItemImage);
|
||||
public abstract List<SaxItemImage> GetItemImageList(SaxItemImage.Params prmItemImage);
|
||||
public abstract DbResultSet ExecuteItemImageQuery(List<ColumnDfn> columns, SaxItemImage.Params prmItemImage);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <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 GetItemImageDataValue(ColumnDfn column, NamedValue.Map values)
|
||||
{
|
||||
DataValue value = new DataValue();
|
||||
switch ((SaxItemImage.Column)column.Id)
|
||||
{
|
||||
//-----------------------------------------------------------
|
||||
// Data item type.
|
||||
case SaxItemImage.Column.ItemType_Code:
|
||||
{
|
||||
value = new DataValue(DataItemTypeCodes.GetCodeForType(values.GetLong(column.DataName)));
|
||||
}
|
||||
break;
|
||||
case SaxItemImage.Column.ItemType_Desc:
|
||||
{
|
||||
value = new DataValue(DataItemTypeCodes.GetDescForType(values.GetLong(column.DataName)));
|
||||
}
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Notes.
|
||||
case SaxItemImage.Column.Notes:
|
||||
value = new DataValue(SacsHierarchyItem.FormatForDisplay(values.GetValue(column.DataName).ToString(), 200));
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Status.
|
||||
case SaxItemImage.Column.Status_Desc:
|
||||
case SaxItemImage.Column.Status_Ind:
|
||||
{
|
||||
String statusCode = values.GetValue(column.DataName).ToString();
|
||||
SaStatus status = SacsSystem.GetStatusForCode(statusCode);
|
||||
if (column.Id == (int)SaxItemImage.Column.Status_Desc)
|
||||
value = new DataValue(SacsSystem.GetStatusDesc(status));
|
||||
else if (column.Id == (int)SaxItemImage.Column.Status_Ind)
|
||||
value = new DataValue(SaxItemImage.GetStatusTriState(status));
|
||||
}
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
Reference in New Issue
Block a user