Add support item process tracking and admin updates
This commit is contained in:
@@ -9,10 +9,10 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
|
||||
<PackageReference Include="Moq" Version="4.20.70" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
||||
<PackageReference Include="Moq" Version="4.20.72" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
|
||||
<PackageReference Include="Moq" Version="4.20.70" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.5.2" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.5.2" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
|
||||
<PackageReference Include="Moq" Version="4.20.72" />
|
||||
<PackageReference Include="MSTest.TestAdapter" Version="3.6.4" />
|
||||
<PackageReference Include="MSTest.TestFramework" Version="3.6.4" />
|
||||
<PackageReference Include="coverlet.collector" Version="6.0.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<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)
|
||||
{
|
||||
Context = context;
|
||||
populateDefaults(defaultConfig);
|
||||
PopulateDefaults(defaultConfig);
|
||||
PopulateConfig(configSection);
|
||||
}
|
||||
|
||||
@@ -118,13 +118,15 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
public LoggingConfig Logging { get; } = new LoggingConfig();
|
||||
|
||||
//---------------------------------------------------------------
|
||||
private void populateDefaults(SaxAppConfig defaultConfig)
|
||||
private void PopulateDefaults(SaxAppConfig defaultConfig)
|
||||
{
|
||||
if (defaultConfig == null) return;
|
||||
Security.Password.MinLength = defaultConfig.Security.Password.MinLength;
|
||||
Security.SignIn.KeepLoggedIn.Allowed = defaultConfig.Security.SignIn.KeepLoggedIn.Allowed;
|
||||
Security.SignIn.KeepLoggedIn.CookieExpiresDays = defaultConfig.Security.SignIn.KeepLoggedIn.CookieExpiresDays;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
private void PopulateConfig(ConfigurationSection configSection)
|
||||
{
|
||||
if (configSection != null)
|
||||
@@ -133,6 +135,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
foreach (ConfigurationSection environment in configSection.GetSection("Environments").GetChildren())
|
||||
environments.Add(StringUtil.TrimAll(environment.Value));
|
||||
Instance = StringUtil.OnEmpty(configSection["Instance"], Instance);
|
||||
|
||||
// URLs.
|
||||
IConfigurationSection urls = configSection.GetSection("URLs");
|
||||
if (urls.Exists())
|
||||
@@ -143,6 +146,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
URL.Online.Root = onlineUrls["Root"];
|
||||
}
|
||||
}
|
||||
|
||||
// Security.
|
||||
IConfigurationSection security = configSection.GetSection("Security");
|
||||
if (security.Exists())
|
||||
@@ -170,6 +174,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Email.
|
||||
IConfigurationSection email = configSection.GetSection("Email");
|
||||
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_Welcome, email.GetSection("Signup").GetSection("Welcome"));
|
||||
}
|
||||
|
||||
// Documents.
|
||||
IConfigurationSection documents = configSection.GetSection("Documents");
|
||||
if (documents.Exists())
|
||||
{
|
||||
Documents.RootFolder = StringUtil.OnEmpty(documents["RootFolder"], Documents.RootFolder);
|
||||
}
|
||||
|
||||
// Logging.
|
||||
IConfigurationSection logging = configSection.GetSection("Logging");
|
||||
if (logging.Exists())
|
||||
{
|
||||
Logging.RootFolder = StringUtil.OnEmpty(logging["RootFolder"], Logging.RootFolder);
|
||||
}
|
||||
|
||||
// Database.
|
||||
extractDatabasesConfig(Databases, configSection.GetSection("Databases"));
|
||||
ExtractDatabasesConfig(Databases, configSection.GetSection("Databases"));
|
||||
|
||||
// Variants.
|
||||
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)
|
||||
{
|
||||
if (!emailSection.Exists()) return;
|
||||
@@ -214,14 +225,18 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
foreach (var addressBcc in emailSection.GetSection("AddressesBcc").GetChildren())
|
||||
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;
|
||||
// 'Database' section contains a separate named configuration for each database: 'Core', 'Support' etc.
|
||||
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;
|
||||
Sax.Database databaseType = EnumUtil.ParseEnum<Sax.Database>(databaseSection.Key);
|
||||
|
||||
@@ -132,9 +132,9 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
// Configure database connection.
|
||||
SaxAppConfig.DatabaseConfig databaseConfig = AppConfig.Databases.Databases.GetValue(databaseInstance, new SaxAppConfig.DatabaseConfig());
|
||||
SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig();
|
||||
config.location = databaseConfig.Location;
|
||||
config.user = databaseConfig.User;
|
||||
config.pword = databaseConfig.Password;
|
||||
config.Location = databaseConfig.Location;
|
||||
config.User = databaseConfig.User;
|
||||
config.Password = databaseConfig.Password;
|
||||
SacsDatabase database = SacsDatabaseConsole.OpenOdbcDatabase(config);
|
||||
if (database.HasErrorState())
|
||||
SaLogger.Warn(SysUtil.Fn + " " + databaseInstance.ToString() + " Database initialisation error: " + database.ErrorStateMessage);
|
||||
|
||||
@@ -34,6 +34,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
// Properties.
|
||||
public abstract IStringLocalizer MainProperties { get; }
|
||||
public virtual List<IStringLocalizer> AlternativeProperties { get; } = new List<IStringLocalizer>();
|
||||
private HashSet<String> MissingKeysLogged { get; } = new HashSet<String>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Generic phrase translation.
|
||||
@@ -72,8 +73,11 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (text.ResourceNotFound && logMissingKey)
|
||||
if (text.ResourceNotFound && logMissingKey && !MissingKeysLogged.Contains(key))
|
||||
{
|
||||
MissingKeysLogged.Add(key);
|
||||
SaLogger.Debug($"{SysUtil.Fn} Key not found: {key}");
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
@@ -324,6 +328,12 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
return GetCodeTypeCaption(Sax.CodeType.UserReportType, reportType);
|
||||
}
|
||||
|
||||
// Support Item Process Type.
|
||||
public String GetSupportItemProcessTypeCaption(Sax.SupportItemProcessType processType)
|
||||
{
|
||||
return GetCodeTypeCaption(Sax.CodeType.SupportItemProcessType, processType);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// 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; } }
|
||||
// Support.
|
||||
public List<TypeCodeDesc> UserReportTypeCodes { get { return Internals.UserReportTypeCodes; } }
|
||||
public List<TypeCodeDesc> SupportItemProcessTypeCodes { get { return Internals.SupportItemProcessTypeCodes; } }
|
||||
// Email.
|
||||
public SaEmailConfig EmailConfig { get { return App.EmailConfig; } }
|
||||
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
|
||||
// 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.
|
||||
// IV Must be regenerated if key is changed.
|
||||
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.
|
||||
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.
|
||||
@@ -93,6 +94,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
||||
public List<TypeCodeDesc> ActivityReactionCodes { get { return Internals.ActivityReactionCodes; } }
|
||||
// Support.
|
||||
public List<TypeCodeDesc> UserReportTypeCodes { get { return Internals.UserReportTypeCodes; } }
|
||||
public List<TypeCodeDesc> SupportItemProcessTypeCodes { get { return Internals.SupportItemProcessTypeCodes; } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Common data components.
|
||||
|
||||
@@ -625,7 +625,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
if (StringUtil.IsBlank(usgaCourse.UsgaFacilityId)) continue;
|
||||
SaxReferenceGolfMgr.UsgaFacilityData facilityData = new SaxReferenceGolfMgr.UsgaFacilityData();
|
||||
facilityData.ProvinceCode = provinceCode;
|
||||
facilityData.UsgaFacilityId = StringUtil.ToSysId(usgaCourse.UsgaFacilityId);
|
||||
facilityData.UsgaFacilityId = SysId.ToSysId(usgaCourse.UsgaFacilityId);
|
||||
facilityData.FacilityName = usgaCourse.FacilityName;
|
||||
if (!SysId.IsValid(facilityData.UsgaFacilityId))
|
||||
{
|
||||
@@ -643,9 +643,9 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
{
|
||||
if (StringUtil.IsBlank(usgaCourse.UsgaCourseId)) continue;
|
||||
SaxReferenceGolfMgr.UsgaCourseData courseData = new SaxReferenceGolfMgr.UsgaCourseData();
|
||||
courseData.UsgaFacilityId = StringUtil.ToSysId(usgaCourse.UsgaFacilityId);
|
||||
courseData.UsgaCourseId = StringUtil.ToSysId(usgaCourse.UsgaCourseId);
|
||||
courseData.LegacyCrpCourseId = StringUtil.ToSysId(usgaCourse.LegacyCrpCourseId);
|
||||
courseData.UsgaFacilityId = SysId.ToSysId(usgaCourse.UsgaFacilityId);
|
||||
courseData.UsgaCourseId = SysId.ToSysId(usgaCourse.UsgaCourseId);
|
||||
courseData.LegacyCrpCourseId = SysId.ToSysId(usgaCourse.LegacyCrpCourseId);
|
||||
courseData.Caption = usgaCourse.Caption;
|
||||
courseData.CourseName = usgaCourse.CourseName;
|
||||
courseData.FullName = usgaCourse.FullName;
|
||||
@@ -1026,10 +1026,10 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
}
|
||||
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.
|
||||
//markerDataF9.MarkerId = StringUtil.ToSysId(propertyText);
|
||||
//markerDataB9.MarkerId = StringUtil.ToSysId(propertyText);
|
||||
//markerDataF9.MarkerId = SysId.ToSysId(propertyText);
|
||||
//markerDataB9.MarkerId = SysId.ToSysId(propertyText);
|
||||
}
|
||||
else if (markerColumns.ColIdx_Length == teeColumnIdx)
|
||||
{
|
||||
@@ -1154,7 +1154,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
|
||||
int markerCount = 0;
|
||||
int courseCount = 0;
|
||||
int maxMarkers = 0;
|
||||
//int maxMarkers = 0;
|
||||
int markersCorrected = 0;
|
||||
|
||||
using (DisposableCollection<SacsDisposable> disposables = new DisposableCollection<SacsDisposable>())
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
</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" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@ namespace Saxonite.Net.Core.Web.Admin.Consoles
|
||||
// Data cache console.
|
||||
public override SaxDataCacheConsole GetDataCacheConsole(SaxSessionContext sessionContext)
|
||||
{
|
||||
String fn = GetType().Name + ".GetDataCacheConsole";
|
||||
//throw new NotSupportedException(fn + " Data Cache Console not supported in Admin app.");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Saxonite.Net.Core.Web.Admin.Consoles
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private SaxInternals internals = null;
|
||||
//private SaxInternals internals = null;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
|
||||
@@ -57,7 +57,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Home/Ajax/GetApplicationStats")]
|
||||
public IActionResult Ajax_GetApplicationStats(Model_Sport model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetApplicationStats";
|
||||
String messageTitle = Localiser["home.caption.application"];
|
||||
AjaxResponse_ApplicationStats responseData = new AjaxResponse_ApplicationStats(model);
|
||||
|
||||
|
||||
@@ -34,8 +34,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[HttpGet]
|
||||
public IActionResult Index()
|
||||
{
|
||||
String fn = GetType().Name + ".Index";
|
||||
|
||||
if (!ValidUserSession)
|
||||
AutoLoginUser();
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
public IActionResult GetAccountContactImage(String uaie)
|
||||
{
|
||||
String userAccountIdParam = "";// ToDo Decrypt from uaie value.
|
||||
SysId userAccountId = userAccountIdParam.ToSysId();
|
||||
SysId userAccountId = SysId.ToSysId(userAccountIdParam);
|
||||
if (!SysId.IsValid(userAccountId))
|
||||
userAccountId = SessionUserAccountId;
|
||||
return GetAccountContactImage(userAccountId, Sax.ImageType.Avatar);
|
||||
@@ -80,8 +80,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
/// <returns></returns>
|
||||
private IActionResult GetAccountContactImage(SysId userAccountId, Sax.ImageType imageTypePriority)
|
||||
{
|
||||
String fn = GetType().Name + ".GetAccountContactImage";
|
||||
|
||||
// Validate session and referrer.
|
||||
if (!ValidReferer || !ValidUserSession) return Forbid();
|
||||
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)
|
||||
{
|
||||
String fn = GetType().Name + ".GetOrganisationLogo";
|
||||
|
||||
// Validate session and referrer.
|
||||
if (!ValidReferer || !ValidUserSession) return Forbid();
|
||||
|
||||
@@ -146,7 +142,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
if (parameters.Count < 1) return Forbid();
|
||||
|
||||
// Organisation Id.
|
||||
SysId organisationId = parameters.Get(ParamName_OrganisationId).ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(parameters.Get(ParamName_OrganisationId));
|
||||
if (!SysId.IsValid(organisationId)) return Forbid();
|
||||
ItemId organisationItemId = new ItemId((short)Sax.DataItemType.Organisation, organisationId);
|
||||
|
||||
@@ -187,8 +183,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Image/Item")]
|
||||
public IActionResult GetItemImage(String iie)
|
||||
{
|
||||
String fn = GetType().Name + ".GetItemImage";
|
||||
|
||||
// Validate session and referrer.
|
||||
if (!ValidReferer || !ValidUserSession) return Forbid();
|
||||
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();
|
||||
|
||||
// Item Image.
|
||||
SysId itemImageId = parameters.Get(ParamName_ItemImageId).ToSysId();
|
||||
SysId itemImageId = SysId.ToSysId(parameters.Get(ParamName_ItemImageId));
|
||||
if (!SysId.IsValid(itemImageId)) return Forbid();
|
||||
SaxItemImage itemImage = ItemDataMgr.GetItemImageById(itemImageId);
|
||||
if (itemImage == null)
|
||||
|
||||
@@ -37,7 +37,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Organisation/Ajax/GetActivationInfo")]
|
||||
public IActionResult Ajax_GetActivationInfo(Model_Organisation model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetActivationInfo";
|
||||
String messageTitle = Localiser["caption.organisation"];
|
||||
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."));
|
||||
|
||||
// Identify item.
|
||||
SysId organisationId = model.OrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.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"]));
|
||||
}
|
||||
|
||||
@@ -65,7 +64,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
disposableItems.Add(organisation);
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -107,7 +106,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Organisation/Ajax/ActivateItem")]
|
||||
public IActionResult Ajax_Activate(Model_OrganisationActivation model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_Activate";
|
||||
String messageTitle = Localiser["caption.organisation"];
|
||||
AjaxResponse_Organisation responseData = new AjaxResponse_Organisation(model);
|
||||
|
||||
@@ -120,12 +118,12 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Retrieve existing item.
|
||||
SysId organisationId = model.OrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||
disposableItems.Add(organisation);
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -140,26 +138,26 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
if (userOrganisationId == null) continue;
|
||||
OrganisationMemberData organisationMember = new OrganisationMemberData();
|
||||
disposableItems.Add(organisationMember);
|
||||
organisationMember.UserOrganisation = AccountMgr.GetUserOrganisationById(userOrganisationId.ToSysId());
|
||||
organisationMember.UserOrganisation = AccountMgr.GetUserOrganisationById(SysId.ToSysId(userOrganisationId));
|
||||
organisationMember.UserAccount = AccountMgr.GetUserAccountById(organisationMember.UserOrganisation?.UserAccountId ?? 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"]));
|
||||
}
|
||||
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"]));
|
||||
}
|
||||
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"]));
|
||||
}
|
||||
// Check if this user is to be activated.
|
||||
bool activateUser = false;
|
||||
String controlName_Activate = "MemberActivate_" + userOrganisationId;
|
||||
String controlName_Activate = $"MemberActivate_{userOrganisationId}";
|
||||
foreach (String key in Request.Form.Keys)
|
||||
{
|
||||
if (key.EqualsCI(controlName_Activate))
|
||||
@@ -178,7 +176,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
// Check that organisation already has active members.
|
||||
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"]));
|
||||
}
|
||||
}
|
||||
@@ -187,7 +185,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
organisation.Status = Sarand.Net.Standard.Base.Core.SaStatus.Active;
|
||||
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));
|
||||
}
|
||||
|
||||
@@ -203,14 +201,14 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
// Send activation email.
|
||||
if (SendAccountActivatedEmail(this, organisationMember.UserAccount))
|
||||
SaLogger.Info(fn + " User Activation email sent to " + organisationMember.UserAccount.EmailAddress, true);
|
||||
else SaLogger.Warn(fn + " Failed to send User Activation email to " + organisationMember.UserAccount.EmailAddress);
|
||||
SaLogger.Info($"{SysUtil.Fn} User Activation email sent to {organisationMember.UserAccount.EmailAddress}", true);
|
||||
else SaLogger.Warn($"{SysUtil.Fn} Failed to send User Activation email to {organisationMember.UserAccount.EmailAddress}");
|
||||
}
|
||||
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
|
||||
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.
|
||||
|
||||
+36
-42
@@ -152,7 +152,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Organisation/Ajax/GetAssociations")]
|
||||
public IActionResult Ajax_GetAssociationList(Model_OrganisationAssociations model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetAssociationList";
|
||||
String messageTitle = Localiser["caption.organisation.associations"];
|
||||
AjaxResponse_AssociationList responseData = new AjaxResponse_AssociationList(model);
|
||||
|
||||
@@ -161,10 +160,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
return GetAjaxResult_InvalidSession(responseData);
|
||||
|
||||
// Organisation Id is mandatory.
|
||||
SysId organisationId = model.Filter.OrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.Filter.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"]));
|
||||
}
|
||||
|
||||
@@ -192,8 +191,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
}
|
||||
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.
|
||||
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
||||
{
|
||||
@@ -307,7 +304,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Organisation/Ajax/GetAssociation")]
|
||||
public IActionResult Ajax_GetAssociation(Model_OrganisationAssociations model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetAssociation";
|
||||
String messageTitle = Localiser["caption.organisation.association"];
|
||||
AjaxResponse_Association responseData = new AjaxResponse_Association(model);
|
||||
|
||||
@@ -320,7 +316,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Identify item.
|
||||
SysId itemAssociationId = model.ItemAssociationId.ToSysId();
|
||||
SysId itemAssociationId = SysId.ToSysId(model.ItemAssociationId);
|
||||
if (!SysId.IsValid(itemAssociationId))
|
||||
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);
|
||||
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"]));
|
||||
}
|
||||
|
||||
// Identify organisations.
|
||||
SysId organisationId = model.OrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||
SysId organisationIdAssoc = null;
|
||||
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"]));
|
||||
}
|
||||
|
||||
// Validate the association.
|
||||
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"]));
|
||||
}
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -362,7 +358,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
organisationIdAssoc = itemAssociation.ItemIdFrom.Id;
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -371,7 +367,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
disposableItems.Add(organisation);
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -380,7 +376,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
disposableItems.Add(organisationAssoc);
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -399,7 +395,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Organisation/Ajax/StoreAssociation")]
|
||||
public IActionResult Ajax_StoreAssociation(Model_OrganisationAssociations model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_StoreAssociation";
|
||||
String messageTitle = Localiser["caption.organisation.association"];
|
||||
AjaxResponse_Association responseData = new AjaxResponse_Association(model);
|
||||
|
||||
@@ -417,27 +412,27 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Organisation.
|
||||
SysId organisationId = model.OrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||
disposableItems.Add(organisation);
|
||||
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"]));
|
||||
}
|
||||
|
||||
// Associated Organisation.
|
||||
SysId organisationIdAssoc = model.OrganisationIdAssoc.ToSysId();
|
||||
SysId organisationIdAssoc = SysId.ToSysId(model.OrganisationIdAssoc);
|
||||
SaxOrganisation organisationAssoc = AccountMgr.GetOrganisationById(organisationIdAssoc);
|
||||
disposableItems.Add(organisationAssoc);
|
||||
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"]));
|
||||
}
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -445,18 +440,18 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
Sax.AssociationType associationType = model.GetAssociationTypeForOption(model.Association.GetAssociationTypeOption());
|
||||
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"]));
|
||||
}
|
||||
Sax.AssociationTypeOption associationTypeOption = model.Association.GetAssociationTypeOption();
|
||||
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"]));
|
||||
}
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -470,11 +465,11 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
}
|
||||
|
||||
// Retrieve existing association.
|
||||
SysId itemAssociationId = model.ItemAssociationId.ToSysId();
|
||||
SysId itemAssociationId = SysId.ToSysId(model.ItemAssociationId);
|
||||
if (SysId.IsValid(itemAssociationId) == StringUtil.ToBool(model.NewItem))
|
||||
{
|
||||
// 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"]));
|
||||
}
|
||||
SaxItemAssociation itemAssociation = ItemDataMgr.GetItemAssociationById(itemAssociationId);
|
||||
@@ -499,7 +494,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
disposableItems.Add(itemAssociation);
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -518,12 +513,12 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
// Validate From/To items.
|
||||
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"]));
|
||||
}
|
||||
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"]));
|
||||
}
|
||||
}
|
||||
@@ -553,7 +548,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -561,7 +556,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -581,7 +576,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Organisation/Ajax/RemoveAssociation")]
|
||||
public IActionResult Ajax_RemoveAssociation(Model_OrganisationAssociations model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_RemoveAssociation";
|
||||
String messageTitle = Localiser["caption.organisation.association"];
|
||||
AjaxResponse_Association responseData = new AjaxResponse_Association(model);
|
||||
|
||||
@@ -594,49 +588,49 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Organisation.
|
||||
SysId organisationId = model.OrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||
disposableItems.Add(organisation);
|
||||
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"]));
|
||||
}
|
||||
|
||||
// Association Organisation.
|
||||
SysId organisationIdAssoc = model.OrganisationIdAssoc.ToSysId();
|
||||
SysId organisationIdAssoc = SysId.ToSysId(model.OrganisationIdAssoc);
|
||||
SaxOrganisation organisationAssoc = AccountMgr.GetOrganisationById(organisationIdAssoc);
|
||||
disposableItems.Add(organisationAssoc);
|
||||
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"]));
|
||||
}
|
||||
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"]));
|
||||
}
|
||||
|
||||
// Item Association.
|
||||
SysId itemAssociationId = model.ItemAssociationId.ToSysId();
|
||||
SysId itemAssociationId = SysId.ToSysId(model.ItemAssociationId);
|
||||
SaxItemAssociation itemAssociation = ItemDataMgr.GetItemAssociationById(itemAssociationId);
|
||||
disposableItems.Add(itemAssociation);
|
||||
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"]));
|
||||
}
|
||||
|
||||
// Validate association Item Ids.
|
||||
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"]));
|
||||
}
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -644,7 +638,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
itemAssociation.Status = SaStatus.Deleted;
|
||||
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));
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Organisation/Ajax/GetItemImages")]
|
||||
public IActionResult Ajax_GetImages(Model_Organisation model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetImages";
|
||||
String messageTitle = Localiser["caption.organisation"];
|
||||
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);
|
||||
|
||||
// Identify item.
|
||||
SysId organisationId = model.OrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||
if (!SysId.IsValid(organisationId))
|
||||
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);
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -111,7 +110,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Organisation/Ajax/UploadLogoImage")]
|
||||
public IActionResult UploadOrganisationLogoImage(Model_Organisation model)
|
||||
{
|
||||
String fn = GetType().Name + ".UploadOrganisationLogoImage";
|
||||
AjaxResponse_UploadOrganisationLogoImage responseData = new AjaxResponse_UploadOrganisationLogoImage(model);
|
||||
String messageTitle = Localiser["caption.organisation"];
|
||||
|
||||
@@ -124,26 +122,26 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
||||
{
|
||||
// Retrieve organisation.
|
||||
SysId organisationId = model.OrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||
if (!SysId.IsValid(organisationId))
|
||||
return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"]));
|
||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||
disposableItems.Add(organisation);
|
||||
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"]));
|
||||
}
|
||||
|
||||
// Validate number of images.
|
||||
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);
|
||||
}
|
||||
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"]));
|
||||
}
|
||||
IFormFile file = model.OrganisationLogoImage[0];
|
||||
@@ -202,7 +200,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
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"]));
|
||||
}
|
||||
}
|
||||
@@ -210,7 +208,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
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"]));
|
||||
}
|
||||
}
|
||||
@@ -232,7 +230,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Organisation/Ajax/StoreImages")]
|
||||
public IActionResult Ajax_StoreImages(Model_Organisation model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_StoreImages";
|
||||
String messageTitle = Localiser["caption.organisation"];
|
||||
AjaxResponse_OrganisationImages responseData = new AjaxResponse_OrganisationImages(model);
|
||||
|
||||
@@ -250,12 +247,12 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
return Json(responseData);
|
||||
|
||||
// Retrieve organisation.
|
||||
SysId organisationId = model.OrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||
disposableItems.Add(organisation);
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -286,7 +283,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
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"]));
|
||||
}
|
||||
}
|
||||
@@ -294,14 +291,14 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
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"]));
|
||||
}
|
||||
}
|
||||
// Logically delete the uplaoded image.
|
||||
itemImageLogoUploaded.Status = SaStatus.Deleted;
|
||||
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.
|
||||
|
||||
@@ -91,7 +91,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Organisation/Ajax/GetMemberList")]
|
||||
public IActionResult Ajax_GetMemberList(Model_OrganisationMembers model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetMemberList";
|
||||
String messageTitle = Localiser["caption.organisation.members"];
|
||||
AjaxResponse_MemberList responseData = new AjaxResponse_MemberList(model);
|
||||
|
||||
@@ -100,10 +99,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
return GetAjaxResult_InvalidSession(responseData);
|
||||
|
||||
// Organisation Id filter is mandatory.
|
||||
SysId organisationId = model.Filter.OrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.Filter.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"]));
|
||||
}
|
||||
|
||||
@@ -203,7 +202,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Organisation/Ajax/GetMember")]
|
||||
public IActionResult Ajax_GetMember(Model_OrganisationMembers model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetItem";
|
||||
String messageTitle = Localiser["caption.organisation.member"];
|
||||
AjaxResponse_Member responseData = new AjaxResponse_Member(model);
|
||||
|
||||
@@ -216,7 +214,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Identify item.
|
||||
SysId userOrganisationId = model.UserOrganisationId.ToSysId();
|
||||
SysId userOrganisationId = SysId.ToSysId(model.UserOrganisationId);
|
||||
if (!SysId.IsValid(userOrganisationId))
|
||||
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);
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -234,7 +232,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
disposableItems.Add(userAccount);
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -243,7 +241,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
disposableItems.Add(organisation);
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -262,7 +260,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Organisation/Ajax/StoreMember")]
|
||||
public IActionResult Ajax_StoreMember(Model_OrganisationMembers model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_StoreMember";
|
||||
String messageTitle = Localiser["caption.organisation.member"];
|
||||
AjaxResponse_Member responseData = new AjaxResponse_Member(model);
|
||||
|
||||
@@ -280,7 +277,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// User account.
|
||||
SysId userAccountId = model.MemberUserAccountId.ToSysId();
|
||||
SysId userAccountId = SysId.ToSysId(model.MemberUserAccountId);
|
||||
SaxUserAccount userAccount = null;
|
||||
if (!SysId.IsValid(userAccountId) && !StringUtil.IsEmpty(model.MemberUserEmailAddress))
|
||||
{
|
||||
@@ -290,32 +287,32 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
}
|
||||
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"]));
|
||||
}
|
||||
|
||||
// Organisation.
|
||||
SysId organisationId = model.MemberOrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.MemberOrganisationId);
|
||||
SaxOrganisation organisation = null;
|
||||
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"]));
|
||||
}
|
||||
|
||||
// Retrieve existing item.
|
||||
SysId userOrganisationId = model.UserOrganisationId.ToSysId();
|
||||
SysId userOrganisationId = SysId.ToSysId(model.UserOrganisationId);
|
||||
SaxUserOrganisation userOrganisation = AccountMgr.GetUserOrganisationById(userOrganisationId);
|
||||
disposableItems.Add(userOrganisation);
|
||||
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"]));
|
||||
}
|
||||
if (userOrganisation != null && (!userOrganisation.UserAccountId.Equals(userAccountId) || !userOrganisation.OrganisationId.Equals(organisationId)))
|
||||
{
|
||||
// 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"]));
|
||||
}
|
||||
|
||||
@@ -361,7 +358,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -369,7 +366,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -389,7 +386,6 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
[Route("Organisation/Ajax/RemoveMember")]
|
||||
public IActionResult Ajax_RemoveMember(Model_OrganisationMembers model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_RemoveMember";
|
||||
String messageTitle = Localiser["caption.organisation.member"];
|
||||
AjaxResponse_Member responseData = new AjaxResponse_Member(model);
|
||||
|
||||
@@ -402,27 +398,27 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Organisation.
|
||||
SysId organisationId = model.OrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||
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"]));
|
||||
}
|
||||
disposableItems.Add(organisation);
|
||||
|
||||
// User Organisation.
|
||||
SysId userOrganisationId = model.UserOrganisationId.ToSysId();
|
||||
SysId userOrganisationId = SysId.ToSysId(model.UserOrganisationId);
|
||||
SaxUserOrganisation userOrganisation = AccountMgr.GetUserOrganisationById(userOrganisationId);
|
||||
disposableItems.Add(userOrganisation);
|
||||
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"]));
|
||||
}
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -431,7 +427,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
disposableItems.Add(userAccount);
|
||||
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"]));
|
||||
}
|
||||
|
||||
@@ -443,7 +439,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -451,7 +447,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,9 +161,9 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
responseData.UploadContentTypes = SaxOrganisationUploader.ValidContentTypes;
|
||||
|
||||
// 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;
|
||||
SysId filterRegionId = model.Filter.OrganisationRegionId.ToSysId();
|
||||
SysId filterRegionId = SysId.ToSysId(model.Filter.OrganisationRegionId);
|
||||
SessionData_Admin.Filter.RegionId = SysId.IsValid(filterRegionId) ? filterRegionId : null;
|
||||
|
||||
// Item filter.
|
||||
@@ -250,8 +250,8 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
prmOrganisation.OrganisationFilter = model.Filter.Organisation;
|
||||
prmOrganisation.OrganisationType = model.FilterOrganisationType;
|
||||
prmOrganisation.OrganisationCategory = model.FilterOrganisationCategory;
|
||||
prmOrganisation.SportIdsIncluded.AddId(model.Filter.OrganisationSportId.ToSysId());
|
||||
prmOrganisation.RegionIdsIncluded.AddId(model.Filter.OrganisationRegionId.ToSysId());
|
||||
prmOrganisation.SportIdsIncluded.AddId(SysId.ToSysId(model.Filter.OrganisationSportId));
|
||||
prmOrganisation.RegionIdsIncluded.AddId(SysId.ToSysId(model.Filter.OrganisationRegionId));
|
||||
prmOrganisation.StatusCat = model.Filter.OrganisationStatusCategoryCode != null ? model.FilterOrganisationStatusCategory : SaxOrganisation.StatusCat.NotDeleted;
|
||||
prmOrganisation.SortColumns.Add(accountMgr.GetOrganisationColumnDfn(SaxOrganisation.Column.Name));
|
||||
return prmOrganisation;
|
||||
@@ -285,7 +285,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Identify item.
|
||||
SysId organisationId = model.OrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||
if (!SysId.IsValid(organisationId))
|
||||
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);
|
||||
|
||||
// Retrieve existing item.
|
||||
SysId organisationId = model.OrganisationId.ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(model.OrganisationId);
|
||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId);
|
||||
disposableItems.Add(organisation);
|
||||
if (organisation == null && SysId.IsValid(organisationId))
|
||||
@@ -364,9 +364,9 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
if (model.OrganisationCategoryValue != null)
|
||||
organisation.OrganisationCategory = model.OrganisationCategory;
|
||||
if (model.OrganisationSportId != null)
|
||||
organisation.SportIdPrimary = model.OrganisationSportId.ToSysId();
|
||||
organisation.SportIdPrimary = SysId.ToSysId(model.OrganisationSportId);
|
||||
if (model.OrganisationRegionIdPrimary != null)
|
||||
organisation.RegionIdPrimary = model.OrganisationRegionIdPrimary.ToSysId();
|
||||
organisation.RegionIdPrimary = SysId.ToSysId(model.OrganisationRegionIdPrimary);
|
||||
if (model.OrganisationAbout != null)
|
||||
organisation.About = model.OrganisationAbout;
|
||||
if (model.OrganisationFacilities != null)
|
||||
@@ -403,7 +403,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
if (model.Address.IsPopulated())
|
||||
{
|
||||
// Organisation regions.
|
||||
SaxRegion.Data regionCountry = Internals.GetRegion(model.Address.RegionIdCountry.ToSysId());
|
||||
SaxRegion.Data regionCountry = Internals.GetRegion(SysId.ToSysId(model.Address.RegionIdCountry));
|
||||
if (regionCountry == null)
|
||||
// Default to Organisation's primary region.
|
||||
regionCountry = Internals.GetRegion(organisation.RegionIdPrimary);
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
return RedirectToAction("", "");
|
||||
|
||||
// Retrieve organisation.
|
||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(model.OrganisationId.ToSysId());
|
||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(SysId.ToSysId(model.OrganisationId));
|
||||
if (organisation == null)
|
||||
RedirectToAction("", "Organisation");
|
||||
model.Filter.OrganisationId= SysId.ToString(organisation.Id);
|
||||
@@ -100,7 +100,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
return RedirectToAction("", "");
|
||||
|
||||
// Retrieve organisation.
|
||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(model.OrganisationId.ToSysId());
|
||||
SaxOrganisation organisation = AccountMgr.GetOrganisationById(SysId.ToSysId(model.OrganisationId));
|
||||
if (organisation == null)
|
||||
RedirectToAction("", "Organisation");
|
||||
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? FacilityCountActive { 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
|
||||
{
|
||||
@@ -67,7 +67,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
||||
public long? CourseCount { get; set; }
|
||||
public long? CourseCountActive { 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
|
||||
{
|
||||
@@ -288,7 +288,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
||||
// Item filter.
|
||||
SaxGolfUsgaProvince.Params prmUsgaProvince = new SaxGolfUsgaProvince.Params();
|
||||
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.StatusCat = SaxGolfUsgaProvince.StatusCat.Any;
|
||||
model.Paging.ItemTotal = (ulong)ReferenceGolfMgr.GetUsgaProvinceCount(prmUsgaProvince);
|
||||
@@ -376,7 +376,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
||||
// Item filter.
|
||||
SaxGolfUsgaCourse.Params prmUsgaCourse = new SaxGolfUsgaCourse.Params();
|
||||
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.StatusCat = SaxGolfUsgaCourse.StatusCat.Any;
|
||||
model.Paging.ItemTotal = (ulong)ReferenceGolfMgr.GetUsgaCourseCount(prmUsgaCourse);
|
||||
@@ -533,7 +533,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
||||
// Item filter.
|
||||
SaxGolfUsgaMarker.Params prmUsgaMarker = new SaxGolfUsgaMarker.Params();
|
||||
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.StatusCat = SaxGolfUsgaMarker.StatusCat.Any;
|
||||
model.Paging.ItemTotal = (ulong)ReferenceGolfMgr.GetUsgaMarkerCount(prmUsgaMarker);
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Identify item.
|
||||
SysId regionId = model.RegionId.ToSysId();
|
||||
SysId regionId = SysId.ToSysId(model.RegionId);
|
||||
if (!SysId.IsValid(regionId))
|
||||
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);
|
||||
|
||||
// Retrieve existing item.
|
||||
SysId regionId = model.RegionId.ToSysId();
|
||||
SysId regionId = SysId.ToSysId(model.RegionId);
|
||||
SaxRegion region = ReferenceMgr.GetRegionById(regionId);
|
||||
disposableItems.Add(region);
|
||||
if (region == null && SysId.IsValid(regionId))
|
||||
@@ -243,7 +243,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
if (model.RegionName != null)
|
||||
region.Name = model.RegionName;
|
||||
if (model.RegionIdParent != null)
|
||||
region.RegionIdParent = model.RegionIdParent.ToSysId();
|
||||
region.RegionIdParent = SysId.ToSysId(model.RegionIdParent);
|
||||
if (model.RegionStatusCode != null)
|
||||
region.Status = model.RegionStatus;
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Identify item.
|
||||
SysId sportId = model.SportId.ToSysId();
|
||||
SysId sportId = SysId.ToSysId(model.SportId);
|
||||
if (!SysId.IsValid(sportId))
|
||||
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);
|
||||
|
||||
// Retrieve existing item.
|
||||
SysId sportId = model.SportId.ToSysId();
|
||||
SysId sportId = SysId.ToSysId(model.SportId);
|
||||
SaxSport sport = ReferenceMgr.GetSportById(sportId);
|
||||
disposableItems.Add(sport);
|
||||
if (sport == null && SysId.IsValid(sportId))
|
||||
@@ -240,7 +240,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
if (model.SportGroupingCode != null)
|
||||
sport.Grouping = model.SportGrouping;
|
||||
if (model.SportIdParent != null)
|
||||
sport.SportIdParent = model.SportIdParent.ToSysId();
|
||||
sport.SportIdParent = SysId.ToSysId(model.SportIdParent);
|
||||
if (model.SportName != null)
|
||||
sport.Name = model.SportName;
|
||||
if (model.SportSpecialityLabelCode != null)
|
||||
|
||||
@@ -224,7 +224,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Support
|
||||
{
|
||||
|
||||
// Identify item.
|
||||
SysId userReportId = model.UserReport.Id.ToSysId();
|
||||
SysId userReportId = SysId.ToSysId(model.UserReport.Id);
|
||||
if (!SysId.IsValid(userReportId))
|
||||
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);
|
||||
|
||||
// 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))
|
||||
{
|
||||
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
|
||||
{
|
||||
//=======================================================================
|
||||
// System - Ajax - Database controller
|
||||
// System - Ajax - Logs controller
|
||||
//=======================================================================
|
||||
partial class SystemController
|
||||
{
|
||||
|
||||
@@ -162,16 +162,16 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
responseData.Statuses.Add(SacsSystem.GetStatusCode(status), Localiser.GetStatusCaption(status));
|
||||
|
||||
// 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;
|
||||
SysId filterRegionId = model.Filter.UserRegionId.ToSysId();
|
||||
SysId filterRegionId = SysId.ToSysId(model.Filter.UserRegionId);
|
||||
SessionData_Admin.Filter.RegionId = SysId.IsValid(filterRegionId) ? filterRegionId : null;
|
||||
|
||||
// Item filter.
|
||||
SaxUserAccount.Params prmUserAccount = new SaxUserAccount.Params();
|
||||
prmUserAccount.UserFilterPartial = model.Filter.User;
|
||||
prmUserAccount.SportIdsIncluded.AddId(model.Filter.UserSportId.ToSysId());
|
||||
prmUserAccount.RegionIdsIncluded.AddId(model.Filter.UserRegionId.ToSysId());
|
||||
prmUserAccount.SportIdsIncluded.AddId(SysId.ToSysId(model.Filter.UserSportId));
|
||||
prmUserAccount.RegionIdsIncluded.AddId(SysId.ToSysId(model.Filter.UserRegionId));
|
||||
prmUserAccount.StatusCat = model.Filter.UserStatusCategoryCode != null ? model.FilterUserStatusCategory : SaxUserAccount.StatusCat.NotDeleted;
|
||||
model.Paging.ItemTotal = (ulong)AccountMgr.GetUserAccountCount(prmUserAccount);
|
||||
model.PopulatePagingTo(prmUserAccount.ResultsPaging);
|
||||
@@ -268,7 +268,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Identify item.
|
||||
SysId userAccountId = model.UserId.ToSysId();
|
||||
SysId userAccountId = SysId.ToSysId(model.UserId);
|
||||
if (!SysId.IsValid(userAccountId))
|
||||
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.
|
||||
SysId userAccountId = model.UserId.ToSysId();
|
||||
SysId userAccountId = SysId.ToSysId(model.UserId);
|
||||
SaxUserAccount user = AccountMgr.GetUserAccountById(userAccountId);
|
||||
disposableItems.Add(user);
|
||||
if (user == null && SysId.IsValid(userAccountId))
|
||||
@@ -427,9 +427,9 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
if (model.UserLastName != null)
|
||||
user.LastName = model.UserLastName;
|
||||
if (model.UserRegionIdCountry != null)
|
||||
user.RegionIdCountry = model.UserRegionIdCountry.ToSysId();
|
||||
user.RegionIdCountry = SysId.ToSysId(model.UserRegionIdCountry);
|
||||
if (model.UserRegionIdProvince != null)
|
||||
user.RegionIdProvince = model.UserRegionIdProvince.ToSysId();
|
||||
user.RegionIdProvince = SysId.ToSysId(model.UserRegionIdProvince);
|
||||
if (model.UserStatusCode != null)
|
||||
user.Status = model.UserStatus;
|
||||
|
||||
@@ -505,7 +505,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Retrieve user.
|
||||
SysId userAccountId = model.UserId.ToSysId();
|
||||
SysId userAccountId = SysId.ToSysId(model.UserId);
|
||||
SaxUserAccount userAccount = AccountMgr.GetUserAccountById(userAccountId);
|
||||
disposableItems.Add(userAccount);
|
||||
if (userAccount == null)
|
||||
@@ -533,7 +533,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
if (sendAcountActivationOnline)
|
||||
{
|
||||
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++;
|
||||
}
|
||||
if (sendRequestPasswordOnline)
|
||||
|
||||
@@ -81,8 +81,8 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
// Item filter.
|
||||
SaxUserOnline.Params prmUserOnline = new SaxUserOnline.Params();
|
||||
prmUserOnline.UserFilterPartial = model.Filter.User;
|
||||
prmUserOnline.SportIdsIncluded.AddId(model.Filter.UserSportId.ToSysId());
|
||||
prmUserOnline.RegionIdsIncluded.AddId(model.Filter.UserRegionId.ToSysId());
|
||||
prmUserOnline.SportIdsIncluded.AddId(SysId.ToSysId(model.Filter.UserSportId));
|
||||
prmUserOnline.RegionIdsIncluded.AddId(SysId.ToSysId(model.Filter.UserRegionId));
|
||||
model.Paging.ItemTotal = (ulong)AccountMgr.GetUserOnlineCount(prmUserOnline);
|
||||
model.PopulatePagingTo(prmUserOnline.ResultsPaging);
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Identify item.
|
||||
SysId userAccountId = model.UserId.ToSysId();
|
||||
SysId userAccountId = SysId.ToSysId(model.UserId);
|
||||
if (!SysId.IsValid(userAccountId))
|
||||
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>
|
||||
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 false;
|
||||
}
|
||||
@@ -126,11 +126,11 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
if (RegionIdCountry != null)
|
||||
{
|
||||
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"]);
|
||||
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)
|
||||
responseData.SetControlError(controlName, Model.Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
@@ -141,9 +141,9 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
// Organisation sport.
|
||||
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)
|
||||
responseData.SetControlError(nameof(OrganisationSportId), Localiser["msg.validation.invalid.value"]);
|
||||
@@ -154,7 +154,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
// Organisation primary region.
|
||||
if (OrganisationRegionIdPrimary != null)
|
||||
{
|
||||
using (SaxRegion region = ReferenceMgr.GetRegionById(OrganisationRegionIdPrimary.ToSysId()))
|
||||
using (SaxRegion region = ReferenceMgr.GetRegionById(SysId.ToSysId(OrganisationRegionIdPrimary)))
|
||||
{
|
||||
if (region == null)
|
||||
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.
|
||||
SaxOrganisation.Params prmOrganisation = new SaxOrganisation.Params();
|
||||
if (SysId.IsValid(OrganisationId.ToSysId()))
|
||||
prmOrganisation.IdsExcluded.Add(OrganisationId.ToSysId());
|
||||
if (SysId.IsValid(SysId.ToSysId(OrganisationId)))
|
||||
prmOrganisation.IdsExcluded.Add(SysId.ToSysId(OrganisationId));
|
||||
prmOrganisation.NameFull = OrganisationName;
|
||||
prmOrganisation.RegionIdsIncluded.Add(OrganisationRegionIdPrimary.ToSysId());
|
||||
prmOrganisation.RegionIdsIncluded.Add(SysId.ToSysId(OrganisationRegionIdPrimary));
|
||||
prmOrganisation.StatusCat = SaxOrganisation.StatusCat.Any;
|
||||
if (AccountMgr.GetOrganisationCount(prmOrganisation) > 0)
|
||||
responseData.SetControlError(nameof(OrganisationName), Localiser["msg.validation.duplicate.value"]);
|
||||
|
||||
@@ -106,13 +106,13 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
{
|
||||
// Mandatory.
|
||||
String controlName = "OrganisationIdAssoc";
|
||||
if (!SysId.IsValid(OrganisationIdAssoc.ToSysId()))
|
||||
if (!SysId.IsValid(SysId.ToSysId(OrganisationIdAssoc)))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||
// Must exist.
|
||||
else if (!AccountMgr.OrganisationExistsById(OrganisationIdAssoc.ToSysId()))
|
||||
else if (!AccountMgr.OrganisationExistsById(SysId.ToSysId(OrganisationIdAssoc)))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
// 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"]);
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
// User Account.
|
||||
if (MemberUserAccountId != null)
|
||||
{
|
||||
SysId memberUserAccountId = MemberUserAccountId.ToSysId();
|
||||
SysId memberUserAccountId = SysId.ToSysId(MemberUserAccountId);
|
||||
if (!SysId.IsValid(memberUserAccountId))
|
||||
responseData.SetControlError(nameof(MemberUserAccountId), Localiser["msg.validation.mandatory.value"]);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
{
|
||||
// Check for duplicate code.
|
||||
SaxRegion.Params prmRegion = new SaxRegion.Params();
|
||||
SysId regionId = RegionId.ToSysId();
|
||||
SysId regionId = SysId.ToSysId(RegionId);
|
||||
if (SysId.IsValid(regionId))
|
||||
prmRegion.IdsExcluded.Add(regionId);
|
||||
prmRegion.CountryIso2CodesIncluded.Add(RegionCountryIso2Code);
|
||||
@@ -111,7 +111,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
{
|
||||
// Check for duplicate name.
|
||||
SaxRegion.Params prmRegion = new SaxRegion.Params();
|
||||
SysId regionId = RegionId.ToSysId();
|
||||
SysId regionId = SysId.ToSysId(RegionId);
|
||||
if (SysId.IsValid(regionId))
|
||||
prmRegion.IdsExcluded.Add(regionId);
|
||||
prmRegion.NameFull = RegionName;
|
||||
@@ -124,7 +124,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
// Parent region.
|
||||
if (!StringUtil.IsEmpty(RegionIdParent))
|
||||
{
|
||||
SaxRegion parentRegion = ReferenceMgr.GetRegionById(RegionIdParent.ToSysId());
|
||||
SaxRegion parentRegion = ReferenceMgr.GetRegionById(SysId.ToSysId(RegionIdParent));
|
||||
if (parentRegion != null)
|
||||
{
|
||||
if (RegionType<= 0 || SaxRegion.IsValidParentRegionType(RegionType, parentRegion.RegionType))
|
||||
|
||||
@@ -69,11 +69,11 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
}
|
||||
|
||||
// Parent sport.
|
||||
SysId sportIdParent = SportIdParent.ToSysId();
|
||||
SysId sportIdParent = SysId.ToSysId(SportIdParent);
|
||||
if (SportIdParent != null && SysId.IsValid(sportIdParent))
|
||||
{
|
||||
String controlName = "SportParent";
|
||||
SaxSport sport = ReferenceMgr.GetSportById(SportIdParent.ToSysId());
|
||||
SaxSport sport = ReferenceMgr.GetSportById(SysId.ToSysId(SportIdParent));
|
||||
disposableItems.Add(sport);
|
||||
if (sport == null)
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
@@ -94,7 +94,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
{
|
||||
// Check for duplicate name.
|
||||
SaxSport.Params prmSport = new SaxSport.Params();
|
||||
SysId sportId = SportId.ToSysId();
|
||||
SysId sportId = SysId.ToSysId(SportId);
|
||||
if (SysId.IsValid(sportId))
|
||||
prmSport.IdsExcluded.Add(sportId);
|
||||
prmSport.NameFull = SportName;
|
||||
|
||||
@@ -96,8 +96,6 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
// User.
|
||||
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.
|
||||
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
||||
{
|
||||
@@ -117,7 +115,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
{
|
||||
// Check for duplicate email address.
|
||||
SaxUserAccount.Params prmUserAccount = new SaxUserAccount.Params();
|
||||
SysId userAccountId = UserId.ToSysId();
|
||||
SysId userAccountId = SysId.ToSysId(UserId);
|
||||
if (SysId.IsValid(userAccountId))
|
||||
prmUserAccount.IdsExcluded.Add(userAccountId);
|
||||
prmUserAccount.EmailAddress = UserEmailAddress;
|
||||
@@ -156,23 +154,23 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
SaxRegion regionCountry = null;
|
||||
if (UserRegionIdCountry != null)
|
||||
{
|
||||
if (!SysId.IsValid(UserRegionIdCountry.ToSysId()))
|
||||
if (!SysId.IsValid(SysId.ToSysId(UserRegionIdCountry)))
|
||||
responseData.SetControlError(nameof(UserRegionIdCountry), Localiser["msg.validation.mandatory.value"]);
|
||||
else
|
||||
{
|
||||
regionCountry = ReferenceMgr.GetRegionById(UserRegionIdCountry.ToSysId());
|
||||
regionCountry = ReferenceMgr.GetRegionById(SysId.ToSysId(UserRegionIdCountry));
|
||||
disposableItems.Add(regionCountry);
|
||||
if (regionCountry != null)
|
||||
{
|
||||
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"]);
|
||||
}
|
||||
}
|
||||
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"]);
|
||||
}
|
||||
}
|
||||
@@ -184,24 +182,24 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
{
|
||||
if (!UserRegionIdProvince.IsEmpty())
|
||||
{
|
||||
regionProvince = ReferenceMgr.GetRegionById(UserRegionIdProvince.ToSysId());
|
||||
regionProvince = ReferenceMgr.GetRegionById(SysId.ToSysId(UserRegionIdProvince));
|
||||
disposableItems.Add(regionProvince);
|
||||
if (regionProvince != null)
|
||||
{
|
||||
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"]);
|
||||
}
|
||||
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"]);
|
||||
}
|
||||
}
|
||||
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"]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -771,6 +771,9 @@
|
||||
<data name="msg.validation.select.option" xml:space="preserve">
|
||||
<value>At least one option must be selected.</value>
|
||||
</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">
|
||||
<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>
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<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="System.Collections.Specialized" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
{
|
||||
max-height: auto;
|
||||
}
|
||||
|
||||
.sax-panel-results .sax-panel-info.DbSchema .sax-panel-messages
|
||||
{
|
||||
margin-bottom: 8px;
|
||||
@@ -99,7 +100,7 @@
|
||||
<div class="sax-panel-messages"></div>
|
||||
</div>
|
||||
|
||||
@* Database Schema - Reference *@
|
||||
@* Database Schema - Support *@
|
||||
<div class="sax-panel-info DbSchema Support">
|
||||
<div class="sax-header">
|
||||
<div class="sax-caption">@Localiser["system.caption.database.support"]</div>
|
||||
@@ -118,7 +119,7 @@
|
||||
<th class="">@Localiser["label.table"]</th>
|
||||
<th class="">@Localiser["label.column"]</th>
|
||||
<th class="">@Localiser["label.index"]</th>
|
||||
<th class="">@Localiser["label.comment"]</th>
|
||||
<th class="" style="min-width:50%;">@Localiser["label.comment"]</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
@model SaxModel_Admin
|
||||
@model SaxModel_Admin
|
||||
@inject Microsoft.AspNetCore.Antiforgery.IAntiforgery AntiForgery;
|
||||
@inject SaxLocaliser Localiser
|
||||
@*
|
||||
@@ -55,7 +54,7 @@
|
||||
}
|
||||
|
||||
@* Scripts *@
|
||||
<script>
|
||||
<script>
|
||||
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.home = '@Model.RedirectLocation.Home';
|
||||
@@ -85,7 +84,7 @@
|
||||
sax.kli.active = @keepLoggedIn;
|
||||
sax.kli.interval = @(Sax.Config.Admin.Session.Cookie.KeepLoggedInTimeoutMillis);
|
||||
sax.debugMode = @debug;
|
||||
</script>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
@@ -94,7 +93,7 @@
|
||||
<header id="sax-page-header">
|
||||
|
||||
@* 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">
|
||||
<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"
|
||||
|
||||
@@ -4,56 +4,91 @@
|
||||
ViewData["Title"] = "System - Database";
|
||||
}
|
||||
|
||||
<div class="container-fluid DatabaseTables">
|
||||
<div class="sax-panel DatabaseTables">
|
||||
|
||||
<div class="sax-panel-filter">
|
||||
<div class="sax-header row">
|
||||
<div class="col"><div class="sax-caption">@Localiser["system.caption.database"]</div></div>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
|
||||
<div class="sax-panel-data sax-flex">
|
||||
|
||||
@* 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 class="sax-content">
|
||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmDbTableFilter", @class = "sax-form", @onSubmit = "return false;" }))
|
||||
{
|
||||
</div>
|
||||
|
||||
@* Filter Panel *@
|
||||
<div class="sax-panel-filter">
|
||||
<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-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-7 col-md-3">@Html.TextBoxFor(model => model.DatabaseFilter.Search, new { @id = "ifDatabaseFilterSearch", @class = "DatabaseFilterSearch", @maxlength = "32" })</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 class="sax-panel-results">
|
||||
<div class="sax-panel-messages"></div>
|
||||
<div class="sax-panel-item-list"></div>
|
||||
</div>
|
||||
|
||||
|
||||
@* Element templates *@
|
||||
<div class="sax-panel-item-template">
|
||||
<div class="sax-panel-item DatabaseTable">
|
||||
<div class="sax-header row">
|
||||
<div class="col">
|
||||
<div class="sax-caption"><div class="sax-action TableName"></div></div>
|
||||
</div>
|
||||
<div class="fixed sax-actions">
|
||||
</div>
|
||||
</div>
|
||||
<div class="sax-content">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">@Localiser["label.rows"]: <span class="RowCount"></span></div>
|
||||
<div class="col-sm-6 text-right">@Localiser["label.columns"]: <span class="ColumnCount"></span></div>
|
||||
</div>
|
||||
<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>
|
||||
|
||||
@* Item row template - table is ignored. *@
|
||||
<table>
|
||||
<tr class="sax-row-item DatabaseTable">
|
||||
<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>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@* Item burger dropdown template - ul is ignored *@
|
||||
<ul class="sax-dropdown-menu DatabaseTable">
|
||||
<li class="sax-dropdown-item sax-action"><div class="sax-label">XXX</div></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmDbTableName", @onSubmit = "return false;" }))
|
||||
{
|
||||
@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.Name, new { @class = "DatabaseTableName" })
|
||||
}
|
||||
<table>
|
||||
<table class="fullwidth">
|
||||
<tr>
|
||||
<td class="right pt2 pr8">Properties:</td>
|
||||
<td>
|
||||
@@ -87,11 +122,11 @@
|
||||
<tr>
|
||||
<td class="right pt2 pr8">Columns:</td>
|
||||
<td>
|
||||
<table class="sax-striped TableColumns">
|
||||
<table class="sax-striped TableColumns fullwidth">
|
||||
<tr class="sax-heading">
|
||||
<td class="right pl8 pr8">Pos</td>
|
||||
<td class="pl8 pr8">Name</td>
|
||||
<td class="center">Format</td>
|
||||
<td class="width10pc right pl8 pr8">Pos</td>
|
||||
<td class="width50pc pl8 pr8">Name</td>
|
||||
<td class="width50pc center">Format</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
@@ -99,11 +134,11 @@
|
||||
<tr>
|
||||
<td class="right pt2 pr8">Indices:</td>
|
||||
<td>
|
||||
<table class="sax-striped TableIndices">
|
||||
<table class="sax-striped TableIndices fullwidth">
|
||||
<tr class="sax-heading">
|
||||
<td class="pl8 pr8">Name</td>
|
||||
<td class="center pl8 pr8">Unique</td>
|
||||
<td class="pl8 pr8">Columns</td>
|
||||
<td class="width50pc pl8 pr8">Name</td>
|
||||
<td class="width20pc center pl8 pr8">Unique</td>
|
||||
<td class="width20pc pl8 pr8">Columns</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
|
||||
@@ -40,18 +40,26 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="container-fluid LogFiles">
|
||||
<div class="sax-panel LogFiles">
|
||||
|
||||
<div class="sax-panel-filter">
|
||||
<div class="sax-header row">
|
||||
<div class="col"><div class="sax-caption">@Localiser["system.caption.logs"]</div></div>
|
||||
<div class="sax-panel-data sax-flex">
|
||||
|
||||
@* Filter form - wrap header to include paging controls. *@
|
||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmLogsFilter", @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.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 class="sax-content">
|
||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmLogsFilter", @class = "sax-form", @onSubmit = "return false;" }))
|
||||
{
|
||||
</div>
|
||||
|
||||
@* Filter Panel *@
|
||||
<div class="sax-panel-filter">
|
||||
<input type="hidden" name="LogsFilter.Filename" class="FilterLogFilename" />
|
||||
<div class="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>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sax-panel-results">
|
||||
<div class="sax-panel-messages"></div>
|
||||
}
|
||||
|
||||
@* 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">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -86,10 +92,12 @@
|
||||
<th class="center">@Localiser["label.updated"]</th>
|
||||
<th class="center">@Localiser["label.size"]</th>
|
||||
</tr>
|
||||
<tr><td colspan="6"><div class="sax-panel-messages"></div></td></tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@* Log file template. *@
|
||||
<table class="sax-panel-item-template">
|
||||
<tr class="sax-panel-item LogFile pointer">
|
||||
@@ -98,7 +106,6 @@
|
||||
<td><div class="Size center"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="dlgLogFile" class="sax-dialog">
|
||||
<form>
|
||||
@@ -107,6 +114,8 @@
|
||||
<div class="sax-data FileData"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -2,6 +2,25 @@
|
||||
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
|
||||
{
|
||||
margin: 0;
|
||||
@@ -109,12 +128,12 @@ table.sax-striped
|
||||
|
||||
table.sax-striped tr.sax-odd
|
||||
{
|
||||
background-color:#fff;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
table.sax-striped tr.sax-even
|
||||
{
|
||||
background-color:#f8f8f8;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
th, td
|
||||
@@ -215,6 +234,31 @@ td.action
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.width5pc
|
||||
{
|
||||
width: 5%;
|
||||
}
|
||||
|
||||
.width10pc
|
||||
{
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
.width20pc
|
||||
{
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.width25pc
|
||||
{
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.width50pc
|
||||
{
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.fullwidth
|
||||
{
|
||||
width: 100%;
|
||||
|
||||
@@ -2,85 +2,112 @@
|
||||
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;
|
||||
background-color: #f8f8f8;
|
||||
border: solid 1px #979797;
|
||||
border: solid 1px var(--color-panel-data-border);
|
||||
border-radius: 6px;
|
||||
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;
|
||||
min-height: 24px;
|
||||
color: #f0f0f0;
|
||||
background-color: #979797;
|
||||
border-bottom: solid 1px #979797;
|
||||
background-color: var(--color-panel-data-background);
|
||||
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;
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sax-panel-filter ul.nav.sax-burger
|
||||
/* Data panel - Actions */
|
||||
|
||||
.sax-panel-data ul.nav.sax-burger
|
||||
{
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.sax-panel-filter .sax-header .sax-action
|
||||
.sax-panel-data .sax-panel-header .sax-action
|
||||
{
|
||||
margin: 2px 0 0 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.sax-panel-filter .sax-header .sax-action:hover
|
||||
.sax-panel-data .sax-panel-header .sax-action:hover
|
||||
{
|
||||
background-color: #b0b0b0;
|
||||
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;
|
||||
padding: 4px 4px;
|
||||
background-color: #f8f8f8;
|
||||
}
|
||||
|
||||
.sax-panel-filter .sax-content .sax-label
|
||||
.sax-panel-data .sax-panel-content .sax-label
|
||||
{
|
||||
padding-top: 6px;
|
||||
padding-right: 12px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.sax-panel-filter .sax-content .sax-value
|
||||
.sax-panel-data .sax-panel-content .sax-value
|
||||
{
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.sax-panel-filter .sax-content input[type="text"],
|
||||
.sax-panel-filter .sax-content select
|
||||
.sax-panel-data .sax-panel-content input[type="text"],
|
||||
.sax-panel-data .sax-panel-content select
|
||||
{
|
||||
min-width: 75%;
|
||||
max-width: 90%;
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.sax-panel-filter .sax-content .sax-button
|
||||
.sax-panel-data .sax-panel-content .sax-button
|
||||
{
|
||||
min-width: auto;
|
||||
margin-left: 4px;
|
||||
|
||||
@@ -37,7 +37,39 @@ body
|
||||
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%;
|
||||
}
|
||||
@@ -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 */
|
||||
|
||||
#sax-page-header
|
||||
{
|
||||
}
|
||||
|
||||
a.navbar-brand
|
||||
{
|
||||
padding-top: 0.3rem;
|
||||
padding-bottom: 0.1rem;
|
||||
white-space: normal;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.navbar li.nav-item a.nav-link
|
||||
{
|
||||
padding-top: 0.3rem;
|
||||
padding-bottom: 0.1rem;
|
||||
}
|
||||
|
||||
.border-top
|
||||
{
|
||||
border-top: 1px solid #e5e5e5;
|
||||
@@ -122,14 +140,6 @@ button.accept-policy
|
||||
line-height: inherit;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
|
||||
#sax-page-footer div,
|
||||
#sax-page-footer a
|
||||
{
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
/* Information */
|
||||
|
||||
.sax-para
|
||||
@@ -137,6 +147,18 @@ button.accept-policy
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
/* Sticky footer styles */
|
||||
|
||||
#sax-page-footer
|
||||
{
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
#sax-page-footer, #sax-page-footer div
|
||||
{
|
||||
font-size: .75rem;
|
||||
}
|
||||
|
||||
/* Page caption */
|
||||
.sax-page-caption
|
||||
{
|
||||
@@ -394,8 +416,8 @@ a:focus
|
||||
.ui-dialog .ui-dialog-buttonpane button:disabled
|
||||
{
|
||||
color: #e0e0e0;
|
||||
background-color:#d5be70;
|
||||
border-color:#d5be70;
|
||||
background-color: #d5be70;
|
||||
border-color: #d5be70;
|
||||
}
|
||||
|
||||
.ui-widget-overlay
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
if (file.filename) return filename.split('.').pop();
|
||||
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 ** 6 > 1) return (size / 10.0 ** 6).toFixed(decimals) + ' Mb';
|
||||
@@ -137,16 +137,14 @@
|
||||
{
|
||||
$(sel).datepicker().on('keyup', function (e)
|
||||
{
|
||||
if (e.keyCode == 8 || e.keyCode == 46)
|
||||
{
|
||||
$(this).datepicker('setDate', null).datepicker('hide').change();
|
||||
}
|
||||
if (e.key == 'Backspace' || e.key == 'Delete')
|
||||
$(this).datepicker('setDate', null).datepicker('hide').trigger('change');
|
||||
});
|
||||
}
|
||||
sax.refreshPaging = function (response, context, refreshFn)
|
||||
{
|
||||
if (sax.resultsPaging.fn.refreshPaging)
|
||||
sax.resultsPaging.fn.refreshPaging(response.paging, context, refreshFn);
|
||||
if (((sax.mdl.resultsPaging || {}).fn || {}).refreshPaging)
|
||||
sax.mdl.resultsPaging.fn.refreshPaging(response.paging, context, refreshFn);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
@@ -154,7 +152,7 @@
|
||||
sax.navigateTo = function (action)
|
||||
{
|
||||
sax.doPleaseWait();
|
||||
$('#frmNavigate').prop('action', sax.url.base + action).submit();
|
||||
$('#frmNavigate').prop('action', sax.url.base + action).trigger('submit');
|
||||
}
|
||||
sax.goToPage = function (action)
|
||||
{
|
||||
@@ -224,7 +222,7 @@
|
||||
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);
|
||||
}
|
||||
$('#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.openDialog(sax.$dlg.alert);
|
||||
}
|
||||
@@ -244,7 +242,7 @@
|
||||
buttons[sax.dlg.btn.yes] = function () { $(this).dialog('close'); if (onOk) onOk(); };
|
||||
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 });
|
||||
$('#dlgConfirmMsg').html(msg);
|
||||
$('#dlgConfirmMsg').html(msg.replace(/\\n/g, '<br>'));
|
||||
sax.openDialog(sax.$dlg.confirm);
|
||||
}
|
||||
sax.doProgress = function (title, msg, delay)
|
||||
@@ -262,7 +260,7 @@
|
||||
opt.hide = { effect: 'fade', duration: 200 };
|
||||
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 });
|
||||
if (delay > 0) sax.toShowProgress = setTimeout(function () { sax.$dlg.progress.dialog('open'); }, delay);
|
||||
else sax.$dlg.progress.dialog('open');
|
||||
@@ -328,7 +326,7 @@
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
//enctype: 'multipart/form-data',
|
||||
data: ajax.formData || $("#" + ajax.formId).serialize(),
|
||||
data: ajax.formData || $(ajax.formSel || "#" + ajax.formId).serialize(),
|
||||
dataType: 'json',
|
||||
success: function (response, status, jqXHR)
|
||||
{
|
||||
@@ -507,22 +505,30 @@
|
||||
sax.onWinResizePage = function () { };
|
||||
sax.onWinResize = function ()
|
||||
{
|
||||
var winH = $(win).height();
|
||||
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');
|
||||
$('body').toggleClass('sax-layout-flex', !sax.isAutoHeight()).toggleClass('sax-layout-flow', sax.isAutoHeight());
|
||||
sax.onWinResizePage();
|
||||
}
|
||||
setTimeout(sax.onWinResize, 50);
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
$(win).on('resize', function () { sax.onWinResize(); });
|
||||
|
||||
$('.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)
|
||||
sax.configureKeepLoggedIn();
|
||||
else if (!sax.awaitingLogin)
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
$(':input:enabled:visible:first').focus();
|
||||
$(':input:enabled:visible:first').trigger('focus');
|
||||
$('#ifEmailAddress,#ifPasswordCurrent,#ifPassword,#ifPasswordConfirm').on('input', function () { sax.clearControlError(this); });
|
||||
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(); });
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
$('.sax-panel-item-list', $pnl.results).prepend($item).show();
|
||||
}
|
||||
sm.populateItem($item, item);
|
||||
// Force repopulation of sprts.
|
||||
// Force repopulation of sports.
|
||||
delete sm.data.sports;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,93 +5,137 @@
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let sd = sax.sysDb = { $pnl: {}, $frm: {}, $dlg: {} };
|
||||
let $pnl = sd.$pnl; let $frm = sd.$frm; let $dlg = sd.$dlg;
|
||||
sax.itemIdPrefix = 'Itm_';
|
||||
let sd = sax.sysDb = { env: {} };
|
||||
|
||||
//--------------------------------------------------------------
|
||||
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();
|
||||
var $msgs = $('.sax-panel-messages', $pnl.results).hide().empty().append($('<div class="sax-message">' + sax.msg.dataQuerying + '</div>')).fadeIn(200);
|
||||
env.$pnl.bgr.invisible();
|
||||
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 };
|
||||
sax.doAjaxRequest(sax.ajax.refreshResults, delay || 50);
|
||||
sax.awaitingRefreshResponse = true;
|
||||
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(env.ajax.refreshResults, delay || 50);
|
||||
env.data.awaitingRefreshResponse = true;
|
||||
}
|
||||
sd.doRefreshResults = function (response)
|
||||
sd.doRefreshResults = function (env, response)
|
||||
{
|
||||
//sax.debug('doRefreshResults', response);
|
||||
delete sax.awaitingRefreshResponse;
|
||||
sax.refreshControlValues(response.controlValues);
|
||||
var $msgs = $('.sax-panel-messages', $pnl.results).hide().empty();
|
||||
var $items = $('.sax-panel-item-list', $pnl.results).hide().empty();
|
||||
//sax.debug('doRefreshResults', env, response);
|
||||
delete env.data.awaitingRefreshResponse;
|
||||
env.$pnl.msgs.hide().empty();
|
||||
let $table = $('table', env.$pnl.table).find('tbody tr').remove().end();
|
||||
sax.refreshPaging(response, env.$frm.filter, function () { sd.refreshResults(env); });
|
||||
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.
|
||||
var items = response.tables;
|
||||
if (!items.length)
|
||||
return $msgs.append($('<div class="sax-message">' + sax.msg.dataNoneFound + '</div>')).fadeIn(500);
|
||||
for (let itemIdx = 0; itemIdx < items.length; itemIdx++)
|
||||
$items.append(sd.populateItem(sd.getTableTemplate(), items[itemIdx]));
|
||||
$items.fadeIn(50);
|
||||
return env.$pnl.msgs.append($('<div class="sax-message">' + sax.msg.dataNoneFound + '</div>')).fadeIn(500);
|
||||
for (const item of items)
|
||||
$table.append(sd.populateItem(env, sd.getItemTemplate(env), item));
|
||||
}
|
||||
sd.populateItem = function ($item, item)
|
||||
sd.populateItem = function (env, $item, item)
|
||||
{
|
||||
if (!item) return $item;
|
||||
$item.prop('id', sax.itemIdPrefix + item.id);
|
||||
$item.prop('id', sd.getItemId(item));
|
||||
$('.TableName', $item).text(item.qualifiedName);
|
||||
$('.RowCount', $item).text(item.rowCount);
|
||||
$('.ColumnCount', $item).text(item.columnCount);
|
||||
$('.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) })
|
||||
$item.off('dblclick').on('dblclick', function () { sax.viewItem(item) })
|
||||
$('.sax-panel-results .sax-panel-messages').hide().empty();
|
||||
// Actions.
|
||||
var $bgr = $('.sax-burger', $item).hide();
|
||||
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;
|
||||
}
|
||||
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))
|
||||
$('.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);
|
||||
return $('.sax-dropdown-menu.DatabaseTables li.sax-dropdown-item', env.$pnl.tmpls).clone();
|
||||
}
|
||||
sd.onViewItem = function (response)
|
||||
sd.getItemTemplate = function (env)
|
||||
{
|
||||
//sax.debug('onViewItem', response);
|
||||
sd.clearItem();
|
||||
return env.$pnl.tmpls.find('.sax-row-item.DatabaseTable').clone();
|
||||
}
|
||||
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;
|
||||
let item = response.table;
|
||||
let $frmT = $frm.table;
|
||||
let $frmT = env.$frm.item;
|
||||
$('.DatabaseTableName', $frmT).val(item.name);
|
||||
// Properties.
|
||||
let prts = item.properties;
|
||||
let $prts = $('.TableProperties', $dlg.table);
|
||||
let $prts = $('.TableProperties', env.$dlg.item);
|
||||
$('tr:not(.sax-heading)', $prts).remove();
|
||||
for (let prtIdx = 0; prtIdx < prts.length; 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);
|
||||
$('.Value', $prt).text(prt.value);
|
||||
$prts.append($prt);
|
||||
}
|
||||
// Columns.
|
||||
let cols = item.columns;
|
||||
let $cols = $('.TableColumns', $dlg.table);
|
||||
let $cols = $('.TableColumns', env.$dlg.item);
|
||||
$('tr:not(.sax-heading)', $cols).remove();
|
||||
for (let colIdx = 0; colIdx < cols.length; 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);
|
||||
$('.Name', $col).text(col.name);
|
||||
$('.Format', $col).text(col.format);
|
||||
@@ -99,12 +143,12 @@
|
||||
}
|
||||
// Indices.
|
||||
let idxs = item.indices;
|
||||
let $idxs = $('.TableIndices', $dlg.table);
|
||||
let $idxs = $('.TableIndices', env.$dlg.item);
|
||||
$('tr:not(.sax-heading)', $idxs).remove();
|
||||
for (let idxIdx = 0; idxIdx < idxs.length; 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);
|
||||
for (const col of idx.columns)
|
||||
$('.Columns', $idx).append($('<div>').text(col.name));
|
||||
@@ -112,54 +156,61 @@
|
||||
$idxs.append($idx);
|
||||
}
|
||||
// Display table details.
|
||||
$dlg.table.dialog('option', 'title', response.popupTitle || "Table: " + item.name);
|
||||
sax.openDialog($dlg.table, 600, 600);
|
||||
env.$dlg.item.dialog('option', 'title', response.popupTitle || "Table: " + item.name);
|
||||
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('');
|
||||
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 ()
|
||||
{
|
||||
$pnl.tables = $('.DatabaseTables');
|
||||
$pnl.filter = $('.sax-panel-filter', $pnl.tables);
|
||||
$pnl.results = $('.sax-panel-results', $pnl.tables);
|
||||
let env = sd.env.maint = { data: {}, ajax: {}, $pnl: {}, $frm: {}, $ctrl: {}, $dlg: {} };
|
||||
|
||||
$pnl.filter.on('click', '.sax-action.sax-results-refresh', function () { sd.refreshResults(); });
|
||||
$('.sax-input').on('input', function () { sax.clearControlError(this); });
|
||||
env.$pnl.items = $('.DatabaseTables');
|
||||
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');
|
||||
$('.DatabaseFilterInstance', $frm.filter).on('change', function () { sd.refreshResults(250); });
|
||||
$('.DatabaseFilterSearch', $frm.filter).on('input', function () { sd.refreshResults(250); });
|
||||
$frm.tableName = $('#frmDbTableName');
|
||||
$frm.table = $('#frmDbTable');
|
||||
env.$pnl.header.on('click', '.sax-action.sax-results-refresh', function () { sd.refreshResults(env); });
|
||||
|
||||
env.$frm.filter = $('#frmDbTableFilter');
|
||||
$('.DatabaseFilterInstance', env.$frm.filter).on('change', function () { sd.refreshResults(env, 250); });
|
||||
$('.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();
|
||||
opt.dialogClass += " sax-DatabaseTable";
|
||||
//opt.buttons[sax.dlg.btn.ok] = function () { sax.storeItem(); };
|
||||
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));
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
sl.clearFiles = function ()
|
||||
{
|
||||
$pnl.msgs.hide().empty();
|
||||
$pnl.list.find('tbody tr').remove();
|
||||
$pnl.table.find('tbody tr').remove();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
@@ -141,18 +141,17 @@
|
||||
{
|
||||
//sax.debug('doRefreshFiles', response);
|
||||
delete sl.data.awaitingRefreshFilesResponse;
|
||||
sl.clearFiles();
|
||||
sax.refreshControlValues(response.controlValues);
|
||||
sl.clearFiles();
|
||||
let $table = $('table', $pnl.table);
|
||||
if (!response.success) return;
|
||||
sax.data.logMonth = $ctrl.cbMonths.val();
|
||||
// Files.
|
||||
var items = response.files;
|
||||
sl.data.files = response.files;
|
||||
if (!(items || []).length)
|
||||
var items = sl.data.files = response.files||[];
|
||||
if (!items.length)
|
||||
return $pnl.msgs.append($('<div class="sax-message">' + sax.msg.dataNoneFound + '</div>')).fadeIn(500);
|
||||
for (let itemIdx = 0; itemIdx < items.length; itemIdx++)
|
||||
$pnl.list.append(sl.populateItem(sl.getFileTemplate(), items[itemIdx]));
|
||||
$pnl.list.fadeIn(50);
|
||||
for (const item of items)
|
||||
$table.append(sl.populateItem(sl.getFileTemplate(), item));
|
||||
}
|
||||
sl.populateItem = function ($item, item)
|
||||
{
|
||||
@@ -165,7 +164,7 @@
|
||||
}
|
||||
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 ()
|
||||
{
|
||||
$pnl.logFiles = $('.LogFiles');
|
||||
$pnl.filter = $('.sax-panel-filter', $pnl.logFiles);
|
||||
$pnl.results = $('.sax-panel-results', $pnl.logFiles);
|
||||
$pnl.msgs = $('.sax-panel-messages', $pnl.results)
|
||||
$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); });
|
||||
$pnl.items = $('.LogFiles');
|
||||
$pnl.table = $pnl.items.find('.sax-panel-item-table');
|
||||
$pnl.msgs = $pnl.table.find('.sax-panel-messages');
|
||||
$pnl.tmpls = $pnl.items.find('.sax-panel-item-template');
|
||||
|
||||
$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.cbYears = $('#cbFilterLogYear', $frm.filter).on('change', function () { sl.refreshMonths(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">
|
||||
<value>Value must not exceed {0} characters</value>
|
||||
</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">
|
||||
<value>Event</value>
|
||||
</data>
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
}
|
||||
|
||||
// User account.
|
||||
SysId userAccountId = StringUtil.ToSysId(model.UserAccount.Id);
|
||||
SysId userAccountId = SysId.ToSysId(model.UserAccount.Id);
|
||||
if (!SysId.IsValid(userAccountId))
|
||||
userAccountId = SessionUserAccountId;
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
return Json(responseData);
|
||||
|
||||
// User account.
|
||||
SysId userAccountId = StringUtil.ToSysId(model.UserAccount.Id);
|
||||
SysId userAccountId = SysId.ToSysId(model.UserAccount.Id);
|
||||
if (!SysId.IsValid(userAccountId))
|
||||
userAccountId = SessionUserAccountId;
|
||||
|
||||
@@ -471,7 +471,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
RefreshModel(model);
|
||||
|
||||
// User account.
|
||||
SysId userAccountId = StringUtil.ToSysId(model.UserAccount.Id);
|
||||
SysId userAccountId = SysId.ToSysId(model.UserAccount.Id);
|
||||
if (!SysId.IsValid(userAccountId))
|
||||
userAccountId = SessionUserAccountId;
|
||||
|
||||
|
||||
@@ -290,8 +290,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
OrganisationName = values.GetString(colOrganisationName.DataName),
|
||||
Headline = values.GetString(colHeadline.DataName),
|
||||
Summary = values.GetString(colSummary.DataName),
|
||||
RegionCaptionPrimary = model.GetRegionCaption(values.GetString(colRegionIdPrimary.DataName).ToSysId()),
|
||||
SportCaptionPrimary = model.GetSportCaption(values.GetString(colSportIdPrimary.DataName).ToSysId()),
|
||||
RegionCaptionPrimary = model.GetRegionCaption(SysId.ToSysId(values.GetString(colRegionIdPrimary.DataName))),
|
||||
SportCaptionPrimary = model.GetSportCaption(SysId.ToSysId(values.GetString(colSportIdPrimary.DataName))),
|
||||
CreatedOnFmt = model.FormatDateForDisplay(values.GetDateTime(colCreatedOn.DataName)),
|
||||
PublishedOnFmt = model.FormatDateForDisplay(values.GetDateTime(colPublishedOn.DataName)),
|
||||
StatusCode = values.GetString(colStatus.DataName),
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
public IActionResult GetAccountContactImage(String uaie)
|
||||
{
|
||||
String userAccountIdParam = "";// ToDo Decrypt from uaie value.
|
||||
SysId userAccountId = userAccountIdParam.ToSysId();
|
||||
SysId userAccountId = SysId.ToSysId(userAccountIdParam);
|
||||
if (!SysId.IsValid(userAccountId))
|
||||
userAccountId = SessionUserAccountId;
|
||||
return GetAccountContactImage(userAccountId, Sax.ImageType.Avatar);
|
||||
@@ -160,7 +160,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
if (parameters.Count < 1) return Forbid();
|
||||
|
||||
// Organisation Id.
|
||||
SysId organisationId = parameters.Get(ParamName_OrganisationId).ToSysId();
|
||||
SysId organisationId = SysId.ToSysId(parameters.Get(ParamName_OrganisationId));
|
||||
if (!SysId.IsValid(organisationId)) return Forbid();
|
||||
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();
|
||||
|
||||
// Item Image.
|
||||
SysId itemImageId = parameters.Get(ParamName_ItemImageId).ToSysId();
|
||||
SysId itemImageId = SysId.ToSysId(parameters.Get(ParamName_ItemImageId));
|
||||
if (!SysId.IsValid(itemImageId)) return Forbid();
|
||||
SaxItemImage itemImage = ItemDataMgr.GetItemImageById(itemImageId);
|
||||
if (itemImage == null)
|
||||
|
||||
@@ -264,8 +264,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
TypeCode = values.GetString(colEventTypeCode.DataName),
|
||||
TypeDesc = Localiser.GetEventTypeCaption((Sax.EventType)EventTypeCodes.GetTypeForCode(values.GetString(colEventTypeCode.DataName))),
|
||||
Summary = ActivityMgr.GetOrganisationEventDataValue(colSummary, values).AsString(),
|
||||
RegionCaptionCountry = model.GetRegionCaption(values.GetString(colRegionId.DataName).ToSysId()),
|
||||
SportCaptionPrimary = model.GetSportCaption(values.GetString(colSportId.DataName).ToSysId()),
|
||||
RegionCaptionCountry = model.GetRegionCaption(SysId.ToSysId(values.GetString(colRegionId.DataName))),
|
||||
SportCaptionPrimary = model.GetSportCaption(SysId.ToSysId(values.GetString(colSportId.DataName))),
|
||||
CreatedOnFmt = Localiser.FormatDate(values.GetDateTime(colCreatedOn.DataName)),
|
||||
PublishedOnFmt = Localiser.FormatDate(values.GetDateTime(colPublishedOn.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))),
|
||||
Position = values.GetString(colPosition.DataName),
|
||||
Outline = values.GetString(colOutline.DataName),
|
||||
RegionCaption = model.GetRegionCaption(values.GetString(colRegionId.DataName).ToSysId()),
|
||||
SportCaption = model.GetSportCaption(values.GetString(colSportId.DataName).ToSysId()),
|
||||
RegionCaption = model.GetRegionCaption(SysId.ToSysId(values.GetString(colRegionId.DataName))),
|
||||
SportCaption = model.GetSportCaption(SysId.ToSysId(values.GetString(colSportId.DataName))),
|
||||
CreatedOnFmt = Localiser.FormatDate(values.GetDateTime(colCreatedOn.DataName)),
|
||||
PublishedOnFmt = Localiser.FormatDate(values.GetDateTime(colPublishedOn.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_ExpiresAt { get; } = "exp";
|
||||
private static String ParamName_Token { get; } = "tok";
|
||||
// Request Password encryption parameters (key & IV) are defined in the base Controller
|
||||
// so that they can be shared with the Adnin application.
|
||||
// Online Request Password encryption parameters (key & IV) are defined in the base Controller
|
||||
// so that they can be shared with the Admin application.
|
||||
internal static String GenerateRequestPasswordLink(SaxController_Online controller, SysId userAccountId, String emailAddress, String requestPasswordToken)
|
||||
{
|
||||
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>
|
||||
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 false;
|
||||
}
|
||||
|
||||
@@ -142,13 +142,13 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
// Event duration.
|
||||
if (EventDuration != null)
|
||||
{
|
||||
String controlName = nameof(EventDuration);
|
||||
//String controlName = nameof(EventDuration);
|
||||
}
|
||||
|
||||
// Event duration type.
|
||||
if (EventDurationType != null)
|
||||
{
|
||||
String controlName = nameof(EventDurationType);
|
||||
//String controlName = nameof(EventDurationType);
|
||||
}
|
||||
|
||||
// Event To date.
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
|
||||
// Numeric values are assumed to be unencrypted Ids.
|
||||
if (StringUtil.IsNumeric(idx))
|
||||
return idx.ToSysId();
|
||||
return SysId.ToSysId(idx);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -172,9 +172,9 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
if (StringUtil.IsEmpty(encryptedId))
|
||||
return new SysId();
|
||||
if (StringUtil.IsNumeric(encryptedId))
|
||||
return encryptedId.ToSysId();
|
||||
return SysId.ToSysId(encryptedId);
|
||||
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>
|
||||
|
||||
<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="Moment.js" Version="2.30.1" />
|
||||
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
|
||||
|
||||
@@ -199,7 +199,17 @@
|
||||
</div>
|
||||
|
||||
@* 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>
|
||||
|
||||
@* Form to allow page navigation. *@
|
||||
|
||||
@@ -124,7 +124,7 @@ input
|
||||
|
||||
textarea
|
||||
{
|
||||
overflow-y:scroll;
|
||||
overflow-y: scroll;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
@@ -198,6 +198,31 @@ td.action
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.width5pc
|
||||
{
|
||||
width: 5%;
|
||||
}
|
||||
|
||||
.width10pc
|
||||
{
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
.width20pc
|
||||
{
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
.width25pc
|
||||
{
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.width50pc
|
||||
{
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.fullwidth
|
||||
{
|
||||
width: 100%;
|
||||
|
||||
@@ -53,45 +53,88 @@ body
|
||||
background-color: #e9edf6;
|
||||
}
|
||||
|
||||
body > .container
|
||||
@media screen and (max-height: 399px)
|
||||
{
|
||||
padding: 0 1%;
|
||||
#sax-page-body
|
||||
{
|
||||
min-height: 240px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Sticky footer styles */
|
||||
|
||||
html
|
||||
@media screen and (min-height: 400px)
|
||||
{
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
body
|
||||
/* Responsive */
|
||||
|
||||
body > .container, header > .container, footer > .container
|
||||
{
|
||||
/* Margin bottom by footer height */
|
||||
/*margin-bottom: 60px;*/
|
||||
padding: 0 0.5%;
|
||||
}
|
||||
|
||||
.footer
|
||||
@media (min-width: 992px)
|
||||
{
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
/* Set the fixed height of the footer here */
|
||||
height: 60px;
|
||||
line-height: 60px; /* Vertically center the text there */
|
||||
.container
|
||||
{
|
||||
max-width: 1200px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px)
|
||||
{
|
||||
.container
|
||||
{
|
||||
max-width: 1200px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 576px)
|
||||
{
|
||||
.container
|
||||
{
|
||||
max-width: 1200px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Header */
|
||||
|
||||
#sax-page-header
|
||||
{
|
||||
}
|
||||
|
||||
a.navbar-brand
|
||||
{
|
||||
padding-top: 0.3rem;
|
||||
padding-bottom: 0.1rem;
|
||||
white-space: normal;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.navbar li.nav-item a.nav-link
|
||||
{
|
||||
padding-top: 0.3rem;
|
||||
padding-bottom: 0.1rem;
|
||||
}
|
||||
|
||||
.border-top
|
||||
{
|
||||
border-top: 1px solid #e5e5e5;
|
||||
@@ -120,6 +163,18 @@ button.accept-policy
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
|
||||
#sax-page-footer
|
||||
{
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
#sax-page-footer, #sax-page-footer div
|
||||
{
|
||||
font-size: .8rem;
|
||||
}
|
||||
|
||||
/* Actions */
|
||||
|
||||
a, a:hover
|
||||
|
||||
@@ -133,10 +133,8 @@
|
||||
{
|
||||
$(sel).datepicker().on('keyup', function (e)
|
||||
{
|
||||
if (e.keyCode == 8 || e.keyCode == 46)
|
||||
{
|
||||
$(this).datepicker('setDate', null).datepicker('hide').change();
|
||||
}
|
||||
if (e.key == 'Backspace' || e.key == 'Delete')
|
||||
$(this).datepicker('setDate', null).datepicker('hide').trigger('change');
|
||||
});
|
||||
}
|
||||
sax.initTimePickers = function (sel, opt)
|
||||
@@ -157,7 +155,7 @@
|
||||
}
|
||||
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);
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
@@ -165,7 +163,7 @@
|
||||
sax.navigateTo = function (action)
|
||||
{
|
||||
sax.doPleaseWait();
|
||||
$('#frmNavigate').prop('action', sax.url.base + action).submit();
|
||||
$('#frmNavigate').prop('action', sax.url.base + action).trigger('submit');
|
||||
}
|
||||
sax.goToPage = function (action)
|
||||
{
|
||||
@@ -341,7 +339,7 @@
|
||||
type: 'POST',
|
||||
cache: false,
|
||||
//enctype: 'multipart/form-data',
|
||||
data: ajax.formData || $("#" + ajax.formId).serialize(),
|
||||
data: ajax.formData || $(ajax.formSel || "#" + ajax.formId).serialize(),
|
||||
dataType: 'json',
|
||||
success: function (response, status, jqXHR)
|
||||
{
|
||||
@@ -505,21 +503,29 @@
|
||||
sax.onWinResizePage = function () { };
|
||||
sax.onWinResize = function ()
|
||||
{
|
||||
var winH = $(win).height();
|
||||
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');
|
||||
$('body').toggleClass('sax-layout-flex', !sax.isAutoHeight()).toggleClass('sax-layout-flow', sax.isAutoHeight());
|
||||
sax.onWinResizePage();
|
||||
}
|
||||
setTimeout(sax.onWinResize, 50);
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
$(win).on('resize', function () { sax.onWinResize(); });
|
||||
|
||||
$('.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)
|
||||
sax.configureKeepLoggedIn();
|
||||
else if (!sax.awaitingLogin)
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
$(function ()
|
||||
{
|
||||
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); });
|
||||
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(); });
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
sax.initCalendars('#frmSportExperience .sax-calendar', { changeMonth: true, changeYear: true, yearRange: '-99:+00' });
|
||||
se.$dpPeriodFrom = $('.sax-calendar.ExperiencePeriodFrom', 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');
|
||||
});
|
||||
//--------------------------------------------------------------
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
public static class Version
|
||||
{
|
||||
private static String version { get; } = "1.2.11.14";
|
||||
private static String version { get; } = "1.2.11.15";
|
||||
// Retrieve version.
|
||||
public static String GetFullVersion () { return version; }
|
||||
public static String GetAppVersion ()
|
||||
|
||||
@@ -41,6 +41,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
ActivityReaction,
|
||||
// Support.
|
||||
UserReportType,
|
||||
SupportItemProcessType
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -121,6 +122,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
Golf_UsgaMarker = 1004,
|
||||
// Support.
|
||||
UserReport = 9010,
|
||||
SupportItemProcess = 9020,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -463,6 +465,14 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
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); } }
|
||||
// Support.
|
||||
public List<TypeCodeDesc> UserReportTypeCodes { get { return GetCodesOfType(Sax.CodeType.UserReportType); } }
|
||||
public List<TypeCodeDesc> SupportItemProcessTypeCodes { get { return GetCodesOfType(Sax.CodeType.SupportItemProcessType); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Consoles.
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
private static readonly List<TypeCodeDesc> activityReactionCodes = new List<TypeCodeDesc>();
|
||||
// Support.
|
||||
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
|
||||
@@ -97,6 +98,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
// Support.
|
||||
case Sax.CodeType.UserReportType:
|
||||
return new List<TypeCodeDesc>(userReportTypeCodes);
|
||||
case Sax.CodeType.SupportItemProcessType:
|
||||
return new List<TypeCodeDesc>(supportItemProcessTypeCodes);
|
||||
|
||||
default:
|
||||
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.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.
|
||||
public override bool ItemHasId { get; } = false;
|
||||
public override bool ItemHasId() { return false; }
|
||||
public Data GetData() { return data.Clone(); }
|
||||
public void SetData(Data data)
|
||||
{
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
{
|
||||
// Content segment image Id.
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
//=======================================================================
|
||||
// ItemSport.
|
||||
//=======================================================================
|
||||
public abstract class SaxItemSport : SacsHierarchyItem
|
||||
public abstract class SaxItemProcess : SacsHierarchyItem
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Columns.
|
||||
@@ -107,7 +107,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
protected SaxItemSport(SysId id, ItemId itemId, SysId sportId) : base(id)
|
||||
protected SaxItemProcess(SysId id, ItemId itemId, SysId sportId) : base(id)
|
||||
{
|
||||
base.SetData(data);
|
||||
ItemId = itemId;
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
ContactData contactData = new ContactData()
|
||||
{
|
||||
ContactType = contactType,
|
||||
UserAccountId = rootChildElement.GetChildText(ElementName_UserAccountId).ToSysId(),
|
||||
UserAccountId = SysId.ToSysId(rootChildElement.GetChildText(ElementName_UserAccountId)),
|
||||
Title = rootChildElement.GetChildText(ElementName_Title),
|
||||
FirstName = rootChildElement.GetChildText(ElementName_FirstName),
|
||||
LastName = rootChildElement.GetChildText(ElementName_LastName),
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
public override bool ItemHasId => false;
|
||||
public override bool ItemHasId() { return false; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// 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.
|
||||
public abstract SaxItemSport CreateItemSport();
|
||||
public abstract SaxItemProcess CreateItemSport();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item exists.
|
||||
@@ -29,34 +29,34 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return false;
|
||||
SaxItemSport.Params prmItemSport = new SaxItemSport.Params();
|
||||
SaxItemProcess.Params prmItemSport = new SaxItemProcess.Params();
|
||||
prmItemSport.IdsIncluded.Add(id);
|
||||
prmItemSport.StatusCat = SaxItemSport.StatusCat.Any;
|
||||
prmItemSport.StatusCat = SaxItemProcess.StatusCat.Any;
|
||||
return GetItemSportCount(prmItemSport) == 1;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Retrieve individual items.
|
||||
public abstract SaxItemSport GetItemSport(SaxItemSport.Params prmItemSport);
|
||||
public SaxItemSport GetItemSportById(SysId id)
|
||||
public abstract SaxItemProcess GetItemSport(SaxItemProcess.Params prmItemSport);
|
||||
public SaxItemProcess GetItemSportById(SysId id)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return null;
|
||||
SaxItemSport.Params prmItemSport = new SaxItemSport.Params();
|
||||
SaxItemProcess.Params prmItemSport = new SaxItemProcess.Params();
|
||||
prmItemSport.IdsIncluded.Add(id);
|
||||
prmItemSport.StatusCat = SaxItemSport.StatusCat.Any;
|
||||
prmItemSport.StatusCat = SaxItemProcess.StatusCat.Any;
|
||||
return GetItemSport(prmItemSport);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate item data.
|
||||
public bool IsValidItemSport(SaxItemSport itemSport)
|
||||
public bool IsValidItemSport(SaxItemProcess itemSport)
|
||||
{
|
||||
ClearErrorState();
|
||||
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();
|
||||
|
||||
@@ -88,7 +88,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
if (!SaxItemSport.ValidStatuses.Contains(data.Status))
|
||||
if (!SaxItemProcess.ValidStatuses.Contains(data.Status))
|
||||
{
|
||||
errField.Status = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState(ErrorMessage.InvalidStatus);
|
||||
@@ -101,12 +101,12 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
{
|
||||
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))
|
||||
prmItemSport.IdsExcluded.Add(data.Id);
|
||||
prmItemSport.ItemIdsIncluded.Add(data.ItemId);
|
||||
prmItemSport.SportIdsIncluded.Add(data.SportId);
|
||||
prmItemSport.StatusCat = SaxItemSport.StatusCat.Any;
|
||||
prmItemSport.StatusCat = SaxItemProcess.StatusCat.Any;
|
||||
if (GetItemSportCount(prmItemSport) > 0)
|
||||
{
|
||||
errField.SportId = SacsHierarchyItem.ValidValue.Invalid;
|
||||
@@ -121,22 +121,22 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item database interface.
|
||||
public abstract bool InsertItemSport(SaxItemSport itemSport, DbUpdateInfo dbUpdateInfo);
|
||||
public abstract bool UpdateItemSport(SaxItemSport itemSport, DbUpdateInfo dbUpdateInfo);
|
||||
public virtual bool ItemSportCanBeDeleted(SaxItemSport itemSport)
|
||||
public abstract bool InsertItemSport(SaxItemProcess itemSport, DbUpdateInfo dbUpdateInfo);
|
||||
public abstract bool UpdateItemSport(SaxItemProcess itemSport, DbUpdateInfo dbUpdateInfo);
|
||||
public virtual bool ItemSportCanBeDeleted(SaxItemProcess itemSport)
|
||||
{
|
||||
ClearErrorState();
|
||||
return true;
|
||||
}
|
||||
public abstract bool DeleteItemSport(SaxItemSport itemSport, DbUpdateInfo dbUpdateInfo);
|
||||
public abstract bool DeleteItemSport(SaxItemProcess itemSport, DbUpdateInfo dbUpdateInfo);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item list.
|
||||
public abstract ColumnDfn GetItemSportColumnDfn(SaxItemSport.Column columnId, String caption = "", int width = 0);
|
||||
public abstract List<String> GetItemSportQueryFilter(SaxItemSport.Params prmItemSport);
|
||||
public abstract long GetItemSportCount(SaxItemSport.Params prmItemSport);
|
||||
public abstract List<SaxItemSport> GetItemSportList(SaxItemSport.Params prmItemSport);
|
||||
public abstract DbResultSet ExecuteItemSportQuery(List<ColumnDfn> columns, SaxItemSport.Params prmItemSport);
|
||||
public abstract ColumnDfn GetItemSportColumnDfn(SaxItemProcess.Column columnId, String caption = "", int width = 0);
|
||||
public abstract List<String> GetItemSportQueryFilter(SaxItemProcess.Params prmItemSport);
|
||||
public abstract long GetItemSportCount(SaxItemProcess.Params prmItemSport);
|
||||
public abstract List<SaxItemProcess> GetItemSportList(SaxItemProcess.Params prmItemSport);
|
||||
public abstract DbResultSet ExecuteItemSportQuery(List<ColumnDfn> columns, SaxItemProcess.Params prmItemSport);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
@@ -146,16 +146,16 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
public virtual DataValue GetItemSportDataValue(ColumnDfn column, NamedValue.Map values)
|
||||
{
|
||||
DataValue value = new DataValue();
|
||||
switch ((SaxItemSport.Column)column.Id)
|
||||
switch ((SaxItemProcess.Column)column.Id)
|
||||
{
|
||||
//-----------------------------------------------------------
|
||||
// Data item type.
|
||||
case SaxItemSport.Column.ItemType_Code:
|
||||
case SaxItemProcess.Column.ItemType_Code:
|
||||
{
|
||||
value = new DataValue(DataItemTypeCodes.GetCodeForType(values.GetLong(column.DataName)));
|
||||
}
|
||||
break;
|
||||
case SaxItemSport.Column.ItemType_Desc:
|
||||
case SaxItemProcess.Column.ItemType_Desc:
|
||||
{
|
||||
value = new DataValue(DataItemTypeCodes.GetDescForType(values.GetLong(column.DataName)));
|
||||
}
|
||||
@@ -163,21 +163,21 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Notes.
|
||||
case SaxItemSport.Column.Notes:
|
||||
case SaxItemProcess.Column.Notes:
|
||||
value = new DataValue(SacsHierarchyItem.FormatForDisplay(values.GetValue(column.DataName).ToString(), 200));
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Status.
|
||||
case SaxItemSport.Column.Status_Desc:
|
||||
case SaxItemSport.Column.Status_Ind:
|
||||
case SaxItemProcess.Column.Status_Desc:
|
||||
case SaxItemProcess.Column.Status_Ind:
|
||||
{
|
||||
String statusCode = values.GetValue(column.DataName).ToString();
|
||||
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));
|
||||
else if (column.Id == (int)SaxItemSport.Column.Status_Ind)
|
||||
value = new DataValue(SaxItemSport.GetStatusTriState(status));
|
||||
else if (column.Id == (int)SaxItemProcess.Column.Status_Ind)
|
||||
value = new DataValue(SaxItemProcess.GetStatusTriState(status));
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Saxonite.Net.Standard.Dbas.App
|
||||
// Open database.
|
||||
// NB Must be ODBC connection - especially to retrieve index columns.
|
||||
SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig();
|
||||
config.connectionString = connectionString;
|
||||
config.ConnectionString = connectionString;
|
||||
SacsDatabase database = SacsDatabaseConsole.OpenOdbcDatabase(config);
|
||||
|
||||
// Generate database definition.
|
||||
|
||||
@@ -8,7 +8,7 @@ using System.Text;
|
||||
namespace Saxonite.Net.Standard.Dbas.Bus
|
||||
{
|
||||
//=======================================================================
|
||||
public class SaxItemSport_Dbas : SaxItemSport
|
||||
public class SaxItemSport_Dbas : SaxItemProcess
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
private void PopulateFrom(UserSession_Db dbUserSession, SaxUserSession userSession)
|
||||
{
|
||||
//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;
|
||||
// Common.
|
||||
userSession.SetCreateStamp(dbUserSession._CreateOn, new SysId(), "");
|
||||
|
||||
@@ -242,9 +242,9 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
//userSport.SportId = new SysId(dbUserSport._SportId);
|
||||
userSport.About = dbUserSport._About;
|
||||
userSport.ContactsData = dbUserSport._ContactsData;
|
||||
userSport.Participating = (Sax.SportParticipating)dbUserSport._Participating;
|
||||
userSport.Preparing = (Sax.SportPreparing)dbUserSport._Preparing;
|
||||
userSport.Officiating = (Sax.SportOfficiating)dbUserSport._Officiating;
|
||||
userSport.Participating = (Sax.SportParticipating)(dbUserSport._Participating ?? 0);
|
||||
userSport.Preparing = (Sax.SportPreparing)(dbUserSport._Preparing ?? 0);
|
||||
userSport.Officiating = (Sax.SportOfficiating)(dbUserSport._Officiating ?? 0);
|
||||
userSport.UserSportData = dbUserSport._UserSportData;
|
||||
// Common.
|
||||
userSport.Notes = dbUserSport._Notes;
|
||||
|
||||
@@ -102,7 +102,6 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
// Insert item.
|
||||
public override bool InsertUserActivity(SaxUserActivity userActivity, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
String fn = GetType().Name + ".InsertUserActivity";
|
||||
ClearErrorState();
|
||||
if (!IsValidUserActivity(userActivity)) return false;
|
||||
if (SysId.IsValid(userActivity.Id)) return SetErrorState(ErrorMessage.ValiditemId);
|
||||
@@ -122,7 +121,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
dbUserActivity.ExecuteInsertCommand(dbCommand);
|
||||
userActivity.Id = new SysId(dbUserActivity._Id);
|
||||
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);
|
||||
}
|
||||
catch (Exception exc) { SetErrorState(exc.Message); }
|
||||
@@ -134,13 +133,12 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
// Update item.
|
||||
public override bool UpdateUserActivity(SaxUserActivity userActivity, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
String fn = GetType().Name + ".UpdateUserActivity";
|
||||
ClearErrorState();
|
||||
if (!IsValidUserActivity(userActivity)) return false;
|
||||
if (!SysId.IsValid(userActivity.Id)) return SetErrorState(ErrorMessage.InvalidItemId);
|
||||
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;
|
||||
}
|
||||
using (var dbConnection = CoreDatabase.CreateConnection())
|
||||
@@ -151,7 +149,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
// Retrieve item.
|
||||
dbConnection.Open();
|
||||
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.
|
||||
SaxUserActivity userActivity_Snapshot = CreateUserActivity(dbUserActivity);
|
||||
// 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);
|
||||
dbUserActivity.ExecuteUpdateCommand(dbCommand);
|
||||
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.
|
||||
// ToDo updateLogMonitor.RecordUpdatedValues(userActivity);
|
||||
// ToDo updateLogMonitor.LogUpdates();
|
||||
@@ -202,7 +200,6 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
}
|
||||
public override bool DeleteUserActivity(SaxUserActivity userActivity, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
String fn = GetType().Name + ".DeleteUserActivity";
|
||||
ClearErrorState();
|
||||
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.ExecuteNonQuery();
|
||||
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); }
|
||||
}
|
||||
@@ -439,17 +436,15 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
String aliasUserActivity = StringUtil.OnEmpty(prm.Alias_UserActivity, SaxActivityMgr_Dbas.aliasUserActivity);
|
||||
|
||||
// Ids.
|
||||
String idsIncluded = prm.IdsIncluded.Concat(",");
|
||||
if (!idsIncluded.IsEmpty())
|
||||
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserSport_Id, aliasUserActivity) + " IN (" + idsIncluded + ")");
|
||||
String idsExcluded = prm.IdsExcluded.Concat(",");
|
||||
if (!idsExcluded.IsEmpty())
|
||||
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserSport_Id, aliasUserActivity) + " NOT IN (" + idsExcluded + ")");
|
||||
if (prm.IdsIncluded.HasValidIds())
|
||||
filter.Add($"{SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserSport_Id, aliasUserActivity)} IN ({prm.IdsIncluded.Concat(", ")})");
|
||||
if (prm.IdsExcluded.HasValidIds())
|
||||
filter.Add($"{SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserSport_Id, aliasUserActivity)} NOT IN ({prm.IdsExcluded.Concat(",")})");
|
||||
|
||||
// User accounts.
|
||||
String userAccountIdsIncluded = prm.UserAccountIdsIncluded.Concat(",");
|
||||
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.
|
||||
if (!prm.ItemIdsIncluded.IsEmpty())
|
||||
@@ -459,8 +454,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
{
|
||||
if (!ItemId.IsValid(itemId)) continue;
|
||||
String itemIdFilter =
|
||||
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);
|
||||
$"{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)}";
|
||||
itemIdFilters.Add(itemIdFilter);
|
||||
}
|
||||
if (!itemIdFilters.IsEmpty())
|
||||
@@ -511,7 +506,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
private long GetUserActivityCount(String filter)
|
||||
{
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
// Item Data Mgr - Item Sport
|
||||
//*******************************************************************
|
||||
// Utilities.
|
||||
private List<StringPair> GetLogProperties(SaxItemSport itemSport)
|
||||
private List<StringPair> GetLogProperties(SaxItemProcess itemSport)
|
||||
{
|
||||
return new List<StringPair>()
|
||||
{
|
||||
@@ -37,7 +37,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Create item.
|
||||
public override SaxItemSport CreateItemSport()
|
||||
public override SaxItemProcess CreateItemSport()
|
||||
{
|
||||
ClearErrorState();
|
||||
return new SaxItemSport_Dbas(CoreDatabase, null, null, null, 0);
|
||||
@@ -53,12 +53,12 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get item.
|
||||
public override SaxItemSport GetItemSport(SaxItemSport.Params prm)
|
||||
public override SaxItemProcess GetItemSport(SaxItemProcess.Params prm)
|
||||
{
|
||||
ClearErrorState();
|
||||
return GetItemSport(GetItemSportQueryFilter(prm).Concat(" And ", "(", ")"));
|
||||
}
|
||||
private SaxItemSport GetItemSport(String filter)
|
||||
private SaxItemProcess GetItemSport(String filter)
|
||||
{
|
||||
ClearErrorState();
|
||||
long count = GetItemSportCount(filter);
|
||||
@@ -68,7 +68,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
SetErrorState("Multiple items found");
|
||||
return null;
|
||||
}
|
||||
SaxItemSport itemSport = null;
|
||||
SaxItemProcess itemSport = null;
|
||||
// Query data.
|
||||
using (var dbConnection = CoreDatabase.CreateConnection())
|
||||
using (var dbCommand = dbConnection.CreateCommand())
|
||||
@@ -91,7 +91,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate item.
|
||||
public override bool IsValidItemSportData(SaxItemSport.Data data, SaxItemSport.ErrField errField)
|
||||
public override bool IsValidItemSportData(SaxItemProcess.Data data, SaxItemProcess.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!base.IsValidItemSportData(data, errField)) return false;
|
||||
@@ -100,7 +100,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert item.
|
||||
public override bool InsertItemSport(SaxItemSport itemSport, DbUpdateInfo dbUpdateInfo)
|
||||
public override bool InsertItemSport(SaxItemProcess itemSport, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!IsValidItemSport(itemSport)) return false;
|
||||
@@ -130,7 +130,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update item.
|
||||
public override bool UpdateItemSport(SaxItemSport itemSport, DbUpdateInfo dbUpdateInfo)
|
||||
public override bool UpdateItemSport(SaxItemProcess itemSport, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!IsValidItemSport(itemSport)) return false;
|
||||
@@ -166,13 +166,13 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Delete item.
|
||||
public override bool ItemSportCanBeDeleted(SaxItemSport itemSport)
|
||||
public override bool ItemSportCanBeDeleted(SaxItemProcess itemSport)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!base.ItemSportCanBeDeleted(itemSport)) return false;
|
||||
return true;
|
||||
}
|
||||
public override bool DeleteItemSport(SaxItemSport itemSport, DbUpdateInfo dbUpdateInfo)
|
||||
public override bool DeleteItemSport(SaxItemProcess itemSport, DbUpdateInfo dbUpdateInfo)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!ItemSportCanBeDeleted(itemSport)) return false;
|
||||
@@ -207,7 +207,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// 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._ItemType = itemSport.ItemId.Type;
|
||||
@@ -228,7 +228,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
dbItemSport._UpdateBy = dbUpdateInfo.UserId.ToInt();
|
||||
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.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)
|
||||
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);
|
||||
switch (columnId)
|
||||
{
|
||||
//-----------------------------------------------------------
|
||||
case SaxItemSport.Column.Pos:
|
||||
case SaxItemProcess.Column.Pos:
|
||||
SetItemSportColDfn(columnDfn, "Pos", 60, SaxDbDfn_Core.ColumnIdx.Unknown, ColumnAlignment.Right);
|
||||
columnDfn.SortMode = ColumnDfn.ColumnSortMode.Off;
|
||||
columnDfn.ReadOnly = true;
|
||||
columnDfn.Resizable = false;
|
||||
break;
|
||||
case SaxItemSport.Column.Id:
|
||||
case SaxItemProcess.Column.Id:
|
||||
SetItemSportColDfn(columnDfn, "Id", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_Id, ColumnAlignment.Right, DataValue.DataType.Long);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
case SaxItemSport.Column.ItemType:
|
||||
case SaxItemProcess.Column.ItemType:
|
||||
SetItemSportColDfn(columnDfn, "Item type", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_ItemType, ColumnAlignment.Center, DataValue.DataType.Long);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
case SaxItemSport.Column.ItemType_Code:
|
||||
case SaxItemProcess.Column.ItemType_Code:
|
||||
SetItemSportColDfn(columnDfn, "Item type", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_ItemType, ColumnAlignment.Center);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
case SaxItemSport.Column.ItemType_Desc:
|
||||
case SaxItemProcess.Column.ItemType_Desc:
|
||||
SetItemSportColDfn(columnDfn, "Item type", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_ItemType, ColumnAlignment.Center);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
case SaxItemSport.Column.ItemId:
|
||||
case SaxItemProcess.Column.ItemId:
|
||||
SetItemSportColDfn(columnDfn, "Item Id", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_ItemId, ColumnAlignment.Right, DataValue.DataType.Long);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
case SaxItemSport.Column.SportId:
|
||||
case SaxItemProcess.Column.SportId:
|
||||
SetItemSportColDfn(columnDfn, "Sport Id", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_SportId, ColumnAlignment.Right, DataValue.DataType.Long);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// 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);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
@@ -307,27 +307,27 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Common properties.
|
||||
case SaxItemSport.Column.Notes:
|
||||
case SaxItemProcess.Column.Notes:
|
||||
SetItemSportColDfn(columnDfn, "Notes", 240, SaxDbDfn_Core.ColumnIdx.ItemSport_Notes);
|
||||
break;
|
||||
case SaxItemSport.Column.Flags:
|
||||
case SaxItemProcess.Column.Flags:
|
||||
SetItemSportColDfn(columnDfn, "Flags", 60, SaxDbDfn_Core.ColumnIdx.ItemSport_Flags, ColumnAlignment.Center, DataValue.DataType.Long);
|
||||
break;
|
||||
case SaxItemSport.Column.Status:
|
||||
case SaxItemProcess.Column.Status:
|
||||
SetItemSportColDfn(columnDfn, "Status", 80, SaxDbDfn_Core.ColumnIdx.ItemSport_Status, ColumnAlignment.Center);
|
||||
break;
|
||||
case SaxItemSport.Column.Status_Desc:
|
||||
case SaxItemProcess.Column.Status_Desc:
|
||||
SetItemSportColDfn(columnDfn, "Status", 90, SaxDbDfn_Core.ColumnIdx.ItemSport_Status, ColumnAlignment.Center);
|
||||
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);
|
||||
columnDfn.TriStateFormat = ColumnTriStateFormat.Lights;
|
||||
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);
|
||||
columnDfn.ReadOnly = true;
|
||||
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);
|
||||
columnDfn.ReadOnly = true;
|
||||
break;
|
||||
@@ -342,7 +342,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// 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>();
|
||||
|
||||
@@ -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) + "%'");
|
||||
|
||||
// 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));
|
||||
|
||||
if (filter.Count < 1) filter.Add("1=1");
|
||||
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) + "'";
|
||||
if (statusCat == SaxItemSport.StatusCat.InactiveOnly)
|
||||
if (statusCat == SaxItemProcess.StatusCat.InactiveOnly)
|
||||
return "='" + SacsSystem.GetStatusCode(SaStatus.Inactive) + "'";
|
||||
if (statusCat == SaxItemSport.StatusCat.NotDeleted)
|
||||
if (statusCat == SaxItemProcess.StatusCat.NotDeleted)
|
||||
return "!='" + SacsSystem.GetStatusCode(SaStatus.Deleted) + "'";
|
||||
if (statusCat == SaxItemSport.StatusCat.DeletedOnly)
|
||||
if (statusCat == SaxItemProcess.StatusCat.DeletedOnly)
|
||||
return "='" + SacsSystem.GetStatusCode(SaStatus.Deleted) + "'";
|
||||
return "";
|
||||
}
|
||||
// Item sort columns.
|
||||
public List<String> GetItemSportSortColumns(SaxItemSport.Params prm)
|
||||
public List<String> GetItemSportSortColumns(SaxItemProcess.Params prm)
|
||||
{
|
||||
// Sort sequence:
|
||||
List<String> sortColumnNames = new List<String>();
|
||||
@@ -439,7 +439,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
ClearErrorState();
|
||||
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();
|
||||
return GetItemSportCount(GetItemSportQueryFilter(prm).Concat(" AND ", "(", ")"));
|
||||
@@ -447,10 +447,10 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item list.
|
||||
public override List<SaxItemSport> GetItemSportList(SaxItemSport.Params prm)
|
||||
public override List<SaxItemProcess> GetItemSportList(SaxItemProcess.Params prm)
|
||||
{
|
||||
ClearErrorState();
|
||||
List<SaxItemSport> itemSports = new List<SaxItemSport>();
|
||||
List<SaxItemProcess> itemSports = new List<SaxItemProcess>();
|
||||
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
|
||||
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.ItemSport), aliasItemSport);
|
||||
ItemSport_Db dbItemSport = new ItemSport_Db(CoreDbInfo);
|
||||
@@ -486,7 +486,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item query execution.
|
||||
public override DbResultSet ExecuteItemSportQuery(List<ColumnDfn> columns, SaxItemSport.Params prm)
|
||||
public override DbResultSet ExecuteItemSportQuery(List<ColumnDfn> columns, SaxItemProcess.Params prm)
|
||||
{
|
||||
ClearErrorState();
|
||||
|
||||
@@ -496,25 +496,25 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
query.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.ItemSport), aliasItemSport);
|
||||
|
||||
// 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));
|
||||
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));
|
||||
if (columns.HasId(SaxItemSport.Column.ItemId))
|
||||
if (columns.HasId(SaxItemProcess.Column.ItemId))
|
||||
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_ItemId, aliasItemSport));
|
||||
bool hasSportCols = (columns.HasId(SaxItemSport.Column.Sport_Name));
|
||||
if (columns.HasId(SaxItemSport.Column.SportId) || hasSportCols)
|
||||
bool hasSportCols = (columns.HasId(SaxItemProcess.Column.Sport_Name));
|
||||
if (columns.HasId(SaxItemProcess.Column.SportId) || hasSportCols)
|
||||
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ItemSport_SportId, aliasItemSport));
|
||||
// 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));
|
||||
if (columns.HasId(SaxItemSport.Column.Flags))
|
||||
if (columns.HasId(SaxItemProcess.Column.Flags))
|
||||
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));
|
||||
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));
|
||||
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));
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
@@ -37,10 +37,9 @@ namespace Saxonite.Web.Api.Consoles
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// 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 API app.");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Saxonite.Web.Api.Controllers
|
||||
{
|
||||
ResponseData_UsgaProvinces responseData = new ResponseData_UsgaProvinces();
|
||||
|
||||
SysId countryId = StringUtil.ToSysId(requestData.CountryId);
|
||||
SysId countryId = SysId.ToSysId(requestData.CountryId);
|
||||
if (SysId.IsValid(countryId))
|
||||
{
|
||||
SaxGolfUsgaProvince.Params prmProvinces = new SaxGolfUsgaProvince.Params();
|
||||
@@ -138,7 +138,7 @@ namespace Saxonite.Web.Api.Controllers
|
||||
{
|
||||
ResponseData_UsgaCourses responseData = new ResponseData_UsgaCourses();
|
||||
|
||||
SysId provinceId = StringUtil.ToSysId(requestData.ProvinceId);
|
||||
SysId provinceId = SysId.ToSysId(requestData.ProvinceId);
|
||||
if (SysId.IsValid(provinceId))
|
||||
{
|
||||
SaxGolfUsgaCourse.Params prmCourses = new SaxGolfUsgaCourse.Params();
|
||||
@@ -202,7 +202,7 @@ namespace Saxonite.Web.Api.Controllers
|
||||
{
|
||||
ResponseData_UsgaMarkers responseData = new ResponseData_UsgaMarkers();
|
||||
|
||||
SysId courseId = StringUtil.ToSysId(requestData.CourseId);
|
||||
SysId courseId = SysId.ToSysId(requestData.CourseId);
|
||||
if (SysId.IsValid(courseId))
|
||||
{
|
||||
SaxGolfUsgaMarker.Params prmMarkers = new SaxGolfUsgaMarker.Params();
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.1" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user