Add support item process tracking and admin updates
This commit is contained in:
@@ -9,10 +9,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
||||||
<PackageReference Include="Moq" Version="4.20.70" />
|
<PackageReference Include="Moq" Version="4.20.72" />
|
||||||
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
|
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
|
||||||
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
|
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
|
||||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
||||||
<PackageReference Include="Moq" Version="4.20.70" />
|
<PackageReference Include="Moq" Version="4.20.72" />
|
||||||
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
|
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
|
||||||
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
|
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
|
||||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
|||||||
public SaxAppConfig(String context, ConfigurationSection configSection, SaxAppConfig defaultConfig)
|
public SaxAppConfig(String context, ConfigurationSection configSection, SaxAppConfig defaultConfig)
|
||||||
{
|
{
|
||||||
Context = context;
|
Context = context;
|
||||||
populateDefaults(defaultConfig);
|
PopulateDefaults(defaultConfig);
|
||||||
PopulateConfig(configSection);
|
PopulateConfig(configSection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,13 +118,15 @@ namespace Saxonite.Net.Core.Web.Base.App
|
|||||||
public LoggingConfig Logging { get; } = new LoggingConfig();
|
public LoggingConfig Logging { get; } = new LoggingConfig();
|
||||||
|
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
private void populateDefaults(SaxAppConfig defaultConfig)
|
private void PopulateDefaults(SaxAppConfig defaultConfig)
|
||||||
{
|
{
|
||||||
if (defaultConfig == null) return;
|
if (defaultConfig == null) return;
|
||||||
Security.Password.MinLength = defaultConfig.Security.Password.MinLength;
|
Security.Password.MinLength = defaultConfig.Security.Password.MinLength;
|
||||||
Security.SignIn.KeepLoggedIn.Allowed = defaultConfig.Security.SignIn.KeepLoggedIn.Allowed;
|
Security.SignIn.KeepLoggedIn.Allowed = defaultConfig.Security.SignIn.KeepLoggedIn.Allowed;
|
||||||
Security.SignIn.KeepLoggedIn.CookieExpiresDays = defaultConfig.Security.SignIn.KeepLoggedIn.CookieExpiresDays;
|
Security.SignIn.KeepLoggedIn.CookieExpiresDays = defaultConfig.Security.SignIn.KeepLoggedIn.CookieExpiresDays;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
private void PopulateConfig(ConfigurationSection configSection)
|
private void PopulateConfig(ConfigurationSection configSection)
|
||||||
{
|
{
|
||||||
if (configSection != null)
|
if (configSection != null)
|
||||||
@@ -133,6 +135,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
|||||||
foreach (ConfigurationSection environment in configSection.GetSection("Environments").GetChildren())
|
foreach (ConfigurationSection environment in configSection.GetSection("Environments").GetChildren())
|
||||||
environments.Add(StringUtil.TrimAll(environment.Value));
|
environments.Add(StringUtil.TrimAll(environment.Value));
|
||||||
Instance = StringUtil.OnEmpty(configSection["Instance"], Instance);
|
Instance = StringUtil.OnEmpty(configSection["Instance"], Instance);
|
||||||
|
|
||||||
// URLs.
|
// URLs.
|
||||||
IConfigurationSection urls = configSection.GetSection("URLs");
|
IConfigurationSection urls = configSection.GetSection("URLs");
|
||||||
if (urls.Exists())
|
if (urls.Exists())
|
||||||
@@ -143,6 +146,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
|||||||
URL.Online.Root = onlineUrls["Root"];
|
URL.Online.Root = onlineUrls["Root"];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Security.
|
// Security.
|
||||||
IConfigurationSection security = configSection.GetSection("Security");
|
IConfigurationSection security = configSection.GetSection("Security");
|
||||||
if (security.Exists())
|
if (security.Exists())
|
||||||
@@ -170,6 +174,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Email.
|
// Email.
|
||||||
IConfigurationSection email = configSection.GetSection("Email");
|
IConfigurationSection email = configSection.GetSection("Email");
|
||||||
if (email.Exists())
|
if (email.Exists())
|
||||||
@@ -179,20 +184,24 @@ namespace Saxonite.Net.Core.Web.Base.App
|
|||||||
PopulateEmailConfig(Email.Signup_Activate, email.GetSection("Signup").GetSection("Activate"));
|
PopulateEmailConfig(Email.Signup_Activate, email.GetSection("Signup").GetSection("Activate"));
|
||||||
PopulateEmailConfig(Email.Signup_Welcome, email.GetSection("Signup").GetSection("Welcome"));
|
PopulateEmailConfig(Email.Signup_Welcome, email.GetSection("Signup").GetSection("Welcome"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Documents.
|
// Documents.
|
||||||
IConfigurationSection documents = configSection.GetSection("Documents");
|
IConfigurationSection documents = configSection.GetSection("Documents");
|
||||||
if (documents.Exists())
|
if (documents.Exists())
|
||||||
{
|
{
|
||||||
Documents.RootFolder = StringUtil.OnEmpty(documents["RootFolder"], Documents.RootFolder);
|
Documents.RootFolder = StringUtil.OnEmpty(documents["RootFolder"], Documents.RootFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Logging.
|
// Logging.
|
||||||
IConfigurationSection logging = configSection.GetSection("Logging");
|
IConfigurationSection logging = configSection.GetSection("Logging");
|
||||||
if (logging.Exists())
|
if (logging.Exists())
|
||||||
{
|
{
|
||||||
Logging.RootFolder = StringUtil.OnEmpty(logging["RootFolder"], Logging.RootFolder);
|
Logging.RootFolder = StringUtil.OnEmpty(logging["RootFolder"], Logging.RootFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Database.
|
// Database.
|
||||||
extractDatabasesConfig(Databases, configSection.GetSection("Databases"));
|
ExtractDatabasesConfig(Databases, configSection.GetSection("Databases"));
|
||||||
|
|
||||||
// Variants.
|
// Variants.
|
||||||
foreach (ConfigurationSection variantSection in configSection.GetSection("Variants").GetChildren())
|
foreach (ConfigurationSection variantSection in configSection.GetSection("Variants").GetChildren())
|
||||||
{
|
{
|
||||||
@@ -204,6 +213,8 @@ namespace Saxonite.Net.Core.Web.Base.App
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
private void PopulateEmailConfig(EmailConfig.SpecificEmailConfig config, IConfigurationSection emailSection)
|
private void PopulateEmailConfig(EmailConfig.SpecificEmailConfig config, IConfigurationSection emailSection)
|
||||||
{
|
{
|
||||||
if (!emailSection.Exists()) return;
|
if (!emailSection.Exists()) return;
|
||||||
@@ -214,14 +225,18 @@ namespace Saxonite.Net.Core.Web.Base.App
|
|||||||
foreach (var addressBcc in emailSection.GetSection("AddressesBcc").GetChildren())
|
foreach (var addressBcc in emailSection.GetSection("AddressesBcc").GetChildren())
|
||||||
config.AddressesBcc.Add(StringUtil.TrimAll(addressBcc.Value));
|
config.AddressesBcc.Add(StringUtil.TrimAll(addressBcc.Value));
|
||||||
}
|
}
|
||||||
private void extractDatabasesConfig(DatabasesConfig databases, IConfigurationSection databasesSection)
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
private void ExtractDatabasesConfig(DatabasesConfig databases, IConfigurationSection databasesSection)
|
||||||
{
|
{
|
||||||
if (!databasesSection.Exists()) return;
|
if (!databasesSection.Exists()) return;
|
||||||
// 'Database' section contains a separate named configuration for each database: 'Core', 'Support' etc.
|
// 'Database' section contains a separate named configuration for each database: 'Core', 'Support' etc.
|
||||||
foreach (var databaseSection in databasesSection.GetChildren())
|
foreach (var databaseSection in databasesSection.GetChildren())
|
||||||
extractDatabaseConfig(databases, databaseSection);
|
ExtractDatabaseConfig(databases, databaseSection);
|
||||||
}
|
}
|
||||||
private void extractDatabaseConfig(DatabasesConfig databases, IConfigurationSection databaseSection)
|
|
||||||
|
//---------------------------------------------------------------
|
||||||
|
private void ExtractDatabaseConfig(DatabasesConfig databases, IConfigurationSection databaseSection)
|
||||||
{
|
{
|
||||||
if (!databaseSection.Exists()) return;
|
if (!databaseSection.Exists()) return;
|
||||||
Sax.Database databaseType = EnumUtil.ParseEnum<Sax.Database>(databaseSection.Key);
|
Sax.Database databaseType = EnumUtil.ParseEnum<Sax.Database>(databaseSection.Key);
|
||||||
|
|||||||
@@ -132,9 +132,9 @@ namespace Saxonite.Net.Core.Web.Base.App
|
|||||||
// Configure database connection.
|
// Configure database connection.
|
||||||
SaxAppConfig.DatabaseConfig databaseConfig = AppConfig.Databases.Databases.GetValue(databaseInstance, new SaxAppConfig.DatabaseConfig());
|
SaxAppConfig.DatabaseConfig databaseConfig = AppConfig.Databases.Databases.GetValue(databaseInstance, new SaxAppConfig.DatabaseConfig());
|
||||||
SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig();
|
SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig();
|
||||||
config.location = databaseConfig.Location;
|
config.Location = databaseConfig.Location;
|
||||||
config.user = databaseConfig.User;
|
config.User = databaseConfig.User;
|
||||||
config.pword = databaseConfig.Password;
|
config.Password = databaseConfig.Password;
|
||||||
SacsDatabase database = SacsDatabaseConsole.OpenOdbcDatabase(config);
|
SacsDatabase database = SacsDatabaseConsole.OpenOdbcDatabase(config);
|
||||||
if (database.HasErrorState())
|
if (database.HasErrorState())
|
||||||
SaLogger.Warn(SysUtil.Fn + " " + databaseInstance.ToString() + " Database initialisation error: " + database.ErrorStateMessage);
|
SaLogger.Warn(SysUtil.Fn + " " + databaseInstance.ToString() + " Database initialisation error: " + database.ErrorStateMessage);
|
||||||
|
|||||||
@@ -34,12 +34,13 @@ namespace Saxonite.Net.Core.Web.Base.App
|
|||||||
// Properties.
|
// Properties.
|
||||||
public abstract IStringLocalizer MainProperties { get; }
|
public abstract IStringLocalizer MainProperties { get; }
|
||||||
public virtual List<IStringLocalizer> AlternativeProperties { get; } = new List<IStringLocalizer>();
|
public virtual List<IStringLocalizer> AlternativeProperties { get; } = new List<IStringLocalizer>();
|
||||||
|
private HashSet<String> MissingKeysLogged { get; } = new HashSet<String>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Generic phrase translation.
|
// Generic phrase translation.
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
/// <summary>Retrieve localised text.</summary>
|
/// <summary>Retrieve localised text.</summary>
|
||||||
public LocalizedString GetText(string key)
|
public LocalizedString GetText(string key)
|
||||||
{
|
{
|
||||||
return GetText(key, null);
|
return GetText(key, null);
|
||||||
}
|
}
|
||||||
@@ -72,8 +73,11 @@ namespace Saxonite.Net.Core.Web.Base.App
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (text.ResourceNotFound && logMissingKey)
|
if (text.ResourceNotFound && logMissingKey && !MissingKeysLogged.Contains(key))
|
||||||
SaLogger.Debug($"{SysUtil.Fn} Key not found: {key}");
|
{
|
||||||
|
MissingKeysLogged.Add(key);
|
||||||
|
SaLogger.Debug($"{SysUtil.Fn} Key not found: {key}");
|
||||||
|
}
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -324,6 +328,12 @@ namespace Saxonite.Net.Core.Web.Base.App
|
|||||||
return GetCodeTypeCaption(Sax.CodeType.UserReportType, reportType);
|
return GetCodeTypeCaption(Sax.CodeType.UserReportType, reportType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Support Item Process Type.
|
||||||
|
public String GetSupportItemProcessTypeCaption(Sax.SupportItemProcessType processType)
|
||||||
|
{
|
||||||
|
return GetCodeTypeCaption(Sax.CodeType.SupportItemProcessType, processType);
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Region.
|
// Region.
|
||||||
public String GetRegionName(SaxRegion.Data region)
|
public String GetRegionName(SaxRegion.Data region)
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ namespace Saxonite.Net.Core.Web.Base.Controllers
|
|||||||
public List<TypeCodeDesc> ActivityReactionCodes { get { return Internals.ActivityReactionCodes; } }
|
public List<TypeCodeDesc> ActivityReactionCodes { get { return Internals.ActivityReactionCodes; } }
|
||||||
// Support.
|
// Support.
|
||||||
public List<TypeCodeDesc> UserReportTypeCodes { get { return Internals.UserReportTypeCodes; } }
|
public List<TypeCodeDesc> UserReportTypeCodes { get { return Internals.UserReportTypeCodes; } }
|
||||||
|
public List<TypeCodeDesc> SupportItemProcessTypeCodes { get { return Internals.SupportItemProcessTypeCodes; } }
|
||||||
// Email.
|
// Email.
|
||||||
public SaEmailConfig EmailConfig { get { return App.EmailConfig; } }
|
public SaEmailConfig EmailConfig { get { return App.EmailConfig; } }
|
||||||
public SaxEmailConsole EmailConsole { get { return Internals.EmailConsole; } }
|
public SaxEmailConsole EmailConsole { get { return Internals.EmailConsole; } }
|
||||||
|
|||||||
@@ -106,10 +106,10 @@ namespace Saxonite.Net.Core.Web.Base.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Parameters.
|
// Online encryption parameters.
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Online Request Password encryption parameters (key & IV) are defined in
|
// Online Request Password encryption parameters (key & IV) are defined in
|
||||||
// the base Controller so that they can be shared with the Adnin application.
|
// the base Controller so that they can be shared with the Admin application.
|
||||||
// NB IV value is generated from the key and fixed so that it doesn't change when the application restarts.
|
// NB IV value is generated from the key and fixed so that it doesn't change when the application restarts.
|
||||||
// IV Must be regenerated if key is changed.
|
// IV Must be regenerated if key is changed.
|
||||||
protected static String Base64Key_RequestPassword_Online { get; } = SacsEncryptionHelper.EncodePlainKey("{~Saxonite@@Request^Password=}", SacsEncryptionHelper.KeyLength);
|
protected static String Base64Key_RequestPassword_Online { get; } = SacsEncryptionHelper.EncodePlainKey("{~Saxonite@@Request^Password=}", SacsEncryptionHelper.KeyLength);
|
||||||
|
|||||||
@@ -54,7 +54,8 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Page configuration.
|
// Page configuration.
|
||||||
public String InstanceVersion { get { return !StringUtil.IsEmpty(App.AppConfig.Instance) ? App.AppConfig.Instance + " v" + Sax.Version.GetFullVersion() : "v" + Sax.Version.GetAppVersion(); } }
|
public String Version { get { return SaxSystem.DebugMode ? $"v{Sax.Version.GetFullVersion()}" : $"v{Sax.Version.GetAppVersion()}"; } }
|
||||||
|
public String InstanceVersion { get { return (!StringUtil.IsEmpty(App.AppConfig.Instance) ? App.AppConfig.Instance + " " : "") + $"{Version}"; } }
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Business components.
|
// Business components.
|
||||||
@@ -93,6 +94,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
|||||||
public List<TypeCodeDesc> ActivityReactionCodes { get { return Internals.ActivityReactionCodes; } }
|
public List<TypeCodeDesc> ActivityReactionCodes { get { return Internals.ActivityReactionCodes; } }
|
||||||
// Support.
|
// Support.
|
||||||
public List<TypeCodeDesc> UserReportTypeCodes { get { return Internals.UserReportTypeCodes; } }
|
public List<TypeCodeDesc> UserReportTypeCodes { get { return Internals.UserReportTypeCodes; } }
|
||||||
|
public List<TypeCodeDesc> SupportItemProcessTypeCodes { get { return Internals.SupportItemProcessTypeCodes; } }
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Common data components.
|
// Common data components.
|
||||||
|
|||||||
@@ -625,7 +625,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
|||||||
if (StringUtil.IsBlank(usgaCourse.UsgaFacilityId)) continue;
|
if (StringUtil.IsBlank(usgaCourse.UsgaFacilityId)) continue;
|
||||||
SaxReferenceGolfMgr.UsgaFacilityData facilityData = new SaxReferenceGolfMgr.UsgaFacilityData();
|
SaxReferenceGolfMgr.UsgaFacilityData facilityData = new SaxReferenceGolfMgr.UsgaFacilityData();
|
||||||
facilityData.ProvinceCode = provinceCode;
|
facilityData.ProvinceCode = provinceCode;
|
||||||
facilityData.UsgaFacilityId = StringUtil.ToSysId(usgaCourse.UsgaFacilityId);
|
facilityData.UsgaFacilityId = SysId.ToSysId(usgaCourse.UsgaFacilityId);
|
||||||
facilityData.FacilityName = usgaCourse.FacilityName;
|
facilityData.FacilityName = usgaCourse.FacilityName;
|
||||||
if (!SysId.IsValid(facilityData.UsgaFacilityId))
|
if (!SysId.IsValid(facilityData.UsgaFacilityId))
|
||||||
{
|
{
|
||||||
@@ -643,9 +643,9 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
|||||||
{
|
{
|
||||||
if (StringUtil.IsBlank(usgaCourse.UsgaCourseId)) continue;
|
if (StringUtil.IsBlank(usgaCourse.UsgaCourseId)) continue;
|
||||||
SaxReferenceGolfMgr.UsgaCourseData courseData = new SaxReferenceGolfMgr.UsgaCourseData();
|
SaxReferenceGolfMgr.UsgaCourseData courseData = new SaxReferenceGolfMgr.UsgaCourseData();
|
||||||
courseData.UsgaFacilityId = StringUtil.ToSysId(usgaCourse.UsgaFacilityId);
|
courseData.UsgaFacilityId = SysId.ToSysId(usgaCourse.UsgaFacilityId);
|
||||||
courseData.UsgaCourseId = StringUtil.ToSysId(usgaCourse.UsgaCourseId);
|
courseData.UsgaCourseId = SysId.ToSysId(usgaCourse.UsgaCourseId);
|
||||||
courseData.LegacyCrpCourseId = StringUtil.ToSysId(usgaCourse.LegacyCrpCourseId);
|
courseData.LegacyCrpCourseId = SysId.ToSysId(usgaCourse.LegacyCrpCourseId);
|
||||||
courseData.Caption = usgaCourse.Caption;
|
courseData.Caption = usgaCourse.Caption;
|
||||||
courseData.CourseName = usgaCourse.CourseName;
|
courseData.CourseName = usgaCourse.CourseName;
|
||||||
courseData.FullName = usgaCourse.FullName;
|
courseData.FullName = usgaCourse.FullName;
|
||||||
@@ -1026,10 +1026,10 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
|||||||
}
|
}
|
||||||
else if (markerColumns.ColIdx_MarkerId == teeColumnIdx)
|
else if (markerColumns.ColIdx_MarkerId == teeColumnIdx)
|
||||||
{
|
{
|
||||||
markerData18.MarkerId = StringUtil.ToSysId(propertyText);
|
markerData18.MarkerId = SysId.ToSysId(propertyText);
|
||||||
// Unclear if Tee Id is relevant to 9 holes.
|
// Unclear if Tee Id is relevant to 9 holes.
|
||||||
//markerDataF9.MarkerId = StringUtil.ToSysId(propertyText);
|
//markerDataF9.MarkerId = SysId.ToSysId(propertyText);
|
||||||
//markerDataB9.MarkerId = StringUtil.ToSysId(propertyText);
|
//markerDataB9.MarkerId = SysId.ToSysId(propertyText);
|
||||||
}
|
}
|
||||||
else if (markerColumns.ColIdx_Length == teeColumnIdx)
|
else if (markerColumns.ColIdx_Length == teeColumnIdx)
|
||||||
{
|
{
|
||||||
@@ -1154,7 +1154,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
|||||||
|
|
||||||
int markerCount = 0;
|
int markerCount = 0;
|
||||||
int courseCount = 0;
|
int courseCount = 0;
|
||||||
int maxMarkers = 0;
|
//int maxMarkers = 0;
|
||||||
int markersCorrected = 0;
|
int markersCorrected = 0;
|
||||||
|
|
||||||
using (DisposableCollection<SacsDisposable> disposables = new DisposableCollection<SacsDisposable>())
|
using (DisposableCollection<SacsDisposable> disposables = new DisposableCollection<SacsDisposable>())
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.64" />
|
<PackageReference Include="HtmlAgilityPack" Version="1.11.71" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.31" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.31" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ namespace Saxonite.Net.Core.Web.Admin.Consoles
|
|||||||
// Data cache console.
|
// Data cache console.
|
||||||
public override SaxDataCacheConsole GetDataCacheConsole(SaxSessionContext sessionContext)
|
public override SaxDataCacheConsole GetDataCacheConsole(SaxSessionContext sessionContext)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".GetDataCacheConsole";
|
|
||||||
//throw new NotSupportedException(fn + " Data Cache Console not supported in Admin app.");
|
//throw new NotSupportedException(fn + " Data Cache Console not supported in Admin app.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace Saxonite.Net.Core.Web.Admin.Consoles
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Data members.
|
// Data members.
|
||||||
private SaxInternals internals = null;
|
//private SaxInternals internals = null;
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Construction.
|
// Construction.
|
||||||
|
|||||||
@@ -57,7 +57,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Home/Ajax/GetApplicationStats")]
|
[Route("Home/Ajax/GetApplicationStats")]
|
||||||
public IActionResult Ajax_GetApplicationStats(Model_Sport model)
|
public IActionResult Ajax_GetApplicationStats(Model_Sport model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Ajax_GetApplicationStats";
|
|
||||||
String messageTitle = Localiser["home.caption.application"];
|
String messageTitle = Localiser["home.caption.application"];
|
||||||
AjaxResponse_ApplicationStats responseData = new AjaxResponse_ApplicationStats(model);
|
AjaxResponse_ApplicationStats responseData = new AjaxResponse_ApplicationStats(model);
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IActionResult Index()
|
public IActionResult Index()
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Index";
|
|
||||||
|
|
||||||
if (!ValidUserSession)
|
if (!ValidUserSession)
|
||||||
AutoLoginUser();
|
AutoLoginUser();
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
public IActionResult GetAccountContactImage(String uaie)
|
public IActionResult GetAccountContactImage(String uaie)
|
||||||
{
|
{
|
||||||
String userAccountIdParam = "";// ToDo Decrypt from uaie value.
|
String userAccountIdParam = "";// ToDo Decrypt from uaie value.
|
||||||
SysId userAccountId = userAccountIdParam.ToSysId();
|
SysId userAccountId = SysId.ToSysId(userAccountIdParam);
|
||||||
if (!SysId.IsValid(userAccountId))
|
if (!SysId.IsValid(userAccountId))
|
||||||
userAccountId = SessionUserAccountId;
|
userAccountId = SessionUserAccountId;
|
||||||
return GetAccountContactImage(userAccountId, Sax.ImageType.Avatar);
|
return GetAccountContactImage(userAccountId, Sax.ImageType.Avatar);
|
||||||
@@ -80,8 +80,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private IActionResult GetAccountContactImage(SysId userAccountId, Sax.ImageType imageTypePriority)
|
private IActionResult GetAccountContactImage(SysId userAccountId, Sax.ImageType imageTypePriority)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".GetAccountContactImage";
|
|
||||||
|
|
||||||
// Validate session and referrer.
|
// Validate session and referrer.
|
||||||
if (!ValidReferer || !ValidUserSession) return Forbid();
|
if (!ValidReferer || !ValidUserSession) return Forbid();
|
||||||
ItemId userItemId = new ItemId((short)Sax.DataItemType.UserAccount, userAccountId);
|
ItemId userItemId = new ItemId((short)Sax.DataItemType.UserAccount, userAccountId);
|
||||||
@@ -136,8 +134,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
}
|
}
|
||||||
private IActionResult GetOrganisationLogo(String encryptedParams, bool allowUploadImage)
|
private IActionResult GetOrganisationLogo(String encryptedParams, bool allowUploadImage)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".GetOrganisationLogo";
|
|
||||||
|
|
||||||
// Validate session and referrer.
|
// Validate session and referrer.
|
||||||
if (!ValidReferer || !ValidUserSession) return Forbid();
|
if (!ValidReferer || !ValidUserSession) return Forbid();
|
||||||
|
|
||||||
@@ -146,7 +142,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
if (parameters.Count < 1) return Forbid();
|
if (parameters.Count < 1) return Forbid();
|
||||||
|
|
||||||
// Organisation Id.
|
// Organisation Id.
|
||||||
SysId organisationId = parameters.Get(ParamName_OrganisationId).ToSysId();
|
SysId organisationId = SysId.ToSysId(parameters.Get(ParamName_OrganisationId));
|
||||||
if (!SysId.IsValid(organisationId)) return Forbid();
|
if (!SysId.IsValid(organisationId)) return Forbid();
|
||||||
ItemId organisationItemId = new ItemId((short)Sax.DataItemType.Organisation, organisationId);
|
ItemId organisationItemId = new ItemId((short)Sax.DataItemType.Organisation, organisationId);
|
||||||
|
|
||||||
@@ -187,8 +183,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Image/Item")]
|
[Route("Image/Item")]
|
||||||
public IActionResult GetItemImage(String iie)
|
public IActionResult GetItemImage(String iie)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".GetItemImage";
|
|
||||||
|
|
||||||
// Validate session and referrer.
|
// Validate session and referrer.
|
||||||
if (!ValidReferer || !ValidUserSession) return Forbid();
|
if (!ValidReferer || !ValidUserSession) return Forbid();
|
||||||
ItemId userItemId = new ItemId((short)Sax.DataItemType.UserAccount, SessionUserAccountId);
|
ItemId userItemId = new ItemId((short)Sax.DataItemType.UserAccount, SessionUserAccountId);
|
||||||
@@ -198,7 +192,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
if (parameters.Count < 1) return Forbid();
|
if (parameters.Count < 1) return Forbid();
|
||||||
|
|
||||||
// Item Image.
|
// Item Image.
|
||||||
SysId itemImageId = parameters.Get(ParamName_ItemImageId).ToSysId();
|
SysId itemImageId = SysId.ToSysId(parameters.Get(ParamName_ItemImageId));
|
||||||
if (!SysId.IsValid(itemImageId)) return Forbid();
|
if (!SysId.IsValid(itemImageId)) return Forbid();
|
||||||
SaxItemImage itemImage = ItemDataMgr.GetItemImageById(itemImageId);
|
SaxItemImage itemImage = ItemDataMgr.GetItemImageById(itemImageId);
|
||||||
if (itemImage == null)
|
if (itemImage == null)
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Organisation/Ajax/GetActivationInfo")]
|
[Route("Organisation/Ajax/GetActivationInfo")]
|
||||||
public IActionResult Ajax_GetActivationInfo(Model_Organisation model)
|
public IActionResult Ajax_GetActivationInfo(Model_Organisation model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Ajax_GetActivationInfo";
|
|
||||||
String messageTitle = Localiser["caption.organisation"];
|
String messageTitle = Localiser["caption.organisation"];
|
||||||
AjaxResponse_OrganisationActivationInfo responseData = new AjaxResponse_OrganisationActivationInfo(model);
|
AjaxResponse_OrganisationActivationInfo responseData = new AjaxResponse_OrganisationActivationInfo(model);
|
||||||
|
|
||||||
@@ -53,10 +52,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
return Json(responseData.SetMessage(messageTitle, "Root online URL not specified."));
|
return Json(responseData.SetMessage(messageTitle, "Root online URL not specified."));
|
||||||
|
|
||||||
// Identify item.
|
// Identify item.
|
||||||
SysId organisationId = model.OrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||||
if (!SysId.IsValid(organisationId))
|
if (!SysId.IsValid(organisationId))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Request to get activation info without valid organisation Id.");
|
SaLogger.Warn($"{SysUtil.Fn} Request to get activation info without valid organisation Id.");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +64,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
disposableItems.Add(organisation);
|
disposableItems.Add(organisation);
|
||||||
if (organisation == null)
|
if (organisation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve organisation for Id: '" + model.OrganisationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve organisation. Id: '{model.OrganisationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,7 +106,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Organisation/Ajax/ActivateItem")]
|
[Route("Organisation/Ajax/ActivateItem")]
|
||||||
public IActionResult Ajax_Activate(Model_OrganisationActivation model)
|
public IActionResult Ajax_Activate(Model_OrganisationActivation model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Ajax_Activate";
|
|
||||||
String messageTitle = Localiser["caption.organisation"];
|
String messageTitle = Localiser["caption.organisation"];
|
||||||
AjaxResponse_Organisation responseData = new AjaxResponse_Organisation(model);
|
AjaxResponse_Organisation responseData = new AjaxResponse_Organisation(model);
|
||||||
|
|
||||||
@@ -120,12 +118,12 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Retrieve existing item.
|
// Retrieve existing item.
|
||||||
SysId organisationId = model.OrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||||
disposableItems.Add(organisation);
|
disposableItems.Add(organisation);
|
||||||
if (organisation == null)
|
if (organisation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve organisation for. : '" + model.OrganisationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve organisation. Id: '{model.OrganisationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,26 +138,26 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
if (userOrganisationId == null) continue;
|
if (userOrganisationId == null) continue;
|
||||||
OrganisationMemberData organisationMember = new OrganisationMemberData();
|
OrganisationMemberData organisationMember = new OrganisationMemberData();
|
||||||
disposableItems.Add(organisationMember);
|
disposableItems.Add(organisationMember);
|
||||||
organisationMember.UserOrganisation = AccountMgr.GetUserOrganisationById(userOrganisationId.ToSysId());
|
organisationMember.UserOrganisation = AccountMgr.GetUserOrganisationById(SysId.ToSysId(userOrganisationId));
|
||||||
organisationMember.UserAccount = AccountMgr.GetUserAccountById(organisationMember.UserOrganisation?.UserAccountId ?? null);
|
organisationMember.UserAccount = AccountMgr.GetUserAccountById(organisationMember.UserOrganisation?.UserAccountId ?? null);
|
||||||
if (organisationMember.UserOrganisation == null)
|
if (organisationMember.UserOrganisation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve user organisation. Id: '" + userOrganisationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve user organisation. Id: '{userOrganisationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
||||||
}
|
}
|
||||||
if (organisationMember.UserAccount == null)
|
if (organisationMember.UserAccount == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve user account . Id: '" + organisationMember.UserOrganisation.UserAccountId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve user account . Id: '{organisationMember.UserOrganisation.UserAccountId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
||||||
}
|
}
|
||||||
if (organisationMember.UserAccount.Status != SaStatus.Awaiting)
|
if (organisationMember.UserAccount.Status != SaStatus.Awaiting)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " User organisation is not awaiting. Id: '" + userOrganisationId + "'. Status: " + organisationMember.UserAccount.StatusDesc);
|
SaLogger.Warn($"{SysUtil.Fn} User organisation is not awaiting. Id: '{userOrganisationId}'. Status: {organisationMember.UserAccount.StatusDesc}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
||||||
}
|
}
|
||||||
// Check if this user is to be activated.
|
// Check if this user is to be activated.
|
||||||
bool activateUser = false;
|
bool activateUser = false;
|
||||||
String controlName_Activate = "MemberActivate_" + userOrganisationId;
|
String controlName_Activate = $"MemberActivate_{userOrganisationId}";
|
||||||
foreach (String key in Request.Form.Keys)
|
foreach (String key in Request.Form.Keys)
|
||||||
{
|
{
|
||||||
if (key.EqualsCI(controlName_Activate))
|
if (key.EqualsCI(controlName_Activate))
|
||||||
@@ -178,7 +176,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
// Check that organisation already has active members.
|
// Check that organisation already has active members.
|
||||||
if (AccountMgr.GetOrganisationMemberCount(organisation.Id) < 1)
|
if (AccountMgr.GetOrganisationMemberCount(organisation.Id) < 1)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Unable to activate Organisation - no active members. Id: '" + SysId.ToString(organisationId));
|
SaLogger.Warn($"{SysUtil.Fn} Unable to activate Organisation - no active members. Id: '{SysId.ToString(organisationId)}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["organisation.activate.msg.no.active.members"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["organisation.activate.msg.no.active.members"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -187,7 +185,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
organisation.Status = Sarand.Net.Standard.Base.Core.SaStatus.Active;
|
organisation.Status = Sarand.Net.Standard.Base.Core.SaStatus.Active;
|
||||||
if (!AccountMgr.UpdateOrganisation(organisation, DbUpdateInfo))
|
if (!AccountMgr.UpdateOrganisation(organisation, DbUpdateInfo))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to update organisation [Id:" + SysId.ToString(organisation.Id) + "]: " + AccountMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to update organisation [Id:{SysId.ToString(organisation.Id)}]: {AccountMgr.ErrorStateMessage}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + AccountMgr.ErrorStateMessage));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + AccountMgr.ErrorStateMessage));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,14 +201,14 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
// Send activation email.
|
// Send activation email.
|
||||||
if (SendAccountActivatedEmail(this, organisationMember.UserAccount))
|
if (SendAccountActivatedEmail(this, organisationMember.UserAccount))
|
||||||
SaLogger.Info(fn + " User Activation email sent to " + organisationMember.UserAccount.EmailAddress, true);
|
SaLogger.Info($"{SysUtil.Fn} User Activation email sent to {organisationMember.UserAccount.EmailAddress}", true);
|
||||||
else SaLogger.Warn(fn + " Failed to send User Activation email to " + organisationMember.UserAccount.EmailAddress);
|
else SaLogger.Warn($"{SysUtil.Fn} Failed to send User Activation email to {organisationMember.UserAccount.EmailAddress}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SaLogger.Warn(fn + " Failed to update user account [Id:" + SysId.ToString(organisationMember.UserAccount.Id) + "]: " + AccountMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to update user account [Id:{SysId.ToString(organisationMember.UserAccount.Id)}]: {AccountMgr.ErrorStateMessage}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
SaLogger.Warn(fn + " Failed to update user organisation [Id:" + SysId.ToString(organisationMember.UserOrganisation.Id) + "]: " + AccountMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to update user organisation [Id:{SysId.ToString(organisationMember.UserOrganisation.Id)}]: {AccountMgr.ErrorStateMessage}");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct response.
|
// Construct response.
|
||||||
|
|||||||
+36
-42
@@ -152,7 +152,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Organisation/Ajax/GetAssociations")]
|
[Route("Organisation/Ajax/GetAssociations")]
|
||||||
public IActionResult Ajax_GetAssociationList(Model_OrganisationAssociations model)
|
public IActionResult Ajax_GetAssociationList(Model_OrganisationAssociations model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Ajax_GetAssociationList";
|
|
||||||
String messageTitle = Localiser["caption.organisation.associations"];
|
String messageTitle = Localiser["caption.organisation.associations"];
|
||||||
AjaxResponse_AssociationList responseData = new AjaxResponse_AssociationList(model);
|
AjaxResponse_AssociationList responseData = new AjaxResponse_AssociationList(model);
|
||||||
|
|
||||||
@@ -161,10 +160,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
return GetAjaxResult_InvalidSession(responseData);
|
return GetAjaxResult_InvalidSession(responseData);
|
||||||
|
|
||||||
// Organisation Id is mandatory.
|
// Organisation Id is mandatory.
|
||||||
SysId organisationId = model.Filter.OrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.Filter.OrganisationId);
|
||||||
if (!SysId.IsValid(organisationId))
|
if (!SysId.IsValid(organisationId))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Request to retrieve associations without valid organisation Id.");
|
SaLogger.Warn($"{SysUtil.Fn} Request to retrieve associations without valid organisation Id.");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -192,8 +191,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
}
|
}
|
||||||
private void GetOrganisationAssociations(SaxModel_Admin model, SysId organisationId, List<AssociationListData> associations)
|
private void GetOrganisationAssociations(SaxModel_Admin model, SysId organisationId, List<AssociationListData> associations)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".GetOrganisationAssociations";
|
|
||||||
|
|
||||||
// Record disposable items as they are created so all can be disposed when needed.
|
// Record disposable items as they are created so all can be disposed when needed.
|
||||||
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
||||||
{
|
{
|
||||||
@@ -307,7 +304,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Organisation/Ajax/GetAssociation")]
|
[Route("Organisation/Ajax/GetAssociation")]
|
||||||
public IActionResult Ajax_GetAssociation(Model_OrganisationAssociations model)
|
public IActionResult Ajax_GetAssociation(Model_OrganisationAssociations model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Ajax_GetAssociation";
|
|
||||||
String messageTitle = Localiser["caption.organisation.association"];
|
String messageTitle = Localiser["caption.organisation.association"];
|
||||||
AjaxResponse_Association responseData = new AjaxResponse_Association(model);
|
AjaxResponse_Association responseData = new AjaxResponse_Association(model);
|
||||||
|
|
||||||
@@ -320,7 +316,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Identify item.
|
// Identify item.
|
||||||
SysId itemAssociationId = model.ItemAssociationId.ToSysId();
|
SysId itemAssociationId = SysId.ToSysId(model.ItemAssociationId);
|
||||||
if (!SysId.IsValid(itemAssociationId))
|
if (!SysId.IsValid(itemAssociationId))
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||||
|
|
||||||
@@ -329,28 +325,28 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
disposableItems.Add(itemAssociation);
|
disposableItems.Add(itemAssociation);
|
||||||
if (itemAssociation == null)
|
if (itemAssociation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve Item Association for Id: '" + model.ItemAssociationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Item Association for Id: '{model.ItemAssociationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Identify organisations.
|
// Identify organisations.
|
||||||
SysId organisationId = model.OrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||||
SysId organisationIdAssoc = null;
|
SysId organisationIdAssoc = null;
|
||||||
if (!SysId.IsValid(organisationId))
|
if (!SysId.IsValid(organisationId))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Organisation Id must be supplied.");
|
SaLogger.Warn($"{SysUtil.Fn} Organisation Id must be supplied.");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate the association.
|
// Validate the association.
|
||||||
if (itemAssociation.ItemIdFrom.Type != (int)Sax.DataItemType.Organisation)
|
if (itemAssociation.ItemIdFrom.Type != (int)Sax.DataItemType.Organisation)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Inconsistent association 'From' item type: " + AssociationTypeCodes.GetCodeForType(itemAssociation.ItemIdFrom.Type) + ". Expected: Organisation.");
|
SaLogger.Warn($"{SysUtil.Fn} Inconsistent association 'From' item type: {AssociationTypeCodes.GetCodeForType(itemAssociation.ItemIdFrom.Type)}. Expected: Organisation.");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
||||||
}
|
}
|
||||||
if (itemAssociation.ItemIdTo.Type != (int)Sax.DataItemType.Organisation)
|
if (itemAssociation.ItemIdTo.Type != (int)Sax.DataItemType.Organisation)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Inconsistent association 'To' item type: " + AssociationTypeCodes.GetCodeForType(itemAssociation.ItemIdTo.Type) + ". Expected: Organisation.");
|
SaLogger.Warn($"{SysUtil.Fn} Inconsistent association 'To' item type: {AssociationTypeCodes.GetCodeForType(itemAssociation.ItemIdTo.Type)}. Expected: Organisation.");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -362,7 +358,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
organisationIdAssoc = itemAssociation.ItemIdFrom.Id;
|
organisationIdAssoc = itemAssociation.ItemIdFrom.Id;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Inconsistent association - Specified organisation is neither item.");
|
SaLogger.Warn($"{SysUtil.Fn} Inconsistent association - Specified organisation is neither item.");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,7 +367,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
disposableItems.Add(organisation);
|
disposableItems.Add(organisation);
|
||||||
if (organisation == null)
|
if (organisation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve Organisation for Id: '" + organisationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Organisation for Id: '{organisationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -380,7 +376,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
disposableItems.Add(organisationAssoc);
|
disposableItems.Add(organisationAssoc);
|
||||||
if (organisationAssoc == null)
|
if (organisationAssoc == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve associated Organisation for Id: '" + organisationIdAssoc + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve associated Organisation for Id: '{organisationIdAssoc}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -399,7 +395,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Organisation/Ajax/StoreAssociation")]
|
[Route("Organisation/Ajax/StoreAssociation")]
|
||||||
public IActionResult Ajax_StoreAssociation(Model_OrganisationAssociations model)
|
public IActionResult Ajax_StoreAssociation(Model_OrganisationAssociations model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Ajax_StoreAssociation";
|
|
||||||
String messageTitle = Localiser["caption.organisation.association"];
|
String messageTitle = Localiser["caption.organisation.association"];
|
||||||
AjaxResponse_Association responseData = new AjaxResponse_Association(model);
|
AjaxResponse_Association responseData = new AjaxResponse_Association(model);
|
||||||
|
|
||||||
@@ -417,27 +412,27 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Organisation.
|
// Organisation.
|
||||||
SysId organisationId = model.OrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||||
disposableItems.Add(organisation);
|
disposableItems.Add(organisation);
|
||||||
if (organisation == null)
|
if (organisation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve Organisation for Id: " + model.OrganisationId);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Organisation for Id: {model.OrganisationId}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Associated Organisation.
|
// Associated Organisation.
|
||||||
SysId organisationIdAssoc = model.OrganisationIdAssoc.ToSysId();
|
SysId organisationIdAssoc = SysId.ToSysId(model.OrganisationIdAssoc);
|
||||||
SaxOrganisation organisationAssoc = AccountMgr.GetOrganisationById(organisationIdAssoc);
|
SaxOrganisation organisationAssoc = AccountMgr.GetOrganisationById(organisationIdAssoc);
|
||||||
disposableItems.Add(organisationAssoc);
|
disposableItems.Add(organisationAssoc);
|
||||||
if (organisationAssoc == null)
|
if (organisationAssoc == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve associated Organisation for Id: " + model.OrganisationIdAssoc);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve associated Organisation for Id: {model.OrganisationIdAssoc}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
||||||
}
|
}
|
||||||
if (organisationIdAssoc.Equals(organisationId))
|
if (organisationIdAssoc.Equals(organisationId))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Associated organisation must not be the same as the organisation.");
|
SaLogger.Warn($"{SysUtil.Fn} Associated organisation must not be the same as the organisation.");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -445,18 +440,18 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
Sax.AssociationType associationType = model.GetAssociationTypeForOption(model.Association.GetAssociationTypeOption());
|
Sax.AssociationType associationType = model.GetAssociationTypeForOption(model.Association.GetAssociationTypeOption());
|
||||||
if ((int)associationType < 1)
|
if ((int)associationType < 1)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Association Type must be specified.");
|
SaLogger.Warn($"{SysUtil.Fn} Association Type must be specified.");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
||||||
}
|
}
|
||||||
Sax.AssociationTypeOption associationTypeOption = model.Association.GetAssociationTypeOption();
|
Sax.AssociationTypeOption associationTypeOption = model.Association.GetAssociationTypeOption();
|
||||||
if ((int)associationTypeOption < 1)
|
if ((int)associationTypeOption < 1)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Association Type Option must be specified.");
|
SaLogger.Warn($"{SysUtil.Fn} Association Type Option must be specified.");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
||||||
}
|
}
|
||||||
if (!model.IsConsistentWith(associationTypeOption, associationType))
|
if (!model.IsConsistentWith(associationTypeOption, associationType))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Association Type Option (" + associationTypeOption + ") is inconsistent with Association Type (" + associationType + ").");
|
SaLogger.Warn($"{SysUtil.Fn} Association Type Option ({associationTypeOption}) is inconsistent with Association Type ({associationType}).");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -470,11 +465,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve existing association.
|
// Retrieve existing association.
|
||||||
SysId itemAssociationId = model.ItemAssociationId.ToSysId();
|
SysId itemAssociationId = SysId.ToSysId(model.ItemAssociationId);
|
||||||
if (SysId.IsValid(itemAssociationId) == StringUtil.ToBool(model.NewItem))
|
if (SysId.IsValid(itemAssociationId) == StringUtil.ToBool(model.NewItem))
|
||||||
{
|
{
|
||||||
// Inconsistentcy between the 'Existing' flag and whether the Item Association Id has been specified.
|
// Inconsistentcy between the 'Existing' flag and whether the Item Association Id has been specified.
|
||||||
SaLogger.Warn(fn + " Item Association Id " + (StringUtil.ToBool(model.NewItem) ? "specified for new item" : "not specified for existing item") + ".");
|
SaLogger.Warn($"{SysUtil.Fn} Item Association Id " + (StringUtil.ToBool(model.NewItem) ? "specified for new item" : "not specified for existing item") + ".");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
||||||
}
|
}
|
||||||
SaxItemAssociation itemAssociation = ItemDataMgr.GetItemAssociationById(itemAssociationId);
|
SaxItemAssociation itemAssociation = ItemDataMgr.GetItemAssociationById(itemAssociationId);
|
||||||
@@ -499,7 +494,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
disposableItems.Add(itemAssociation);
|
disposableItems.Add(itemAssociation);
|
||||||
if (itemAssociation == null && SysId.IsValid(itemAssociationId))
|
if (itemAssociation == null && SysId.IsValid(itemAssociationId))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve item association for Id: '" + itemAssociationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve item association for Id: '{itemAssociationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -518,12 +513,12 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
// Validate From/To items.
|
// Validate From/To items.
|
||||||
if (!itemAssociation.ItemIdFrom.Equals(itemIdFrom))
|
if (!itemAssociation.ItemIdFrom.Equals(itemIdFrom))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Inconsistent association - expected 'From' Item Id: " + SysId.ToString(itemIdFrom.Id) + ". Found: " + SysId.ToString(itemAssociation.ItemIdFrom.Id));
|
SaLogger.Warn($"{SysUtil.Fn} Inconsistent association - expected 'From' Item Id: {SysId.ToString(itemIdFrom.Id)}. Found: {SysId.ToString(itemAssociation.ItemIdFrom.Id)}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
||||||
}
|
}
|
||||||
if (!itemAssociation.ItemIdTo.Equals(itemIdTo))
|
if (!itemAssociation.ItemIdTo.Equals(itemIdTo))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Inconsistent association - expected 'To' Item Id: " + SysId.ToString(itemIdTo.Id) + ". Found: " + SysId.ToString(itemAssociation.ItemIdTo.Id));
|
SaLogger.Warn($"{SysUtil.Fn} Inconsistent association - expected 'To' Item Id: {SysId.ToString(itemIdTo.Id)}. Found: {SysId.ToString(itemAssociation.ItemIdTo.Id)}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -553,7 +548,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
if (!ItemDataMgr.InsertItemAssociation(itemAssociation, DbUpdateInfo))
|
if (!ItemDataMgr.InsertItemAssociation(itemAssociation, DbUpdateInfo))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to insert item association: " + ItemDataMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to insert item association: {ItemDataMgr.ErrorStateMessage}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"] + "\n\n" + ItemDataMgr.ErrorStateMessage));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"] + "\n\n" + ItemDataMgr.ErrorStateMessage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -561,7 +556,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
if (!ItemDataMgr.UpdateItemAssociation(itemAssociation, DbUpdateInfo))
|
if (!ItemDataMgr.UpdateItemAssociation(itemAssociation, DbUpdateInfo))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to update item association [Id:" + SysId.ToString(itemAssociation.Id) + "]: " + ItemDataMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to update item association [Id:{SysId.ToString(itemAssociation.Id)}]: {ItemDataMgr.ErrorStateMessage}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + ItemDataMgr.ErrorStateMessage));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + ItemDataMgr.ErrorStateMessage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -581,7 +576,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Organisation/Ajax/RemoveAssociation")]
|
[Route("Organisation/Ajax/RemoveAssociation")]
|
||||||
public IActionResult Ajax_RemoveAssociation(Model_OrganisationAssociations model)
|
public IActionResult Ajax_RemoveAssociation(Model_OrganisationAssociations model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Ajax_RemoveAssociation";
|
|
||||||
String messageTitle = Localiser["caption.organisation.association"];
|
String messageTitle = Localiser["caption.organisation.association"];
|
||||||
AjaxResponse_Association responseData = new AjaxResponse_Association(model);
|
AjaxResponse_Association responseData = new AjaxResponse_Association(model);
|
||||||
|
|
||||||
@@ -594,49 +588,49 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Organisation.
|
// Organisation.
|
||||||
SysId organisationId = model.OrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||||
disposableItems.Add(organisation);
|
disposableItems.Add(organisation);
|
||||||
if (organisation == null)
|
if (organisation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve Organisation for Id: '" + model.OrganisationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Organisation for Id: '{model.OrganisationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Association Organisation.
|
// Association Organisation.
|
||||||
SysId organisationIdAssoc = model.OrganisationIdAssoc.ToSysId();
|
SysId organisationIdAssoc = SysId.ToSysId(model.OrganisationIdAssoc);
|
||||||
SaxOrganisation organisationAssoc = AccountMgr.GetOrganisationById(organisationIdAssoc);
|
SaxOrganisation organisationAssoc = AccountMgr.GetOrganisationById(organisationIdAssoc);
|
||||||
disposableItems.Add(organisationAssoc);
|
disposableItems.Add(organisationAssoc);
|
||||||
if (organisationAssoc == null)
|
if (organisationAssoc == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve associated Organisation for Id: '" + model.OrganisationIdAssoc + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve associated Organisation for Id: '{model.OrganisationIdAssoc}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
||||||
}
|
}
|
||||||
if (organisationIdAssoc.Equals(organisationId))
|
if (organisationIdAssoc.Equals(organisationId))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Associated organisation must not be the same as the organisation.");
|
SaLogger.Warn($"{SysUtil.Fn} Associated organisation must not be the same as the organisation.");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Item Association.
|
// Item Association.
|
||||||
SysId itemAssociationId = model.ItemAssociationId.ToSysId();
|
SysId itemAssociationId = SysId.ToSysId(model.ItemAssociationId);
|
||||||
SaxItemAssociation itemAssociation = ItemDataMgr.GetItemAssociationById(itemAssociationId);
|
SaxItemAssociation itemAssociation = ItemDataMgr.GetItemAssociationById(itemAssociationId);
|
||||||
disposableItems.Add(itemAssociation);
|
disposableItems.Add(itemAssociation);
|
||||||
if (itemAssociation == null)
|
if (itemAssociation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve Item Association for Id: '" + itemAssociationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Item Association for Id: '{itemAssociationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate association Item Ids.
|
// Validate association Item Ids.
|
||||||
if (!itemAssociation.ItemIdFrom.Id.Equals(organisation.Id) && !itemAssociation.ItemIdTo.Id.Equals(organisation.Id))
|
if (!itemAssociation.ItemIdFrom.Id.Equals(organisation.Id) && !itemAssociation.ItemIdTo.Id.Equals(organisation.Id))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Inconsistent item association properties. Organisation must be 'From' or 'To' item");
|
SaLogger.Warn($"{SysUtil.Fn} Inconsistent item association properties. Organisation must be 'From' or 'To' item");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
||||||
}
|
}
|
||||||
if (!itemAssociation.ItemIdFrom.Id.Equals(organisationAssoc.Id) && !itemAssociation.ItemIdTo.Id.Equals(organisationAssoc.Id))
|
if (!itemAssociation.ItemIdFrom.Id.Equals(organisationAssoc.Id) && !itemAssociation.ItemIdTo.Id.Equals(organisationAssoc.Id))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Inconsistent item association properties. Associated Organisation must be 'From' or 'To' item");
|
SaLogger.Warn($"{SysUtil.Fn} Inconsistent item association properties. Associated Organisation must be 'From' or 'To' item");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -644,7 +638,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
itemAssociation.Status = SaStatus.Deleted;
|
itemAssociation.Status = SaStatus.Deleted;
|
||||||
if (!ItemDataMgr.UpdateItemAssociation(itemAssociation, DbUpdateInfo))
|
if (!ItemDataMgr.UpdateItemAssociation(itemAssociation, DbUpdateInfo))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to update Item Association [Id:" + SysId.ToString(itemAssociation.Id) + "]: " + ItemDataMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to update Item Association [Id:{SysId.ToString(itemAssociation.Id)}]: {ItemDataMgr.ErrorStateMessage}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + ItemDataMgr.ErrorStateMessage));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + ItemDataMgr.ErrorStateMessage));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Organisation/Ajax/GetItemImages")]
|
[Route("Organisation/Ajax/GetItemImages")]
|
||||||
public IActionResult Ajax_GetImages(Model_Organisation model)
|
public IActionResult Ajax_GetImages(Model_Organisation model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Ajax_GetImages";
|
|
||||||
String messageTitle = Localiser["caption.organisation"];
|
String messageTitle = Localiser["caption.organisation"];
|
||||||
AjaxResponse_OrganisationImages responseData = new AjaxResponse_OrganisationImages(model);
|
AjaxResponse_OrganisationImages responseData = new AjaxResponse_OrganisationImages(model);
|
||||||
|
|
||||||
@@ -66,7 +65,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
responseData.ImageContentTypes = SaxItemImage.GetValidContentTypes(Sax.DataItemType.Organisation);
|
responseData.ImageContentTypes = SaxItemImage.GetValidContentTypes(Sax.DataItemType.Organisation);
|
||||||
|
|
||||||
// Identify item.
|
// Identify item.
|
||||||
SysId organisationId = model.OrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||||
if (!SysId.IsValid(organisationId))
|
if (!SysId.IsValid(organisationId))
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||||
|
|
||||||
@@ -75,7 +74,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
disposableItems.Add(organisation);
|
disposableItems.Add(organisation);
|
||||||
if (organisation == null)
|
if (organisation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve organisation for Id: '" + model.OrganisationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve organisation for Id: '{model.OrganisationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,7 +110,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Organisation/Ajax/UploadLogoImage")]
|
[Route("Organisation/Ajax/UploadLogoImage")]
|
||||||
public IActionResult UploadOrganisationLogoImage(Model_Organisation model)
|
public IActionResult UploadOrganisationLogoImage(Model_Organisation model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".UploadOrganisationLogoImage";
|
|
||||||
AjaxResponse_UploadOrganisationLogoImage responseData = new AjaxResponse_UploadOrganisationLogoImage(model);
|
AjaxResponse_UploadOrganisationLogoImage responseData = new AjaxResponse_UploadOrganisationLogoImage(model);
|
||||||
String messageTitle = Localiser["caption.organisation"];
|
String messageTitle = Localiser["caption.organisation"];
|
||||||
|
|
||||||
@@ -124,26 +122,26 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
||||||
{
|
{
|
||||||
// Retrieve organisation.
|
// Retrieve organisation.
|
||||||
SysId organisationId = model.OrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||||
if (!SysId.IsValid(organisationId))
|
if (!SysId.IsValid(organisationId))
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||||
disposableItems.Add(organisation);
|
disposableItems.Add(organisation);
|
||||||
if (organisation == null)
|
if (organisation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve organisation for Id: '" + model.OrganisationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve organisation for Id: '{model.OrganisationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate number of images.
|
// Validate number of images.
|
||||||
if (model.OrganisationLogoImage.IsEmpty())
|
if (model.OrganisationLogoImage.IsEmpty())
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " No image file supplied for upload");
|
SaLogger.Warn($"{SysUtil.Fn} No image file supplied for upload");
|
||||||
return Json(responseData);
|
return Json(responseData);
|
||||||
}
|
}
|
||||||
if (model.OrganisationLogoImage.Count != 1)
|
if (model.OrganisationLogoImage.Count != 1)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Invalid number of image files uploaded: " + model.OrganisationLogoImage.Count);
|
SaLogger.Warn($"{SysUtil.Fn} Invalid number of image files uploaded: {model.OrganisationLogoImage.Count}");
|
||||||
return Json(responseData.SetControlError("OrganisationLogoImage", Localiser["msg.upload.image.single"]));
|
return Json(responseData.SetControlError("OrganisationLogoImage", Localiser["msg.upload.image.single"]));
|
||||||
}
|
}
|
||||||
IFormFile file = model.OrganisationLogoImage[0];
|
IFormFile file = model.OrganisationLogoImage[0];
|
||||||
@@ -202,7 +200,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
if (!ItemDataMgr.InsertItemImage(itemImage, DbUpdateInfo))
|
if (!ItemDataMgr.InsertItemImage(itemImage, DbUpdateInfo))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to insert uploaded image - " + ItemDataMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to insert uploaded image - {ItemDataMgr.ErrorStateMessage}");
|
||||||
return Json(responseData.SetControlError("OrganisationLogoImage", Localiser["msg.error.item.insert.failed"]));
|
return Json(responseData.SetControlError("OrganisationLogoImage", Localiser["msg.error.item.insert.failed"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -210,7 +208,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
if (!ItemDataMgr.UpdateItemImage(itemImage, DbUpdateInfo))
|
if (!ItemDataMgr.UpdateItemImage(itemImage, DbUpdateInfo))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to update uploaded image - " + ItemDataMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to update uploaded image - {ItemDataMgr.ErrorStateMessage}");
|
||||||
return Json(responseData.SetControlError("OrganisationLogoImage", Localiser["msg.error.item.insert.failed"]));
|
return Json(responseData.SetControlError("OrganisationLogoImage", Localiser["msg.error.item.insert.failed"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -232,7 +230,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Organisation/Ajax/StoreImages")]
|
[Route("Organisation/Ajax/StoreImages")]
|
||||||
public IActionResult Ajax_StoreImages(Model_Organisation model)
|
public IActionResult Ajax_StoreImages(Model_Organisation model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Ajax_StoreImages";
|
|
||||||
String messageTitle = Localiser["caption.organisation"];
|
String messageTitle = Localiser["caption.organisation"];
|
||||||
AjaxResponse_OrganisationImages responseData = new AjaxResponse_OrganisationImages(model);
|
AjaxResponse_OrganisationImages responseData = new AjaxResponse_OrganisationImages(model);
|
||||||
|
|
||||||
@@ -250,12 +247,12 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
return Json(responseData);
|
return Json(responseData);
|
||||||
|
|
||||||
// Retrieve organisation.
|
// Retrieve organisation.
|
||||||
SysId organisationId = model.OrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||||
disposableItems.Add(organisation);
|
disposableItems.Add(organisation);
|
||||||
if (organisation == null)
|
if (organisation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve organisation for Id: '" + model.OrganisationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve organisation for Id: '{model.OrganisationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +283,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
if (!ItemDataMgr.InsertItemImage(itemImageLogo, DbUpdateInfo))
|
if (!ItemDataMgr.InsertItemImage(itemImageLogo, DbUpdateInfo))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to insert logo image - " + ItemDataMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to insert logo image - {ItemDataMgr.ErrorStateMessage}");
|
||||||
return Json(responseData.SetControlError("AccountContactImage", Localiser["msg.error.item.insert.failed"]));
|
return Json(responseData.SetControlError("AccountContactImage", Localiser["msg.error.item.insert.failed"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -294,14 +291,14 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
if (!ItemDataMgr.UpdateItemImage(itemImageLogo, DbUpdateInfo))
|
if (!ItemDataMgr.UpdateItemImage(itemImageLogo, DbUpdateInfo))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to update logo image - " + ItemDataMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to update logo image - {ItemDataMgr.ErrorStateMessage}");
|
||||||
return Json(responseData.SetControlError("AccountContactImage", Localiser["msg.error.item.update.failed"]));
|
return Json(responseData.SetControlError("AccountContactImage", Localiser["msg.error.item.update.failed"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Logically delete the uplaoded image.
|
// Logically delete the uplaoded image.
|
||||||
itemImageLogoUploaded.Status = SaStatus.Deleted;
|
itemImageLogoUploaded.Status = SaStatus.Deleted;
|
||||||
if (!ItemDataMgr.UpdateItemImage(itemImageLogoUploaded, DbUpdateInfo))
|
if (!ItemDataMgr.UpdateItemImage(itemImageLogoUploaded, DbUpdateInfo))
|
||||||
SaLogger.Warn(fn + " Failed to logically delete uploaded logo image - " + ItemDataMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to logically delete uploaded logo image - {ItemDataMgr.ErrorStateMessage}");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct response.
|
// Construct response.
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Organisation/Ajax/GetMemberList")]
|
[Route("Organisation/Ajax/GetMemberList")]
|
||||||
public IActionResult Ajax_GetMemberList(Model_OrganisationMembers model)
|
public IActionResult Ajax_GetMemberList(Model_OrganisationMembers model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Ajax_GetMemberList";
|
|
||||||
String messageTitle = Localiser["caption.organisation.members"];
|
String messageTitle = Localiser["caption.organisation.members"];
|
||||||
AjaxResponse_MemberList responseData = new AjaxResponse_MemberList(model);
|
AjaxResponse_MemberList responseData = new AjaxResponse_MemberList(model);
|
||||||
|
|
||||||
@@ -100,10 +99,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
return GetAjaxResult_InvalidSession(responseData);
|
return GetAjaxResult_InvalidSession(responseData);
|
||||||
|
|
||||||
// Organisation Id filter is mandatory.
|
// Organisation Id filter is mandatory.
|
||||||
SysId organisationId = model.Filter.OrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.Filter.OrganisationId);
|
||||||
if (!SysId.IsValid(organisationId))
|
if (!SysId.IsValid(organisationId))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Request to retrieve members without valid organisation Id.");
|
SaLogger.Warn($"{SysUtil.Fn} Request to retrieve members without valid organisation Id.");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -203,7 +202,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Organisation/Ajax/GetMember")]
|
[Route("Organisation/Ajax/GetMember")]
|
||||||
public IActionResult Ajax_GetMember(Model_OrganisationMembers model)
|
public IActionResult Ajax_GetMember(Model_OrganisationMembers model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Ajax_GetItem";
|
|
||||||
String messageTitle = Localiser["caption.organisation.member"];
|
String messageTitle = Localiser["caption.organisation.member"];
|
||||||
AjaxResponse_Member responseData = new AjaxResponse_Member(model);
|
AjaxResponse_Member responseData = new AjaxResponse_Member(model);
|
||||||
|
|
||||||
@@ -216,7 +214,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Identify item.
|
// Identify item.
|
||||||
SysId userOrganisationId = model.UserOrganisationId.ToSysId();
|
SysId userOrganisationId = SysId.ToSysId(model.UserOrganisationId);
|
||||||
if (!SysId.IsValid(userOrganisationId))
|
if (!SysId.IsValid(userOrganisationId))
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||||
|
|
||||||
@@ -225,7 +223,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
disposableItems.Add(userOrganisation);
|
disposableItems.Add(userOrganisation);
|
||||||
if (userOrganisation == null)
|
if (userOrganisation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve User Organisation for Id: '" + model.UserOrganisationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve User Organisation for Id: '{model.UserOrganisationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,7 +232,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
disposableItems.Add(userAccount);
|
disposableItems.Add(userAccount);
|
||||||
if (userAccount == null)
|
if (userAccount == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve user account for Id: '" + userOrganisation.UserAccountId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve user account for Id: '{userOrganisation.UserAccountId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,7 +241,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
disposableItems.Add(organisation);
|
disposableItems.Add(organisation);
|
||||||
if (organisation == null)
|
if (organisation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve organisation for Id: '" + userOrganisation.OrganisationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve organisation for Id: '{userOrganisation.OrganisationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -262,7 +260,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Organisation/Ajax/StoreMember")]
|
[Route("Organisation/Ajax/StoreMember")]
|
||||||
public IActionResult Ajax_StoreMember(Model_OrganisationMembers model)
|
public IActionResult Ajax_StoreMember(Model_OrganisationMembers model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Ajax_StoreMember";
|
|
||||||
String messageTitle = Localiser["caption.organisation.member"];
|
String messageTitle = Localiser["caption.organisation.member"];
|
||||||
AjaxResponse_Member responseData = new AjaxResponse_Member(model);
|
AjaxResponse_Member responseData = new AjaxResponse_Member(model);
|
||||||
|
|
||||||
@@ -280,7 +277,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// User account.
|
// User account.
|
||||||
SysId userAccountId = model.MemberUserAccountId.ToSysId();
|
SysId userAccountId = SysId.ToSysId(model.MemberUserAccountId);
|
||||||
SaxUserAccount userAccount = null;
|
SaxUserAccount userAccount = null;
|
||||||
if (!SysId.IsValid(userAccountId) && !StringUtil.IsEmpty(model.MemberUserEmailAddress))
|
if (!SysId.IsValid(userAccountId) && !StringUtil.IsEmpty(model.MemberUserEmailAddress))
|
||||||
{
|
{
|
||||||
@@ -290,32 +287,32 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
}
|
}
|
||||||
if (!SysId.IsValid(userAccountId))
|
if (!SysId.IsValid(userAccountId))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " User Account must be identified");
|
SaLogger.Warn($"{SysUtil.Fn} User Account must be identified");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Organisation.
|
// Organisation.
|
||||||
SysId organisationId = model.MemberOrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.MemberOrganisationId);
|
||||||
SaxOrganisation organisation = null;
|
SaxOrganisation organisation = null;
|
||||||
if (!SysId.IsValid(organisationId))
|
if (!SysId.IsValid(organisationId))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Organisation Id must be specified");
|
SaLogger.Warn($"{SysUtil.Fn} Organisation Id must be specified");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve existing item.
|
// Retrieve existing item.
|
||||||
SysId userOrganisationId = model.UserOrganisationId.ToSysId();
|
SysId userOrganisationId = SysId.ToSysId(model.UserOrganisationId);
|
||||||
SaxUserOrganisation userOrganisation = AccountMgr.GetUserOrganisationById(userOrganisationId);
|
SaxUserOrganisation userOrganisation = AccountMgr.GetUserOrganisationById(userOrganisationId);
|
||||||
disposableItems.Add(userOrganisation);
|
disposableItems.Add(userOrganisation);
|
||||||
if (userOrganisation == null && SysId.IsValid(userOrganisationId))
|
if (userOrganisation == null && SysId.IsValid(userOrganisationId))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve user organisation for Id: '" + userOrganisationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve user organisation for Id: '{userOrganisationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
if (userOrganisation != null && (!userOrganisation.UserAccountId.Equals(userAccountId) || !userOrganisation.OrganisationId.Equals(organisationId)))
|
if (userOrganisation != null && (!userOrganisation.UserAccountId.Equals(userAccountId) || !userOrganisation.OrganisationId.Equals(organisationId)))
|
||||||
{
|
{
|
||||||
// Either User Account and/or Organisation Ids don't match.
|
// Either User Account and/or Organisation Ids don't match.
|
||||||
SaLogger.Warn(fn + " Inconsistent user organisation properties. UserAccountId: " + userOrganisation.UserAccountId + " vs " + userAccountId + ". OrganisationId: " + userOrganisation.OrganisationId + " vs " + organisationId + ".");
|
SaLogger.Warn($"{SysUtil.Fn} Inconsistent user organisation properties. UserAccountId: {userOrganisation.UserAccountId} vs {userAccountId}. OrganisationId: {userOrganisation.OrganisationId} vs {organisationId}.");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,7 +358,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
if (!AccountMgr.InsertUserOrganisation(userOrganisation, DbUpdateInfo))
|
if (!AccountMgr.InsertUserOrganisation(userOrganisation, DbUpdateInfo))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to insert user organisation: " + AccountMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to insert user organisation: {AccountMgr.ErrorStateMessage}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"] + "\n\n" + AccountMgr.ErrorStateMessage));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"] + "\n\n" + AccountMgr.ErrorStateMessage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -369,7 +366,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
if (!AccountMgr.UpdateUserOrganisation(userOrganisation, DbUpdateInfo))
|
if (!AccountMgr.UpdateUserOrganisation(userOrganisation, DbUpdateInfo))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to update user organisation [Id:" + SysId.ToString(userOrganisation.Id) + "]: " + AccountMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to update user organisation [Id:{SysId.ToString(userOrganisation.Id)}]: {AccountMgr.ErrorStateMessage}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + AccountMgr.ErrorStateMessage));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + AccountMgr.ErrorStateMessage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -389,7 +386,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
[Route("Organisation/Ajax/RemoveMember")]
|
[Route("Organisation/Ajax/RemoveMember")]
|
||||||
public IActionResult Ajax_RemoveMember(Model_OrganisationMembers model)
|
public IActionResult Ajax_RemoveMember(Model_OrganisationMembers model)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".Ajax_RemoveMember";
|
|
||||||
String messageTitle = Localiser["caption.organisation.member"];
|
String messageTitle = Localiser["caption.organisation.member"];
|
||||||
AjaxResponse_Member responseData = new AjaxResponse_Member(model);
|
AjaxResponse_Member responseData = new AjaxResponse_Member(model);
|
||||||
|
|
||||||
@@ -402,27 +398,27 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Organisation.
|
// Organisation.
|
||||||
SysId organisationId = model.OrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||||
if (organisation == null)
|
if (organisation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve Organisation for Id: '" + model.OrganisationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve Organisation for Id: '{model.OrganisationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.incomplete"]));
|
||||||
}
|
}
|
||||||
disposableItems.Add(organisation);
|
disposableItems.Add(organisation);
|
||||||
|
|
||||||
// User Organisation.
|
// User Organisation.
|
||||||
SysId userOrganisationId = model.UserOrganisationId.ToSysId();
|
SysId userOrganisationId = SysId.ToSysId(model.UserOrganisationId);
|
||||||
SaxUserOrganisation userOrganisation = AccountMgr.GetUserOrganisationById(userOrganisationId);
|
SaxUserOrganisation userOrganisation = AccountMgr.GetUserOrganisationById(userOrganisationId);
|
||||||
disposableItems.Add(userOrganisation);
|
disposableItems.Add(userOrganisation);
|
||||||
if (userOrganisation == null)
|
if (userOrganisation == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve user organisation for Id: '" + userOrganisationId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve user organisation for Id: '{userOrganisationId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"]));
|
||||||
}
|
}
|
||||||
if (!userOrganisation.OrganisationId.Equals(organisation.Id))
|
if (!userOrganisation.OrganisationId.Equals(organisation.Id))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Inconsistent user organisation properties. OrganisationId: " + userOrganisation.OrganisationId + " vs " + organisation.Id + ".");
|
SaLogger.Warn($"{SysUtil.Fn} Inconsistent user organisation properties. OrganisationId: {userOrganisation.OrganisationId} vs {organisation.Id}.");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.data.inconsistent"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,7 +427,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
disposableItems.Add(userAccount);
|
disposableItems.Add(userAccount);
|
||||||
if (userAccount == null)
|
if (userAccount == null)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve user account for Id: '" + userOrganisation.UserAccountId + "'");
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve user account for Id: '{userOrganisation.UserAccountId}'");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.system"]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -443,7 +439,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
if (!AccountMgr.InsertUserOrganisation(userOrganisation, DbUpdateInfo))
|
if (!AccountMgr.InsertUserOrganisation(userOrganisation, DbUpdateInfo))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to insert user organisation: " + AccountMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to insert user organisation: {AccountMgr.ErrorStateMessage}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"] + "\n\n" + AccountMgr.ErrorStateMessage));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"] + "\n\n" + AccountMgr.ErrorStateMessage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -451,7 +447,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
if (!AccountMgr.UpdateUserOrganisation(userOrganisation, DbUpdateInfo))
|
if (!AccountMgr.UpdateUserOrganisation(userOrganisation, DbUpdateInfo))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to update user organisation [Id:" + SysId.ToString(userOrganisation.Id) + "]: " + AccountMgr.ErrorStateMessage);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to update user organisation [Id:{SysId.ToString(userOrganisation.Id)}]: {AccountMgr.ErrorStateMessage}");
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + AccountMgr.ErrorStateMessage));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + AccountMgr.ErrorStateMessage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,9 +161,9 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
responseData.UploadContentTypes = SaxOrganisationUploader.ValidContentTypes;
|
responseData.UploadContentTypes = SaxOrganisationUploader.ValidContentTypes;
|
||||||
|
|
||||||
// Store filter values.
|
// Store filter values.
|
||||||
SysId filterSportId = model.Filter.OrganisationSportId.ToSysId();
|
SysId filterSportId = SysId.ToSysId(model.Filter.OrganisationSportId);
|
||||||
SessionData_Admin.Filter.SportId = SysId.IsValid(filterSportId) ? filterSportId : null;
|
SessionData_Admin.Filter.SportId = SysId.IsValid(filterSportId) ? filterSportId : null;
|
||||||
SysId filterRegionId = model.Filter.OrganisationRegionId.ToSysId();
|
SysId filterRegionId = SysId.ToSysId(model.Filter.OrganisationRegionId);
|
||||||
SessionData_Admin.Filter.RegionId = SysId.IsValid(filterRegionId) ? filterRegionId : null;
|
SessionData_Admin.Filter.RegionId = SysId.IsValid(filterRegionId) ? filterRegionId : null;
|
||||||
|
|
||||||
// Item filter.
|
// Item filter.
|
||||||
@@ -250,8 +250,8 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
prmOrganisation.OrganisationFilter = model.Filter.Organisation;
|
prmOrganisation.OrganisationFilter = model.Filter.Organisation;
|
||||||
prmOrganisation.OrganisationType = model.FilterOrganisationType;
|
prmOrganisation.OrganisationType = model.FilterOrganisationType;
|
||||||
prmOrganisation.OrganisationCategory = model.FilterOrganisationCategory;
|
prmOrganisation.OrganisationCategory = model.FilterOrganisationCategory;
|
||||||
prmOrganisation.SportIdsIncluded.AddId(model.Filter.OrganisationSportId.ToSysId());
|
prmOrganisation.SportIdsIncluded.AddId(SysId.ToSysId(model.Filter.OrganisationSportId));
|
||||||
prmOrganisation.RegionIdsIncluded.AddId(model.Filter.OrganisationRegionId.ToSysId());
|
prmOrganisation.RegionIdsIncluded.AddId(SysId.ToSysId(model.Filter.OrganisationRegionId));
|
||||||
prmOrganisation.StatusCat = model.Filter.OrganisationStatusCategoryCode != null ? model.FilterOrganisationStatusCategory : SaxOrganisation.StatusCat.NotDeleted;
|
prmOrganisation.StatusCat = model.Filter.OrganisationStatusCategoryCode != null ? model.FilterOrganisationStatusCategory : SaxOrganisation.StatusCat.NotDeleted;
|
||||||
prmOrganisation.SortColumns.Add(accountMgr.GetOrganisationColumnDfn(SaxOrganisation.Column.Name));
|
prmOrganisation.SortColumns.Add(accountMgr.GetOrganisationColumnDfn(SaxOrganisation.Column.Name));
|
||||||
return prmOrganisation;
|
return prmOrganisation;
|
||||||
@@ -285,7 +285,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Identify item.
|
// Identify item.
|
||||||
SysId organisationId = model.OrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||||
if (!SysId.IsValid(organisationId))
|
if (!SysId.IsValid(organisationId))
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||||
|
|
||||||
@@ -336,7 +336,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
return Json(responseData);
|
return Json(responseData);
|
||||||
|
|
||||||
// Retrieve existing item.
|
// Retrieve existing item.
|
||||||
SysId organisationId = model.OrganisationId.ToSysId();
|
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||||
disposableItems.Add(organisation);
|
disposableItems.Add(organisation);
|
||||||
if (organisation == null && SysId.IsValid(organisationId))
|
if (organisation == null && SysId.IsValid(organisationId))
|
||||||
@@ -364,9 +364,9 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
if (model.OrganisationCategoryValue != null)
|
if (model.OrganisationCategoryValue != null)
|
||||||
organisation.OrganisationCategory = model.OrganisationCategory;
|
organisation.OrganisationCategory = model.OrganisationCategory;
|
||||||
if (model.OrganisationSportId != null)
|
if (model.OrganisationSportId != null)
|
||||||
organisation.SportIdPrimary = model.OrganisationSportId.ToSysId();
|
organisation.SportIdPrimary = SysId.ToSysId(model.OrganisationSportId);
|
||||||
if (model.OrganisationRegionIdPrimary != null)
|
if (model.OrganisationRegionIdPrimary != null)
|
||||||
organisation.RegionIdPrimary = model.OrganisationRegionIdPrimary.ToSysId();
|
organisation.RegionIdPrimary = SysId.ToSysId(model.OrganisationRegionIdPrimary);
|
||||||
if (model.OrganisationAbout != null)
|
if (model.OrganisationAbout != null)
|
||||||
organisation.About = model.OrganisationAbout;
|
organisation.About = model.OrganisationAbout;
|
||||||
if (model.OrganisationFacilities != null)
|
if (model.OrganisationFacilities != null)
|
||||||
@@ -403,7 +403,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
if (model.Address.IsPopulated())
|
if (model.Address.IsPopulated())
|
||||||
{
|
{
|
||||||
// Organisation regions.
|
// Organisation regions.
|
||||||
SaxRegion.Data regionCountry = Internals.GetRegion(model.Address.RegionIdCountry.ToSysId());
|
SaxRegion.Data regionCountry = Internals.GetRegion(SysId.ToSysId(model.Address.RegionIdCountry));
|
||||||
if (regionCountry == null)
|
if (regionCountry == null)
|
||||||
// Default to Organisation's primary region.
|
// Default to Organisation's primary region.
|
||||||
regionCountry = Internals.GetRegion(organisation.RegionIdPrimary);
|
regionCountry = Internals.GetRegion(organisation.RegionIdPrimary);
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
return RedirectToAction("", "");
|
return RedirectToAction("", "");
|
||||||
|
|
||||||
// Retrieve organisation.
|
// Retrieve organisation.
|
||||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(model.OrganisationId.ToSysId());
|
SaxOrganisation organisation = AccountMgr.GetOrganisationById(SysId.ToSysId(model.OrganisationId));
|
||||||
if (organisation == null)
|
if (organisation == null)
|
||||||
RedirectToAction("", "Organisation");
|
RedirectToAction("", "Organisation");
|
||||||
model.Filter.OrganisationId= SysId.ToString(organisation.Id);
|
model.Filter.OrganisationId= SysId.ToString(organisation.Id);
|
||||||
@@ -100,7 +100,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
return RedirectToAction("", "");
|
return RedirectToAction("", "");
|
||||||
|
|
||||||
// Retrieve organisation.
|
// Retrieve organisation.
|
||||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(model.OrganisationId.ToSysId());
|
SaxOrganisation organisation = AccountMgr.GetOrganisationById(SysId.ToSysId(model.OrganisationId));
|
||||||
if (organisation == null)
|
if (organisation == null)
|
||||||
RedirectToAction("", "Organisation");
|
RedirectToAction("", "Organisation");
|
||||||
model.Filter.OrganisationId = SysId.ToString(organisation.Id);
|
model.Filter.OrganisationId = SysId.ToString(organisation.Id);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
|||||||
public long? FacilityCount { get; set; }
|
public long? FacilityCount { get; set; }
|
||||||
public long? FacilityCountActive { get; set; }
|
public long? FacilityCountActive { get; set; }
|
||||||
public decimal? CoursesPercent { get; set; }
|
public decimal? CoursesPercent { get; set; }
|
||||||
public String? CoursesPercentFmt { get { return (CoursesPercent ?? 0.0m) > 0 ? $"{((decimal)CoursesPercent).ToString("N0")}%" : ""; } }
|
public String CoursesPercentFmt { get { return (CoursesPercent ?? 0.0m) > 0 ? $"{((decimal)CoursesPercent).ToString("N0")}%" : null; } }
|
||||||
}
|
}
|
||||||
private class UsgaCountryItemData : UsgaCountryListData
|
private class UsgaCountryItemData : UsgaCountryListData
|
||||||
{
|
{
|
||||||
@@ -67,7 +67,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
|||||||
public long? CourseCount { get; set; }
|
public long? CourseCount { get; set; }
|
||||||
public long? CourseCountActive { get; set; }
|
public long? CourseCountActive { get; set; }
|
||||||
public decimal? MarkersPercent { get; set; }
|
public decimal? MarkersPercent { get; set; }
|
||||||
public String? MarkersPercentFmt { get { return (MarkersPercent ?? 0.0m) > 0 ? $"{((decimal)MarkersPercent).ToString("N0")}%" : ""; } }
|
public String MarkersPercentFmt { get { return (MarkersPercent ?? 0.0m) > 0 ? $"{((decimal)MarkersPercent).ToString("N0")}%" : null; } }
|
||||||
}
|
}
|
||||||
private class UsgaProvinceItemData : UsgaProvinceListData
|
private class UsgaProvinceItemData : UsgaProvinceListData
|
||||||
{
|
{
|
||||||
@@ -288,7 +288,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
|||||||
// Item filter.
|
// Item filter.
|
||||||
SaxGolfUsgaProvince.Params prmUsgaProvince = new SaxGolfUsgaProvince.Params();
|
SaxGolfUsgaProvince.Params prmUsgaProvince = new SaxGolfUsgaProvince.Params();
|
||||||
if (StringUtil.ToLong(model.Filter.CountryId) > 0)
|
if (StringUtil.ToLong(model.Filter.CountryId) > 0)
|
||||||
prmUsgaProvince.CountryIdsIncluded.Add(StringUtil.ToSysId(model.Filter.CountryId));
|
prmUsgaProvince.CountryIdsIncluded.Add(SysId.ToSysId(model.Filter.CountryId));
|
||||||
prmUsgaProvince.ProvinceFilter = model.Filter.ProvinceSearch;
|
prmUsgaProvince.ProvinceFilter = model.Filter.ProvinceSearch;
|
||||||
prmUsgaProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.Any;
|
prmUsgaProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.Any;
|
||||||
model.Paging.ItemTotal = (ulong)ReferenceGolfMgr.GetUsgaProvinceCount(prmUsgaProvince);
|
model.Paging.ItemTotal = (ulong)ReferenceGolfMgr.GetUsgaProvinceCount(prmUsgaProvince);
|
||||||
@@ -376,7 +376,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
|||||||
// Item filter.
|
// Item filter.
|
||||||
SaxGolfUsgaCourse.Params prmUsgaCourse = new SaxGolfUsgaCourse.Params();
|
SaxGolfUsgaCourse.Params prmUsgaCourse = new SaxGolfUsgaCourse.Params();
|
||||||
if (StringUtil.ToLong(model.Filter.ProvinceId) > 0)
|
if (StringUtil.ToLong(model.Filter.ProvinceId) > 0)
|
||||||
prmUsgaCourse.ProvinceIdsIncluded.Add(StringUtil.ToSysId(model.Filter.ProvinceId));
|
prmUsgaCourse.ProvinceIdsIncluded.Add(SysId.ToSysId(model.Filter.ProvinceId));
|
||||||
prmUsgaCourse.CourseFilter = model.Filter.CourseSearch;
|
prmUsgaCourse.CourseFilter = model.Filter.CourseSearch;
|
||||||
prmUsgaCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.Any;
|
prmUsgaCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.Any;
|
||||||
model.Paging.ItemTotal = (ulong)ReferenceGolfMgr.GetUsgaCourseCount(prmUsgaCourse);
|
model.Paging.ItemTotal = (ulong)ReferenceGolfMgr.GetUsgaCourseCount(prmUsgaCourse);
|
||||||
@@ -533,7 +533,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
|||||||
// Item filter.
|
// Item filter.
|
||||||
SaxGolfUsgaMarker.Params prmUsgaMarker = new SaxGolfUsgaMarker.Params();
|
SaxGolfUsgaMarker.Params prmUsgaMarker = new SaxGolfUsgaMarker.Params();
|
||||||
if (StringUtil.ToLong(model.Filter.CourseId) > 0)
|
if (StringUtil.ToLong(model.Filter.CourseId) > 0)
|
||||||
prmUsgaMarker.CourseIdsIncluded.Add(StringUtil.ToSysId(model.Filter.CourseId));
|
prmUsgaMarker.CourseIdsIncluded.Add(SysId.ToSysId(model.Filter.CourseId));
|
||||||
prmUsgaMarker.MarkerFilter = model.Filter.MarkerSearch;
|
prmUsgaMarker.MarkerFilter = model.Filter.MarkerSearch;
|
||||||
prmUsgaMarker.StatusCat = SaxGolfUsgaMarker.StatusCat.Any;
|
prmUsgaMarker.StatusCat = SaxGolfUsgaMarker.StatusCat.Any;
|
||||||
model.Paging.ItemTotal = (ulong)ReferenceGolfMgr.GetUsgaMarkerCount(prmUsgaMarker);
|
model.Paging.ItemTotal = (ulong)ReferenceGolfMgr.GetUsgaMarkerCount(prmUsgaMarker);
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Identify item.
|
// Identify item.
|
||||||
SysId regionId = model.RegionId.ToSysId();
|
SysId regionId = SysId.ToSysId(model.RegionId);
|
||||||
if (!SysId.IsValid(regionId))
|
if (!SysId.IsValid(regionId))
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
return Json(responseData);
|
return Json(responseData);
|
||||||
|
|
||||||
// Retrieve existing item.
|
// Retrieve existing item.
|
||||||
SysId regionId = model.RegionId.ToSysId();
|
SysId regionId = SysId.ToSysId(model.RegionId);
|
||||||
SaxRegion region = ReferenceMgr.GetRegionById(regionId);
|
SaxRegion region = ReferenceMgr.GetRegionById(regionId);
|
||||||
disposableItems.Add(region);
|
disposableItems.Add(region);
|
||||||
if (region == null && SysId.IsValid(regionId))
|
if (region == null && SysId.IsValid(regionId))
|
||||||
@@ -243,7 +243,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
if (model.RegionName != null)
|
if (model.RegionName != null)
|
||||||
region.Name = model.RegionName;
|
region.Name = model.RegionName;
|
||||||
if (model.RegionIdParent != null)
|
if (model.RegionIdParent != null)
|
||||||
region.RegionIdParent = model.RegionIdParent.ToSysId();
|
region.RegionIdParent = SysId.ToSysId(model.RegionIdParent);
|
||||||
if (model.RegionStatusCode != null)
|
if (model.RegionStatusCode != null)
|
||||||
region.Status = model.RegionStatus;
|
region.Status = model.RegionStatus;
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Identify item.
|
// Identify item.
|
||||||
SysId sportId = model.SportId.ToSysId();
|
SysId sportId = SysId.ToSysId(model.SportId);
|
||||||
if (!SysId.IsValid(sportId))
|
if (!SysId.IsValid(sportId))
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
return Json(responseData);
|
return Json(responseData);
|
||||||
|
|
||||||
// Retrieve existing item.
|
// Retrieve existing item.
|
||||||
SysId sportId = model.SportId.ToSysId();
|
SysId sportId = SysId.ToSysId(model.SportId);
|
||||||
SaxSport sport = ReferenceMgr.GetSportById(sportId);
|
SaxSport sport = ReferenceMgr.GetSportById(sportId);
|
||||||
disposableItems.Add(sport);
|
disposableItems.Add(sport);
|
||||||
if (sport == null && SysId.IsValid(sportId))
|
if (sport == null && SysId.IsValid(sportId))
|
||||||
@@ -240,7 +240,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
if (model.SportGroupingCode != null)
|
if (model.SportGroupingCode != null)
|
||||||
sport.Grouping = model.SportGrouping;
|
sport.Grouping = model.SportGrouping;
|
||||||
if (model.SportIdParent != null)
|
if (model.SportIdParent != null)
|
||||||
sport.SportIdParent = model.SportIdParent.ToSysId();
|
sport.SportIdParent = SysId.ToSysId(model.SportIdParent);
|
||||||
if (model.SportName != null)
|
if (model.SportName != null)
|
||||||
sport.Name = model.SportName;
|
sport.Name = model.SportName;
|
||||||
if (model.SportSpecialityLabelCode != null)
|
if (model.SportSpecialityLabelCode != null)
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Support
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Identify item.
|
// Identify item.
|
||||||
SysId userReportId = model.UserReport.Id.ToSysId();
|
SysId userReportId = SysId.ToSysId(model.UserReport.Id);
|
||||||
if (!SysId.IsValid(userReportId))
|
if (!SysId.IsValid(userReportId))
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Support
|
|||||||
return Json(responseData);
|
return Json(responseData);
|
||||||
|
|
||||||
// Retrieve existing item.
|
// Retrieve existing item.
|
||||||
SysId userReportId = model.UserReport.Id.ToSysId();
|
SysId userReportId = SysId.ToSysId(model.UserReport.Id);
|
||||||
if (StringUtil.ToBool(model.UserReport.Exists) && !SysId.IsValid(userReportId))
|
if (StringUtil.ToBool(model.UserReport.Exists) && !SysId.IsValid(userReportId))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Item Id not supplied for existing item.");
|
SaLogger.Warn(fn + " Item Id not supplied for existing item.");
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ using System.Threading.Tasks;
|
|||||||
namespace Saxonite.Net.Core.Web.Admin.Controllers.System
|
namespace Saxonite.Net.Core.Web.Admin.Controllers.System
|
||||||
{
|
{
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// System - Ajax - Database controller
|
// System - Ajax - Logs controller
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
partial class SystemController
|
partial class SystemController
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -162,16 +162,16 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
responseData.Statuses.Add(SacsSystem.GetStatusCode(status), Localiser.GetStatusCaption(status));
|
responseData.Statuses.Add(SacsSystem.GetStatusCode(status), Localiser.GetStatusCaption(status));
|
||||||
|
|
||||||
// Store filter values.
|
// Store filter values.
|
||||||
SysId filterSportId = model.Filter.UserSportId.ToSysId();
|
SysId filterSportId = SysId.ToSysId(model.Filter.UserSportId);
|
||||||
SessionData_Admin.Filter.SportId = SysId.IsValid(filterSportId) ? filterSportId : null;
|
SessionData_Admin.Filter.SportId = SysId.IsValid(filterSportId) ? filterSportId : null;
|
||||||
SysId filterRegionId = model.Filter.UserRegionId.ToSysId();
|
SysId filterRegionId = SysId.ToSysId(model.Filter.UserRegionId);
|
||||||
SessionData_Admin.Filter.RegionId = SysId.IsValid(filterRegionId) ? filterRegionId : null;
|
SessionData_Admin.Filter.RegionId = SysId.IsValid(filterRegionId) ? filterRegionId : null;
|
||||||
|
|
||||||
// Item filter.
|
// Item filter.
|
||||||
SaxUserAccount.Params prmUserAccount = new SaxUserAccount.Params();
|
SaxUserAccount.Params prmUserAccount = new SaxUserAccount.Params();
|
||||||
prmUserAccount.UserFilterPartial = model.Filter.User;
|
prmUserAccount.UserFilterPartial = model.Filter.User;
|
||||||
prmUserAccount.SportIdsIncluded.AddId(model.Filter.UserSportId.ToSysId());
|
prmUserAccount.SportIdsIncluded.AddId(SysId.ToSysId(model.Filter.UserSportId));
|
||||||
prmUserAccount.RegionIdsIncluded.AddId(model.Filter.UserRegionId.ToSysId());
|
prmUserAccount.RegionIdsIncluded.AddId(SysId.ToSysId(model.Filter.UserRegionId));
|
||||||
prmUserAccount.StatusCat = model.Filter.UserStatusCategoryCode != null ? model.FilterUserStatusCategory : SaxUserAccount.StatusCat.NotDeleted;
|
prmUserAccount.StatusCat = model.Filter.UserStatusCategoryCode != null ? model.FilterUserStatusCategory : SaxUserAccount.StatusCat.NotDeleted;
|
||||||
model.Paging.ItemTotal = (ulong)AccountMgr.GetUserAccountCount(prmUserAccount);
|
model.Paging.ItemTotal = (ulong)AccountMgr.GetUserAccountCount(prmUserAccount);
|
||||||
model.PopulatePagingTo(prmUserAccount.ResultsPaging);
|
model.PopulatePagingTo(prmUserAccount.ResultsPaging);
|
||||||
@@ -268,7 +268,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Identify item.
|
// Identify item.
|
||||||
SysId userAccountId = model.UserId.ToSysId();
|
SysId userAccountId = SysId.ToSysId(model.UserId);
|
||||||
if (!SysId.IsValid(userAccountId))
|
if (!SysId.IsValid(userAccountId))
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Retrieve existing item.
|
// Retrieve existing item.
|
||||||
SysId userAccountId = model.UserId.ToSysId();
|
SysId userAccountId = SysId.ToSysId(model.UserId);
|
||||||
SaxUserAccount user = AccountMgr.GetUserAccountById(userAccountId);
|
SaxUserAccount user = AccountMgr.GetUserAccountById(userAccountId);
|
||||||
disposableItems.Add(user);
|
disposableItems.Add(user);
|
||||||
if (user == null && SysId.IsValid(userAccountId))
|
if (user == null && SysId.IsValid(userAccountId))
|
||||||
@@ -427,9 +427,9 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
if (model.UserLastName != null)
|
if (model.UserLastName != null)
|
||||||
user.LastName = model.UserLastName;
|
user.LastName = model.UserLastName;
|
||||||
if (model.UserRegionIdCountry != null)
|
if (model.UserRegionIdCountry != null)
|
||||||
user.RegionIdCountry = model.UserRegionIdCountry.ToSysId();
|
user.RegionIdCountry = SysId.ToSysId(model.UserRegionIdCountry);
|
||||||
if (model.UserRegionIdProvince != null)
|
if (model.UserRegionIdProvince != null)
|
||||||
user.RegionIdProvince = model.UserRegionIdProvince.ToSysId();
|
user.RegionIdProvince = SysId.ToSysId(model.UserRegionIdProvince);
|
||||||
if (model.UserStatusCode != null)
|
if (model.UserStatusCode != null)
|
||||||
user.Status = model.UserStatus;
|
user.Status = model.UserStatus;
|
||||||
|
|
||||||
@@ -505,7 +505,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Retrieve user.
|
// Retrieve user.
|
||||||
SysId userAccountId = model.UserId.ToSysId();
|
SysId userAccountId = SysId.ToSysId(model.UserId);
|
||||||
SaxUserAccount userAccount = AccountMgr.GetUserAccountById(userAccountId);
|
SaxUserAccount userAccount = AccountMgr.GetUserAccountById(userAccountId);
|
||||||
disposableItems.Add(userAccount);
|
disposableItems.Add(userAccount);
|
||||||
if (userAccount == null)
|
if (userAccount == null)
|
||||||
@@ -533,7 +533,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
if (sendAcountActivationOnline)
|
if (sendAcountActivationOnline)
|
||||||
{
|
{
|
||||||
if (!OrganisationController.SendAccountActivatedEmail(this, userAccount))
|
if (!OrganisationController.SendAccountActivatedEmail(this, userAccount))
|
||||||
return Json(responseData.SetMessage(messageTitle, "Failed to send Online Accoutn Activation email."));
|
return Json(responseData.SetMessage(messageTitle, "Failed to send Online Account Activation email."));
|
||||||
emailsSentCount++;
|
emailsSentCount++;
|
||||||
}
|
}
|
||||||
if (sendRequestPasswordOnline)
|
if (sendRequestPasswordOnline)
|
||||||
|
|||||||
@@ -81,8 +81,8 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
// Item filter.
|
// Item filter.
|
||||||
SaxUserOnline.Params prmUserOnline = new SaxUserOnline.Params();
|
SaxUserOnline.Params prmUserOnline = new SaxUserOnline.Params();
|
||||||
prmUserOnline.UserFilterPartial = model.Filter.User;
|
prmUserOnline.UserFilterPartial = model.Filter.User;
|
||||||
prmUserOnline.SportIdsIncluded.AddId(model.Filter.UserSportId.ToSysId());
|
prmUserOnline.SportIdsIncluded.AddId(SysId.ToSysId(model.Filter.UserSportId));
|
||||||
prmUserOnline.RegionIdsIncluded.AddId(model.Filter.UserRegionId.ToSysId());
|
prmUserOnline.RegionIdsIncluded.AddId(SysId.ToSysId(model.Filter.UserRegionId));
|
||||||
model.Paging.ItemTotal = (ulong)AccountMgr.GetUserOnlineCount(prmUserOnline);
|
model.Paging.ItemTotal = (ulong)AccountMgr.GetUserOnlineCount(prmUserOnline);
|
||||||
model.PopulatePagingTo(prmUserOnline.ResultsPaging);
|
model.PopulatePagingTo(prmUserOnline.ResultsPaging);
|
||||||
|
|
||||||
@@ -160,7 +160,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
|
|
||||||
// Identify item.
|
// Identify item.
|
||||||
SysId userAccountId = model.UserId.ToSysId();
|
SysId userAccountId = SysId.ToSysId(model.UserId);
|
||||||
if (!SysId.IsValid(userAccountId))
|
if (!SysId.IsValid(userAccountId))
|
||||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
/// <summary>Have any address values been populated on the form.</summary>
|
/// <summary>Have any address values been populated on the form.</summary>
|
||||||
public bool IsPopulated()
|
public bool IsPopulated()
|
||||||
{
|
{
|
||||||
if (SysId.IsValid(Id.ToSysId()) || !StringUtil.IsEmpty(Line1) || !StringUtil.IsEmpty(Town) || !StringUtil.IsEmpty(Province) || !StringUtil.IsEmpty(RegionIdCountry) || !StringUtil.IsEmpty(PostalCode))
|
if (SysId.IsValid(SysId.ToSysId(Id)) || !StringUtil.IsEmpty(Line1) || !StringUtil.IsEmpty(Town) || !StringUtil.IsEmpty(Province) || !StringUtil.IsEmpty(RegionIdCountry) || !StringUtil.IsEmpty(PostalCode))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -126,11 +126,11 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
if (RegionIdCountry != null)
|
if (RegionIdCountry != null)
|
||||||
{
|
{
|
||||||
String controlName = ControlNameSuffix + nameof(RegionIdCountry);
|
String controlName = ControlNameSuffix + nameof(RegionIdCountry);
|
||||||
if (!SysId.IsValid(RegionIdCountry.ToSysId()) && populated)
|
if (!SysId.IsValid(SysId.ToSysId(RegionIdCountry)) && populated)
|
||||||
responseData.SetControlError(controlName, Model.Localiser["msg.validation.mandatory.value"]);
|
responseData.SetControlError(controlName, Model.Localiser["msg.validation.mandatory.value"]);
|
||||||
else if (SysId.IsValid(RegionIdCountry.ToSysId()))
|
else if (SysId.IsValid(SysId.ToSysId(RegionIdCountry)))
|
||||||
{
|
{
|
||||||
SaxRegion.Data region = model.Internals.GetRegion(RegionIdCountry.ToSysId());
|
SaxRegion.Data region = model.Internals.GetRegion(SysId.ToSysId(RegionIdCountry));
|
||||||
if (region == null || region.RegionType != Sax.RegionType.Country)
|
if (region == null || region.RegionType != Sax.RegionType.Country)
|
||||||
responseData.SetControlError(controlName, Model.Localiser["msg.validation.invalid.value"]);
|
responseData.SetControlError(controlName, Model.Localiser["msg.validation.invalid.value"]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,9 +141,9 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
// Organisation sport.
|
// Organisation sport.
|
||||||
if (OrganisationSportId != null)
|
if (OrganisationSportId != null)
|
||||||
{
|
{
|
||||||
if (SysId.IsValid(OrganisationSportId.ToSysId()) || IsSportMandatory())
|
if (SysId.IsValid(SysId.ToSysId(OrganisationSportId)) || IsSportMandatory())
|
||||||
{
|
{
|
||||||
using (SaxSport sport = ReferenceMgr.GetSportById(OrganisationSportId.ToSysId()))
|
using (SaxSport sport = ReferenceMgr.GetSportById(SysId.ToSysId(OrganisationSportId)))
|
||||||
{
|
{
|
||||||
if (sport == null)
|
if (sport == null)
|
||||||
responseData.SetControlError(nameof(OrganisationSportId), Localiser["msg.validation.invalid.value"]);
|
responseData.SetControlError(nameof(OrganisationSportId), Localiser["msg.validation.invalid.value"]);
|
||||||
@@ -154,7 +154,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
// Organisation primary region.
|
// Organisation primary region.
|
||||||
if (OrganisationRegionIdPrimary != null)
|
if (OrganisationRegionIdPrimary != null)
|
||||||
{
|
{
|
||||||
using (SaxRegion region = ReferenceMgr.GetRegionById(OrganisationRegionIdPrimary.ToSysId()))
|
using (SaxRegion region = ReferenceMgr.GetRegionById(SysId.ToSysId(OrganisationRegionIdPrimary)))
|
||||||
{
|
{
|
||||||
if (region == null)
|
if (region == null)
|
||||||
responseData.SetControlError(nameof(OrganisationRegionIdPrimary), Localiser["msg.validation.invalid.value"]);
|
responseData.SetControlError(nameof(OrganisationRegionIdPrimary), Localiser["msg.validation.invalid.value"]);
|
||||||
@@ -166,10 +166,10 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
{
|
{
|
||||||
// Name must be unqiue within region.
|
// Name must be unqiue within region.
|
||||||
SaxOrganisation.Params prmOrganisation = new SaxOrganisation.Params();
|
SaxOrganisation.Params prmOrganisation = new SaxOrganisation.Params();
|
||||||
if (SysId.IsValid(OrganisationId.ToSysId()))
|
if (SysId.IsValid(SysId.ToSysId(OrganisationId)))
|
||||||
prmOrganisation.IdsExcluded.Add(OrganisationId.ToSysId());
|
prmOrganisation.IdsExcluded.Add(SysId.ToSysId(OrganisationId));
|
||||||
prmOrganisation.NameFull = OrganisationName;
|
prmOrganisation.NameFull = OrganisationName;
|
||||||
prmOrganisation.RegionIdsIncluded.Add(OrganisationRegionIdPrimary.ToSysId());
|
prmOrganisation.RegionIdsIncluded.Add(SysId.ToSysId(OrganisationRegionIdPrimary));
|
||||||
prmOrganisation.StatusCat = SaxOrganisation.StatusCat.Any;
|
prmOrganisation.StatusCat = SaxOrganisation.StatusCat.Any;
|
||||||
if (AccountMgr.GetOrganisationCount(prmOrganisation) > 0)
|
if (AccountMgr.GetOrganisationCount(prmOrganisation) > 0)
|
||||||
responseData.SetControlError(nameof(OrganisationName), Localiser["msg.validation.duplicate.value"]);
|
responseData.SetControlError(nameof(OrganisationName), Localiser["msg.validation.duplicate.value"]);
|
||||||
|
|||||||
@@ -106,13 +106,13 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
{
|
{
|
||||||
// Mandatory.
|
// Mandatory.
|
||||||
String controlName = "OrganisationIdAssoc";
|
String controlName = "OrganisationIdAssoc";
|
||||||
if (!SysId.IsValid(OrganisationIdAssoc.ToSysId()))
|
if (!SysId.IsValid(SysId.ToSysId(OrganisationIdAssoc)))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||||
// Must exist.
|
// Must exist.
|
||||||
else if (!AccountMgr.OrganisationExistsById(OrganisationIdAssoc.ToSysId()))
|
else if (!AccountMgr.OrganisationExistsById(SysId.ToSysId(OrganisationIdAssoc)))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||||
// Not same as primary organisation.
|
// Not same as primary organisation.
|
||||||
else if (OrganisationId != null && OrganisationId.ToSysId().Equals(OrganisationIdAssoc.ToSysId()))
|
else if (OrganisationId != null && SysId.ToSysId(OrganisationId).Equals(SysId.ToSysId(OrganisationIdAssoc)))
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
// User Account.
|
// User Account.
|
||||||
if (MemberUserAccountId != null)
|
if (MemberUserAccountId != null)
|
||||||
{
|
{
|
||||||
SysId memberUserAccountId = MemberUserAccountId.ToSysId();
|
SysId memberUserAccountId = SysId.ToSysId(MemberUserAccountId);
|
||||||
if (!SysId.IsValid(memberUserAccountId))
|
if (!SysId.IsValid(memberUserAccountId))
|
||||||
responseData.SetControlError(nameof(MemberUserAccountId), Localiser["msg.validation.mandatory.value"]);
|
responseData.SetControlError(nameof(MemberUserAccountId), Localiser["msg.validation.mandatory.value"]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
{
|
{
|
||||||
// Check for duplicate code.
|
// Check for duplicate code.
|
||||||
SaxRegion.Params prmRegion = new SaxRegion.Params();
|
SaxRegion.Params prmRegion = new SaxRegion.Params();
|
||||||
SysId regionId = RegionId.ToSysId();
|
SysId regionId = SysId.ToSysId(RegionId);
|
||||||
if (SysId.IsValid(regionId))
|
if (SysId.IsValid(regionId))
|
||||||
prmRegion.IdsExcluded.Add(regionId);
|
prmRegion.IdsExcluded.Add(regionId);
|
||||||
prmRegion.CountryIso2CodesIncluded.Add(RegionCountryIso2Code);
|
prmRegion.CountryIso2CodesIncluded.Add(RegionCountryIso2Code);
|
||||||
@@ -111,7 +111,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
{
|
{
|
||||||
// Check for duplicate name.
|
// Check for duplicate name.
|
||||||
SaxRegion.Params prmRegion = new SaxRegion.Params();
|
SaxRegion.Params prmRegion = new SaxRegion.Params();
|
||||||
SysId regionId = RegionId.ToSysId();
|
SysId regionId = SysId.ToSysId(RegionId);
|
||||||
if (SysId.IsValid(regionId))
|
if (SysId.IsValid(regionId))
|
||||||
prmRegion.IdsExcluded.Add(regionId);
|
prmRegion.IdsExcluded.Add(regionId);
|
||||||
prmRegion.NameFull = RegionName;
|
prmRegion.NameFull = RegionName;
|
||||||
@@ -124,7 +124,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
// Parent region.
|
// Parent region.
|
||||||
if (!StringUtil.IsEmpty(RegionIdParent))
|
if (!StringUtil.IsEmpty(RegionIdParent))
|
||||||
{
|
{
|
||||||
SaxRegion parentRegion = ReferenceMgr.GetRegionById(RegionIdParent.ToSysId());
|
SaxRegion parentRegion = ReferenceMgr.GetRegionById(SysId.ToSysId(RegionIdParent));
|
||||||
if (parentRegion != null)
|
if (parentRegion != null)
|
||||||
{
|
{
|
||||||
if (RegionType<= 0 || SaxRegion.IsValidParentRegionType(RegionType, parentRegion.RegionType))
|
if (RegionType<= 0 || SaxRegion.IsValidParentRegionType(RegionType, parentRegion.RegionType))
|
||||||
|
|||||||
@@ -69,11 +69,11 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Parent sport.
|
// Parent sport.
|
||||||
SysId sportIdParent = SportIdParent.ToSysId();
|
SysId sportIdParent = SysId.ToSysId(SportIdParent);
|
||||||
if (SportIdParent != null && SysId.IsValid(sportIdParent))
|
if (SportIdParent != null && SysId.IsValid(sportIdParent))
|
||||||
{
|
{
|
||||||
String controlName = "SportParent";
|
String controlName = "SportParent";
|
||||||
SaxSport sport = ReferenceMgr.GetSportById(SportIdParent.ToSysId());
|
SaxSport sport = ReferenceMgr.GetSportById(SysId.ToSysId(SportIdParent));
|
||||||
disposableItems.Add(sport);
|
disposableItems.Add(sport);
|
||||||
if (sport == null)
|
if (sport == null)
|
||||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||||
@@ -94,7 +94,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
{
|
{
|
||||||
// Check for duplicate name.
|
// Check for duplicate name.
|
||||||
SaxSport.Params prmSport = new SaxSport.Params();
|
SaxSport.Params prmSport = new SaxSport.Params();
|
||||||
SysId sportId = SportId.ToSysId();
|
SysId sportId = SysId.ToSysId(SportId);
|
||||||
if (SysId.IsValid(sportId))
|
if (SysId.IsValid(sportId))
|
||||||
prmSport.IdsExcluded.Add(sportId);
|
prmSport.IdsExcluded.Add(sportId);
|
||||||
prmSport.NameFull = SportName;
|
prmSport.NameFull = SportName;
|
||||||
|
|||||||
@@ -96,8 +96,6 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
// User.
|
// User.
|
||||||
public bool ValidateUserData(SaxController_Base.AjaxResponse_Data responseData)
|
public bool ValidateUserData(SaxController_Base.AjaxResponse_Data responseData)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".ValidateUserData";
|
|
||||||
|
|
||||||
// Record disposable items as they are created so all can be disposed when needed.
|
// Record disposable items as they are created so all can be disposed when needed.
|
||||||
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
||||||
{
|
{
|
||||||
@@ -117,7 +115,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
{
|
{
|
||||||
// Check for duplicate email address.
|
// Check for duplicate email address.
|
||||||
SaxUserAccount.Params prmUserAccount = new SaxUserAccount.Params();
|
SaxUserAccount.Params prmUserAccount = new SaxUserAccount.Params();
|
||||||
SysId userAccountId = UserId.ToSysId();
|
SysId userAccountId = SysId.ToSysId(UserId);
|
||||||
if (SysId.IsValid(userAccountId))
|
if (SysId.IsValid(userAccountId))
|
||||||
prmUserAccount.IdsExcluded.Add(userAccountId);
|
prmUserAccount.IdsExcluded.Add(userAccountId);
|
||||||
prmUserAccount.EmailAddress = UserEmailAddress;
|
prmUserAccount.EmailAddress = UserEmailAddress;
|
||||||
@@ -156,23 +154,23 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
SaxRegion regionCountry = null;
|
SaxRegion regionCountry = null;
|
||||||
if (UserRegionIdCountry != null)
|
if (UserRegionIdCountry != null)
|
||||||
{
|
{
|
||||||
if (!SysId.IsValid(UserRegionIdCountry.ToSysId()))
|
if (!SysId.IsValid(SysId.ToSysId(UserRegionIdCountry)))
|
||||||
responseData.SetControlError(nameof(UserRegionIdCountry), Localiser["msg.validation.mandatory.value"]);
|
responseData.SetControlError(nameof(UserRegionIdCountry), Localiser["msg.validation.mandatory.value"]);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
regionCountry = ReferenceMgr.GetRegionById(UserRegionIdCountry.ToSysId());
|
regionCountry = ReferenceMgr.GetRegionById(SysId.ToSysId(UserRegionIdCountry));
|
||||||
disposableItems.Add(regionCountry);
|
disposableItems.Add(regionCountry);
|
||||||
if (regionCountry != null)
|
if (regionCountry != null)
|
||||||
{
|
{
|
||||||
if (regionCountry.RegionType != Sax.RegionType.Country)
|
if (regionCountry.RegionType != Sax.RegionType.Country)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Invalid region type. Expected: Country. Found: " + regionCountry.RegionType.ToString());
|
SaLogger.Warn($"{SysUtil.Fn} Invalid region type. Expected: Country. Found: " + regionCountry.RegionType.ToString());
|
||||||
responseData.SetControlError(nameof(UserRegionIdCountry), Localiser["msg.validation.invalid.value"]);
|
responseData.SetControlError(nameof(UserRegionIdCountry), Localiser["msg.validation.invalid.value"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve region for Id: " + UserRegionIdCountry);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve region for Id: " + UserRegionIdCountry);
|
||||||
responseData.SetControlError(nameof(UserRegionIdCountry), Localiser["msg.validation.invalid.value"]);
|
responseData.SetControlError(nameof(UserRegionIdCountry), Localiser["msg.validation.invalid.value"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -184,24 +182,24 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
{
|
{
|
||||||
if (!UserRegionIdProvince.IsEmpty())
|
if (!UserRegionIdProvince.IsEmpty())
|
||||||
{
|
{
|
||||||
regionProvince = ReferenceMgr.GetRegionById(UserRegionIdProvince.ToSysId());
|
regionProvince = ReferenceMgr.GetRegionById(SysId.ToSysId(UserRegionIdProvince));
|
||||||
disposableItems.Add(regionProvince);
|
disposableItems.Add(regionProvince);
|
||||||
if (regionProvince != null)
|
if (regionProvince != null)
|
||||||
{
|
{
|
||||||
if (regionProvince.RegionType != Sax.RegionType.Province)
|
if (regionProvince.RegionType != Sax.RegionType.Province)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Invalid region type. Expected: Province . Found: " + regionCountry.RegionType.ToString());
|
SaLogger.Warn($"{SysUtil.Fn} Invalid region type. Expected: Province . Found: " + regionCountry.RegionType.ToString());
|
||||||
responseData.SetControlError(nameof(UserRegionIdProvince), Localiser["msg.validation.invalid.value"]);
|
responseData.SetControlError(nameof(UserRegionIdProvince), Localiser["msg.validation.invalid.value"]);
|
||||||
}
|
}
|
||||||
else if (regionCountry != null && !regionProvince.RegionIdParent.Equals(regionCountry.Id))
|
else if (regionCountry != null && !regionProvince.RegionIdParent.Equals(regionCountry.Id))
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Invalid province region parent. Expected: " + regionCountry.Id.ToString() + " . Found: " + regionCountry.RegionIdParent.ToString());
|
SaLogger.Warn($"{SysUtil.Fn} Invalid province region parent. Expected: " + regionCountry.Id.ToString() + " . Found: " + regionCountry.RegionIdParent.ToString());
|
||||||
responseData.SetControlError(nameof(UserRegionIdProvince), Localiser["msg.validation.invalid.value"]);
|
responseData.SetControlError(nameof(UserRegionIdProvince), Localiser["msg.validation.invalid.value"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Failed to retrieve region for Id: " + UserRegionIdProvince);
|
SaLogger.Warn($"{SysUtil.Fn} Failed to retrieve region for Id: " + UserRegionIdProvince);
|
||||||
responseData.SetControlError(nameof(UserRegionIdProvince), Localiser["msg.validation.invalid.value"]);
|
responseData.SetControlError(nameof(UserRegionIdProvince), Localiser["msg.validation.invalid.value"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -771,6 +771,9 @@
|
|||||||
<data name="msg.validation.select.option" xml:space="preserve">
|
<data name="msg.validation.select.option" xml:space="preserve">
|
||||||
<value>At least one option must be selected.</value>
|
<value>At least one option must be selected.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="msg.warn.password.invalid" xml:space="preserve">
|
||||||
|
<value>Password must be a minimum of {0} characters with upper and lower case letters, at least one number and special character unless at least {1} characters long.</value>
|
||||||
|
</data>
|
||||||
<data name="organisation.activate.intro" xml:space="preserve">
|
<data name="organisation.activate.intro" xml:space="preserve">
|
||||||
<value>On activation, the Organisation will become visible on the platform and authorised members will be able to post content associated with the organisation.</value>
|
<value>On activation, the Organisation will become visible on the platform and authorised members will be able to post content associated with the organisation.</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="jQuery.UI.Combined" Version="1.13.3" />
|
<PackageReference Include="jQuery" Version="3.7.1" />
|
||||||
|
<PackageReference Include="jQuery.UI.Combined" Version="1.14.1" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.31" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.31" />
|
||||||
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
|
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -64,6 +64,7 @@
|
|||||||
{
|
{
|
||||||
max-height: auto;
|
max-height: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sax-panel-results .sax-panel-info.DbSchema .sax-panel-messages
|
.sax-panel-results .sax-panel-info.DbSchema .sax-panel-messages
|
||||||
{
|
{
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
@@ -99,7 +100,7 @@
|
|||||||
<div class="sax-panel-messages"></div>
|
<div class="sax-panel-messages"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* Database Schema - Reference *@
|
@* Database Schema - Support *@
|
||||||
<div class="sax-panel-info DbSchema Support">
|
<div class="sax-panel-info DbSchema Support">
|
||||||
<div class="sax-header">
|
<div class="sax-header">
|
||||||
<div class="sax-caption">@Localiser["system.caption.database.support"]</div>
|
<div class="sax-caption">@Localiser["system.caption.database.support"]</div>
|
||||||
@@ -118,7 +119,7 @@
|
|||||||
<th class="">@Localiser["label.table"]</th>
|
<th class="">@Localiser["label.table"]</th>
|
||||||
<th class="">@Localiser["label.column"]</th>
|
<th class="">@Localiser["label.column"]</th>
|
||||||
<th class="">@Localiser["label.index"]</th>
|
<th class="">@Localiser["label.index"]</th>
|
||||||
<th class="">@Localiser["label.comment"]</th>
|
<th class="" style="min-width:50%;">@Localiser["label.comment"]</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody></tbody>
|
<tbody></tbody>
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
|
@model SaxModel_Admin
|
||||||
@model SaxModel_Admin
|
|
||||||
@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery AntiForgery;
|
@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery AntiForgery;
|
||||||
@inject SaxLocaliser Localiser
|
@inject SaxLocaliser Localiser
|
||||||
@*
|
@*
|
||||||
@@ -55,7 +54,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@* Scripts *@
|
@* Scripts *@
|
||||||
<script>
|
<script>
|
||||||
var sax = sax || { page: {}, mdl: {}, url: {}, links: {}, form: {}, data: {}, ajax: {}, msg: {}, lbl: {}, dlg: { title: {}, btn: {} }, $frm: {}, $dlg: {}, $pnl: {}, session: {}, kli: {} };
|
var sax = sax || { page: {}, mdl: {}, url: {}, links: {}, form: {}, data: {}, ajax: {}, msg: {}, lbl: {}, dlg: { title: {}, btn: {} }, $frm: {}, $dlg: {}, $pnl: {}, session: {}, kli: {} };
|
||||||
sax.url.base = '@Model.RedirectLocation.Base';
|
sax.url.base = '@Model.RedirectLocation.Base';
|
||||||
sax.url.home = '@Model.RedirectLocation.Home';
|
sax.url.home = '@Model.RedirectLocation.Home';
|
||||||
@@ -85,7 +84,7 @@
|
|||||||
sax.kli.active = @keepLoggedIn;
|
sax.kli.active = @keepLoggedIn;
|
||||||
sax.kli.interval = @(Sax.Config.Admin.Session.Cookie.KeepLoggedInTimeoutMillis);
|
sax.kli.interval = @(Sax.Config.Admin.Session.Cookie.KeepLoggedInTimeoutMillis);
|
||||||
sax.debugMode = @debug;
|
sax.debugMode = @debug;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -94,7 +93,7 @@
|
|||||||
<header id="sax-page-header">
|
<header id="sax-page-header">
|
||||||
|
|
||||||
@* Navigation bar *@
|
@* Navigation bar *@
|
||||||
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
|
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">@Localiser["home.caption.application"]</a>
|
<a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">@Localiser["home.caption.application"]</a>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
|
||||||
@@ -104,9 +103,9 @@
|
|||||||
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
|
<div class="navbar-collapse collapse d-sm-inline-flex flex-sm-row-reverse">
|
||||||
<ul class="navbar-nav flex-grow-1">
|
<ul class="navbar-nav flex-grow-1">
|
||||||
@*
|
@*
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">@Localiser["home.caption.home"]</a>
|
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="Index">@Localiser["home.caption.home"]</a>
|
||||||
</li>
|
</li>
|
||||||
*@
|
*@
|
||||||
@if (Model.AwaitingLogin)
|
@if (Model.AwaitingLogin)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,56 +4,91 @@
|
|||||||
ViewData["Title"] = "System - Database";
|
ViewData["Title"] = "System - Database";
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="container-fluid DatabaseTables">
|
<div class="sax-panel DatabaseTables">
|
||||||
|
|
||||||
<div class="sax-panel-filter">
|
<script type="text/javascript">
|
||||||
<div class="sax-header row">
|
</script>
|
||||||
<div class="col"><div class="sax-caption">@Localiser["system.caption.database"]</div></div>
|
|
||||||
<div class="fixed row">
|
<div class="sax-panel-data sax-flex">
|
||||||
<div class="sax-action sax-results-refresh"><img src="~/img/action/refresh24.png" alt="@(Localiser["label.refresh"])" title="@(Localiser["label.refresh"])" /></div>
|
|
||||||
|
@* Filter form - wrap header to include paging controls. *@
|
||||||
|
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmDbTableFilter", @class = "sax-form", @onSubmit = "return false;" }))
|
||||||
|
{
|
||||||
|
|
||||||
|
@* Header - Page caption, paging controls, actions. *@
|
||||||
|
<div class="sax-panel-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col"><div class="sax-panel-caption">@Localiser["system.caption.database"]</div></div>
|
||||||
|
<div class="fixed row">
|
||||||
|
<div class="sax-action sax-results-refresh"><img src="~/img/action/refresh24.png" alt="@(Localiser["label.refresh"])" title="@(Localiser["label.refresh"])" /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="sax-content">
|
@* Filter Panel *@
|
||||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmDbTableFilter", @class = "sax-form", @onSubmit = "return false;" }))
|
<div class="sax-panel-filter">
|
||||||
{
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-5 col-md-3 sax-label text-left text-sm-right">@Localiser["label.instance"]</div>
|
<div class="col-sm-5 col-md-3 sax-label text-left text-sm-right">@Localiser["label.instance"]</div>
|
||||||
<div class="col-sm-7 col-md-3 mb-sm-1 mb-md-0">@Html.DropDownListFor(model => model.DatabaseFilter.Instance, Model.GetDatabases(), new { @id = "cbDatabaseFilterInstance", @class = "DatabaseFilterInstance" })</div>
|
<div class="col-sm-7 col-md-3 mb-sm-1 mb-md-0">@Html.DropDownListFor(model => model.DatabaseFilter.Instance, Model.GetDatabases(), new { @id = "cbDatabaseFilterInstance", @class = "DatabaseFilterInstance" })</div>
|
||||||
<div class="col-sm-5 col-md-3 sax-label text-left text-sm-right">@Localiser["label.search"]</div>
|
<div class="col-sm-5 col-md-3 sax-label text-left text-sm-right">@Localiser["label.search"]</div>
|
||||||
<div class="col-sm-7 col-md-3">@Html.TextBoxFor(model => model.DatabaseFilter.Search, new { @id = "ifDatabaseFilterSearch", @class = "DatabaseFilterSearch", @maxlength = "32" })</div>
|
<div class="col-sm-7 col-md-3">@Html.TextBoxFor(model => model.DatabaseFilter.Search, new { @id = "ifDatabaseFilterSearch", @class = "DatabaseFilterSearch", @maxlength = "32" })</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@* Item list *@
|
||||||
|
<div class="sax-panel-item-table sax-flex">
|
||||||
|
<table class="sax-item-list">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="width50pc pl-2">@Localiser["label.table"]</th>
|
||||||
|
<th class="width15pc center">@Localiser["label.rows"]</th>
|
||||||
|
<th class="width15pc center">@Localiser["label.columns"]</th>
|
||||||
|
<th class="width15pc center">@Localiser["label.indices"]</th>
|
||||||
|
<th class="width5pc center"></th>
|
||||||
|
</tr>
|
||||||
|
<tr><td colspan="6"><div class="sax-panel-messages"></div></td></tr>
|
||||||
|
</thead>
|
||||||
|
<tbody></tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="sax-panel-results">
|
|
||||||
<div class="sax-panel-messages"></div>
|
@* Element templates *@
|
||||||
<div class="sax-panel-item-list"></div>
|
<div class="sax-panel-item-template">
|
||||||
<div class="sax-panel-item-template">
|
|
||||||
<div class="sax-panel-item DatabaseTable">
|
@* Item row template - table is ignored. *@
|
||||||
<div class="sax-header row">
|
<table>
|
||||||
<div class="col">
|
<tr class="sax-row-item DatabaseTable">
|
||||||
<div class="sax-caption"><div class="sax-action TableName"></div></div>
|
<td class="TableName pl-1"></td>
|
||||||
|
<td class="RowCount center"></td>
|
||||||
|
<td class="ColumnCount center"></td>
|
||||||
|
<td class="IndexCount center"></td>
|
||||||
|
<td class="Actions">
|
||||||
|
<div class="right">
|
||||||
|
@* Burger menu *@
|
||||||
|
<ul class="nav navbar-nav navbar-light navbar-right sax-burger">
|
||||||
|
<li class="dropdown-toggle caret-off">
|
||||||
|
<a href="#" class="dropdown" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="sax-ellipsis-dot"></span><span class="sax-ellipsis-dot"></span><span class="sax-ellipsis-dot"></span></a>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-right sax-dropdown-menu">@* Menu items will be inserted here. *@</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="fixed sax-actions">
|
</td>
|
||||||
</div>
|
</tr>
|
||||||
</div>
|
</table>
|
||||||
<div class="sax-content">
|
|
||||||
<div class="row">
|
@* Item burger dropdown template - ul is ignored *@
|
||||||
<div class="col-sm-6">@Localiser["label.rows"]: <span class="RowCount"></span></div>
|
<ul class="sax-dropdown-menu DatabaseTable">
|
||||||
<div class="col-sm-6 text-right">@Localiser["label.columns"]: <span class="ColumnCount"></span></div>
|
<li class="sax-dropdown-item sax-action"><div class="sax-label">XXX</div></li>
|
||||||
</div>
|
</ul>
|
||||||
<div class="row">
|
|
||||||
<div class="col-sm-6"></div>
|
|
||||||
<div class="col-sm-6 text-right">@Localiser["label.indices"]: <span class="IndexCount"></span></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmDbTableName", @onSubmit = "return false;" }))
|
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmDbTableName", @onSubmit = "return false;" }))
|
||||||
{
|
{
|
||||||
@Html.HiddenFor(model => model.DatabaseTable.Instance, new { @class = "DatabaseTableInstance" })
|
@Html.HiddenFor(model => model.DatabaseTable.Instance, new { @class = "DatabaseTableInstance" })
|
||||||
@@ -76,7 +111,7 @@
|
|||||||
@Html.HiddenFor(model => model.DatabaseTable.Instance, new { @class = "DatabaseTableInstance" })
|
@Html.HiddenFor(model => model.DatabaseTable.Instance, new { @class = "DatabaseTableInstance" })
|
||||||
@Html.HiddenFor(model => model.DatabaseTable.Name, new { @class = "DatabaseTableName" })
|
@Html.HiddenFor(model => model.DatabaseTable.Name, new { @class = "DatabaseTableName" })
|
||||||
}
|
}
|
||||||
<table>
|
<table class="fullwidth">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="right pt2 pr8">Properties:</td>
|
<td class="right pt2 pr8">Properties:</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -87,11 +122,11 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="right pt2 pr8">Columns:</td>
|
<td class="right pt2 pr8">Columns:</td>
|
||||||
<td>
|
<td>
|
||||||
<table class="sax-striped TableColumns">
|
<table class="sax-striped TableColumns fullwidth">
|
||||||
<tr class="sax-heading">
|
<tr class="sax-heading">
|
||||||
<td class="right pl8 pr8">Pos</td>
|
<td class="width10pc right pl8 pr8">Pos</td>
|
||||||
<td class="pl8 pr8">Name</td>
|
<td class="width50pc pl8 pr8">Name</td>
|
||||||
<td class="center">Format</td>
|
<td class="width50pc center">Format</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
@@ -99,11 +134,11 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="right pt2 pr8">Indices:</td>
|
<td class="right pt2 pr8">Indices:</td>
|
||||||
<td>
|
<td>
|
||||||
<table class="sax-striped TableIndices">
|
<table class="sax-striped TableIndices fullwidth">
|
||||||
<tr class="sax-heading">
|
<tr class="sax-heading">
|
||||||
<td class="pl8 pr8">Name</td>
|
<td class="width50pc pl8 pr8">Name</td>
|
||||||
<td class="center pl8 pr8">Unique</td>
|
<td class="width20pc center pl8 pr8">Unique</td>
|
||||||
<td class="pl8 pr8">Columns</td>
|
<td class="width20pc pl8 pr8">Columns</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -40,18 +40,26 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="container-fluid LogFiles">
|
<div class="sax-panel LogFiles">
|
||||||
|
|
||||||
<div class="sax-panel-filter">
|
<div class="sax-panel-data sax-flex">
|
||||||
<div class="sax-header row">
|
|
||||||
<div class="col"><div class="sax-caption">@Localiser["system.caption.logs"]</div></div>
|
@* Filter form - wrap header to include paging controls. *@
|
||||||
<div class="fixed row">
|
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmLogsFilter", @class = "sax-form", @onSubmit = "return false;" }))
|
||||||
<div class="sax-action sax-results-refresh"><img src="~/img/action/refresh24.png" alt="@(Localiser["label.refresh"])" title="@(Localiser["label.refresh"])" /></div>
|
{
|
||||||
|
|
||||||
|
@* Header - Page caption, paging controls, actions. *@
|
||||||
|
<div class="sax-panel-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col"><div class="sax-panel-caption">@Localiser["system.caption.logs"]</div></div>
|
||||||
|
<div class="fixed row">
|
||||||
|
<div class="sax-action sax-results-refresh"><img src="~/img/action/refresh24.png" alt="@(Localiser["label.refresh"])" title="@(Localiser["label.refresh"])" /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="sax-content">
|
@* Filter Panel *@
|
||||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmLogsFilter", @class = "sax-form", @onSubmit = "return false;" }))
|
<div class="sax-panel-filter">
|
||||||
{
|
|
||||||
<input type="hidden" name="LogsFilter.Filename" class="FilterLogFilename" />
|
<input type="hidden" name="LogsFilter.Filename" class="FilterLogFilename" />
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12 row">
|
<div class="col-sm-12 row">
|
||||||
@@ -71,14 +79,12 @@
|
|||||||
<div class="col-sm-8 col-md-7"><div style="max-width:200px;"><select id="cbFilterLogMonth" name="LogsFilter.Month" class="FilterLogMonth"></select></div></div>
|
<div class="col-sm-8 col-md-7"><div style="max-width:200px;"><select id="cbFilterLogMonth" name="LogsFilter.Month" class="FilterLogMonth"></select></div></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
}
|
||||||
|
|
||||||
<div class="sax-panel-results">
|
|
||||||
<div class="sax-panel-messages"></div>
|
|
||||||
@* Log file list. *@
|
@* Log file list. *@
|
||||||
<div class="sax-panel-info" style="min-height:120px;max-height:100%;overflow-y:auto;">
|
<div class="sax-panel-item-table sax-flex">
|
||||||
<table class="sax-item-list">
|
<table class="sax-item-list">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -86,10 +92,12 @@
|
|||||||
<th class="center">@Localiser["label.updated"]</th>
|
<th class="center">@Localiser["label.updated"]</th>
|
||||||
<th class="center">@Localiser["label.size"]</th>
|
<th class="center">@Localiser["label.size"]</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr><td colspan="6"><div class="sax-panel-messages"></div></td></tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody></tbody>
|
<tbody></tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* Log file template. *@
|
@* Log file template. *@
|
||||||
<table class="sax-panel-item-template">
|
<table class="sax-panel-item-template">
|
||||||
<tr class="sax-panel-item LogFile pointer">
|
<tr class="sax-panel-item LogFile pointer">
|
||||||
@@ -98,13 +106,14 @@
|
|||||||
<td><div class="Size center"></div></td>
|
<td><div class="Size center"></div></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="dlgLogFile" class="sax-dialog">
|
<div id="dlgLogFile" class="sax-dialog">
|
||||||
<form>
|
<form>
|
||||||
<input type="hidden" class="LogFilename" />
|
<input type="hidden" class="LogFilename" />
|
||||||
</form>
|
</form>
|
||||||
<div class="sax-data FileData"></div>
|
<div class="sax-data FileData"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,6 +2,25 @@
|
|||||||
Admin - Base stylesheet.
|
Admin - Base stylesheet.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
:root
|
||||||
|
{
|
||||||
|
--color-OldGold: #d4af37;
|
||||||
|
--color-MintGreen: #98fb98;
|
||||||
|
--color-LimeGreen: #32cd32;
|
||||||
|
--color-KellyGreen: #4cbb17;
|
||||||
|
--color-OliveGreen: #808000;
|
||||||
|
--color-ForestGreen: #228b22;
|
||||||
|
--color-CornflowerBlue: #6495ed;
|
||||||
|
--color-RoyalBlue: #4169e1;
|
||||||
|
--color-NavyBlue: #000080;
|
||||||
|
--color-DarkBlue: #00008B;
|
||||||
|
--color-Indigo: #4b0082;
|
||||||
|
--color-Iris: #5d3fd3;
|
||||||
|
--color-Burgundy: #800020;
|
||||||
|
--color-BrightPurple: #bf40bf;
|
||||||
|
--color-DarkPink: #aa336a;
|
||||||
|
}
|
||||||
|
|
||||||
body
|
body
|
||||||
{
|
{
|
||||||
margin: 0;
|
margin: 0;
|
||||||
@@ -109,12 +128,12 @@ table.sax-striped
|
|||||||
|
|
||||||
table.sax-striped tr.sax-odd
|
table.sax-striped tr.sax-odd
|
||||||
{
|
{
|
||||||
background-color:#fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.sax-striped tr.sax-even
|
table.sax-striped tr.sax-even
|
||||||
{
|
{
|
||||||
background-color:#f8f8f8;
|
background-color: #f8f8f8;
|
||||||
}
|
}
|
||||||
|
|
||||||
th, td
|
th, td
|
||||||
@@ -215,6 +234,31 @@ td.action
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.width5pc
|
||||||
|
{
|
||||||
|
width: 5%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.width10pc
|
||||||
|
{
|
||||||
|
width: 10%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.width20pc
|
||||||
|
{
|
||||||
|
width: 20%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.width25pc
|
||||||
|
{
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.width50pc
|
||||||
|
{
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
.fullwidth
|
.fullwidth
|
||||||
{
|
{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -2,85 +2,112 @@
|
|||||||
Admin - Data stylesheet.
|
Admin - Data stylesheet.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Filter panel */
|
/* Data panel */
|
||||||
|
|
||||||
.sax-panel-filter
|
:root
|
||||||
|
{
|
||||||
|
/* Data panels */
|
||||||
|
--color-panel-data: var(--color-Iris);
|
||||||
|
--color-panel-data-background: var(--color-Iris);
|
||||||
|
--color-panel-data-border: var(--color-Iris);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sax-panel-data
|
||||||
{
|
{
|
||||||
margin: 6px auto;
|
margin: 6px auto;
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
border: solid 1px #979797;
|
border: solid 1px var(--color-panel-data-border);
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 576px)
|
.sax-layout-flex .sax-panel-data.sax-flex
|
||||||
{
|
{
|
||||||
.sax-panel-filter
|
height: 100%;
|
||||||
{
|
display: flex;
|
||||||
}
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sax-panel-filter .sax-header
|
/* Data panel - Header */
|
||||||
|
|
||||||
|
.sax-panel-data .sax-panel-header
|
||||||
{
|
{
|
||||||
padding: 1px 8px 2px 8px;
|
padding: 1px 8px 2px 8px;
|
||||||
min-height: 24px;
|
min-height: 24px;
|
||||||
color: #f0f0f0;
|
color: #f0f0f0;
|
||||||
background-color: #979797;
|
background-color: var(--color-panel-data-background);
|
||||||
border-bottom: solid 1px #979797;
|
border-bottom: solid 1px var(--color-panel-data-border);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sax-panel-filter .sax-header .sax-caption
|
.sax-panel-data .sax-panel-header .sax-panel-caption
|
||||||
{
|
{
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sax-panel-filter ul.nav.sax-burger
|
/* Data panel - Actions */
|
||||||
|
|
||||||
|
.sax-panel-data ul.nav.sax-burger
|
||||||
{
|
{
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sax-panel-filter .sax-header .sax-action
|
.sax-panel-data .sax-panel-header .sax-action
|
||||||
{
|
{
|
||||||
margin: 2px 0 0 8px;
|
margin: 2px 0 0 8px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sax-panel-filter .sax-header .sax-action:hover
|
.sax-panel-data .sax-panel-header .sax-action:hover
|
||||||
{
|
{
|
||||||
background-color: #b0b0b0;
|
background-color: #b0b0b0;
|
||||||
box-shadow: 0 0 4px 2px #80808080;
|
box-shadow: 0 0 4px 2px #80808080;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sax-panel-filter .sax-content
|
/* Data panel - Filter */
|
||||||
|
|
||||||
|
.sax-panel-data .sax-panel-filter
|
||||||
|
{
|
||||||
|
padding: 6px 8px;
|
||||||
|
border-bottom: solid 1px var(--color-panel-data-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.sax-panel-data .sax-panel-filter .sax-label
|
||||||
|
{
|
||||||
|
padding: 2px 8px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Data panel - Content */
|
||||||
|
|
||||||
|
.sax-panel-data .sax-panel-content
|
||||||
{
|
{
|
||||||
margin: 4px 4px;
|
margin: 4px 4px;
|
||||||
padding: 4px 4px;
|
padding: 4px 4px;
|
||||||
background-color: #f8f8f8;
|
background-color: #f8f8f8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sax-panel-filter .sax-content .sax-label
|
.sax-panel-data .sax-panel-content .sax-label
|
||||||
{
|
{
|
||||||
padding-top: 6px;
|
padding-top: 6px;
|
||||||
padding-right: 12px;
|
padding-right: 12px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sax-panel-filter .sax-content .sax-value
|
.sax-panel-data .sax-panel-content .sax-value
|
||||||
{
|
{
|
||||||
padding-top: 2px;
|
padding-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sax-panel-filter .sax-content input[type="text"],
|
.sax-panel-data .sax-panel-content input[type="text"],
|
||||||
.sax-panel-filter .sax-content select
|
.sax-panel-data .sax-panel-content select
|
||||||
{
|
{
|
||||||
min-width: 75%;
|
min-width: 75%;
|
||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sax-panel-filter .sax-content .sax-button
|
.sax-panel-data .sax-panel-content .sax-button
|
||||||
{
|
{
|
||||||
min-width: auto;
|
min-width: auto;
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
|
|||||||
@@ -37,7 +37,39 @@ body
|
|||||||
font-family: Arial, Verdana, Helvetica, Lucida, sans-serif;
|
font-family: Arial, Verdana, Helvetica, Lucida, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
body > .container
|
@media screen and (max-height: 399px)
|
||||||
|
{
|
||||||
|
#sax-page-body
|
||||||
|
{
|
||||||
|
min-height: 240px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (min-height: 400px)
|
||||||
|
{
|
||||||
|
html
|
||||||
|
{
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.sax-layout-flex
|
||||||
|
{
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.sax-layout-flex #sax-page-body
|
||||||
|
{
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Responsive */
|
||||||
|
|
||||||
|
body > .container, header > .container, footer > .container
|
||||||
{
|
{
|
||||||
padding: 0 0.5%;
|
padding: 0 0.5%;
|
||||||
}
|
}
|
||||||
@@ -66,41 +98,27 @@ body > .container
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sticky footer styles */
|
|
||||||
|
|
||||||
html
|
|
||||||
{
|
|
||||||
position: relative;
|
|
||||||
min-height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
body
|
|
||||||
{
|
|
||||||
/* Margin bottom by footer height */
|
|
||||||
margin-bottom: 40px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer
|
|
||||||
{
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
padding: 0 2%;
|
|
||||||
white-space: nowrap;
|
|
||||||
/* Set the fixed height of the footer here */
|
|
||||||
height: 40px;
|
|
||||||
line-height: 38px; /* Vertically center the text there */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Header */
|
/* Header */
|
||||||
|
|
||||||
|
#sax-page-header
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
a.navbar-brand
|
a.navbar-brand
|
||||||
{
|
{
|
||||||
|
padding-top: 0.3rem;
|
||||||
|
padding-bottom: 0.1rem;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar li.nav-item a.nav-link
|
||||||
|
{
|
||||||
|
padding-top: 0.3rem;
|
||||||
|
padding-bottom: 0.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
.border-top
|
.border-top
|
||||||
{
|
{
|
||||||
border-top: 1px solid #e5e5e5;
|
border-top: 1px solid #e5e5e5;
|
||||||
@@ -122,14 +140,6 @@ button.accept-policy
|
|||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Footer */
|
|
||||||
|
|
||||||
#sax-page-footer div,
|
|
||||||
#sax-page-footer a
|
|
||||||
{
|
|
||||||
font-size: 0.75rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Information */
|
/* Information */
|
||||||
|
|
||||||
.sax-para
|
.sax-para
|
||||||
@@ -137,6 +147,18 @@ button.accept-policy
|
|||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Sticky footer styles */
|
||||||
|
|
||||||
|
#sax-page-footer
|
||||||
|
{
|
||||||
|
padding: 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sax-page-footer, #sax-page-footer div
|
||||||
|
{
|
||||||
|
font-size: .75rem;
|
||||||
|
}
|
||||||
|
|
||||||
/* Page caption */
|
/* Page caption */
|
||||||
.sax-page-caption
|
.sax-page-caption
|
||||||
{
|
{
|
||||||
@@ -394,8 +416,8 @@ a:focus
|
|||||||
.ui-dialog .ui-dialog-buttonpane button:disabled
|
.ui-dialog .ui-dialog-buttonpane button:disabled
|
||||||
{
|
{
|
||||||
color: #e0e0e0;
|
color: #e0e0e0;
|
||||||
background-color:#d5be70;
|
background-color: #d5be70;
|
||||||
border-color:#d5be70;
|
border-color: #d5be70;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ui-widget-overlay
|
.ui-widget-overlay
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
if (file.filename) return filename.split('.').pop();
|
if (file.filename) return filename.split('.').pop();
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
sax.formatFileSize = function (size, decimals=0)
|
sax.formatFileSize = function (size, decimals = 0)
|
||||||
{
|
{
|
||||||
if (size / 10 ** 9 > 1) return (size / 10.0 ** 9).toFixed(decimals) + ' Gb';
|
if (size / 10 ** 9 > 1) return (size / 10.0 ** 9).toFixed(decimals) + ' Gb';
|
||||||
if (size / 10 ** 6 > 1) return (size / 10.0 ** 6).toFixed(decimals) + ' Mb';
|
if (size / 10 ** 6 > 1) return (size / 10.0 ** 6).toFixed(decimals) + ' Mb';
|
||||||
@@ -137,16 +137,14 @@
|
|||||||
{
|
{
|
||||||
$(sel).datepicker().on('keyup', function (e)
|
$(sel).datepicker().on('keyup', function (e)
|
||||||
{
|
{
|
||||||
if (e.keyCode == 8 || e.keyCode == 46)
|
if (e.key == 'Backspace' || e.key == 'Delete')
|
||||||
{
|
$(this).datepicker('setDate', null).datepicker('hide').trigger('change');
|
||||||
$(this).datepicker('setDate', null).datepicker('hide').change();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
sax.refreshPaging = function (response, context, refreshFn)
|
sax.refreshPaging = function (response, context, refreshFn)
|
||||||
{
|
{
|
||||||
if (sax.resultsPaging.fn.refreshPaging)
|
if (((sax.mdl.resultsPaging || {}).fn || {}).refreshPaging)
|
||||||
sax.resultsPaging.fn.refreshPaging(response.paging, context, refreshFn);
|
sax.mdl.resultsPaging.fn.refreshPaging(response.paging, context, refreshFn);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
@@ -154,7 +152,7 @@
|
|||||||
sax.navigateTo = function (action)
|
sax.navigateTo = function (action)
|
||||||
{
|
{
|
||||||
sax.doPleaseWait();
|
sax.doPleaseWait();
|
||||||
$('#frmNavigate').prop('action', sax.url.base + action).submit();
|
$('#frmNavigate').prop('action', sax.url.base + action).trigger('submit');
|
||||||
}
|
}
|
||||||
sax.goToPage = function (action)
|
sax.goToPage = function (action)
|
||||||
{
|
{
|
||||||
@@ -224,7 +222,7 @@
|
|||||||
opt.buttons[sax.dlg.btn.ok] = function () { $(this).dialog('close'); if (onOk) onOk(); };
|
opt.buttons[sax.dlg.btn.ok] = function () { $(this).dialog('close'); if (onOk) onOk(); };
|
||||||
sax.$dlg.alert = $('<div id="dlgAlert"><div id="dlgAlertMsg"></div></div>').dialog(opt);
|
sax.$dlg.alert = $('<div id="dlgAlert"><div id="dlgAlertMsg"></div></div>').dialog(opt);
|
||||||
}
|
}
|
||||||
$('#dlgAlertMsg', sax.$dlg.alert).html(msg.replace("\n", "<br>"));
|
$('#dlgAlertMsg', sax.$dlg.alert).html(msg.replace(/\\n/g, '<br>'));
|
||||||
sax.$dlg.alert.dialog('option', { title: title || sax.dlg.title.alert });
|
sax.$dlg.alert.dialog('option', { title: title || sax.dlg.title.alert });
|
||||||
sax.openDialog(sax.$dlg.alert);
|
sax.openDialog(sax.$dlg.alert);
|
||||||
}
|
}
|
||||||
@@ -244,7 +242,7 @@
|
|||||||
buttons[sax.dlg.btn.yes] = function () { $(this).dialog('close'); if (onOk) onOk(); };
|
buttons[sax.dlg.btn.yes] = function () { $(this).dialog('close'); if (onOk) onOk(); };
|
||||||
buttons[sax.dlg.btn.no] = function () { $(this).dialog('close'); if (onCancel) onCancel(); };
|
buttons[sax.dlg.btn.no] = function () { $(this).dialog('close'); if (onCancel) onCancel(); };
|
||||||
sax.$dlg.confirm.dialog('option', { title: title || sax.dlg.title.confirm, 'buttons': buttons });
|
sax.$dlg.confirm.dialog('option', { title: title || sax.dlg.title.confirm, 'buttons': buttons });
|
||||||
$('#dlgConfirmMsg').html(msg);
|
$('#dlgConfirmMsg').html(msg.replace(/\\n/g, '<br>'));
|
||||||
sax.openDialog(sax.$dlg.confirm);
|
sax.openDialog(sax.$dlg.confirm);
|
||||||
}
|
}
|
||||||
sax.doProgress = function (title, msg, delay)
|
sax.doProgress = function (title, msg, delay)
|
||||||
@@ -262,7 +260,7 @@
|
|||||||
opt.hide = { effect: 'fade', duration: 200 };
|
opt.hide = { effect: 'fade', duration: 200 };
|
||||||
sax.$dlg.progress = $('<div id="dlgProgress"><div id="dlgProgressMsg"></div></div>').dialog(opt);
|
sax.$dlg.progress = $('<div id="dlgProgress"><div id="dlgProgressMsg"></div></div>').dialog(opt);
|
||||||
}
|
}
|
||||||
$('#dlgProgressMsg').html(msg);
|
$('#dlgProgressMsg').html(msg.replace(/\\n/g, '<br>'));
|
||||||
sax.$dlg.progress.dialog('option', { title: title || sax.dlg.title.progress });
|
sax.$dlg.progress.dialog('option', { title: title || sax.dlg.title.progress });
|
||||||
if (delay > 0) sax.toShowProgress = setTimeout(function () { sax.$dlg.progress.dialog('open'); }, delay);
|
if (delay > 0) sax.toShowProgress = setTimeout(function () { sax.$dlg.progress.dialog('open'); }, delay);
|
||||||
else sax.$dlg.progress.dialog('open');
|
else sax.$dlg.progress.dialog('open');
|
||||||
@@ -328,7 +326,7 @@
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
cache: false,
|
cache: false,
|
||||||
//enctype: 'multipart/form-data',
|
//enctype: 'multipart/form-data',
|
||||||
data: ajax.formData || $("#" + ajax.formId).serialize(),
|
data: ajax.formData || $(ajax.formSel || "#" + ajax.formId).serialize(),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (response, status, jqXHR)
|
success: function (response, status, jqXHR)
|
||||||
{
|
{
|
||||||
@@ -507,22 +505,30 @@
|
|||||||
sax.onWinResizePage = function () { };
|
sax.onWinResizePage = function () { };
|
||||||
sax.onWinResize = function ()
|
sax.onWinResize = function ()
|
||||||
{
|
{
|
||||||
var winH = $(win).height();
|
$('body').toggleClass('sax-layout-flex', !sax.isAutoHeight()).toggleClass('sax-layout-flow', sax.isAutoHeight());
|
||||||
var $pageBody = $('#sax-body');
|
|
||||||
var $hdr = $('#sax-header');
|
|
||||||
var $ftr = $('#sax-footer');
|
|
||||||
if (sax.isAutoHeight())
|
|
||||||
$pageBody.height('auto');
|
|
||||||
else
|
|
||||||
$pageBody.innerHeight(Math.min(1200, winH - $hdr.outerHeight() - $ftr.outerHeight(true)));
|
|
||||||
$ftr.css('visibility', 'visible');
|
|
||||||
sax.onWinResizePage();
|
sax.onWinResizePage();
|
||||||
}
|
}
|
||||||
|
setTimeout(sax.onWinResize, 50);
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
$(function ()
|
$(function ()
|
||||||
{
|
{
|
||||||
|
$(win).on('resize', function () { sax.onWinResize(); });
|
||||||
|
|
||||||
$('.sax-button-cta,.sax-button-action,.sax-action-link,.sax-social-icon.sax-action').prop('tabindex', 0);
|
$('.sax-button-cta,.sax-button-action,.sax-action-link,.sax-social-icon.sax-action').prop('tabindex', 0);
|
||||||
|
|
||||||
|
$.fn.visible = function () { return this.css('visibility', 'visible'); };
|
||||||
|
$.fn.invisible = function () { return this.css('visibility', 'hidden'); };
|
||||||
|
$.fn.toggleVisibility = function ()
|
||||||
|
{
|
||||||
|
return this.css('visibility', function (i, visibility) { return (visibility == 'visible') ? 'hidden' : 'visible'; });
|
||||||
|
};
|
||||||
|
|
||||||
|
$.fn.removeStatusClasses = function ()
|
||||||
|
{
|
||||||
|
return this.removeClass(function (idx, name) { return (name.match(/(^|\s)sax-status-\S+/g) || []).join(' '); });
|
||||||
|
};
|
||||||
|
|
||||||
if (sax.kli.active)
|
if (sax.kli.active)
|
||||||
sax.configureKeepLoggedIn();
|
sax.configureKeepLoggedIn();
|
||||||
else if (!sax.awaitingLogin)
|
else if (!sax.awaitingLogin)
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
$(function ()
|
$(function ()
|
||||||
{
|
{
|
||||||
$(':input:enabled:visible:first').focus();
|
$(':input:enabled:visible:first').trigger('focus');
|
||||||
$('#ifEmailAddress,#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm').on('input', function () { sax.clearControlError(this); });
|
$('#ifEmailAddress,#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm').on('input', function () { sax.clearControlError(this); });
|
||||||
sax.$frm.signIn = $('#frmSignIn');
|
sax.$frm.signIn = $('#frmSignIn');
|
||||||
sax.$frm.signIn.on('keypress', '#ifEmailAddress,#ifPassword,#chkKeepMeSignedIn', function (e) { if (e.which == 13 && $('#ifEmailAddress', sax.$frm.signIn).val() && $('#ifPassword', sax.$frm.signIn).val()) sax.doSignin(); });
|
sax.$frm.signIn.on('keypress', '#ifEmailAddress,#ifPassword,#chkKeepMeSignedIn', function (e) { if (e.which == 13 && $('#ifEmailAddress', sax.$frm.signIn).val() && $('#ifPassword', sax.$frm.signIn).val()) sax.doSignin(); });
|
||||||
|
|||||||
@@ -204,7 +204,7 @@
|
|||||||
$('.sax-panel-item-list', $pnl.results).prepend($item).show();
|
$('.sax-panel-item-list', $pnl.results).prepend($item).show();
|
||||||
}
|
}
|
||||||
sm.populateItem($item, item);
|
sm.populateItem($item, item);
|
||||||
// Force repopulation of sprts.
|
// Force repopulation of sports.
|
||||||
delete sm.data.sports;
|
delete sm.data.sports;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,93 +5,137 @@
|
|||||||
(function (win, doc, undef)
|
(function (win, doc, undef)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
let sd = sax.sysDb = { $pnl: {}, $frm: {}, $dlg: {} };
|
let sd = sax.sysDb = { env: {} };
|
||||||
let $pnl = sd.$pnl; let $frm = sd.$frm; let $dlg = sd.$dlg;
|
|
||||||
sax.itemIdPrefix = 'Itm_';
|
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
sd.refreshResults = function (delay)
|
sd.refreshResults = function (env, delay)
|
||||||
{
|
{
|
||||||
if (!sax.awaitingRefreshResponse)
|
sax.debug('refreshResults', env);
|
||||||
|
if (!env.data.awaitingRefreshResponse)
|
||||||
{
|
{
|
||||||
var $items = $('.sax-panel-item-list', $pnl.results).fadeOut(200).empty();
|
env.$pnl.bgr.invisible();
|
||||||
var $msgs = $('.sax-panel-messages', $pnl.results).hide().empty().append($('<div class="sax-message">' + sax.msg.dataQuerying + '</div>')).fadeIn(200);
|
env.$pnl.table.find('tbody tr').remove();
|
||||||
|
env.$pnl.msgs.hide().empty().append($('<div class="sax-message">' + sax.msg.dataQuerying + '</div>')).fadeIn(200);
|
||||||
}
|
}
|
||||||
sax.ajax.refreshResults = sax.ajax.refreshResults || { url: sax.url.base + 'System/Ajax/GetDatabaseTables', formId: 'frmDbTableFilter', callbackFn: sd.doRefreshResults };
|
env.ajax.refreshResults = env.ajax.refreshResults || { url: sax.url.base + 'System/Ajax/GetDatabaseTables', formSel: env.$frm.filter, callbackFn: function (response) { sd.doRefreshResults(env, response); } };
|
||||||
sax.doAjaxRequest(sax.ajax.refreshResults, delay || 50);
|
sax.doAjaxRequest(env.ajax.refreshResults, delay || 50);
|
||||||
sax.awaitingRefreshResponse = true;
|
env.data.awaitingRefreshResponse = true;
|
||||||
}
|
}
|
||||||
sd.doRefreshResults = function (response)
|
sd.doRefreshResults = function (env, response)
|
||||||
{
|
{
|
||||||
//sax.debug('doRefreshResults', response);
|
//sax.debug('doRefreshResults', env, response);
|
||||||
delete sax.awaitingRefreshResponse;
|
delete env.data.awaitingRefreshResponse;
|
||||||
sax.refreshControlValues(response.controlValues);
|
env.$pnl.msgs.hide().empty();
|
||||||
var $msgs = $('.sax-panel-messages', $pnl.results).hide().empty();
|
let $table = $('table', env.$pnl.table).find('tbody tr').remove().end();
|
||||||
var $items = $('.sax-panel-item-list', $pnl.results).hide().empty();
|
sax.refreshPaging(response, env.$frm.filter, function () { sd.refreshResults(env); });
|
||||||
if (!response.success) return;
|
if (!response.success) return;
|
||||||
|
// Menu.
|
||||||
|
if (env.$pnl.bgr.length)
|
||||||
|
{
|
||||||
|
env.$pnl.bgr.invisible();
|
||||||
|
env.$pnl.mnu.empty();
|
||||||
|
env.$pnl.mnu.append(sd.getFilterMenuOption(env, sax.lbl.refresh, function () { sd.refreshResults(env); }, 'sax-refresh'));
|
||||||
|
env.$pnl.bgr.toggleVisibility(!!$('.sax-dropdown-item', env.$pnl.mnu).length);
|
||||||
|
}
|
||||||
// Items.
|
// Items.
|
||||||
var items = response.tables;
|
var items = response.tables;
|
||||||
if (!items.length)
|
if (!items.length)
|
||||||
return $msgs.append($('<div class="sax-message">' + sax.msg.dataNoneFound + '</div>')).fadeIn(500);
|
return env.$pnl.msgs.append($('<div class="sax-message">' + sax.msg.dataNoneFound + '</div>')).fadeIn(500);
|
||||||
for (let itemIdx = 0; itemIdx < items.length; itemIdx++)
|
for (const item of items)
|
||||||
$items.append(sd.populateItem(sd.getTableTemplate(), items[itemIdx]));
|
$table.append(sd.populateItem(env, sd.getItemTemplate(env), item));
|
||||||
$items.fadeIn(50);
|
|
||||||
}
|
}
|
||||||
sd.populateItem = function ($item, item)
|
sd.populateItem = function (env, $item, item)
|
||||||
{
|
{
|
||||||
if (!item) return $item;
|
if (!item) return $item;
|
||||||
$item.prop('id', sax.itemIdPrefix + item.id);
|
$item.prop('id', sd.getItemId(item));
|
||||||
$('.TableName', $item).text(item.qualifiedName);
|
$('.TableName', $item).text(item.qualifiedName);
|
||||||
$('.RowCount', $item).text(item.rowCount);
|
$('.RowCount', $item).text(item.rowCount);
|
||||||
$('.ColumnCount', $item).text(item.columnCount);
|
$('.ColumnCount', $item).text(item.columnCount);
|
||||||
$('.IndexCount', $item).text(item.indexCount);
|
$('.IndexCount', $item).text(item.indexCount);
|
||||||
$('.sax-caption .sax-action, .sax-actions .sax-action.sax-item-view', $item).off('click').on('click', function () { sd.viewItem(item) })
|
// Actions.
|
||||||
$item.off('dblclick').on('dblclick', function () { sax.viewItem(item) })
|
var $bgr = $('.sax-burger', $item).hide();
|
||||||
$('.sax-panel-results .sax-panel-messages').hide().empty();
|
let $mnu = $('ul.sax-dropdown-menu', $bgr).empty();
|
||||||
|
if (!item.deleted)
|
||||||
|
{
|
||||||
|
let fnUpd = function () { sd.viewItem(env, item) };
|
||||||
|
$mnu.append(sd.getItemMenuOption(env, sax.lbl.edit, fnUpd, 'sax-edit'));
|
||||||
|
$('.TableName', $item).off('click').on('click', fnUpd).addClass('sax-action-text');
|
||||||
|
$item.off('dblclick').on('dblclick', fnUpd);
|
||||||
|
}
|
||||||
|
$bgr.toggle(!!$('.sax-dropdown-item', $mnu).length);
|
||||||
return $item;
|
return $item;
|
||||||
}
|
}
|
||||||
sd.getTableTemplate = function ()
|
sd.getItemId = function (item)
|
||||||
{
|
{
|
||||||
return $('.sax-panel-item-template .sax-panel-item.DatabaseTable', $pnl.results).clone();
|
return 'Tbl_' + (item || {}).id;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
sd.viewItem = function (item)
|
sd.getFilterDropdownTemplate = function (env)
|
||||||
{
|
{
|
||||||
//sax.debug('viewItem', item.tableName, $frm.tableName, $('.DatabaseTableName', $frm.tableName))
|
return $('.sax-dropdown-menu.DatabaseTables li.sax-dropdown-item', env.$pnl.tmpls).clone();
|
||||||
$('.DatabaseTableInstance', $frm.tableName).val($('.DatabaseFilterInstance', $frm.filter).val());
|
|
||||||
$('.DatabaseTableName', $frm.tableName).val(item.tableName);
|
|
||||||
sax.ajax.updateItem = sax.ajax.updateItem || { url: sax.url.base + 'System/Ajax/GetDatabaseTable', formId: 'frmDbTableName', callbackFn: sd.onViewItem };
|
|
||||||
sax.doAjaxRequest(sax.ajax.updateItem, 50);
|
|
||||||
}
|
}
|
||||||
sd.onViewItem = function (response)
|
sd.getItemTemplate = function (env)
|
||||||
{
|
{
|
||||||
//sax.debug('onViewItem', response);
|
return env.$pnl.tmpls.find('.sax-row-item.DatabaseTable').clone();
|
||||||
sd.clearItem();
|
}
|
||||||
|
sd.getItemDropdownTemplate = function (env)
|
||||||
|
{
|
||||||
|
return $('.sax-dropdown-menu.DatabaseTable li.sax-dropdown-item', env.$pnl.tmpls).clone();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
sd.getFilterMenuOption = function (env, lbl, fn, cls)
|
||||||
|
{
|
||||||
|
return sd.getMenuOption(sd.getFilterDropdownTemplate(env), lbl, fn, cls);
|
||||||
|
}
|
||||||
|
sd.getItemMenuOption = function (env, lbl, fn, cls)
|
||||||
|
{
|
||||||
|
return sd.getMenuOption(sd.getItemDropdownTemplate(env), lbl, fn, cls);
|
||||||
|
}
|
||||||
|
sd.getMenuOption = function ($opt, lbl, fn, cls)
|
||||||
|
{
|
||||||
|
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
sd.viewItem = function (env, item)
|
||||||
|
{
|
||||||
|
sax.debug('viewItem', env, item)
|
||||||
|
env.$frm.itemId.find('.DatabaseTableInstance').val($('.DatabaseFilterInstance', env.$frm.filter).val());
|
||||||
|
env.$frm.itemId.find('.DatabaseTableName').val(item.tableName);
|
||||||
|
env.ajax.updateItem = env.ajax.updateItem || {
|
||||||
|
url: sax.url.base + 'System/Ajax/GetDatabaseTable', formSel: env.$frm.itemId, callbackFn: function (response) { sd.onViewItem(env, response); } };
|
||||||
|
sax.doAjaxRequest(env.ajax.updateItem, 50);
|
||||||
|
}
|
||||||
|
sd.onViewItem = function (env, response)
|
||||||
|
{
|
||||||
|
sax.debug('onViewItem', env, response);
|
||||||
|
sd.clearItem(env);
|
||||||
if (!response.success) return;
|
if (!response.success) return;
|
||||||
let item = response.table;
|
let item = response.table;
|
||||||
let $frmT = $frm.table;
|
let $frmT = env.$frm.item;
|
||||||
$('.DatabaseTableName', $frmT).val(item.name);
|
$('.DatabaseTableName', $frmT).val(item.name);
|
||||||
// Properties.
|
// Properties.
|
||||||
let prts = item.properties;
|
let prts = item.properties;
|
||||||
let $prts = $('.TableProperties', $dlg.table);
|
let $prts = $('.TableProperties', env.$dlg.item);
|
||||||
$('tr:not(.sax-heading)', $prts).remove();
|
$('tr:not(.sax-heading)', $prts).remove();
|
||||||
for (let prtIdx = 0; prtIdx < prts.length; prtIdx++)
|
for (let prtIdx = 0; prtIdx < prts.length; prtIdx++)
|
||||||
{
|
{
|
||||||
let prt = prts[prtIdx];
|
let prt = prts[prtIdx];
|
||||||
let $prt = sd.getTablePropertyTemplate().addClass('sax-' + (prtIdx % 2 ? 'even' : 'odd'));
|
let $prt = sd.getTablePropertyTemplate(env).addClass('sax-' + (prtIdx % 2 ? 'even' : 'odd'));
|
||||||
$('.Label', $prt).text(prt.label);
|
$('.Label', $prt).text(prt.label);
|
||||||
$('.Value', $prt).text(prt.value);
|
$('.Value', $prt).text(prt.value);
|
||||||
$prts.append($prt);
|
$prts.append($prt);
|
||||||
}
|
}
|
||||||
// Columns.
|
// Columns.
|
||||||
let cols = item.columns;
|
let cols = item.columns;
|
||||||
let $cols = $('.TableColumns', $dlg.table);
|
let $cols = $('.TableColumns', env.$dlg.item);
|
||||||
$('tr:not(.sax-heading)', $cols).remove();
|
$('tr:not(.sax-heading)', $cols).remove();
|
||||||
for (let colIdx = 0; colIdx < cols.length; colIdx++)
|
for (let colIdx = 0; colIdx < cols.length; colIdx++)
|
||||||
{
|
{
|
||||||
let col = cols[colIdx];
|
let col = cols[colIdx];
|
||||||
let $col = sd.getTableColumnTemplate().addClass('sax-' + (colIdx % 2 ? 'even' : 'odd'));
|
let $col = sd.getTableColumnTemplate(env).addClass('sax-' + (colIdx % 2 ? 'even' : 'odd'));
|
||||||
$('.Pos', $col).text(col.pos);
|
$('.Pos', $col).text(col.pos);
|
||||||
$('.Name', $col).text(col.name);
|
$('.Name', $col).text(col.name);
|
||||||
$('.Format', $col).text(col.format);
|
$('.Format', $col).text(col.format);
|
||||||
@@ -99,12 +143,12 @@
|
|||||||
}
|
}
|
||||||
// Indices.
|
// Indices.
|
||||||
let idxs = item.indices;
|
let idxs = item.indices;
|
||||||
let $idxs = $('.TableIndices', $dlg.table);
|
let $idxs = $('.TableIndices', env.$dlg.item);
|
||||||
$('tr:not(.sax-heading)', $idxs).remove();
|
$('tr:not(.sax-heading)', $idxs).remove();
|
||||||
for (let idxIdx = 0; idxIdx < idxs.length; idxIdx++)
|
for (let idxIdx = 0; idxIdx < idxs.length; idxIdx++)
|
||||||
{
|
{
|
||||||
let idx = idxs[idxIdx];
|
let idx = idxs[idxIdx];
|
||||||
let $idx = sd.getTableIndexTemplate().addClass('sax-' + (idxIdx % 2 ? 'even' : 'odd'));
|
let $idx = sd.getTableIndexTemplate(env).addClass('sax-' + (idxIdx % 2 ? 'even' : 'odd'));
|
||||||
$('.Name', $idx).text(idx.name);
|
$('.Name', $idx).text(idx.name);
|
||||||
for (const col of idx.columns)
|
for (const col of idx.columns)
|
||||||
$('.Columns', $idx).append($('<div>').text(col.name));
|
$('.Columns', $idx).append($('<div>').text(col.name));
|
||||||
@@ -112,54 +156,61 @@
|
|||||||
$idxs.append($idx);
|
$idxs.append($idx);
|
||||||
}
|
}
|
||||||
// Display table details.
|
// Display table details.
|
||||||
$dlg.table.dialog('option', 'title', response.popupTitle || "Table: " + item.name);
|
env.$dlg.item.dialog('option', 'title', response.popupTitle || "Table: " + item.name);
|
||||||
sax.openDialog($dlg.table, 600, 600);
|
sax.openDialog(env.$dlg.item, 600, 600);
|
||||||
}
|
}
|
||||||
sd.clearItem = function ()
|
sd.clearItem = function (env)
|
||||||
{
|
{
|
||||||
let $frmT = $frm.table;
|
let $frmT = env.$frm.item;
|
||||||
$('input[type="text"],textarea,select', $frmT).val('');
|
$('input[type="text"],textarea,select', $frmT).val('');
|
||||||
sax.clearControlErrors();
|
sax.clearControlErrors();
|
||||||
}
|
}
|
||||||
sd.getTablePropertyTemplate = function ()
|
sd.getTablePropertyTemplate = function (env)
|
||||||
{
|
{
|
||||||
return sd.getTableRowTemplate('TableProperty');
|
return sd.getTableRowTemplate(env, 'TableProperty');
|
||||||
}
|
}
|
||||||
sd.getTableColumnTemplate = function ()
|
sd.getTableColumnTemplate = function (env)
|
||||||
{
|
{
|
||||||
return sd.getTableRowTemplate('TableColumn');
|
return sd.getTableRowTemplate(env, 'TableColumn');
|
||||||
}
|
}
|
||||||
sd.getTableIndexTemplate = function ()
|
sd.getTableIndexTemplate = function (env)
|
||||||
{
|
{
|
||||||
return sd.getTableRowTemplate('TableIndex');
|
return sd.getTableRowTemplate(env, 'TableIndex');
|
||||||
}
|
}
|
||||||
sd.getTableRowTemplate = function (name)
|
sd.getTableRowTemplate = function (env, name)
|
||||||
{
|
{
|
||||||
return $('.sax-panel-item-template .' + name, $dlg.table).clone();
|
return $('.sax-panel-item-template .' + name, env.$dlg.item).clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
$(function ()
|
$(function ()
|
||||||
{
|
{
|
||||||
$pnl.tables = $('.DatabaseTables');
|
let env = sd.env.maint = { data: {}, ajax: {}, $pnl: {}, $frm: {}, $ctrl: {}, $dlg: {} };
|
||||||
$pnl.filter = $('.sax-panel-filter', $pnl.tables);
|
|
||||||
$pnl.results = $('.sax-panel-results', $pnl.tables);
|
|
||||||
|
|
||||||
$pnl.filter.on('click', '.sax-action.sax-results-refresh', function () { sd.refreshResults(); });
|
env.$pnl.items = $('.DatabaseTables');
|
||||||
$('.sax-input').on('input', function () { sax.clearControlError(this); });
|
env.$pnl.header = env.$pnl.items.find('.sax-panel-header');
|
||||||
|
env.$pnl.bgr = env.$pnl.header.find('.sax-burger');
|
||||||
|
env.$pnl.mnu = env.$pnl.bgr.find('ul.sax-dropdown-menu');
|
||||||
|
env.$pnl.table = env.$pnl.items.find('.sax-panel-item-table');
|
||||||
|
env.$pnl.msgs = env.$pnl.table.find('.sax-panel-messages');
|
||||||
|
env.$pnl.tmpls = env.$pnl.items.find('.sax-panel-item-template');
|
||||||
|
|
||||||
$frm.filter = $('#frmDbTableFilter');
|
env.$pnl.header.on('click', '.sax-action.sax-results-refresh', function () { sd.refreshResults(env); });
|
||||||
$('.DatabaseFilterInstance', $frm.filter).on('change', function () { sd.refreshResults(250); });
|
|
||||||
$('.DatabaseFilterSearch', $frm.filter).on('input', function () { sd.refreshResults(250); });
|
env.$frm.filter = $('#frmDbTableFilter');
|
||||||
$frm.tableName = $('#frmDbTableName');
|
$('.DatabaseFilterInstance', env.$frm.filter).on('change', function () { sd.refreshResults(env, 250); });
|
||||||
$frm.table = $('#frmDbTable');
|
$('.DatabaseFilterSearch', env.$frm.filter).on('input', function () { sd.refreshResults(env, 250); });
|
||||||
|
|
||||||
|
env.$frm.itemId = $('#frmDbTableName');
|
||||||
|
env.$frm.item = $('#frmDbTable').on('input', '.sax-input, .sax-textarea', function () { sax.clearControlError(this); }).on('change', '.sax-select', function () { sax.clearControlError(this); });
|
||||||
|
|
||||||
var opt = sax.dlgOpts();
|
var opt = sax.dlgOpts();
|
||||||
|
opt.dialogClass += " sax-DatabaseTable";
|
||||||
//opt.buttons[sax.dlg.btn.ok] = function () { sax.storeItem(); };
|
//opt.buttons[sax.dlg.btn.ok] = function () { sax.storeItem(); };
|
||||||
opt.buttons[sax.dlg.btn.close] = function () { $(this).dialog('close'); };
|
opt.buttons[sax.dlg.btn.close] = function () { $(this).dialog('close'); };
|
||||||
$dlg.table = $('#dlgDbTable').dialog(opt);
|
env.$dlg.item = $('#dlgDbTable').dialog(opt);
|
||||||
|
|
||||||
setTimeout(sd.refreshResults, 250);
|
if (sd.env.maint.$pnl.items.length) setTimeout(function () { sd.refreshResults(sd.env.maint); }, 250);
|
||||||
});
|
});
|
||||||
|
|
||||||
}(window, window.document));
|
}(window, window.document));
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
sl.clearFiles = function ()
|
sl.clearFiles = function ()
|
||||||
{
|
{
|
||||||
$pnl.msgs.hide().empty();
|
$pnl.msgs.hide().empty();
|
||||||
$pnl.list.find('tbody tr').remove();
|
$pnl.table.find('tbody tr').remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
@@ -141,18 +141,17 @@
|
|||||||
{
|
{
|
||||||
//sax.debug('doRefreshFiles', response);
|
//sax.debug('doRefreshFiles', response);
|
||||||
delete sl.data.awaitingRefreshFilesResponse;
|
delete sl.data.awaitingRefreshFilesResponse;
|
||||||
sl.clearFiles();
|
|
||||||
sax.refreshControlValues(response.controlValues);
|
sax.refreshControlValues(response.controlValues);
|
||||||
|
sl.clearFiles();
|
||||||
|
let $table = $('table', $pnl.table);
|
||||||
if (!response.success) return;
|
if (!response.success) return;
|
||||||
sax.data.logMonth = $ctrl.cbMonths.val();
|
sax.data.logMonth = $ctrl.cbMonths.val();
|
||||||
// Files.
|
// Files.
|
||||||
var items = response.files;
|
var items = sl.data.files = response.files||[];
|
||||||
sl.data.files = response.files;
|
if (!items.length)
|
||||||
if (!(items || []).length)
|
|
||||||
return $pnl.msgs.append($('<div class="sax-message">' + sax.msg.dataNoneFound + '</div>')).fadeIn(500);
|
return $pnl.msgs.append($('<div class="sax-message">' + sax.msg.dataNoneFound + '</div>')).fadeIn(500);
|
||||||
for (let itemIdx = 0; itemIdx < items.length; itemIdx++)
|
for (const item of items)
|
||||||
$pnl.list.append(sl.populateItem(sl.getFileTemplate(), items[itemIdx]));
|
$table.append(sl.populateItem(sl.getFileTemplate(), item));
|
||||||
$pnl.list.fadeIn(50);
|
|
||||||
}
|
}
|
||||||
sl.populateItem = function ($item, item)
|
sl.populateItem = function ($item, item)
|
||||||
{
|
{
|
||||||
@@ -165,7 +164,7 @@
|
|||||||
}
|
}
|
||||||
sl.getFileTemplate = function ()
|
sl.getFileTemplate = function ()
|
||||||
{
|
{
|
||||||
return $('.sax-panel-item-template .sax-panel-item.LogFile', $pnl.results).clone();
|
return $pnl.tmpls.find('.sax-panel-item.LogFile').clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
@@ -261,16 +260,13 @@
|
|||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
$(function ()
|
$(function ()
|
||||||
{
|
{
|
||||||
$pnl.logFiles = $('.LogFiles');
|
$pnl.items = $('.LogFiles');
|
||||||
$pnl.filter = $('.sax-panel-filter', $pnl.logFiles);
|
$pnl.table = $pnl.items.find('.sax-panel-item-table');
|
||||||
$pnl.results = $('.sax-panel-results', $pnl.logFiles);
|
$pnl.msgs = $pnl.table.find('.sax-panel-messages');
|
||||||
$pnl.msgs = $('.sax-panel-messages', $pnl.results)
|
$pnl.tmpls = $pnl.items.find('.sax-panel-item-template');
|
||||||
$pnl.list = $('table.sax-item-list', $pnl.results)
|
|
||||||
|
|
||||||
$pnl.filter.on('click', '.sax-action.sax-results-refresh', function () { sl.refreshFiles(); });
|
|
||||||
$('.sax-input').on('input', function () { sax.clearControlError(this); });
|
|
||||||
|
|
||||||
$frm.filter = $('#frmLogsFilter');
|
$frm.filter = $('#frmLogsFilter');
|
||||||
|
$frm.filter.on('click', '.sax-action.sax-results-refresh', function () { sl.refreshFiles(); });
|
||||||
$ctrl.cbFolders = $('#cbFilterLogFolder', $frm.filter).on('change', function () { sl.refreshYears(250); });
|
$ctrl.cbFolders = $('#cbFilterLogFolder', $frm.filter).on('change', function () { sl.refreshYears(250); });
|
||||||
$ctrl.cbYears = $('#cbFilterLogYear', $frm.filter).on('change', function () { sl.refreshMonths(250); });
|
$ctrl.cbYears = $('#cbFilterLogYear', $frm.filter).on('change', function () { sl.refreshMonths(250); });
|
||||||
$ctrl.cbMonths = $('#cbFilterLogMonth', $frm.filter).on('change', function () { sl.refreshFiles(250); });
|
$ctrl.cbMonths = $('#cbFilterLogMonth', $frm.filter).on('change', function () { sl.refreshFiles(250); });
|
||||||
|
|||||||
@@ -821,6 +821,9 @@ You will then be able to publicise your sporting activities.</value>
|
|||||||
<data name="msg.validation.maximum.length" xml:space="preserve">
|
<data name="msg.validation.maximum.length" xml:space="preserve">
|
||||||
<value>Value must not exceed {0} characters</value>
|
<value>Value must not exceed {0} characters</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="msg.warn.password.invalid" xml:space="preserve">
|
||||||
|
<value>Password must be a minimum of {0} characters with upper and lower case letters, at least one number and special character unless at least {1} characters long.</value>
|
||||||
|
</data>
|
||||||
<data name="organisation.caption.event" xml:space="preserve">
|
<data name="organisation.caption.event" xml:space="preserve">
|
||||||
<value>Event</value>
|
<value>Event</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
// User account.
|
// User account.
|
||||||
SysId userAccountId = StringUtil.ToSysId(model.UserAccount.Id);
|
SysId userAccountId = SysId.ToSysId(model.UserAccount.Id);
|
||||||
if (!SysId.IsValid(userAccountId))
|
if (!SysId.IsValid(userAccountId))
|
||||||
userAccountId = SessionUserAccountId;
|
userAccountId = SessionUserAccountId;
|
||||||
|
|
||||||
@@ -262,7 +262,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
return Json(responseData);
|
return Json(responseData);
|
||||||
|
|
||||||
// User account.
|
// User account.
|
||||||
SysId userAccountId = StringUtil.ToSysId(model.UserAccount.Id);
|
SysId userAccountId = SysId.ToSysId(model.UserAccount.Id);
|
||||||
if (!SysId.IsValid(userAccountId))
|
if (!SysId.IsValid(userAccountId))
|
||||||
userAccountId = SessionUserAccountId;
|
userAccountId = SessionUserAccountId;
|
||||||
|
|
||||||
@@ -471,7 +471,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
RefreshModel(model);
|
RefreshModel(model);
|
||||||
|
|
||||||
// User account.
|
// User account.
|
||||||
SysId userAccountId = StringUtil.ToSysId(model.UserAccount.Id);
|
SysId userAccountId = SysId.ToSysId(model.UserAccount.Id);
|
||||||
if (!SysId.IsValid(userAccountId))
|
if (!SysId.IsValid(userAccountId))
|
||||||
userAccountId = SessionUserAccountId;
|
userAccountId = SessionUserAccountId;
|
||||||
|
|
||||||
|
|||||||
@@ -290,8 +290,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
OrganisationName = values.GetString(colOrganisationName.DataName),
|
OrganisationName = values.GetString(colOrganisationName.DataName),
|
||||||
Headline = values.GetString(colHeadline.DataName),
|
Headline = values.GetString(colHeadline.DataName),
|
||||||
Summary = values.GetString(colSummary.DataName),
|
Summary = values.GetString(colSummary.DataName),
|
||||||
RegionCaptionPrimary = model.GetRegionCaption(values.GetString(colRegionIdPrimary.DataName).ToSysId()),
|
RegionCaptionPrimary = model.GetRegionCaption(SysId.ToSysId(values.GetString(colRegionIdPrimary.DataName))),
|
||||||
SportCaptionPrimary = model.GetSportCaption(values.GetString(colSportIdPrimary.DataName).ToSysId()),
|
SportCaptionPrimary = model.GetSportCaption(SysId.ToSysId(values.GetString(colSportIdPrimary.DataName))),
|
||||||
CreatedOnFmt = model.FormatDateForDisplay(values.GetDateTime(colCreatedOn.DataName)),
|
CreatedOnFmt = model.FormatDateForDisplay(values.GetDateTime(colCreatedOn.DataName)),
|
||||||
PublishedOnFmt = model.FormatDateForDisplay(values.GetDateTime(colPublishedOn.DataName)),
|
PublishedOnFmt = model.FormatDateForDisplay(values.GetDateTime(colPublishedOn.DataName)),
|
||||||
StatusCode = values.GetString(colStatus.DataName),
|
StatusCode = values.GetString(colStatus.DataName),
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
public IActionResult GetAccountContactImage(String uaie)
|
public IActionResult GetAccountContactImage(String uaie)
|
||||||
{
|
{
|
||||||
String userAccountIdParam = "";// ToDo Decrypt from uaie value.
|
String userAccountIdParam = "";// ToDo Decrypt from uaie value.
|
||||||
SysId userAccountId = userAccountIdParam.ToSysId();
|
SysId userAccountId = SysId.ToSysId(userAccountIdParam);
|
||||||
if (!SysId.IsValid(userAccountId))
|
if (!SysId.IsValid(userAccountId))
|
||||||
userAccountId = SessionUserAccountId;
|
userAccountId = SessionUserAccountId;
|
||||||
return GetAccountContactImage(userAccountId, Sax.ImageType.Avatar);
|
return GetAccountContactImage(userAccountId, Sax.ImageType.Avatar);
|
||||||
@@ -160,7 +160,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
if (parameters.Count < 1) return Forbid();
|
if (parameters.Count < 1) return Forbid();
|
||||||
|
|
||||||
// Organisation Id.
|
// Organisation Id.
|
||||||
SysId organisationId = parameters.Get(ParamName_OrganisationId).ToSysId();
|
SysId organisationId = SysId.ToSysId(parameters.Get(ParamName_OrganisationId));
|
||||||
if (!SysId.IsValid(organisationId)) return Forbid();
|
if (!SysId.IsValid(organisationId)) return Forbid();
|
||||||
ItemId organisationItemId = new ItemId((short)Sax.DataItemType.Organisation, organisationId);
|
ItemId organisationItemId = new ItemId((short)Sax.DataItemType.Organisation, organisationId);
|
||||||
|
|
||||||
@@ -213,7 +213,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
if (parameters.Count<1) return Forbid();
|
if (parameters.Count<1) return Forbid();
|
||||||
|
|
||||||
// Item Image.
|
// Item Image.
|
||||||
SysId itemImageId = parameters.Get(ParamName_ItemImageId).ToSysId();
|
SysId itemImageId = SysId.ToSysId(parameters.Get(ParamName_ItemImageId));
|
||||||
if (!SysId.IsValid(itemImageId)) return Forbid();
|
if (!SysId.IsValid(itemImageId)) return Forbid();
|
||||||
SaxItemImage itemImage = ItemDataMgr.GetItemImageById(itemImageId);
|
SaxItemImage itemImage = ItemDataMgr.GetItemImageById(itemImageId);
|
||||||
if (itemImage == null)
|
if (itemImage == null)
|
||||||
|
|||||||
@@ -264,8 +264,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
TypeCode = values.GetString(colEventTypeCode.DataName),
|
TypeCode = values.GetString(colEventTypeCode.DataName),
|
||||||
TypeDesc = Localiser.GetEventTypeCaption((Sax.EventType)EventTypeCodes.GetTypeForCode(values.GetString(colEventTypeCode.DataName))),
|
TypeDesc = Localiser.GetEventTypeCaption((Sax.EventType)EventTypeCodes.GetTypeForCode(values.GetString(colEventTypeCode.DataName))),
|
||||||
Summary = ActivityMgr.GetOrganisationEventDataValue(colSummary, values).AsString(),
|
Summary = ActivityMgr.GetOrganisationEventDataValue(colSummary, values).AsString(),
|
||||||
RegionCaptionCountry = model.GetRegionCaption(values.GetString(colRegionId.DataName).ToSysId()),
|
RegionCaptionCountry = model.GetRegionCaption(SysId.ToSysId(values.GetString(colRegionId.DataName))),
|
||||||
SportCaptionPrimary = model.GetSportCaption(values.GetString(colSportId.DataName).ToSysId()),
|
SportCaptionPrimary = model.GetSportCaption(SysId.ToSysId(values.GetString(colSportId.DataName))),
|
||||||
CreatedOnFmt = Localiser.FormatDate(values.GetDateTime(colCreatedOn.DataName)),
|
CreatedOnFmt = Localiser.FormatDate(values.GetDateTime(colCreatedOn.DataName)),
|
||||||
PublishedOnFmt = Localiser.FormatDate(values.GetDateTime(colPublishedOn.DataName)),
|
PublishedOnFmt = Localiser.FormatDate(values.GetDateTime(colPublishedOn.DataName)),
|
||||||
ExpiresOnFmt = Localiser.FormatDate(values.GetDateTime(colExpiresOn.DataName)),
|
ExpiresOnFmt = Localiser.FormatDate(values.GetDateTime(colExpiresOn.DataName)),
|
||||||
|
|||||||
+2
-2
@@ -203,8 +203,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
TypeDesc = Localiser.GetOpportunityTypeCaption((Sax.OpportunityType)OpportunityTypeCodes.GetTypeForCode(values.GetString(colOpportunityTypeCode.DataName))),
|
TypeDesc = Localiser.GetOpportunityTypeCaption((Sax.OpportunityType)OpportunityTypeCodes.GetTypeForCode(values.GetString(colOpportunityTypeCode.DataName))),
|
||||||
Position = values.GetString(colPosition.DataName),
|
Position = values.GetString(colPosition.DataName),
|
||||||
Outline = values.GetString(colOutline.DataName),
|
Outline = values.GetString(colOutline.DataName),
|
||||||
RegionCaption = model.GetRegionCaption(values.GetString(colRegionId.DataName).ToSysId()),
|
RegionCaption = model.GetRegionCaption(SysId.ToSysId(values.GetString(colRegionId.DataName))),
|
||||||
SportCaption = model.GetSportCaption(values.GetString(colSportId.DataName).ToSysId()),
|
SportCaption = model.GetSportCaption(SysId.ToSysId(values.GetString(colSportId.DataName))),
|
||||||
CreatedOnFmt = Localiser.FormatDate(values.GetDateTime(colCreatedOn.DataName)),
|
CreatedOnFmt = Localiser.FormatDate(values.GetDateTime(colCreatedOn.DataName)),
|
||||||
PublishedOnFmt = Localiser.FormatDate(values.GetDateTime(colPublishedOn.DataName)),
|
PublishedOnFmt = Localiser.FormatDate(values.GetDateTime(colPublishedOn.DataName)),
|
||||||
ExpiresOnFmt = Localiser.FormatDate(values.GetDateTime(colExpiresOn.DataName)),
|
ExpiresOnFmt = Localiser.FormatDate(values.GetDateTime(colExpiresOn.DataName)),
|
||||||
|
|||||||
@@ -380,8 +380,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
private static String ParamName_EmailAddress { get; } = "ema";
|
private static String ParamName_EmailAddress { get; } = "ema";
|
||||||
private static String ParamName_ExpiresAt { get; } = "exp";
|
private static String ParamName_ExpiresAt { get; } = "exp";
|
||||||
private static String ParamName_Token { get; } = "tok";
|
private static String ParamName_Token { get; } = "tok";
|
||||||
// Request Password encryption parameters (key & IV) are defined in the base Controller
|
// Online Request Password encryption parameters (key & IV) are defined in the base Controller
|
||||||
// so that they can be shared with the Adnin application.
|
// so that they can be shared with the Admin application.
|
||||||
internal static String GenerateRequestPasswordLink(SaxController_Online controller, SysId userAccountId, String emailAddress, String requestPasswordToken)
|
internal static String GenerateRequestPasswordLink(SaxController_Online controller, SysId userAccountId, String emailAddress, String requestPasswordToken)
|
||||||
{
|
{
|
||||||
NameValueCollection parameters = new NameValueCollection();
|
NameValueCollection parameters = new NameValueCollection();
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
|||||||
/// <summary>Have any address values been populated on the form.</summary>
|
/// <summary>Have any address values been populated on the form.</summary>
|
||||||
public bool IsPopulated()
|
public bool IsPopulated()
|
||||||
{
|
{
|
||||||
if (SysId.IsValid(Id.ToSysId()) || !StringUtil.IsEmpty(Line1) || !StringUtil.IsEmpty(Town) || !StringUtil.IsEmpty(Province) || !StringUtil.IsEmpty(Country) || !StringUtil.IsEmpty(PostalCode))
|
if (SysId.IsValid(SysId.ToSysId(Id)) || !StringUtil.IsEmpty(Line1) || !StringUtil.IsEmpty(Town) || !StringUtil.IsEmpty(Province) || !StringUtil.IsEmpty(Country) || !StringUtil.IsEmpty(PostalCode))
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,13 +142,13 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
|||||||
// Event duration.
|
// Event duration.
|
||||||
if (EventDuration != null)
|
if (EventDuration != null)
|
||||||
{
|
{
|
||||||
String controlName = nameof(EventDuration);
|
//String controlName = nameof(EventDuration);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event duration type.
|
// Event duration type.
|
||||||
if (EventDurationType != null)
|
if (EventDurationType != null)
|
||||||
{
|
{
|
||||||
String controlName = nameof(EventDurationType);
|
//String controlName = nameof(EventDurationType);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Event To date.
|
// Event To date.
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
|||||||
|
|
||||||
// Numeric values are assumed to be unencrypted Ids.
|
// Numeric values are assumed to be unencrypted Ids.
|
||||||
if (StringUtil.IsNumeric(idx))
|
if (StringUtil.IsNumeric(idx))
|
||||||
return idx.ToSysId();
|
return SysId.ToSysId(idx);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -172,9 +172,9 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
|||||||
if (StringUtil.IsEmpty(encryptedId))
|
if (StringUtil.IsEmpty(encryptedId))
|
||||||
return new SysId();
|
return new SysId();
|
||||||
if (StringUtil.IsNumeric(encryptedId))
|
if (StringUtil.IsNumeric(encryptedId))
|
||||||
return encryptedId.ToSysId();
|
return SysId.ToSysId(encryptedId);
|
||||||
NameValueCollection idObfuscationParams = SaController.DecryptParameters(encryptedId, Base64IV_IdObfuscation, Base64Key_IdObfuscation);
|
NameValueCollection idObfuscationParams = SaController.DecryptParameters(encryptedId, Base64IV_IdObfuscation, Base64Key_IdObfuscation);
|
||||||
return idObfuscationParams.Get(ParamName_IdObfuscation_Id).ToSysId();
|
return SysId.ToSysId(idObfuscationParams.Get(ParamName_IdObfuscation_Id));
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="jQuery.UI.Combined" Version="1.13.3" />
|
<PackageReference Include="jQuery" Version="3.7.1" />
|
||||||
|
<PackageReference Include="jQuery.UI.Combined" Version="1.14.1" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.31" />
|
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.31" />
|
||||||
<PackageReference Include="Moment.js" Version="2.30.1" />
|
<PackageReference Include="Moment.js" Version="2.30.1" />
|
||||||
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
|
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
|
||||||
|
|||||||
@@ -199,7 +199,17 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* Footer *@
|
@* Footer *@
|
||||||
<footer id="sax-page-footer" class="">
|
<footer id="sax-page-footer" class="border-top footer">
|
||||||
|
@if (!Model.AwaitingLogin)
|
||||||
|
{
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="fixed-sm">
|
||||||
|
</div>
|
||||||
|
<div class="col-sm right">@(Model.CopyrightNotice) - @Localiser["company.name"] @(Model.Version)</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
@* Form to allow page navigation. *@
|
@* Form to allow page navigation. *@
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ input
|
|||||||
|
|
||||||
textarea
|
textarea
|
||||||
{
|
{
|
||||||
overflow-y:scroll;
|
overflow-y: scroll;
|
||||||
resize: none;
|
resize: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -198,6 +198,31 @@ td.action
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.width5pc
|
||||||
|
{
|
||||||
|
width: 5%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.width10pc
|
||||||
|
{
|
||||||
|
width: 10%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.width20pc
|
||||||
|
{
|
||||||
|
width: 20%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.width25pc
|
||||||
|
{
|
||||||
|
width: 25%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.width50pc
|
||||||
|
{
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
.fullwidth
|
.fullwidth
|
||||||
{
|
{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -53,45 +53,88 @@ body
|
|||||||
background-color: #e9edf6;
|
background-color: #e9edf6;
|
||||||
}
|
}
|
||||||
|
|
||||||
body > .container
|
@media screen and (max-height: 399px)
|
||||||
{
|
{
|
||||||
padding: 0 1%;
|
#sax-page-body
|
||||||
|
{
|
||||||
|
min-height: 240px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sticky footer styles */
|
@media screen and (min-height: 400px)
|
||||||
|
|
||||||
html
|
|
||||||
{
|
{
|
||||||
position: relative;
|
html
|
||||||
min-height: 100%;
|
{
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.sax-layout-flex
|
||||||
|
{
|
||||||
|
height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.sax-layout-flex #sax-page-body
|
||||||
|
{
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
body
|
/* Responsive */
|
||||||
|
|
||||||
|
body > .container, header > .container, footer > .container
|
||||||
{
|
{
|
||||||
/* Margin bottom by footer height */
|
padding: 0 0.5%;
|
||||||
/*margin-bottom: 60px;*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer
|
@media (min-width: 992px)
|
||||||
{
|
{
|
||||||
position: absolute;
|
.container
|
||||||
bottom: 0;
|
{
|
||||||
width: 100%;
|
max-width: 1200px;
|
||||||
white-space: nowrap;
|
}
|
||||||
/* Set the fixed height of the footer here */
|
}
|
||||||
height: 60px;
|
|
||||||
line-height: 60px; /* Vertically center the text there */
|
@media (min-width: 768px)
|
||||||
|
{
|
||||||
|
.container
|
||||||
|
{
|
||||||
|
max-width: 1200px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 576px)
|
||||||
|
{
|
||||||
|
.container
|
||||||
|
{
|
||||||
|
max-width: 1200px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Header */
|
/* Header */
|
||||||
|
|
||||||
|
#sax-page-header
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
a.navbar-brand
|
a.navbar-brand
|
||||||
{
|
{
|
||||||
|
padding-top: 0.3rem;
|
||||||
|
padding-bottom: 0.1rem;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.navbar li.nav-item a.nav-link
|
||||||
|
{
|
||||||
|
padding-top: 0.3rem;
|
||||||
|
padding-bottom: 0.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
.border-top
|
.border-top
|
||||||
{
|
{
|
||||||
border-top: 1px solid #e5e5e5;
|
border-top: 1px solid #e5e5e5;
|
||||||
@@ -120,6 +163,18 @@ button.accept-policy
|
|||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Footer */
|
||||||
|
|
||||||
|
#sax-page-footer
|
||||||
|
{
|
||||||
|
padding: 4px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#sax-page-footer, #sax-page-footer div
|
||||||
|
{
|
||||||
|
font-size: .8rem;
|
||||||
|
}
|
||||||
|
|
||||||
/* Actions */
|
/* Actions */
|
||||||
|
|
||||||
a, a:hover
|
a, a:hover
|
||||||
|
|||||||
@@ -133,10 +133,8 @@
|
|||||||
{
|
{
|
||||||
$(sel).datepicker().on('keyup', function (e)
|
$(sel).datepicker().on('keyup', function (e)
|
||||||
{
|
{
|
||||||
if (e.keyCode == 8 || e.keyCode == 46)
|
if (e.key == 'Backspace' || e.key == 'Delete')
|
||||||
{
|
$(this).datepicker('setDate', null).datepicker('hide').trigger('change');
|
||||||
$(this).datepicker('setDate', null).datepicker('hide').change();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
sax.initTimePickers = function (sel, opt)
|
sax.initTimePickers = function (sel, opt)
|
||||||
@@ -157,7 +155,7 @@
|
|||||||
}
|
}
|
||||||
sax.refreshPaging = function (response, context, refreshFn)
|
sax.refreshPaging = function (response, context, refreshFn)
|
||||||
{
|
{
|
||||||
if (sax.mdl.resultsPaging.fn.refreshPaging)
|
if (((sax.mdl.resultsPaging || {}).fn || {}).refreshPaging)
|
||||||
sax.mdl.resultsPaging.fn.refreshPaging(response.paging, context, refreshFn);
|
sax.mdl.resultsPaging.fn.refreshPaging(response.paging, context, refreshFn);
|
||||||
}
|
}
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
@@ -165,7 +163,7 @@
|
|||||||
sax.navigateTo = function (action)
|
sax.navigateTo = function (action)
|
||||||
{
|
{
|
||||||
sax.doPleaseWait();
|
sax.doPleaseWait();
|
||||||
$('#frmNavigate').prop('action', sax.url.base + action).submit();
|
$('#frmNavigate').prop('action', sax.url.base + action).trigger('submit');
|
||||||
}
|
}
|
||||||
sax.goToPage = function (action)
|
sax.goToPage = function (action)
|
||||||
{
|
{
|
||||||
@@ -341,7 +339,7 @@
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
cache: false,
|
cache: false,
|
||||||
//enctype: 'multipart/form-data',
|
//enctype: 'multipart/form-data',
|
||||||
data: ajax.formData || $("#" + ajax.formId).serialize(),
|
data: ajax.formData || $(ajax.formSel || "#" + ajax.formId).serialize(),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (response, status, jqXHR)
|
success: function (response, status, jqXHR)
|
||||||
{
|
{
|
||||||
@@ -505,21 +503,29 @@
|
|||||||
sax.onWinResizePage = function () { };
|
sax.onWinResizePage = function () { };
|
||||||
sax.onWinResize = function ()
|
sax.onWinResize = function ()
|
||||||
{
|
{
|
||||||
var winH = $(win).height();
|
$('body').toggleClass('sax-layout-flex', !sax.isAutoHeight()).toggleClass('sax-layout-flow', sax.isAutoHeight());
|
||||||
var $pageBody = $('#sax-page-body');
|
|
||||||
var $hdr = $('#sax-page-header');
|
|
||||||
var $ftr = $('#sax-page-footer');
|
|
||||||
if (sax.isAutoHeight())
|
|
||||||
$pageBody.height('auto');
|
|
||||||
else
|
|
||||||
$pageBody.innerHeight(Math.min(1200, winH - $hdr.outerHeight() - $ftr.outerHeight(true)));
|
|
||||||
$ftr.css('visibility', 'visible');
|
|
||||||
sax.onWinResizePage();
|
sax.onWinResizePage();
|
||||||
}
|
}
|
||||||
|
setTimeout(sax.onWinResize, 50);
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
$(function ()
|
$(function ()
|
||||||
{
|
{
|
||||||
|
$(win).on('resize', function () { sax.onWinResize(); });
|
||||||
|
|
||||||
$('.sax-button-cta,.sax-button-action,.sax-action-link,.sax-social-icon.sax-action').prop('tabindex', 0);
|
$('.sax-button-cta,.sax-button-action,.sax-action-link,.sax-social-icon.sax-action').prop('tabindex', 0);
|
||||||
|
|
||||||
|
$.fn.visible = function () { return this.css('visibility', 'visible'); };
|
||||||
|
$.fn.invisible = function () { return this.css('visibility', 'hidden'); };
|
||||||
|
$.fn.toggleVisibility = function ()
|
||||||
|
{
|
||||||
|
return this.css('visibility', function (i, visibility) { return (visibility == 'visible') ? 'hidden' : 'visible'; });
|
||||||
|
};
|
||||||
|
|
||||||
|
$.fn.removeStatusClasses = function ()
|
||||||
|
{
|
||||||
|
return this.removeClass(function (idx, name) { return (name.match(/(^|\s)sax-status-\S+/g) || []).join(' '); });
|
||||||
|
};
|
||||||
|
|
||||||
if (sax.kli.active)
|
if (sax.kli.active)
|
||||||
sax.configureKeepLoggedIn();
|
sax.configureKeepLoggedIn();
|
||||||
else if (!sax.awaitingLogin)
|
else if (!sax.awaitingLogin)
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
$(function ()
|
$(function ()
|
||||||
{
|
{
|
||||||
sax.$frm.signIn = $('#frmSignIn');
|
sax.$frm.signIn = $('#frmSignIn');
|
||||||
$(':input:enabled:visible:first').focus();
|
$(':input:enabled:visible:first').trigger('focus');
|
||||||
$('#ifEmailAddress,#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm').on('input', function () { sax.clearControlError(this); });
|
$('#ifEmailAddress,#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm').on('input', function () { sax.clearControlError(this); });
|
||||||
sax.$frm.signIn.on('keypress', '#ifEmailAddress,#ifPassword,#chkKeepMeSignedIn', function (e) { if (e.which == 13 && $('#ifEmailAddress', sax.$frm.signIn).val() && $('#ifPassword', sax.$frm.signIn).val()) sax.doSignin(); });
|
sax.$frm.signIn.on('keypress', '#ifEmailAddress,#ifPassword,#chkKeepMeSignedIn', function (e) { if (e.which == 13 && $('#ifEmailAddress', sax.$frm.signIn).val() && $('#ifPassword', sax.$frm.signIn).val()) sax.doSignin(); });
|
||||||
sax.$frm.signIn.on('click', '#pbSignIn', function () { sax.doSignin(); }).on('keypress', '#pbSignIn', function (e) { if (e.which == 13) sax.doSignin(); });
|
sax.$frm.signIn.on('click', '#pbSignIn', function () { sax.doSignin(); }).on('keypress', '#pbSignIn', function (e) { if (e.which == 13) sax.doSignin(); });
|
||||||
|
|||||||
@@ -147,7 +147,7 @@
|
|||||||
sax.initCalendars('#frmSportExperience .sax-calendar', { changeMonth: true, changeYear: true, yearRange: '-99:+00' });
|
sax.initCalendars('#frmSportExperience .sax-calendar', { changeMonth: true, changeYear: true, yearRange: '-99:+00' });
|
||||||
se.$dpPeriodFrom = $('.sax-calendar.ExperiencePeriodFrom', se.$frm.sportExp);
|
se.$dpPeriodFrom = $('.sax-calendar.ExperiencePeriodFrom', se.$frm.sportExp);
|
||||||
se.$dpPeriodTo = $('.sax-calendar.ExperiencePeriodTo', se.$frm.sportExp);
|
se.$dpPeriodTo = $('.sax-calendar.ExperiencePeriodTo', se.$frm.sportExp);
|
||||||
se.$dpPeriodFrom.datepicker({ onSelect: function () { $(this).change(); } });
|
se.$dpPeriodFrom.datepicker({ onSelect: function () { $(this).trigger('change'); } });
|
||||||
sax.allowClearCalendar('#frmSportExperience .sax-calendar.ExperiencePeriodTo');
|
sax.allowClearCalendar('#frmSportExperience .sax-calendar.ExperiencePeriodTo');
|
||||||
});
|
});
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
|
|||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
public static class Version
|
public static class Version
|
||||||
{
|
{
|
||||||
private static String version { get; } = "1.2.11.14";
|
private static String version { get; } = "1.2.11.15";
|
||||||
// Retrieve version.
|
// Retrieve version.
|
||||||
public static String GetFullVersion () { return version; }
|
public static String GetFullVersion () { return version; }
|
||||||
public static String GetAppVersion ()
|
public static String GetAppVersion ()
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ namespace Saxonite.Net.Standard.Base.App
|
|||||||
ActivityReaction,
|
ActivityReaction,
|
||||||
// Support.
|
// Support.
|
||||||
UserReportType,
|
UserReportType,
|
||||||
|
SupportItemProcessType
|
||||||
};
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
@@ -121,6 +122,7 @@ namespace Saxonite.Net.Standard.Base.App
|
|||||||
Golf_UsgaMarker = 1004,
|
Golf_UsgaMarker = 1004,
|
||||||
// Support.
|
// Support.
|
||||||
UserReport = 9010,
|
UserReport = 9010,
|
||||||
|
SupportItemProcess = 9020,
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
@@ -463,6 +465,14 @@ namespace Saxonite.Net.Standard.Base.App
|
|||||||
Bug = 30,
|
Bug = 30,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>Support Item Process Type</summary>
|
||||||
|
public enum SupportItemProcessType
|
||||||
|
{
|
||||||
|
Unknown = 0,
|
||||||
|
/* Do not change the values or codes - tied to database. */
|
||||||
|
OrganisationSchedulePopulation = 200,
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|||||||
@@ -125,6 +125,7 @@ namespace Saxonite.Net.Standard.Base.App
|
|||||||
public List<TypeCodeDesc> ActivityReactionCodes { get { return GetCodesOfType(Sax.CodeType.ActivityReaction); } }
|
public List<TypeCodeDesc> ActivityReactionCodes { get { return GetCodesOfType(Sax.CodeType.ActivityReaction); } }
|
||||||
// Support.
|
// Support.
|
||||||
public List<TypeCodeDesc> UserReportTypeCodes { get { return GetCodesOfType(Sax.CodeType.UserReportType); } }
|
public List<TypeCodeDesc> UserReportTypeCodes { get { return GetCodesOfType(Sax.CodeType.UserReportType); } }
|
||||||
|
public List<TypeCodeDesc> SupportItemProcessTypeCodes { get { return GetCodesOfType(Sax.CodeType.SupportItemProcessType); } }
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Consoles.
|
// Consoles.
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ namespace Saxonite.Net.Standard.Base.App
|
|||||||
private static readonly List<TypeCodeDesc> activityReactionCodes = new List<TypeCodeDesc>();
|
private static readonly List<TypeCodeDesc> activityReactionCodes = new List<TypeCodeDesc>();
|
||||||
// Support.
|
// Support.
|
||||||
private static readonly List<TypeCodeDesc> userReportTypeCodes = new List<TypeCodeDesc>();
|
private static readonly List<TypeCodeDesc> userReportTypeCodes = new List<TypeCodeDesc>();
|
||||||
|
private static readonly List<TypeCodeDesc> supportItemProcessTypeCodes = new List<TypeCodeDesc>();
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// C o d e T y p e s
|
// C o d e T y p e s
|
||||||
@@ -97,6 +98,8 @@ namespace Saxonite.Net.Standard.Base.App
|
|||||||
// Support.
|
// Support.
|
||||||
case Sax.CodeType.UserReportType:
|
case Sax.CodeType.UserReportType:
|
||||||
return new List<TypeCodeDesc>(userReportTypeCodes);
|
return new List<TypeCodeDesc>(userReportTypeCodes);
|
||||||
|
case Sax.CodeType.SupportItemProcessType:
|
||||||
|
return new List<TypeCodeDesc>(supportItemProcessTypeCodes);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new NotSupportedException(nameof(SaxSystem) + ".GetCodesOfType Unexpected code type: " + codeType.ToString());
|
throw new NotSupportedException(nameof(SaxSystem) + ".GetCodesOfType Unexpected code type: " + codeType.ToString());
|
||||||
@@ -314,6 +317,9 @@ namespace Saxonite.Net.Standard.Base.App
|
|||||||
userReportTypeCodes.Add(Sax.UserReportType.Information, "INF", "Information request");
|
userReportTypeCodes.Add(Sax.UserReportType.Information, "INF", "Information request");
|
||||||
userReportTypeCodes.Add(Sax.UserReportType.Bug, "BUG", "Bug report");
|
userReportTypeCodes.Add(Sax.UserReportType.Bug, "BUG", "Bug report");
|
||||||
|
|
||||||
|
// Support Item Process Types.
|
||||||
|
supportItemProcessTypeCodes.Add(Sax.SupportItemProcessType.OrganisationSchedulePopulation, "OSP", "Organisation schedule population");
|
||||||
|
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Properties.
|
// Properties.
|
||||||
public override bool ItemHasId { get; } = false;
|
public override bool ItemHasId() { return false; }
|
||||||
public Data GetData() { return data.Clone(); }
|
public Data GetData() { return data.Clone(); }
|
||||||
public void SetData(Data data)
|
public void SetData(Data data)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
|||||||
{
|
{
|
||||||
// Content segment image Id.
|
// Content segment image Id.
|
||||||
XElement imageIdElement = imageChildElement;
|
XElement imageIdElement = imageChildElement;
|
||||||
segment.Image.ItemImageId = imageIdElement.Value.ToSysId();
|
segment.Image.ItemImageId = SysId.ToSysId(imageIdElement.Value);
|
||||||
}
|
}
|
||||||
else SaLogger.Warn($"{SysUtil.Fn} Unexpected 'Segment' child element: " + segmentChildElementName);
|
else SaLogger.Warn($"{SysUtil.Fn} Unexpected 'Segment' child element: " + segmentChildElementName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
// ItemSport.
|
// ItemSport.
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
public abstract class SaxItemSport : SacsHierarchyItem
|
public abstract class SaxItemProcess : SacsHierarchyItem
|
||||||
{
|
{
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Columns.
|
// Columns.
|
||||||
@@ -107,7 +107,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Construction.
|
// Construction.
|
||||||
protected SaxItemSport(SysId id, ItemId itemId, SysId sportId) : base(id)
|
protected SaxItemProcess(SysId id, ItemId itemId, SysId sportId) : base(id)
|
||||||
{
|
{
|
||||||
base.SetData(data);
|
base.SetData(data);
|
||||||
ItemId = itemId;
|
ItemId = itemId;
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
|||||||
ContactData contactData = new ContactData()
|
ContactData contactData = new ContactData()
|
||||||
{
|
{
|
||||||
ContactType = contactType,
|
ContactType = contactType,
|
||||||
UserAccountId = rootChildElement.GetChildText(ElementName_UserAccountId).ToSysId(),
|
UserAccountId = SysId.ToSysId(rootChildElement.GetChildText(ElementName_UserAccountId)),
|
||||||
Title = rootChildElement.GetChildText(ElementName_Title),
|
Title = rootChildElement.GetChildText(ElementName_Title),
|
||||||
FirstName = rootChildElement.GetChildText(ElementName_FirstName),
|
FirstName = rootChildElement.GetChildText(ElementName_FirstName),
|
||||||
LastName = rootChildElement.GetChildText(ElementName_LastName),
|
LastName = rootChildElement.GetChildText(ElementName_LastName),
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Utilities.
|
// Utilities.
|
||||||
public override bool ItemHasId => false;
|
public override bool ItemHasId() { return false; }
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Properties.
|
// Properties.
|
||||||
|
|||||||
@@ -0,0 +1,214 @@
|
|||||||
|
using Sarand.Net.Standard.Base.Bus;
|
||||||
|
using Sarand.Net.Standard.Base.Core;
|
||||||
|
using Sarand.Net.Standard.Base.Utils;
|
||||||
|
using Saxonite.Net.Standard.Base.App;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Saxonite.Net.Standard.Base.Bus.Support
|
||||||
|
{
|
||||||
|
//=======================================================================
|
||||||
|
// ItemSport.
|
||||||
|
//=======================================================================
|
||||||
|
public abstract class SaxItemProcess : SacsHierarchyItem
|
||||||
|
{
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Columns.
|
||||||
|
public enum Column
|
||||||
|
{
|
||||||
|
Pos,
|
||||||
|
Id,
|
||||||
|
// Item.
|
||||||
|
ItemType,
|
||||||
|
ItemType_Code,
|
||||||
|
ItemType_Desc,
|
||||||
|
ItemId,
|
||||||
|
Item_Caption,
|
||||||
|
// Process.
|
||||||
|
ProcessType,
|
||||||
|
ProcessType_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 ItemId { get; set; } = new ItemId();
|
||||||
|
public Sax.SupportItemProcessType ProcessType { get; set; }
|
||||||
|
public String ProcessData { 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.SupportItemProcessType ProcessType
|
||||||
|
{
|
||||||
|
get { return data.ProcessType; }
|
||||||
|
set { CheckChanged((int)data.ProcessType, (int)value); data.ProcessType = value; }
|
||||||
|
}
|
||||||
|
public String ProcessData
|
||||||
|
{
|
||||||
|
get { return data.ProcessData; }
|
||||||
|
set { CheckChanged(data.ProcessData, value); data.ProcessData = value; }
|
||||||
|
}
|
||||||
|
// Population.
|
||||||
|
internal void PopulateFrom(Data data)
|
||||||
|
{
|
||||||
|
ItemId = data.ItemId;
|
||||||
|
ProcessType = data.ProcessType;
|
||||||
|
ProcessData = data.ProcessData;
|
||||||
|
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 ProcessType { get; set; } = ValidValue.Valid;
|
||||||
|
public ValidValue ProcessData { get; set; } = ValidValue.Valid;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Data members.
|
||||||
|
private readonly Data data = new Data();
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Construction.
|
||||||
|
protected SaxItemProcess(SysId id, ItemId itemId, Sax.SupportItemProcessType processType) : base(id)
|
||||||
|
{
|
||||||
|
base.SetData(data);
|
||||||
|
ItemId = itemId;
|
||||||
|
ProcessType = processType;
|
||||||
|
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.SupportItemProcess, Id);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Properties.
|
||||||
|
public Data GetData() { return data.Clone(); }
|
||||||
|
public void SetData(Data data)
|
||||||
|
{
|
||||||
|
// Properties that cannot be changed if previously specified.
|
||||||
|
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
|
||||||
|
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
|
||||||
|
if (ItemId.IsValid(ItemId) && ItemId.Type != data.ItemId.Type && SysId.ToInt(ItemId.Id) != SysId.ToInt(data.ItemId.Id))
|
||||||
|
throw new NotSupportedException($"{SysUtil.Fn} Item Id cannot be changed");
|
||||||
|
this.data.PopulateFrom(data);
|
||||||
|
}
|
||||||
|
public ItemId ItemId
|
||||||
|
{
|
||||||
|
get { return data.ItemId; }
|
||||||
|
protected set { data.ItemId = value; }
|
||||||
|
}
|
||||||
|
public Sax.SupportItemProcessType ProcessType
|
||||||
|
{
|
||||||
|
get { return data.ProcessType; }
|
||||||
|
set { data.ProcessType = value; }
|
||||||
|
}
|
||||||
|
public String ProcessData
|
||||||
|
{
|
||||||
|
get { return data.ProcessData; }
|
||||||
|
set { data.ProcessData = 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 HashSet<SysId> IdsIncluded { get; } = new HashSet<SysId>();
|
||||||
|
public HashSet<SysId> IdsExcluded { get; } = new HashSet<SysId>();
|
||||||
|
public HashSet<ItemId> ItemIdsIncluded { get; } = new HashSet<ItemId>();
|
||||||
|
public HashSet<Sax.SupportItemProcessType> ProcessTypesIncluded { get; } = new HashSet<Sax.SupportItemProcessType>();
|
||||||
|
// Common properties.
|
||||||
|
public String NotesPartial { get; set; }
|
||||||
|
public StatusCat StatusCat { get; set; } = StatusCat.NotDeleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// Item list extension methods.
|
||||||
|
public static class SaxItemProcessList
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
}
|
||||||
@@ -0,0 +1,221 @@
|
|||||||
|
using Sarand.Net.Standard.Base.Bus;
|
||||||
|
using Sarand.Net.Standard.Base.Core;
|
||||||
|
using Sarand.Net.Standard.Base.Utils;
|
||||||
|
using Saxonite.Net.Standard.Base.App;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Saxonite.Net.Standard.Base.Bus.Support
|
||||||
|
{
|
||||||
|
//=======================================================================
|
||||||
|
// ItemSport.
|
||||||
|
//=======================================================================
|
||||||
|
public abstract class SaxItemProcessInstance : SacsHierarchyItem
|
||||||
|
{
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Columns.
|
||||||
|
public enum Column
|
||||||
|
{
|
||||||
|
Pos,
|
||||||
|
Id,
|
||||||
|
// Item process.
|
||||||
|
ItemProcessId,
|
||||||
|
// Process instance.
|
||||||
|
Started_DateTime,
|
||||||
|
Started_Date,
|
||||||
|
Started_Time,
|
||||||
|
Completed_DateTime,
|
||||||
|
Completed_Date,
|
||||||
|
Completed_Time,
|
||||||
|
// 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 ItemProcessId { get; set; }
|
||||||
|
public DateTime? StartedAt { get; set; }
|
||||||
|
public DateTime? CompletedAt { get; set; }
|
||||||
|
public String ProcessingData { 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 ItemProcessId
|
||||||
|
{
|
||||||
|
get { return data.ItemProcessId; }
|
||||||
|
set { CheckChanged(data.ItemProcessId, value); data.ItemProcessId = value; }
|
||||||
|
}
|
||||||
|
public DateTime? StartedAt
|
||||||
|
{
|
||||||
|
get { return data.StartedAt; }
|
||||||
|
set { CheckChangedNullable(data.StartedAt, value); data.StartedAt = value; }
|
||||||
|
}
|
||||||
|
public DateTime? CompletedAt
|
||||||
|
{
|
||||||
|
get { return data.CompletedAt; }
|
||||||
|
set { CheckChangedNullable(data.CompletedAt, value); data.CompletedAt = value; }
|
||||||
|
}
|
||||||
|
public String ProcessingData
|
||||||
|
{
|
||||||
|
get { return data.ProcessingData; }
|
||||||
|
set { CheckChanged(data.ProcessingData, value); data.ProcessingData = value; }
|
||||||
|
}
|
||||||
|
// Population.
|
||||||
|
internal void PopulateFrom(Data data)
|
||||||
|
{
|
||||||
|
ItemProcessId = data.ItemProcessId;
|
||||||
|
StartedAt = data.StartedAt;
|
||||||
|
CompletedAt = data.CompletedAt;
|
||||||
|
ProcessingData = data.ProcessingData;
|
||||||
|
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 ItemProcessId { get; set; } = ValidValue.Valid;
|
||||||
|
public ValidValue StartedAt { get; set; } = ValidValue.Valid;
|
||||||
|
public ValidValue CompletedAt { get; set; } = ValidValue.Valid;
|
||||||
|
public ValidValue ProcessingData { get; set; } = ValidValue.Valid;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Data members.
|
||||||
|
private readonly Data data = new Data();
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Construction.
|
||||||
|
protected SaxItemProcessInstance(SysId id, SysId itemProcessId) : base(id)
|
||||||
|
{
|
||||||
|
base.SetData(data);
|
||||||
|
ItemProcessId = itemProcessId;
|
||||||
|
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.
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Properties.
|
||||||
|
public Data GetData() { return data.Clone(); }
|
||||||
|
public void SetData(Data data)
|
||||||
|
{
|
||||||
|
// Properties that cannot be changed if previously specified.
|
||||||
|
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
|
||||||
|
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
|
||||||
|
if (SysId.IsValid(ItemProcessId) && SysId.ToInt(ItemProcessId) != SysId.ToInt(data.ItemProcessId))
|
||||||
|
throw new NotSupportedException($"{SysUtil.Fn} Item Process Id cannot be changed");
|
||||||
|
this.data.PopulateFrom(data);
|
||||||
|
}
|
||||||
|
public SysId ItemProcessId
|
||||||
|
{
|
||||||
|
get { return data.ItemProcessId; }
|
||||||
|
protected set { data.ItemProcessId = value; }
|
||||||
|
}
|
||||||
|
public DateTime? StartedAt
|
||||||
|
{
|
||||||
|
get { return data.StartedAt; }
|
||||||
|
set { data.StartedAt = value; }
|
||||||
|
}
|
||||||
|
public DateTime? CompletedAt
|
||||||
|
{
|
||||||
|
get { return data.CompletedAt; }
|
||||||
|
set { data.CompletedAt = value; }
|
||||||
|
}
|
||||||
|
public String ProcessingData
|
||||||
|
{
|
||||||
|
get { return data.ProcessingData; }
|
||||||
|
set { data.ProcessingData = 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 HashSet<SysId> IdsIncluded { get; } = new HashSet<SysId>();
|
||||||
|
public HashSet<SysId> IdsExcluded { get; } = new HashSet<SysId>();
|
||||||
|
public HashSet<SysId> ItemProcessIdsIncluded { get; } = new HashSet<SysId>();
|
||||||
|
// Common properties.
|
||||||
|
public String NotesPartial { get; set; }
|
||||||
|
public StatusCat StatusCat { get; set; } = StatusCat.NotDeleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// Item list extension methods.
|
||||||
|
public static class SaxItemProcessInstanceList
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
}
|
||||||
@@ -0,0 +1,211 @@
|
|||||||
|
using Sarand.Net.Standard.Base.Bus;
|
||||||
|
using Sarand.Net.Standard.Base.Core;
|
||||||
|
using Sarand.Net.Standard.Base.Utils;
|
||||||
|
using Saxonite.Net.Standard.Base.App;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Saxonite.Net.Standard.Base.Bus.Support
|
||||||
|
{
|
||||||
|
//=======================================================================
|
||||||
|
// ItemSport.
|
||||||
|
//=======================================================================
|
||||||
|
public abstract class SaxItemProcessMessage : SacsHierarchyItem
|
||||||
|
{
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Columns.
|
||||||
|
public enum Column
|
||||||
|
{
|
||||||
|
Pos,
|
||||||
|
Id,
|
||||||
|
// Item process.
|
||||||
|
ItemProcessInstanceId,
|
||||||
|
// Process message.
|
||||||
|
MessageType,
|
||||||
|
MessageType_Desc,
|
||||||
|
Message,
|
||||||
|
Recorded_DateTime,
|
||||||
|
Recorded_Date,
|
||||||
|
Recorded_Time,
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
/// <summary>Properties other than common.</summary>
|
||||||
|
public class DataProperties
|
||||||
|
{
|
||||||
|
public SysId ItemProcessInstanceId { get; set; }
|
||||||
|
public DateTime? RecordedAt { get; set; }
|
||||||
|
public SaMessageLevel MessageType { get; set; }
|
||||||
|
public String Message { 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 ItemProcessInstanceId
|
||||||
|
{
|
||||||
|
get { return data.ItemProcessInstanceId; }
|
||||||
|
set { CheckChanged(data.ItemProcessInstanceId, value); data.ItemProcessInstanceId = value; }
|
||||||
|
}
|
||||||
|
public DateTime? RecordedAt
|
||||||
|
{
|
||||||
|
get { return data.RecordedAt; }
|
||||||
|
set { CheckChangedNullable(data.RecordedAt, value); data.RecordedAt = value; }
|
||||||
|
}
|
||||||
|
public SaMessageLevel MessageType
|
||||||
|
{
|
||||||
|
get { return data.MessageType; }
|
||||||
|
set { CheckChanged((int)data.MessageType, (int)value); data.MessageType = value; }
|
||||||
|
}
|
||||||
|
public String Message
|
||||||
|
{
|
||||||
|
get { return data.Message; }
|
||||||
|
set { CheckChanged(data.Message, value); data.Message = value; }
|
||||||
|
}
|
||||||
|
// Population.
|
||||||
|
internal void PopulateFrom(Data data)
|
||||||
|
{
|
||||||
|
ItemProcessInstanceId = data.ItemProcessInstanceId;
|
||||||
|
RecordedAt = data.RecordedAt;
|
||||||
|
MessageType = data.MessageType;
|
||||||
|
Message = data.Message;
|
||||||
|
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 ItemProcessInstanceId { get; set; } = ValidValue.Valid;
|
||||||
|
public ValidValue RecordedAt { get; set; } = ValidValue.Valid;
|
||||||
|
public ValidValue MessageType { get; set; } = ValidValue.Valid;
|
||||||
|
public ValidValue Message { get; set; } = ValidValue.Valid;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Data members.
|
||||||
|
private readonly Data data = new Data();
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Construction.
|
||||||
|
protected SaxItemProcessMessage(SysId id, SysId itemProcessId) : base(id)
|
||||||
|
{
|
||||||
|
base.SetData(data);
|
||||||
|
ItemProcessInstanceId = itemProcessId;
|
||||||
|
Status = DefaultStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Status.
|
||||||
|
private static readonly List<SaStatus> validStatuses = new List<SaStatus>()
|
||||||
|
{
|
||||||
|
SaStatus.Active,
|
||||||
|
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.Deleted) return DataValue.TriStateType.Purple;
|
||||||
|
return DataValue.TriStateType.Unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Utilities.
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Properties.
|
||||||
|
public Data GetData() { return data.Clone(); }
|
||||||
|
public void SetData(Data data)
|
||||||
|
{
|
||||||
|
// Properties that cannot be changed if previously specified.
|
||||||
|
if (SysId.IsValid(Id) && SysId.ToInt(Id) != SysId.ToInt(data.Id))
|
||||||
|
throw new NotSupportedException($"{SysUtil.Fn} Id cannot be changed");
|
||||||
|
if (SysId.IsValid(ItemProcessInstanceId) && SysId.ToInt(ItemProcessInstanceId) != SysId.ToInt(data.ItemProcessInstanceId))
|
||||||
|
throw new NotSupportedException($"{SysUtil.Fn} Item Process Id cannot be changed");
|
||||||
|
this.data.PopulateFrom(data);
|
||||||
|
}
|
||||||
|
public SysId ItemProcessInstanceId
|
||||||
|
{
|
||||||
|
get { return data.ItemProcessInstanceId; }
|
||||||
|
protected set { data.ItemProcessInstanceId = value; }
|
||||||
|
}
|
||||||
|
public DateTime? RecordedAt
|
||||||
|
{
|
||||||
|
get { return data.RecordedAt; }
|
||||||
|
set { data.RecordedAt = value; }
|
||||||
|
}
|
||||||
|
public SaMessageLevel MessageType
|
||||||
|
{
|
||||||
|
get { return data.MessageType; }
|
||||||
|
set { data.MessageType = value; }
|
||||||
|
}
|
||||||
|
public String Message
|
||||||
|
{
|
||||||
|
get { return data.Message; }
|
||||||
|
set { data.Message = 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 HashSet<SysId> IdsIncluded { get; } = new HashSet<SysId>();
|
||||||
|
public HashSet<SysId> IdsExcluded { get; } = new HashSet<SysId>();
|
||||||
|
public HashSet<SysId> ItemProcessInstanceIdsIncluded { get; } = new HashSet<SysId>();
|
||||||
|
public HashSet<SaMessageLevel> MessageTypesIncluded { get; } = new HashSet<SaMessageLevel>();
|
||||||
|
// Common properties.
|
||||||
|
public String NotesPartial { get; set; }
|
||||||
|
public StatusCat StatusCat { get; set; } = StatusCat.NotDeleted;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
// Item list extension methods.
|
||||||
|
public static class SaxItemProcessMessageList
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Create item.
|
// Create item.
|
||||||
public abstract SaxItemSport CreateItemSport();
|
public abstract SaxItemProcess CreateItemSport();
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Item exists.
|
// Item exists.
|
||||||
@@ -29,34 +29,34 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!SysId.IsValid(id)) return false;
|
if (!SysId.IsValid(id)) return false;
|
||||||
SaxItemSport.Params prmItemSport = new SaxItemSport.Params();
|
SaxItemProcess.Params prmItemSport = new SaxItemProcess.Params();
|
||||||
prmItemSport.IdsIncluded.Add(id);
|
prmItemSport.IdsIncluded.Add(id);
|
||||||
prmItemSport.StatusCat = SaxItemSport.StatusCat.Any;
|
prmItemSport.StatusCat = SaxItemProcess.StatusCat.Any;
|
||||||
return GetItemSportCount(prmItemSport) == 1;
|
return GetItemSportCount(prmItemSport) == 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Retrieve individual items.
|
// Retrieve individual items.
|
||||||
public abstract SaxItemSport GetItemSport(SaxItemSport.Params prmItemSport);
|
public abstract SaxItemProcess GetItemSport(SaxItemProcess.Params prmItemSport);
|
||||||
public SaxItemSport GetItemSportById(SysId id)
|
public SaxItemProcess GetItemSportById(SysId id)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!SysId.IsValid(id)) return null;
|
if (!SysId.IsValid(id)) return null;
|
||||||
SaxItemSport.Params prmItemSport = new SaxItemSport.Params();
|
SaxItemProcess.Params prmItemSport = new SaxItemProcess.Params();
|
||||||
prmItemSport.IdsIncluded.Add(id);
|
prmItemSport.IdsIncluded.Add(id);
|
||||||
prmItemSport.StatusCat = SaxItemSport.StatusCat.Any;
|
prmItemSport.StatusCat = SaxItemProcess.StatusCat.Any;
|
||||||
return GetItemSport(prmItemSport);
|
return GetItemSport(prmItemSport);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Validate item data.
|
// Validate item data.
|
||||||
public bool IsValidItemSport(SaxItemSport itemSport)
|
public bool IsValidItemSport(SaxItemProcess itemSport)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (itemSport == null) return SetErrorState(ErrorMessage.ItemNotSpecified);
|
if (itemSport == null) return SetErrorState(ErrorMessage.ItemNotSpecified);
|
||||||
return IsValidItemSportData(itemSport.GetData(), new SaxItemSport.ErrField());
|
return IsValidItemSportData(itemSport.GetData(), new SaxItemProcess.ErrField());
|
||||||
}
|
}
|
||||||
public virtual bool IsValidItemSportData(SaxItemSport.Data data, SaxItemSport.ErrField errField)
|
public virtual bool IsValidItemSportData(SaxItemProcess.Data data, SaxItemProcess.ErrField errField)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
|
|
||||||
@@ -88,7 +88,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
|||||||
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!SaxItemSport.ValidStatuses.Contains(data.Status))
|
if (!SaxItemProcess.ValidStatuses.Contains(data.Status))
|
||||||
{
|
{
|
||||||
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return SetErrorState(ErrorMessage.InvalidStatus);
|
return SetErrorState(ErrorMessage.InvalidStatus);
|
||||||
@@ -101,12 +101,12 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
|||||||
{
|
{
|
||||||
if (ItemId.IsValid(data.ItemId) && SysId.IsValid(data.SportId))
|
if (ItemId.IsValid(data.ItemId) && SysId.IsValid(data.SportId))
|
||||||
{
|
{
|
||||||
SaxItemSport.Params prmItemSport = new SaxItemSport.Params();
|
SaxItemProcess.Params prmItemSport = new SaxItemProcess.Params();
|
||||||
if (SysId.IsValid(data.Id))
|
if (SysId.IsValid(data.Id))
|
||||||
prmItemSport.IdsExcluded.Add(data.Id);
|
prmItemSport.IdsExcluded.Add(data.Id);
|
||||||
prmItemSport.ItemIdsIncluded.Add(data.ItemId);
|
prmItemSport.ItemIdsIncluded.Add(data.ItemId);
|
||||||
prmItemSport.SportIdsIncluded.Add(data.SportId);
|
prmItemSport.SportIdsIncluded.Add(data.SportId);
|
||||||
prmItemSport.StatusCat = SaxItemSport.StatusCat.Any;
|
prmItemSport.StatusCat = SaxItemProcess.StatusCat.Any;
|
||||||
if (GetItemSportCount(prmItemSport) > 0)
|
if (GetItemSportCount(prmItemSport) > 0)
|
||||||
{
|
{
|
||||||
errField.SportId = SacsHierarchyItem.ValidValue.Invalid;
|
errField.SportId = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
@@ -121,22 +121,22 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Item database interface.
|
// Item database interface.
|
||||||
public abstract bool InsertItemSport(SaxItemSport itemSport, DbUpdateInfo dbUpdateInfo);
|
public abstract bool InsertItemSport(SaxItemProcess itemSport, DbUpdateInfo dbUpdateInfo);
|
||||||
public abstract bool UpdateItemSport(SaxItemSport itemSport, DbUpdateInfo dbUpdateInfo);
|
public abstract bool UpdateItemSport(SaxItemProcess itemSport, DbUpdateInfo dbUpdateInfo);
|
||||||
public virtual bool ItemSportCanBeDeleted(SaxItemSport itemSport)
|
public virtual bool ItemSportCanBeDeleted(SaxItemProcess itemSport)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public abstract bool DeleteItemSport(SaxItemSport itemSport, DbUpdateInfo dbUpdateInfo);
|
public abstract bool DeleteItemSport(SaxItemProcess itemSport, DbUpdateInfo dbUpdateInfo);
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Item list.
|
// Item list.
|
||||||
public abstract ColumnDfn GetItemSportColumnDfn(SaxItemSport.Column columnId, String caption = "", int width = 0);
|
public abstract ColumnDfn GetItemSportColumnDfn(SaxItemProcess.Column columnId, String caption = "", int width = 0);
|
||||||
public abstract List<String> GetItemSportQueryFilter(SaxItemSport.Params prmItemSport);
|
public abstract List<String> GetItemSportQueryFilter(SaxItemProcess.Params prmItemSport);
|
||||||
public abstract long GetItemSportCount(SaxItemSport.Params prmItemSport);
|
public abstract long GetItemSportCount(SaxItemProcess.Params prmItemSport);
|
||||||
public abstract List<SaxItemSport> GetItemSportList(SaxItemSport.Params prmItemSport);
|
public abstract List<SaxItemProcess> GetItemSportList(SaxItemProcess.Params prmItemSport);
|
||||||
public abstract DbResultSet ExecuteItemSportQuery(List<ColumnDfn> columns, SaxItemSport.Params prmItemSport);
|
public abstract DbResultSet ExecuteItemSportQuery(List<ColumnDfn> columns, SaxItemProcess.Params prmItemSport);
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -146,16 +146,16 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
|||||||
public virtual DataValue GetItemSportDataValue(ColumnDfn column, NamedValue.Map values)
|
public virtual DataValue GetItemSportDataValue(ColumnDfn column, NamedValue.Map values)
|
||||||
{
|
{
|
||||||
DataValue value = new DataValue();
|
DataValue value = new DataValue();
|
||||||
switch ((SaxItemSport.Column)column.Id)
|
switch ((SaxItemProcess.Column)column.Id)
|
||||||
{
|
{
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
// Data item type.
|
// Data item type.
|
||||||
case SaxItemSport.Column.ItemType_Code:
|
case SaxItemProcess.Column.ItemType_Code:
|
||||||
{
|
{
|
||||||
value = new DataValue(DataItemTypeCodes.GetCodeForType(values.GetLong(column.DataName)));
|
value = new DataValue(DataItemTypeCodes.GetCodeForType(values.GetLong(column.DataName)));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SaxItemSport.Column.ItemType_Desc:
|
case SaxItemProcess.Column.ItemType_Desc:
|
||||||
{
|
{
|
||||||
value = new DataValue(DataItemTypeCodes.GetDescForType(values.GetLong(column.DataName)));
|
value = new DataValue(DataItemTypeCodes.GetDescForType(values.GetLong(column.DataName)));
|
||||||
}
|
}
|
||||||
@@ -163,21 +163,21 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
|||||||
|
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
// Notes.
|
// Notes.
|
||||||
case SaxItemSport.Column.Notes:
|
case SaxItemProcess.Column.Notes:
|
||||||
value = new DataValue(SacsHierarchyItem.FormatForDisplay(values.GetValue(column.DataName).ToString(), 200));
|
value = new DataValue(SacsHierarchyItem.FormatForDisplay(values.GetValue(column.DataName).ToString(), 200));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
// Status.
|
// Status.
|
||||||
case SaxItemSport.Column.Status_Desc:
|
case SaxItemProcess.Column.Status_Desc:
|
||||||
case SaxItemSport.Column.Status_Ind:
|
case SaxItemProcess.Column.Status_Ind:
|
||||||
{
|
{
|
||||||
String statusCode = values.GetValue(column.DataName).ToString();
|
String statusCode = values.GetValue(column.DataName).ToString();
|
||||||
SaStatus status = SacsSystem.GetStatusForCode(statusCode);
|
SaStatus status = SacsSystem.GetStatusForCode(statusCode);
|
||||||
if (column.Id == (int)SaxItemSport.Column.Status_Desc)
|
if (column.Id == (int)SaxItemProcess.Column.Status_Desc)
|
||||||
value = new DataValue(SacsSystem.GetStatusDesc(status));
|
value = new DataValue(SacsSystem.GetStatusDesc(status));
|
||||||
else if (column.Id == (int)SaxItemSport.Column.Status_Ind)
|
else if (column.Id == (int)SaxItemProcess.Column.Status_Ind)
|
||||||
value = new DataValue(SaxItemSport.GetStatusTriState(status));
|
value = new DataValue(SaxItemProcess.GetStatusTriState(status));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ namespace Saxonite.Net.Standard.Dbas.App
|
|||||||
// Open database.
|
// Open database.
|
||||||
// NB Must be ODBC connection - especially to retrieve index columns.
|
// NB Must be ODBC connection - especially to retrieve index columns.
|
||||||
SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig();
|
SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig();
|
||||||
config.connectionString = connectionString;
|
config.ConnectionString = connectionString;
|
||||||
SacsDatabase database = SacsDatabaseConsole.OpenOdbcDatabase(config);
|
SacsDatabase database = SacsDatabaseConsole.OpenOdbcDatabase(config);
|
||||||
|
|
||||||
// Generate database definition.
|
// Generate database definition.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ using System.Text;
|
|||||||
namespace Saxonite.Net.Standard.Dbas.Bus
|
namespace Saxonite.Net.Standard.Dbas.Bus
|
||||||
{
|
{
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
public class SaxItemSport_Dbas : SaxItemSport
|
public class SaxItemSport_Dbas : SaxItemProcess
|
||||||
{
|
{
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Data members.
|
// Data members.
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
private void PopulateFrom(UserSession_Db dbUserSession, SaxUserSession userSession)
|
private void PopulateFrom(UserSession_Db dbUserSession, SaxUserSession userSession)
|
||||||
{
|
{
|
||||||
//userSession.UserAccountId = new SysId(dbUserSession._UserAccountId);
|
//userSession.UserAccountId = new SysId(dbUserSession._UserAccountId);
|
||||||
userSession.ActivityIndexIds = StringListUtil.Split(dbUserSession._ActivityIndexIds, SaxUserSession.ActivityIndexDelim).Select(item => item.ToSysId()).ToList();
|
userSession.ActivityIndexIds = StringListUtil.Split(dbUserSession._ActivityIndexIds, SaxUserSession.ActivityIndexDelim).Select(item => SysId.ToSysId(item)).ToList();
|
||||||
userSession.UserSessionData = dbUserSession._UserSessionData;
|
userSession.UserSessionData = dbUserSession._UserSessionData;
|
||||||
// Common.
|
// Common.
|
||||||
userSession.SetCreateStamp(dbUserSession._CreateOn, new SysId(), "");
|
userSession.SetCreateStamp(dbUserSession._CreateOn, new SysId(), "");
|
||||||
|
|||||||
@@ -242,9 +242,9 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
//userSport.SportId = new SysId(dbUserSport._SportId);
|
//userSport.SportId = new SysId(dbUserSport._SportId);
|
||||||
userSport.About = dbUserSport._About;
|
userSport.About = dbUserSport._About;
|
||||||
userSport.ContactsData = dbUserSport._ContactsData;
|
userSport.ContactsData = dbUserSport._ContactsData;
|
||||||
userSport.Participating = (Sax.SportParticipating)dbUserSport._Participating;
|
userSport.Participating = (Sax.SportParticipating)(dbUserSport._Participating ?? 0);
|
||||||
userSport.Preparing = (Sax.SportPreparing)dbUserSport._Preparing;
|
userSport.Preparing = (Sax.SportPreparing)(dbUserSport._Preparing ?? 0);
|
||||||
userSport.Officiating = (Sax.SportOfficiating)dbUserSport._Officiating;
|
userSport.Officiating = (Sax.SportOfficiating)(dbUserSport._Officiating ?? 0);
|
||||||
userSport.UserSportData = dbUserSport._UserSportData;
|
userSport.UserSportData = dbUserSport._UserSportData;
|
||||||
// Common.
|
// Common.
|
||||||
userSport.Notes = dbUserSport._Notes;
|
userSport.Notes = dbUserSport._Notes;
|
||||||
|
|||||||
@@ -102,7 +102,6 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
// Insert item.
|
// Insert item.
|
||||||
public override bool InsertUserActivity(SaxUserActivity userActivity, DbUpdateInfo dbUpdateInfo)
|
public override bool InsertUserActivity(SaxUserActivity userActivity, DbUpdateInfo dbUpdateInfo)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".InsertUserActivity";
|
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidUserActivity(userActivity)) return false;
|
if (!IsValidUserActivity(userActivity)) return false;
|
||||||
if (SysId.IsValid(userActivity.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
if (SysId.IsValid(userActivity.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
||||||
@@ -122,7 +121,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
dbUserActivity.ExecuteInsertCommand(dbCommand);
|
dbUserActivity.ExecuteInsertCommand(dbCommand);
|
||||||
userActivity.Id = new SysId(dbUserActivity._Id);
|
userActivity.Id = new SysId(dbUserActivity._Id);
|
||||||
userActivity.Changed = false;
|
userActivity.Changed = false;
|
||||||
if (DebugMode) SaLogger.Debug(fn + " Inserted. " + GetLogProperties(userActivity).Concat(": ").Concat("", "\n\t"));
|
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn} Inserted. {GetLogProperties(userActivity).Concat(": ").Concat("", "\n\t")}");
|
||||||
UpdateActivityFeedback(userActivity, null, dbUpdateInfo);
|
UpdateActivityFeedback(userActivity, null, dbUpdateInfo);
|
||||||
}
|
}
|
||||||
catch (Exception exc) { SetErrorState(exc.Message); }
|
catch (Exception exc) { SetErrorState(exc.Message); }
|
||||||
@@ -134,13 +133,12 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
// Update item.
|
// Update item.
|
||||||
public override bool UpdateUserActivity(SaxUserActivity userActivity, DbUpdateInfo dbUpdateInfo)
|
public override bool UpdateUserActivity(SaxUserActivity userActivity, DbUpdateInfo dbUpdateInfo)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".UpdateUserActivity";
|
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidUserActivity(userActivity)) return false;
|
if (!IsValidUserActivity(userActivity)) return false;
|
||||||
if (!SysId.IsValid(userActivity.Id)) return SetErrorState(ErrorMessage.InvalidItemId);
|
if (!SysId.IsValid(userActivity.Id)) return SetErrorState(ErrorMessage.InvalidItemId);
|
||||||
if (!userActivity.Changed)
|
if (!userActivity.Changed)
|
||||||
{
|
{
|
||||||
if (DebugMode) SaLogger.Debug(fn + " Data not changed. " + GetLogProperties(userActivity).Concat(": ").Concat("", "\n\t"));
|
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn} Data not changed. {GetLogProperties(userActivity).Concat(": ").Concat("", "\n\t")}");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
using (var dbConnection = CoreDatabase.CreateConnection())
|
using (var dbConnection = CoreDatabase.CreateConnection())
|
||||||
@@ -151,7 +149,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
// Retrieve item.
|
// Retrieve item.
|
||||||
dbConnection.Open();
|
dbConnection.Open();
|
||||||
UserActivity_Db dbUserActivity = new UserActivity_Db(CoreDbInfo);
|
UserActivity_Db dbUserActivity = new UserActivity_Db(CoreDbInfo);
|
||||||
dbUserActivity.PopulateFrom(dbCommand, aliasUserActivity, "Id=" + SysId.ToString(userActivity.Id));
|
dbUserActivity.PopulateFrom(dbCommand, aliasUserActivity, $"Id={SysId.ToString(userActivity.Id)}");
|
||||||
// Snapshot item.
|
// Snapshot item.
|
||||||
SaxUserActivity userActivity_Snapshot = CreateUserActivity(dbUserActivity);
|
SaxUserActivity userActivity_Snapshot = CreateUserActivity(dbUserActivity);
|
||||||
// ToDo SaxUpdateLogItemMonitor_UserActivity updateLogMonitor = new SaxUpdateLogItemMonitor_UserActivity(SessionContext, CreateUserActivity(dbUserActivity), dbUpdateInfo);
|
// ToDo SaxUpdateLogItemMonitor_UserActivity updateLogMonitor = new SaxUpdateLogItemMonitor_UserActivity(SessionContext, CreateUserActivity(dbUserActivity), dbUpdateInfo);
|
||||||
@@ -159,7 +157,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
PopulateTo(dbUserActivity, userActivity, dbUpdateInfo);
|
PopulateTo(dbUserActivity, userActivity, dbUpdateInfo);
|
||||||
dbUserActivity.ExecuteUpdateCommand(dbCommand);
|
dbUserActivity.ExecuteUpdateCommand(dbCommand);
|
||||||
userActivity.Changed = false;
|
userActivity.Changed = false;
|
||||||
if (DebugMode) SaLogger.Debug(fn + " Updated. " + GetLogProperties(userActivity).Concat(": ").Concat("", "\n\t"));
|
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn} Updated. {GetLogProperties(userActivity).Concat(": ").Concat("", "\n\t")}");
|
||||||
// Record updates.
|
// Record updates.
|
||||||
// ToDo updateLogMonitor.RecordUpdatedValues(userActivity);
|
// ToDo updateLogMonitor.RecordUpdatedValues(userActivity);
|
||||||
// ToDo updateLogMonitor.LogUpdates();
|
// ToDo updateLogMonitor.LogUpdates();
|
||||||
@@ -202,7 +200,6 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
public override bool DeleteUserActivity(SaxUserActivity userActivity, DbUpdateInfo dbUpdateInfo)
|
public override bool DeleteUserActivity(SaxUserActivity userActivity, DbUpdateInfo dbUpdateInfo)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".DeleteUserActivity";
|
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!UserActivityCanBeDeleted(userActivity)) return false;
|
if (!UserActivityCanBeDeleted(userActivity)) return false;
|
||||||
|
|
||||||
@@ -226,7 +223,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
dbCommand.CommandText = "DELETE " + aliasUserActivity + " FROM " + SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserActivity) + " As " + aliasUserActivity + " WHERE Id=" + SysId.ToLong(userActivity.Id) + "; ";
|
dbCommand.CommandText = "DELETE " + aliasUserActivity + " FROM " + SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserActivity) + " As " + aliasUserActivity + " WHERE Id=" + SysId.ToLong(userActivity.Id) + "; ";
|
||||||
dbCommand.ExecuteNonQuery();
|
dbCommand.ExecuteNonQuery();
|
||||||
userActivity.Changed = false;
|
userActivity.Changed = false;
|
||||||
if (DebugMode) SaLogger.Debug(fn + " Deleted. " + GetLogProperties(userActivity).Concat(": ").Concat("", "\n\t"));
|
if (DebugMode) SaLogger.Debug($"{SysUtil.Fn} Deleted. " + GetLogProperties(userActivity).Concat(": ").Concat("", "\n\t"));
|
||||||
}
|
}
|
||||||
catch (Exception exc) { SetErrorState(exc.Message); }
|
catch (Exception exc) { SetErrorState(exc.Message); }
|
||||||
}
|
}
|
||||||
@@ -439,17 +436,15 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
String aliasUserActivity = StringUtil.OnEmpty(prm.Alias_UserActivity, SaxActivityMgr_Dbas.aliasUserActivity);
|
String aliasUserActivity = StringUtil.OnEmpty(prm.Alias_UserActivity, SaxActivityMgr_Dbas.aliasUserActivity);
|
||||||
|
|
||||||
// Ids.
|
// Ids.
|
||||||
String idsIncluded = prm.IdsIncluded.Concat(",");
|
if (prm.IdsIncluded.HasValidIds())
|
||||||
if (!idsIncluded.IsEmpty())
|
filter.Add($"{SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserSport_Id, aliasUserActivity)} IN ({prm.IdsIncluded.Concat(", ")})");
|
||||||
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserSport_Id, aliasUserActivity) + " IN (" + idsIncluded + ")");
|
if (prm.IdsExcluded.HasValidIds())
|
||||||
String idsExcluded = prm.IdsExcluded.Concat(",");
|
filter.Add($"{SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserSport_Id, aliasUserActivity)} NOT IN ({prm.IdsExcluded.Concat(",")})");
|
||||||
if (!idsExcluded.IsEmpty())
|
|
||||||
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserSport_Id, aliasUserActivity) + " NOT IN (" + idsExcluded + ")");
|
|
||||||
|
|
||||||
// User accounts.
|
// User accounts.
|
||||||
String userAccountIdsIncluded = prm.UserAccountIdsIncluded.Concat(",");
|
String userAccountIdsIncluded = prm.UserAccountIdsIncluded.Concat(",");
|
||||||
if (!userAccountIdsIncluded.IsEmpty())
|
if (!userAccountIdsIncluded.IsEmpty())
|
||||||
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserSport_UserAccountId, aliasUserActivity) + " IN (" + userAccountIdsIncluded + ")");
|
filter.Add($"{SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserSport_UserAccountId, aliasUserActivity)} IN ({userAccountIdsIncluded})");
|
||||||
|
|
||||||
// Item Ids.
|
// Item Ids.
|
||||||
if (!prm.ItemIdsIncluded.IsEmpty())
|
if (!prm.ItemIdsIncluded.IsEmpty())
|
||||||
@@ -459,8 +454,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
{
|
{
|
||||||
if (!ItemId.IsValid(itemId)) continue;
|
if (!ItemId.IsValid(itemId)) continue;
|
||||||
String itemIdFilter =
|
String itemIdFilter =
|
||||||
SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserActivity_ItemType, aliasUserActivity) + "=" + itemId.Type +
|
$"{SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserActivity_ItemType, aliasUserActivity)}={itemId.Type}" +
|
||||||
" AND " + SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserActivity_ItemId, aliasUserActivity) + "=" + SysId.ToInt(itemId.Id);
|
$" AND {SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserActivity_ItemId, aliasUserActivity)}={SysId.ToInt(itemId.Id)}";
|
||||||
itemIdFilters.Add(itemIdFilter);
|
itemIdFilters.Add(itemIdFilter);
|
||||||
}
|
}
|
||||||
if (!itemIdFilters.IsEmpty())
|
if (!itemIdFilters.IsEmpty())
|
||||||
@@ -511,7 +506,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
private long GetUserActivityCount(String filter)
|
private long GetUserActivityCount(String filter)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
return CoreDatabase.GetRowCount(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserActivity) + " As " + aliasUserActivity, filter);
|
return CoreDatabase.GetRowCount($"{SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserActivity)} As {aliasUserActivity}", filter);
|
||||||
}
|
}
|
||||||
public override long GetUserActivityCount(SaxUserActivity.Params prm)
|
public override long GetUserActivityCount(SaxUserActivity.Params prm)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
// Item Data Mgr - Item Sport
|
// Item Data Mgr - Item Sport
|
||||||
//*******************************************************************
|
//*******************************************************************
|
||||||
// Utilities.
|
// Utilities.
|
||||||
private List<StringPair> GetLogProperties(SaxItemSport itemSport)
|
private List<StringPair> GetLogProperties(SaxItemProcess itemSport)
|
||||||
{
|
{
|
||||||
return new List<StringPair>()
|
return new List<StringPair>()
|
||||||
{
|
{
|
||||||
@@ -37,7 +37,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Create item.
|
// Create item.
|
||||||
public override SaxItemSport CreateItemSport()
|
public override SaxItemProcess CreateItemSport()
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
return new SaxItemSport_Dbas(CoreDatabase, null, null, null, 0);
|
return new SaxItemSport_Dbas(CoreDatabase, null, null, null, 0);
|
||||||
@@ -53,12 +53,12 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Get item.
|
// Get item.
|
||||||
public override SaxItemSport GetItemSport(SaxItemSport.Params prm)
|
public override SaxItemProcess GetItemSport(SaxItemProcess.Params prm)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
return GetItemSport(GetItemSportQueryFilter(prm).Concat(" And ", "(", ")"));
|
return GetItemSport(GetItemSportQueryFilter(prm).Concat(" And ", "(", ")"));
|
||||||
}
|
}
|
||||||
private SaxItemSport GetItemSport(String filter)
|
private SaxItemProcess GetItemSport(String filter)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
long count = GetItemSportCount(filter);
|
long count = GetItemSportCount(filter);
|
||||||
@@ -68,7 +68,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
SetErrorState("Multiple items found");
|
SetErrorState("Multiple items found");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
SaxItemSport itemSport = null;
|
SaxItemProcess itemSport = null;
|
||||||
// Query data.
|
// Query data.
|
||||||
using (var dbConnection = CoreDatabase.CreateConnection())
|
using (var dbConnection = CoreDatabase.CreateConnection())
|
||||||
using (var dbCommand = dbConnection.CreateCommand())
|
using (var dbCommand = dbConnection.CreateCommand())
|
||||||
@@ -91,7 +91,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Validate item.
|
// Validate item.
|
||||||
public override bool IsValidItemSportData(SaxItemSport.Data data, SaxItemSport.ErrField errField)
|
public override bool IsValidItemSportData(SaxItemProcess.Data data, SaxItemProcess.ErrField errField)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!base.IsValidItemSportData(data, errField)) return false;
|
if (!base.IsValidItemSportData(data, errField)) return false;
|
||||||
@@ -100,7 +100,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Insert item.
|
// Insert item.
|
||||||
public override bool InsertItemSport(SaxItemSport itemSport, DbUpdateInfo dbUpdateInfo)
|
public override bool InsertItemSport(SaxItemProcess itemSport, DbUpdateInfo dbUpdateInfo)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidItemSport(itemSport)) return false;
|
if (!IsValidItemSport(itemSport)) return false;
|
||||||
@@ -130,7 +130,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Update item.
|
// Update item.
|
||||||
public override bool UpdateItemSport(SaxItemSport itemSport, DbUpdateInfo dbUpdateInfo)
|
public override bool UpdateItemSport(SaxItemProcess itemSport, DbUpdateInfo dbUpdateInfo)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!IsValidItemSport(itemSport)) return false;
|
if (!IsValidItemSport(itemSport)) return false;
|
||||||
@@ -166,13 +166,13 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Delete item.
|
// Delete item.
|
||||||
public override bool ItemSportCanBeDeleted(SaxItemSport itemSport)
|
public override bool ItemSportCanBeDeleted(SaxItemProcess itemSport)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!base.ItemSportCanBeDeleted(itemSport)) return false;
|
if (!base.ItemSportCanBeDeleted(itemSport)) return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
public override bool DeleteItemSport(SaxItemSport itemSport, DbUpdateInfo dbUpdateInfo)
|
public override bool DeleteItemSport(SaxItemProcess itemSport, DbUpdateInfo dbUpdateInfo)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
if (!ItemSportCanBeDeleted(itemSport)) return false;
|
if (!ItemSportCanBeDeleted(itemSport)) return false;
|
||||||
@@ -207,7 +207,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Copy data properties to and from database.
|
// Copy data properties to and from database.
|
||||||
private void PopulateTo(ItemSport_Db dbItemSport, SaxItemSport itemSport, DbUpdateInfo dbUpdateInfo)
|
private void PopulateTo(ItemSport_Db dbItemSport, SaxItemProcess itemSport, DbUpdateInfo dbUpdateInfo)
|
||||||
{
|
{
|
||||||
dbItemSport._Id = SysId.ToInt(itemSport.Id);
|
dbItemSport._Id = SysId.ToInt(itemSport.Id);
|
||||||
dbItemSport._ItemType = itemSport.ItemId.Type;
|
dbItemSport._ItemType = itemSport.ItemId.Type;
|
||||||
@@ -228,7 +228,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
dbItemSport._UpdateBy = dbUpdateInfo.UserId.ToInt();
|
dbItemSport._UpdateBy = dbUpdateInfo.UserId.ToInt();
|
||||||
dbItemSport._UpdateHost = dbUpdateInfo.Host;
|
dbItemSport._UpdateHost = dbUpdateInfo.Host;
|
||||||
}
|
}
|
||||||
private void PopulateFrom(ItemSport_Db dbItemSport, SaxItemSport itemSport)
|
private void PopulateFrom(ItemSport_Db dbItemSport, SaxItemProcess itemSport)
|
||||||
{
|
{
|
||||||
//itemSport.Id = new SysId(dbItemSport._Id);
|
//itemSport.Id = new SysId(dbItemSport._Id);
|
||||||
//itemSport.ItemId = new ItemId(dbItemSport._ItemType, new SysId(dbItemSport._ItemId);
|
//itemSport.ItemId = new ItemId(dbItemSport._ItemType, new SysId(dbItemSport._ItemId);
|
||||||
@@ -258,46 +258,46 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
if (dataType == DataValue.DataType.String && dbCol != SaxDbDfn_Core.ColumnIdx.Unknown)
|
if (dataType == DataValue.DataType.String && dbCol != SaxDbDfn_Core.ColumnIdx.Unknown)
|
||||||
col.MaxLength = (int)SaxDbDfn_Core.GetColTextLen(dbCol);
|
col.MaxLength = (int)SaxDbDfn_Core.GetColTextLen(dbCol);
|
||||||
}
|
}
|
||||||
public override ColumnDfn GetItemSportColumnDfn(SaxItemSport.Column columnId, string caption = "", int width = 0)
|
public override ColumnDfn GetItemSportColumnDfn(SaxItemProcess.Column columnId, string caption = "", int width = 0)
|
||||||
{
|
{
|
||||||
ColumnDfn columnDfn = new ColumnDfn((int)columnId, caption, width);
|
ColumnDfn columnDfn = new ColumnDfn((int)columnId, caption, width);
|
||||||
switch (columnId)
|
switch (columnId)
|
||||||
{
|
{
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
case SaxItemSport.Column.Pos:
|
case SaxItemProcess.Column.Pos:
|
||||||
SetItemSportColDfn(columnDfn, "Pos", 60, SaxDbDfn_Core.ColumnIdx.Unknown, ColumnAlignment.Right);
|
SetItemSportColDfn(columnDfn, "Pos", 60, SaxDbDfn_Core.ColumnIdx.Unknown, ColumnAlignment.Right);
|
||||||
columnDfn.SortMode = ColumnDfn.ColumnSortMode.Off;
|
columnDfn.SortMode = ColumnDfn.ColumnSortMode.Off;
|
||||||
columnDfn.ReadOnly = true;
|
columnDfn.ReadOnly = true;
|
||||||
columnDfn.Resizable = false;
|
columnDfn.Resizable = false;
|
||||||
break;
|
break;
|
||||||
case SaxItemSport.Column.Id:
|
case SaxItemProcess.Column.Id:
|
||||||
SetItemSportColDfn(columnDfn, "Id", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_Id, ColumnAlignment.Right, DataValue.DataType.Long);
|
SetItemSportColDfn(columnDfn, "Id", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_Id, ColumnAlignment.Right, DataValue.DataType.Long);
|
||||||
columnDfn.ReadOnly = true;
|
columnDfn.ReadOnly = true;
|
||||||
break;
|
break;
|
||||||
case SaxItemSport.Column.ItemType:
|
case SaxItemProcess.Column.ItemType:
|
||||||
SetItemSportColDfn(columnDfn, "Item type", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_ItemType, ColumnAlignment.Center, DataValue.DataType.Long);
|
SetItemSportColDfn(columnDfn, "Item type", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_ItemType, ColumnAlignment.Center, DataValue.DataType.Long);
|
||||||
columnDfn.ReadOnly = true;
|
columnDfn.ReadOnly = true;
|
||||||
break;
|
break;
|
||||||
case SaxItemSport.Column.ItemType_Code:
|
case SaxItemProcess.Column.ItemType_Code:
|
||||||
SetItemSportColDfn(columnDfn, "Item type", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_ItemType, ColumnAlignment.Center);
|
SetItemSportColDfn(columnDfn, "Item type", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_ItemType, ColumnAlignment.Center);
|
||||||
columnDfn.ReadOnly = true;
|
columnDfn.ReadOnly = true;
|
||||||
break;
|
break;
|
||||||
case SaxItemSport.Column.ItemType_Desc:
|
case SaxItemProcess.Column.ItemType_Desc:
|
||||||
SetItemSportColDfn(columnDfn, "Item type", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_ItemType, ColumnAlignment.Center);
|
SetItemSportColDfn(columnDfn, "Item type", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_ItemType, ColumnAlignment.Center);
|
||||||
columnDfn.ReadOnly = true;
|
columnDfn.ReadOnly = true;
|
||||||
break;
|
break;
|
||||||
case SaxItemSport.Column.ItemId:
|
case SaxItemProcess.Column.ItemId:
|
||||||
SetItemSportColDfn(columnDfn, "Item Id", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_ItemId, ColumnAlignment.Right, DataValue.DataType.Long);
|
SetItemSportColDfn(columnDfn, "Item Id", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_ItemId, ColumnAlignment.Right, DataValue.DataType.Long);
|
||||||
columnDfn.ReadOnly = true;
|
columnDfn.ReadOnly = true;
|
||||||
break;
|
break;
|
||||||
case SaxItemSport.Column.SportId:
|
case SaxItemProcess.Column.SportId:
|
||||||
SetItemSportColDfn(columnDfn, "Sport Id", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_SportId, ColumnAlignment.Right, DataValue.DataType.Long);
|
SetItemSportColDfn(columnDfn, "Sport Id", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_SportId, ColumnAlignment.Right, DataValue.DataType.Long);
|
||||||
columnDfn.ReadOnly = true;
|
columnDfn.ReadOnly = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
// Sport properties.
|
// Sport properties.
|
||||||
case SaxItemSport.Column.Sport_Name:
|
case SaxItemProcess.Column.Sport_Name:
|
||||||
SetItemSportColDfn(columnDfn, "Sport", 120, SaxDbDfn_Core.ColumnIdx.Sport_Name, ColumnAlignment.Left, DataValue.DataType.String, aliasItemSport_Sport, prefixItemSport_Sport);
|
SetItemSportColDfn(columnDfn, "Sport", 120, SaxDbDfn_Core.ColumnIdx.Sport_Name, ColumnAlignment.Left, DataValue.DataType.String, aliasItemSport_Sport, prefixItemSport_Sport);
|
||||||
columnDfn.ReadOnly = true;
|
columnDfn.ReadOnly = true;
|
||||||
break;
|
break;
|
||||||
@@ -307,27 +307,27 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
|
|
||||||
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
||||||
// Common properties.
|
// Common properties.
|
||||||
case SaxItemSport.Column.Notes:
|
case SaxItemProcess.Column.Notes:
|
||||||
SetItemSportColDfn(columnDfn, "Notes", 240, SaxDbDfn_Core.ColumnIdx.ItemSport_Notes);
|
SetItemSportColDfn(columnDfn, "Notes", 240, SaxDbDfn_Core.ColumnIdx.ItemSport_Notes);
|
||||||
break;
|
break;
|
||||||
case SaxItemSport.Column.Flags:
|
case SaxItemProcess.Column.Flags:
|
||||||
SetItemSportColDfn(columnDfn, "Flags", 60, SaxDbDfn_Core.ColumnIdx.ItemSport_Flags, ColumnAlignment.Center, DataValue.DataType.Long);
|
SetItemSportColDfn(columnDfn, "Flags", 60, SaxDbDfn_Core.ColumnIdx.ItemSport_Flags, ColumnAlignment.Center, DataValue.DataType.Long);
|
||||||
break;
|
break;
|
||||||
case SaxItemSport.Column.Status:
|
case SaxItemProcess.Column.Status:
|
||||||
SetItemSportColDfn(columnDfn, "Status", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_Status, ColumnAlignment.Center);
|
SetItemSportColDfn(columnDfn, "Status", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_Status, ColumnAlignment.Center);
|
||||||
break;
|
break;
|
||||||
case SaxItemSport.Column.Status_Desc:
|
case SaxItemProcess.Column.Status_Desc:
|
||||||
SetItemSportColDfn(columnDfn, "Status", 90, SaxDbDfn_Core.ColumnIdx.ItemSport_Status, ColumnAlignment.Center);
|
SetItemSportColDfn(columnDfn, "Status", 90, SaxDbDfn_Core.ColumnIdx.ItemSport_Status, ColumnAlignment.Center);
|
||||||
break;
|
break;
|
||||||
case SaxItemSport.Column.Status_Ind:
|
case SaxItemProcess.Column.Status_Ind:
|
||||||
SetItemSportColDfn(columnDfn, "Status", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_Status, ColumnAlignment.Center, DataValue.DataType.TriState);
|
SetItemSportColDfn(columnDfn, "Status", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_Status, ColumnAlignment.Center, DataValue.DataType.TriState);
|
||||||
columnDfn.TriStateFormat = ColumnTriStateFormat.Lights;
|
columnDfn.TriStateFormat = ColumnTriStateFormat.Lights;
|
||||||
break;
|
break;
|
||||||
case SaxItemSport.Column.CreateOn_Date:
|
case SaxItemProcess.Column.CreateOn_Date:
|
||||||
SetItemSportColDfn(columnDfn, "Created", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_CreateOn, ColumnAlignment.Center, DataValue.DataType.Date);
|
SetItemSportColDfn(columnDfn, "Created", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_CreateOn, ColumnAlignment.Center, DataValue.DataType.Date);
|
||||||
columnDfn.ReadOnly = true;
|
columnDfn.ReadOnly = true;
|
||||||
break;
|
break;
|
||||||
case SaxItemSport.Column.UpdateOn_Date:
|
case SaxItemProcess.Column.UpdateOn_Date:
|
||||||
SetItemSportColDfn(columnDfn, "Updated", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_UpdateOn, ColumnAlignment.Center, DataValue.DataType.Date);
|
SetItemSportColDfn(columnDfn, "Updated", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_UpdateOn, ColumnAlignment.Center, DataValue.DataType.Date);
|
||||||
columnDfn.ReadOnly = true;
|
columnDfn.ReadOnly = true;
|
||||||
break;
|
break;
|
||||||
@@ -342,7 +342,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Item query filter.
|
// Item query filter.
|
||||||
public override List<string> GetItemSportQueryFilter(SaxItemSport.Params prm)
|
public override List<string> GetItemSportQueryFilter(SaxItemProcess.Params prm)
|
||||||
{
|
{
|
||||||
List<String> filter = new List<String>();
|
List<String> filter = new List<String>();
|
||||||
|
|
||||||
@@ -380,26 +380,26 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_Notes, aliasItemSport) + " LIKE '%" + DbQuery.FormatForLike(prm.NotesPartial) + "%'");
|
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_Notes, aliasItemSport) + " LIKE '%" + DbQuery.FormatForLike(prm.NotesPartial) + "%'");
|
||||||
|
|
||||||
// Status.
|
// Status.
|
||||||
if (prm.StatusCat != SaxItemSport.StatusCat.Any)
|
if (prm.StatusCat != SaxItemProcess.StatusCat.Any)
|
||||||
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_Status, aliasItemSport) + GetItemSportStatusCatFilterCondition(prm.StatusCat));
|
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_Status, aliasItemSport) + GetItemSportStatusCatFilterCondition(prm.StatusCat));
|
||||||
|
|
||||||
if (filter.Count < 1) filter.Add("1=1");
|
if (filter.Count < 1) filter.Add("1=1");
|
||||||
return filter;
|
return filter;
|
||||||
}
|
}
|
||||||
internal static String GetItemSportStatusCatFilterCondition(SaxItemSport.StatusCat statusCat)
|
internal static String GetItemSportStatusCatFilterCondition(SaxItemProcess.StatusCat statusCat)
|
||||||
{
|
{
|
||||||
if (statusCat == SaxItemSport.StatusCat.ActiveOnly)
|
if (statusCat == SaxItemProcess.StatusCat.ActiveOnly)
|
||||||
return "='" + SacsSystem.GetStatusCode(SaStatus.Active) + "'";
|
return "='" + SacsSystem.GetStatusCode(SaStatus.Active) + "'";
|
||||||
if (statusCat == SaxItemSport.StatusCat.InactiveOnly)
|
if (statusCat == SaxItemProcess.StatusCat.InactiveOnly)
|
||||||
return "='" + SacsSystem.GetStatusCode(SaStatus.Inactive) + "'";
|
return "='" + SacsSystem.GetStatusCode(SaStatus.Inactive) + "'";
|
||||||
if (statusCat == SaxItemSport.StatusCat.NotDeleted)
|
if (statusCat == SaxItemProcess.StatusCat.NotDeleted)
|
||||||
return "!='" + SacsSystem.GetStatusCode(SaStatus.Deleted) + "'";
|
return "!='" + SacsSystem.GetStatusCode(SaStatus.Deleted) + "'";
|
||||||
if (statusCat == SaxItemSport.StatusCat.DeletedOnly)
|
if (statusCat == SaxItemProcess.StatusCat.DeletedOnly)
|
||||||
return "='" + SacsSystem.GetStatusCode(SaStatus.Deleted) + "'";
|
return "='" + SacsSystem.GetStatusCode(SaStatus.Deleted) + "'";
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
// Item sort columns.
|
// Item sort columns.
|
||||||
public List<String> GetItemSportSortColumns(SaxItemSport.Params prm)
|
public List<String> GetItemSportSortColumns(SaxItemProcess.Params prm)
|
||||||
{
|
{
|
||||||
// Sort sequence:
|
// Sort sequence:
|
||||||
List<String> sortColumnNames = new List<String>();
|
List<String> sortColumnNames = new List<String>();
|
||||||
@@ -439,7 +439,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
return CoreDatabase.GetRowCount(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.ItemSport) + " As " + aliasItemSport, filter);
|
return CoreDatabase.GetRowCount(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.ItemSport) + " As " + aliasItemSport, filter);
|
||||||
}
|
}
|
||||||
public override long GetItemSportCount(SaxItemSport.Params prm)
|
public override long GetItemSportCount(SaxItemProcess.Params prm)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
return GetItemSportCount(GetItemSportQueryFilter(prm).Concat(" AND ", "(", ")"));
|
return GetItemSportCount(GetItemSportQueryFilter(prm).Concat(" AND ", "(", ")"));
|
||||||
@@ -447,10 +447,10 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Item list.
|
// Item list.
|
||||||
public override List<SaxItemSport> GetItemSportList(SaxItemSport.Params prm)
|
public override List<SaxItemProcess> GetItemSportList(SaxItemProcess.Params prm)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
List<SaxItemSport> itemSports = new List<SaxItemSport>();
|
List<SaxItemProcess> itemSports = new List<SaxItemProcess>();
|
||||||
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
|
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
|
||||||
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.ItemSport), aliasItemSport);
|
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.ItemSport), aliasItemSport);
|
||||||
ItemSport_Db dbItemSport = new ItemSport_Db(CoreDbInfo);
|
ItemSport_Db dbItemSport = new ItemSport_Db(CoreDbInfo);
|
||||||
@@ -486,7 +486,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Item query execution.
|
// Item query execution.
|
||||||
public override DbResultSet ExecuteItemSportQuery(List<ColumnDfn> columns, SaxItemSport.Params prm)
|
public override DbResultSet ExecuteItemSportQuery(List<ColumnDfn> columns, SaxItemProcess.Params prm)
|
||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
|
|
||||||
@@ -496,25 +496,25 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
query.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.ItemSport), aliasItemSport);
|
query.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.ItemSport), aliasItemSport);
|
||||||
|
|
||||||
// Add columns as defined in query list.
|
// Add columns as defined in query list.
|
||||||
if (columns.HasId(SaxItemSport.Column.Id))
|
if (columns.HasId(SaxItemProcess.Column.Id))
|
||||||
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_Id, aliasItemSport));
|
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_Id, aliasItemSport));
|
||||||
if (columns.HasId(SaxItemSport.Column.ItemType) || columns.HasId(SaxItemSport.Column.ItemType_Code) || columns.HasId(SaxItemSport.Column.ItemType_Desc))
|
if (columns.HasId(SaxItemProcess.Column.ItemType) || columns.HasId(SaxItemProcess.Column.ItemType_Code) || columns.HasId(SaxItemProcess.Column.ItemType_Desc))
|
||||||
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_ItemType, aliasItemSport));
|
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_ItemType, aliasItemSport));
|
||||||
if (columns.HasId(SaxItemSport.Column.ItemId))
|
if (columns.HasId(SaxItemProcess.Column.ItemId))
|
||||||
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_ItemId, aliasItemSport));
|
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_ItemId, aliasItemSport));
|
||||||
bool hasSportCols = (columns.HasId(SaxItemSport.Column.Sport_Name));
|
bool hasSportCols = (columns.HasId(SaxItemProcess.Column.Sport_Name));
|
||||||
if (columns.HasId(SaxItemSport.Column.SportId) || hasSportCols)
|
if (columns.HasId(SaxItemProcess.Column.SportId) || hasSportCols)
|
||||||
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_SportId, aliasItemSport));
|
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_SportId, aliasItemSport));
|
||||||
// Common properties.
|
// Common properties.
|
||||||
if (columns.HasId(SaxItemSport.Column.Notes))
|
if (columns.HasId(SaxItemProcess.Column.Notes))
|
||||||
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_Notes, aliasItemSport));
|
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_Notes, aliasItemSport));
|
||||||
if (columns.HasId(SaxItemSport.Column.Flags))
|
if (columns.HasId(SaxItemProcess.Column.Flags))
|
||||||
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_Flags, aliasItemSport));
|
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_Flags, aliasItemSport));
|
||||||
if (columns.HasId(SaxItemSport.Column.Status) || columns.HasId(SaxItemSport.Column.Status_Desc) || columns.HasId(SaxItemSport.Column.Status_Ind))
|
if (columns.HasId(SaxItemProcess.Column.Status) || columns.HasId(SaxItemProcess.Column.Status_Desc) || columns.HasId(SaxItemProcess.Column.Status_Ind))
|
||||||
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_Status, aliasItemSport));
|
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_Status, aliasItemSport));
|
||||||
if (columns.HasId(SaxItemSport.Column.CreateOn_Date))
|
if (columns.HasId(SaxItemProcess.Column.CreateOn_Date))
|
||||||
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_CreateOn, aliasItemSport));
|
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_CreateOn, aliasItemSport));
|
||||||
if (columns.HasId(SaxItemSport.Column.UpdateOn_Date))
|
if (columns.HasId(SaxItemProcess.Column.UpdateOn_Date))
|
||||||
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_UpdateOn, aliasItemSport));
|
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_UpdateOn, aliasItemSport));
|
||||||
|
|
||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
|
|||||||
@@ -37,10 +37,9 @@ namespace Saxonite.Web.Api.Consoles
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Data cache console.
|
// Data cache console.
|
||||||
public override SaxDataCacheConsole GetDataCacheConsole(SaxSessionContext sessionContext)
|
public override SaxDataCacheConsole? GetDataCacheConsole(SaxSessionContext sessionContext)
|
||||||
{
|
{
|
||||||
String fn = GetType().Name + ".GetDataCacheConsole";
|
//throw new NotSupportedException(fn + " Data Cache Console not supported in API app.");
|
||||||
//throw new NotSupportedException(fn + " Data Cache Console not supported in Admin app.");
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ namespace Saxonite.Web.Api.Controllers
|
|||||||
{
|
{
|
||||||
ResponseData_UsgaProvinces responseData = new ResponseData_UsgaProvinces();
|
ResponseData_UsgaProvinces responseData = new ResponseData_UsgaProvinces();
|
||||||
|
|
||||||
SysId countryId = StringUtil.ToSysId(requestData.CountryId);
|
SysId countryId = SysId.ToSysId(requestData.CountryId);
|
||||||
if (SysId.IsValid(countryId))
|
if (SysId.IsValid(countryId))
|
||||||
{
|
{
|
||||||
SaxGolfUsgaProvince.Params prmProvinces = new SaxGolfUsgaProvince.Params();
|
SaxGolfUsgaProvince.Params prmProvinces = new SaxGolfUsgaProvince.Params();
|
||||||
@@ -138,7 +138,7 @@ namespace Saxonite.Web.Api.Controllers
|
|||||||
{
|
{
|
||||||
ResponseData_UsgaCourses responseData = new ResponseData_UsgaCourses();
|
ResponseData_UsgaCourses responseData = new ResponseData_UsgaCourses();
|
||||||
|
|
||||||
SysId provinceId = StringUtil.ToSysId(requestData.ProvinceId);
|
SysId provinceId = SysId.ToSysId(requestData.ProvinceId);
|
||||||
if (SysId.IsValid(provinceId))
|
if (SysId.IsValid(provinceId))
|
||||||
{
|
{
|
||||||
SaxGolfUsgaCourse.Params prmCourses = new SaxGolfUsgaCourse.Params();
|
SaxGolfUsgaCourse.Params prmCourses = new SaxGolfUsgaCourse.Params();
|
||||||
@@ -202,7 +202,7 @@ namespace Saxonite.Web.Api.Controllers
|
|||||||
{
|
{
|
||||||
ResponseData_UsgaMarkers responseData = new ResponseData_UsgaMarkers();
|
ResponseData_UsgaMarkers responseData = new ResponseData_UsgaMarkers();
|
||||||
|
|
||||||
SysId courseId = StringUtil.ToSysId(requestData.CourseId);
|
SysId courseId = SysId.ToSysId(requestData.CourseId);
|
||||||
if (SysId.IsValid(courseId))
|
if (SysId.IsValid(courseId))
|
||||||
{
|
{
|
||||||
SaxGolfUsgaMarker.Params prmMarkers = new SaxGolfUsgaMarker.Params();
|
SaxGolfUsgaMarker.Params prmMarkers = new SaxGolfUsgaMarker.Params();
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.1" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
Reference in New Issue
Block a user