v1.2.10
This commit is contained in:
@@ -27,7 +27,7 @@ namespace Saxonite.Net.Core.UnitTests.Web.Online.App
|
||||
|
||||
// Application initialisation currently fails reading configuration.
|
||||
if (SessionContext == null)
|
||||
SessionContext = new SessionContextData(new SaxSessionContext_Web(100, Sax.Application.Online)).SessionContext;
|
||||
SessionContext = new SessionContextData_Online(new SaxSessionContext_Web(100, Sax.Application.Online)).SessionContext;
|
||||
}
|
||||
}
|
||||
private static SaxApplication_Online_Test app;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
@@ -17,7 +18,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Construction.
|
||||
public SaxAppConfig (String context, ConfigurationSection configSection, SaxAppConfig defaultConfig)
|
||||
public SaxAppConfig(String context, ConfigurationSection configSection, SaxAppConfig defaultConfig)
|
||||
{
|
||||
Context = context;
|
||||
populateDefaults(defaultConfig);
|
||||
@@ -99,7 +100,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
Logging.RootFolder = StringUtil.OnEmpty(logging["RootFolder"], Logging.RootFolder);
|
||||
}
|
||||
// Database.
|
||||
extractDatabaseConfig(CoreDatabase, configSection.GetSection("CoreDatabase"));
|
||||
extractDatabasesConfig(Databases, configSection.GetSection("Databases"));
|
||||
// Variants.
|
||||
foreach (ConfigurationSection variantSection in configSection.GetSection("Variants").GetChildren())
|
||||
{
|
||||
@@ -121,12 +122,28 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
foreach (var addressBcc in emailSection.GetSection("AddressesBcc").GetChildren())
|
||||
config.AddressesBcc.Add(StringUtil.TrimAll(addressBcc.Value));
|
||||
}
|
||||
private void extractDatabaseConfig(DatabaseConfig database, IConfigurationSection databaseSection)
|
||||
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);
|
||||
}
|
||||
private void extractDatabaseConfig(DatabasesConfig databases, IConfigurationSection databaseSection)
|
||||
{
|
||||
if (!databaseSection.Exists()) return;
|
||||
Sax.Database databaseType = EnumUtil.ParseEnum<Sax.Database>(databaseSection.Key);
|
||||
if (databaseType <= 0)
|
||||
{
|
||||
SaLogger.Warn(GetType().Name + ".extractDatabaseConfig Unrecognised database: " + databaseSection.Key);
|
||||
return;
|
||||
}
|
||||
// Extract database configuration.
|
||||
DatabaseConfig database = new DatabaseConfig();
|
||||
database.Location = StringUtil.OnEmpty(databaseSection["Location"], database.Location);
|
||||
database.User = StringUtil.OnEmpty(databaseSection["User"], database.User);
|
||||
database.Password = StringUtil.OnEmpty(databaseSection["Password"], database.Password);
|
||||
databases.Databases.Add(databaseType, database);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
@@ -200,7 +217,13 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
public String User { get; internal set; }
|
||||
public String Password { get; internal set; }
|
||||
}
|
||||
public DatabaseConfig CoreDatabase { get; } = new DatabaseConfig();
|
||||
public class DatabasesConfig
|
||||
{
|
||||
public Dictionary<Sax.Database, DatabaseConfig> Databases { get; } = new Dictionary<Sax.Database, DatabaseConfig>();
|
||||
public DatabaseConfig Core { get { return Databases.GetValue(Sax.Database.Core, new DatabaseConfig()); } }
|
||||
public DatabaseConfig Support { get { return Databases.GetValue(Sax.Database.Support, new DatabaseConfig()); } }
|
||||
}
|
||||
public DatabasesConfig Databases { get; } = new DatabasesConfig();
|
||||
// Documents.
|
||||
public class DocumentsConfig
|
||||
{
|
||||
|
||||
@@ -23,6 +23,18 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
// Data members.
|
||||
protected Sax.InstanceType instanceType;
|
||||
protected String environmentName = "";
|
||||
// Session context.
|
||||
protected class SessionContextData_Web
|
||||
{
|
||||
public SessionContextData_Web(SaxSessionContext_Web sessionContext)
|
||||
{
|
||||
SessionContext = sessionContext;
|
||||
}
|
||||
public SaxSessionContext_Web SessionContext { get; }
|
||||
public Dictionary<Sax.Database, ISacsDatabase> Databases { get; } = new Dictionary<Sax.Database, ISacsDatabase>();
|
||||
public ISacsDatabase CoreDatabase { get { return Databases.GetValue(Sax.Database.Core, null); } }
|
||||
public ISacsDatabase SupportDatabase { get { return Databases.GetValue(Sax.Database.Support, null); } }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Protected construction.
|
||||
@@ -47,7 +59,7 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
public abstract SaxAppConfig AppConfig { get; }
|
||||
public override SaxConsoleHelper ConsoleHelper { get { return ConsoleHelper_Web; } }
|
||||
public SaxConsoleHelper_Web ConsoleHelper_Web { get; protected set; }
|
||||
public override IDatabaseInfo CreateCoreDbInfo(SaxSessionContext sessionContext) { return new DbDataItem.DatabaseInfo(GetCoreDatabase(sessionContext)); }
|
||||
public override IDatabaseInfo CreateDbInfo(SaxSessionContext sessionContext, Sax.Database databaseType) { return new DbDataItem.DatabaseInfo(GetDatabase(sessionContext, databaseType)); }
|
||||
// Configuration.
|
||||
public IConfiguration Configuration { get; protected set; }
|
||||
public IConfiguration SaxConfiguration { get; protected set; }
|
||||
@@ -63,7 +75,10 @@ namespace Saxonite.Net.Core.Web.Base.App
|
||||
applicationParams.Add("Instance", InstanceType.ToString() + (!StringUtil.IsEmpty(AppConfig.Instance) ? " [" + AppConfig.Instance + "]" : ""));
|
||||
applicationParams.Add("Configuration", SaxSystem.DebugMode ? "Debug" : "Release");
|
||||
applicationParams.Add("Environment", EnvironmentName);
|
||||
applicationParams.Add("Database", AppConfig.CoreDatabase.Location);
|
||||
if (!StringUtil.IsBlank(AppConfig.Databases.Core.Location))
|
||||
applicationParams.Add("Database - Core", AppConfig.Databases.Core.Location);
|
||||
if (!StringUtil.IsBlank(AppConfig.Databases.Support.Location))
|
||||
applicationParams.Add("Database - Support", AppConfig.Databases.Support.Location);
|
||||
applicationParams.Add("Application root", SaxSystem.ApplicationFolder);
|
||||
if (!StringUtil.IsEmpty(AppConfig.Documents.RootFolder))
|
||||
applicationParams.Add("Documents root", AppConfig.Documents.RootFolder);
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace Saxonite.Net.Core.Web.Base.Consoles
|
||||
// Query the Activity Index.
|
||||
// NB An item may have multiple index entries but these wil only differe by Sport and/or Region.
|
||||
// User, Organisation Effective & Expiry dates wil be the same for all entries for an item.
|
||||
ISacsDatabase db = SaxGlobals.App.GetCoreDatabase(SessionContext);
|
||||
ISacsDatabase db = SaxGlobals.App.GetDatabase(SessionContext, Sax.Database.Core);
|
||||
DbQuery query = new DbQuery(db.DbmsType);
|
||||
query.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.ActivityIndex, false), alias_ActivityIndex);
|
||||
query.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.ActivityIndex_ItemType, alias_ActivityIndex), colItemType.DataName);
|
||||
@@ -479,7 +479,7 @@ namespace Saxonite.Net.Core.Web.Base.Consoles
|
||||
String filter =
|
||||
SaxDbDfn_Core.GetColumnName(SaxDbDfn_Core.ColumnIdx.ActivityIndex_ItemType) + "=" + itemId.Type +
|
||||
" And " + SaxDbDfn_Core.GetColumnName(SaxDbDfn_Core.ColumnIdx.ActivityIndex_ItemId) + "=" + itemId.Id.ToLong();
|
||||
ISacsDatabase db = SaxGlobals.App.GetCoreDatabase(SessionContext);
|
||||
ISacsDatabase db = CoreDatabase;
|
||||
int recordsDeleted = db.ExecuteDelete(tableName, filter);
|
||||
if (recordsDeleted > 0)
|
||||
SaLogger.Info(fn + " Records deleted: " + recordsDeleted + ". Filter: " + filter, true);
|
||||
@@ -529,7 +529,7 @@ namespace Saxonite.Net.Core.Web.Base.Consoles
|
||||
};
|
||||
String sql = query.Concat("\n");
|
||||
//SaLogger.Debug(fn + " Query:\n" + sql);
|
||||
ISacsDatabase db = SaxGlobals.App.GetCoreDatabase(SessionContext);
|
||||
ISacsDatabase db = CoreDatabase;
|
||||
int rows = db.ExecuteNonQuery(sql);
|
||||
if (db.HasErrorState())
|
||||
SaLogger.Debug(fn + " Database error: " + db.ErrorStateMessage);
|
||||
|
||||
@@ -164,8 +164,8 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
||||
}
|
||||
}
|
||||
// Additional includes.
|
||||
public List<String> AdditionalFiles_CSS { get; set; } = new List<string>();
|
||||
public List<String> AdditionalFiles_JS { get; set; } = new List<string>();
|
||||
public HashSet<String> AdditionalFiles_CSS { get; set; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
public HashSet<String> AdditionalFiles_JS { get; set; } = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Redirection locations.
|
||||
|
||||
@@ -35,16 +35,11 @@ namespace Saxonite.Net.Core.Web.Admin.App
|
||||
private Dictionary<String, SaxAppConfig> appConfigs = new Dictionary<string, SaxAppConfig>();
|
||||
private Dictionary<String, SaxEmailConfig> emailConfigs = new Dictionary<string, SaxEmailConfig>();
|
||||
// Session contexts.
|
||||
private class SessionContextData
|
||||
private class SessionContextData_Admin : SessionContextData_Web
|
||||
{
|
||||
public SessionContextData(SaxSessionContext_Web sessionContext)
|
||||
{
|
||||
SessionContext = sessionContext;
|
||||
public SessionContextData_Admin(SaxSessionContext_Web sessionContext) : base(sessionContext) { }
|
||||
}
|
||||
public SaxSessionContext_Web SessionContext { get; }
|
||||
public ISacsDatabase CoreDatabase { get; set; }
|
||||
}
|
||||
private readonly Dictionary<int, SessionContextData> sessionContexts = new Dictionary<int, SessionContextData>();
|
||||
private readonly Dictionary<int, SessionContextData_Admin> sessionContexts = new Dictionary<int, SessionContextData_Admin>();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
@@ -70,9 +65,9 @@ namespace Saxonite.Net.Core.Web.Admin.App
|
||||
// Properties.
|
||||
public static SaxApplication_Admin AppInstance { get; private set; }
|
||||
public List<String> Messages { get; } = new List<String>();
|
||||
public override ISacsDatabase GetCoreDatabase(SaxSessionContext sessionContext)
|
||||
public override ISacsDatabase GetDatabase(SaxSessionContext sessionContext, Sax.Database databaseType)
|
||||
{
|
||||
return sessionContexts.GetValue(sessionContext.Index, null)?.CoreDatabase;
|
||||
return sessionContexts.GetValue(sessionContext.Index, null)?.Databases.GetValue(databaseType, null);
|
||||
}
|
||||
public override String SessionCookieName { get { return Sax.Config.Admin.Session.Cookie.Name; } }
|
||||
// Configuration.
|
||||
@@ -131,26 +126,15 @@ namespace Saxonite.Net.Core.Web.Admin.App
|
||||
SaLogger.LogFolder = LoggingRootFolder;
|
||||
LogApplicationStart(fn);
|
||||
|
||||
//Messages.Add($"Database location: {AppConfig.CoreDatabase.Location}");
|
||||
//Messages.Add($"LoggingRootFolder: {SaLogger.LogFolder}");
|
||||
|
||||
// Configure database connection.
|
||||
SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig();
|
||||
config.location = AppConfig.CoreDatabase.Location;
|
||||
config.user = AppConfig.CoreDatabase.User;
|
||||
config.pword = AppConfig.CoreDatabase.Password;
|
||||
SacsDatabase coreDatabase = SacsDatabaseConsole.OpenOdbcDatabase(config);
|
||||
if (coreDatabase.HasErrorState())
|
||||
SaLogger.Warn(fn + " Database initialisation error: " + coreDatabase.ErrorStateMessage);
|
||||
|
||||
//Messages.Add($"Database location: {AppConfig.CoreDatabase.Location}");
|
||||
//Messages.Add($"LoggingRootFolder: {SaLogger.LogFolder}");
|
||||
//Messages.Add($"OdbcDrivers: {OdbcUtil.GetOdbcDriverNames().Concat(", ")}");
|
||||
//Messages.Add($"DbConnection: {coreDatabase.ConnectionString}");
|
||||
|
||||
// Session context - only one context available/necessary (for now).
|
||||
SessionContextData sessionContextData = new SessionContextData(new SaxSessionContext_Web(100, Sax.Application.Admin));
|
||||
sessionContextData.CoreDatabase = coreDatabase;
|
||||
SessionContextData_Admin sessionContextData = new SessionContextData_Admin(new SaxSessionContext_Web(100, Sax.Application.Admin));
|
||||
ConfigureDatabaseConnection(sessionContextData, Sax.Database.Core);
|
||||
ConfigureDatabaseConnection(sessionContextData, Sax.Database.Support);
|
||||
sessionContexts.Add(sessionContextData.SessionContext.Index, sessionContextData);
|
||||
SessionContext = sessionContextData.SessionContext;
|
||||
}
|
||||
@@ -161,24 +145,48 @@ namespace Saxonite.Net.Core.Web.Admin.App
|
||||
|
||||
// Occasional startup processing.
|
||||
if (generateDatabaseDefinitions)
|
||||
GenerateDatabaseDefinition(SessionContext);
|
||||
GenerateDatabaseDefinitions(SessionContext);
|
||||
if (populateRegions)
|
||||
populateRegionsFromDataFile(SessionContext);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private void GenerateDatabaseDefinition(SaxSessionContext sessionContext)
|
||||
private void ConfigureDatabaseConnection(SessionContextData_Admin sessionContextData, Sax.Database databaseInstance)
|
||||
{
|
||||
String fn = GetType().Name + ".ConfigureDatabaseConnection";
|
||||
|
||||
// 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;
|
||||
SacsDatabase database = SacsDatabaseConsole.OpenOdbcDatabase(config);
|
||||
if (database.HasErrorState())
|
||||
SaLogger.Warn(fn + " " + databaseInstance.ToString() + " Database initialisation error: " + database.ErrorStateMessage);
|
||||
sessionContextData.Databases.Add(databaseInstance, database);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private void GenerateDatabaseDefinitions(SaxSessionContext sessionContext)
|
||||
{
|
||||
// Generate database definitions.
|
||||
if (!generateDatabaseDefinitions || !SaxSystem.DebugMode || SessionContext == null) return;
|
||||
if (!StringUtil.EmptyOnNull(EnvironmentName).EqualsCI("Development")) return;
|
||||
ISacsDatabase coreDatabase = GetCoreDatabase(sessionContext);
|
||||
if (coreDatabase == null || StringUtil.IsEmpty(coreDatabase.ConnectionString)) return;
|
||||
|
||||
// Generate database definitions.
|
||||
SaxDbDfnGenerator.Generate(SaxDbDfnGenerator.DatabaseInstance.Core, coreDatabase.ConnectionString);
|
||||
// Core database.
|
||||
ISacsDatabase coreDatabase = GetDatabase(sessionContext, Sax.Database.Core);
|
||||
if (coreDatabase != null && !StringUtil.IsEmpty(coreDatabase.ConnectionString))
|
||||
{
|
||||
SaxDbDfnGenerator.Generate(Sax.Database.Core, coreDatabase.ConnectionString);
|
||||
//SaUpdateLogDbDfnGenerator.Generate(database.ConnectionString);
|
||||
}
|
||||
|
||||
// Support database.
|
||||
ISacsDatabase supportDatabase = GetDatabase(sessionContext, Sax.Database.Support);
|
||||
if (supportDatabase != null && !StringUtil.IsEmpty(supportDatabase.ConnectionString))
|
||||
SaxDbDfnGenerator.Generate(Sax.Database.Support, supportDatabase.ConnectionString);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private void populateRegionsFromDataFile(SaxSessionContext sessionContext)
|
||||
{
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
responseData.Stats.Organisation.Caption = Localiser["caption.organisations"];
|
||||
|
||||
// Core Database connection.
|
||||
ISacsDatabase db = SaxGlobals.App.GetCoreDatabase(SessionContext);
|
||||
ISacsDatabase db = Internals.CoreDatabase;
|
||||
|
||||
// Query to count items awaiting activation.
|
||||
Dictionary<String, int> tableRowCounts = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Core Database connection.
|
||||
ISacsDatabase db = SaxGlobals.App.GetCoreDatabase(SessionContext);
|
||||
ISacsDatabase db = Internals.CoreDatabase;
|
||||
|
||||
// Database table row counts.
|
||||
Dictionary<String, int> tableRowCounts = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
|
||||
@@ -147,7 +147,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
|
||||
// Core Database connection.
|
||||
ISacsDatabase db = SaxGlobals.App.GetCoreDatabase(SessionContext);
|
||||
ISacsDatabase db = Internals.CoreDatabase;
|
||||
|
||||
// Retrieve XML database schema definition.
|
||||
var assembly = typeof(SaxSystem_Dbas).GetTypeInfo().Assembly;
|
||||
@@ -345,7 +345,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
return Json(responseData.SetMessage(messageTitle, "Table name must be supplied."));
|
||||
|
||||
// Core Database connection.
|
||||
ISacsDatabase db = SaxGlobals.App.GetCoreDatabase(SessionContext);
|
||||
ISacsDatabase db = Internals.CoreDatabase;
|
||||
|
||||
// Table definition.
|
||||
DbDfnTable tableDfn = db.GetTableDfn(model.DatabaseTable.Name, true);
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
if (ContactData.Methods.Count != ContactMethods.ToInt())
|
||||
{
|
||||
SaLogger.Warn(fn + " Inconsistent Contact Methods received. Expected: " + ContactMethods + ". Received: " + ContactData.Methods.Count);
|
||||
responseData.SetMessage("caption.contact.method", "System error");
|
||||
responseData.SetMessage(Localiser["caption.contact.method"], "System error");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -690,12 +690,12 @@
|
||||
<data name="sport.caption.sports" xml:space="preserve">
|
||||
<value>Sports</value>
|
||||
</data>
|
||||
<data name="system.caption.core.database.schema" xml:space="preserve">
|
||||
<value>Core Database Schema</value>
|
||||
</data>
|
||||
<data name="system.caption.database" xml:space="preserve">
|
||||
<value>System - Database</value>
|
||||
</data>
|
||||
<data name="system.caption.database.schema" xml:space="preserve">
|
||||
<value>Database Schema</value>
|
||||
</data>
|
||||
<data name="system.caption.logs" xml:space="preserve">
|
||||
<value>System - Logs</value>
|
||||
</data>
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
{
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:50421",
|
||||
"sslPort": 44351
|
||||
}
|
||||
},
|
||||
{
|
||||
"profiles": {
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"workingDirectory": "/",
|
||||
"launchBrowser": true,
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
@@ -19,11 +12,19 @@
|
||||
"SaxoniteCoreWebAdmin": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": true,
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development",
|
||||
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
|
||||
},
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000"
|
||||
}
|
||||
},
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:50421",
|
||||
"sslPort": 44351
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
@model SaxModel_Admin
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/ContactMethods")) return;
|
||||
|
||||
<script src="~/js/sax-cnt-mth.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
@{
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/ContactMethods")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-cnt-mth.js");
|
||||
}
|
||||
|
||||
<div id="dlgContactMethod" class="sax-dialog sax-form" title="@Localiser["caption.contact.method"]">
|
||||
<div class="spacer4"></div>
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
@model SaxModel_Admin
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-res-pag.js");
|
||||
}
|
||||
|
||||
<script src="~/js/sax-res-pag.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
sax.resultsPaging = sax.resultsPaging || { fn: {}, msg: {}, contexts: [] };
|
||||
sax.resultsPaging.msg.pageInfo = '@Localiser.GetJavascriptText("label.page.info","{0}","{1}")';
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
@model SaxModel_Admin
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/SelectCode")) return;
|
||||
@{
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/SelectCode")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-sel-cod.js");
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="~/css/sax-selectCode.css?@Model.HrefVersion" />
|
||||
<script src="~/js/sax-sel-cod.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
|
||||
<div id="dlgSelectCode" class="sax-dialog sax-form">
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
@model SaxModel_Admin
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/SelectItem")) return;
|
||||
@{
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/SelectItem")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-sel-itm.js");
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="~/css/sax-selectItem.css?@Model.HrefVersion" />
|
||||
|
||||
@@ -46,6 +50,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="~/js/sax-sel-itm.js?@Model.HrefVersion"></script>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
@model SaxModel_Admin
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/SelectOrganisation")) return;
|
||||
@{
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/SelectOrganisation")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-sel-org.js");
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="~/css/sax-selectOrganisation.css?@Model.HrefVersion" />
|
||||
<script src="~/js/sax-sel-org.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
sax.selectOrganisation = sax.selectOrganisation || { data: {}, fn: {}, $dlg: {} };
|
||||
sax.selectOrganisation.dlgTitleSelectOrganisation = '@Localiser.GetJavascriptText("organisation.caption.select.organisation")';
|
||||
</script>
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
<div class="sax-panel-info sax-panel-results DbSchema">
|
||||
|
||||
<div class="sax-header">
|
||||
<div class="sax-caption">@Localiser["system.caption.database.schema"]</div>
|
||||
<div class="sax-caption">@Localiser["system.caption.core.database.schema"]</div>
|
||||
</div>
|
||||
<div class="sax-content">
|
||||
<div class="sax-panel-messages"></div>
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
/* Organisations - Organisation Address dialog panel */
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Organisation/Panel-Organisation-Address")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-org-add.js");
|
||||
}
|
||||
|
||||
<script src="~/js/sax-org-add.js?@Model.HrefVersion"></script>
|
||||
|
||||
<div id="dlgOrganisationAddress" class="sax-dialog" title="@Localiser["caption.organisation.address"]">
|
||||
|
||||
<div class="spacer"></div>
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
/* Organisations - Organisation images dialog panel */
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Organisation/Panel-Organisation-Images")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-org-img.js");
|
||||
}
|
||||
|
||||
<style>
|
||||
@@ -33,7 +37,6 @@
|
||||
border-color: darkgreen;
|
||||
}
|
||||
</style>
|
||||
<script src="~/js/sax-org-img.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
sax.msg.uploadImageSingle = '@Localiser.GetJavascriptText("msg.upload.image.single")';
|
||||
sax.msg.uploadFileSizeMax = '@Localiser.GetJavascriptText("msg.upload.file.size.max","{0}")';
|
||||
|
||||
@@ -8,11 +8,18 @@
|
||||
"Root": "https://localhost:44364/"
|
||||
}
|
||||
},
|
||||
"CoreDatabase": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Dev",
|
||||
"Databases": {
|
||||
"Core": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Core_Dev",
|
||||
"User": "saxonite",
|
||||
"Password": "sax-dev-2021"
|
||||
},
|
||||
"Support": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Support_Dev",
|
||||
"User": "saxonite",
|
||||
"Password": "sax-dev-2021"
|
||||
}
|
||||
},
|
||||
"Email": {
|
||||
"Context": "SAX-SF-Dev",
|
||||
"ContactUs": {
|
||||
@@ -29,10 +36,12 @@
|
||||
"Saxonite-Test": {
|
||||
"Environments": [ "Production" ],
|
||||
"Instance": "QC",
|
||||
"CoreDatabase": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Dev",
|
||||
"Databases": {
|
||||
"Core": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Core_Dev",
|
||||
"User": "saxonite",
|
||||
"Password": "sax-dev-2021"
|
||||
}
|
||||
},
|
||||
"Email": {
|
||||
"Context": "SAX-SF-Dev",
|
||||
|
||||
@@ -8,10 +8,12 @@
|
||||
"Root": "https://sportierre.com/"
|
||||
}
|
||||
},
|
||||
"CoreDatabase": {
|
||||
"Databases": {
|
||||
"Core": {
|
||||
"Location": "MsSql:.\\SQLExpress2012.Saxonite_Core_Demo",
|
||||
"User": "sax-demo-user",
|
||||
"Password": "sax-demo-202105"
|
||||
}
|
||||
},
|
||||
"Security": {
|
||||
"Password": {
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
*/
|
||||
sax.editContactMethod = cm.fn.edit = function (cfg)
|
||||
{
|
||||
cm.fn.init();
|
||||
cm.data.cfg = cfg || {};
|
||||
cm.$mth.empty();
|
||||
for (let mth of cfg.methods || [])
|
||||
@@ -52,16 +51,15 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
cm.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if ($dlg.conMth) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { cm.fn.applyChanges(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||
$dlg.conMth = $('#dlgContactMethod').dialog(opt);
|
||||
cm.$mth = $('.sax-select.ContactMethod', $dlg.conMth);
|
||||
cm.$val = $('.sax-input.ContactValue', $dlg.conMth);
|
||||
}
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
ah.toSchema = setTimeout(sax.refreshDbSchema, 600);
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -12,7 +12,6 @@
|
||||
//--------------------------------------------------------------
|
||||
oa.updateItemAddress = function (item, $item)
|
||||
{
|
||||
oa.init();
|
||||
$('.OrganisationId', $frm.orgId).val(item.id);
|
||||
oa.ajax.updateItemAddr = oa.ajax.updateItemAddr || { url: sax.url.base + 'Organisation/Ajax/GetItem', formId: 'frmOrganisationId', callbackFn: oa.onUpdateItemAddress };
|
||||
sax.doAjaxRequest(oa.ajax.updateItemAddr, 50);
|
||||
@@ -88,9 +87,8 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oa.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if ($frm.orgId) return;
|
||||
$frm.orgId = $('#frmOrganisationId');
|
||||
|
||||
// Organisation Address dialog.
|
||||
@@ -103,7 +101,7 @@
|
||||
$frm.orgAddr = $('#frmOrganisationAddress');
|
||||
$frm.orgAddr.on('input', '.sax-input, .sax-textarea', function () { sax.clearControlError(this); }).on('change', '.sax-select', function () { sax.clearControlError(this); });
|
||||
$frm.orgAddr.on('dblclick', '.AddressRegionNameCountry', oa.selectOrgAddrRegionCountry).on('click', '.AddressRegionCountrySelect', oa.selectOrgAddrRegionCountry);
|
||||
}
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
//--------------------------------------------------------------
|
||||
oi.updateItemImages = function (item, $item)
|
||||
{
|
||||
oi.init();
|
||||
$('.OrganisationId', $frm.orgId).val(item.id);
|
||||
oi.ajax.getOrgImages = oi.ajax.getOrgImages || { url: sax.url.base + 'Organisation/Ajax/GetImages', formId: 'frmOrganisationId', callbackFn: oi.onUpdateItemImages };
|
||||
sax.doAjaxRequest(oi.ajax.getOrgImages, 50);
|
||||
@@ -109,9 +108,8 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oi.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if ($frm.orgId) return;
|
||||
$frm.orgId = $('#frmOrganisationId');
|
||||
|
||||
// Organisation Images dialog and form.
|
||||
@@ -135,7 +133,7 @@
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { oi.uploadOrgLogoImage(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||
$dlg.selectOrgLogoImage = $('#dlgSelectOrgLogoImage').dialog(opt);
|
||||
}
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
//--------------------------------------------------------------
|
||||
rp.fn.init = function (context)
|
||||
{
|
||||
// Initialise context.
|
||||
if (context.$rp) return;
|
||||
//sax.debug('resultsPaging.init Initialising Paging.', context);
|
||||
context.$rp = $('.sax-results-paging', $(context.sel));
|
||||
@@ -78,6 +79,12 @@
|
||||
$('.sax-paging-last', context.$rp).off('click').on('click', function () { rp.fn.lastPage(context); });
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -23,7 +23,6 @@
|
||||
sc.fn.openSelectCode = function (cfg)
|
||||
{
|
||||
//sax.debug('openSelectCode', cfg);
|
||||
sc.fn.init();
|
||||
sc.cfg = cfg;
|
||||
sc.selectedCodes = cfg.selectedCodes || [];
|
||||
sc.fn.displayCodes(cfg.codes);
|
||||
@@ -107,17 +106,17 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sc.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if (!sc.$dlg) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { sc.fn.storeSelectCode(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { sc.fn.cleanUp(); $(this).dialog('close'); };
|
||||
sc.$dlg = $('#dlgSelectCode').dialog(opt);
|
||||
$('.sax-button.Select', sc.$dlg).on('click', function () { sc.fn.onClickSelect(); });
|
||||
$('.sax-button.Remove', sc.$dlg).on('click', function () { sc.fn.onClickRemove(); });
|
||||
}
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -17,7 +17,6 @@
|
||||
*/
|
||||
si.fn.selectItem = function (cfg)
|
||||
{
|
||||
si.fn.init();
|
||||
si.cfg = cfg;
|
||||
si.itemId = cfg.itemId;
|
||||
si.fn.showSelectItem();
|
||||
@@ -108,17 +107,17 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
si.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if (!si.$dlg) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.open = function (evt, ui) { si.fn.onDlgSize(); };
|
||||
opt.resize = function (evt, ui) { si.fn.onDlgSize(); };
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { si.fn.storeSelectItem(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { si.fn.cleanUp(); $(this).dialog('close'); };
|
||||
si.$dlg = $('#dlgSelectItem').dialog(opt);
|
||||
}
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -5,7 +5,8 @@
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let so = sax.selectOrganisation = sax.selectOrganisation || { data: {}, fn: {}, $dlg: {}, itemIdPrefix: 'Org_' };
|
||||
let so = sax.selectOrganisation = sax.selectOrganisation || { data: {}, fn: {}, $dlg: {} };
|
||||
so.itemIdPrefix = 'Org_';
|
||||
|
||||
//--------------------------------------------------------------
|
||||
/*
|
||||
@@ -18,7 +19,6 @@
|
||||
so.fn.openDialog = function (cfg)
|
||||
{
|
||||
//sax.debug('openDialog', cfg);
|
||||
so.fn.init();
|
||||
so.cfg = cfg;
|
||||
sax.openDialog(so.$dlg.dialog('option', { title: cfg.caption || so.dlgTitleSelectOrganisation || 'Select Organisation' }), so.cfg.width || 480, so.cfg.height || 600);
|
||||
}
|
||||
@@ -78,9 +78,8 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
so.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if (!so.$dlg) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.open = function () { so.fn.refreshOrganisations(200); };
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { so.fn.confirmSelection(); };
|
||||
@@ -90,8 +89,9 @@
|
||||
$('.sax-input.FilterOrganisation', so.$dlg).on('input', function () { sax.selectOrganisation.fn.refreshOrganisations(250); });
|
||||
$('.PagingPageNo', so.$dlg).val(1);
|
||||
$('.PagingPageLength', so.$dlg).val(16);
|
||||
}
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -205,12 +205,10 @@
|
||||
let $frmUsr = $frm.user;
|
||||
$('.UserRegionIdCountry', $frmUsr).val(rgn.id);
|
||||
$('.UserRegionCaptionCountry', $frmUsr).val(rgn.name);
|
||||
sax.refreshResults();
|
||||
}
|
||||
sax.clearRegionCountry = function ()
|
||||
{
|
||||
$('.UserRegionIdCountry,.UserRegionCaptionCountry', $frm.user).val('');
|
||||
sax.refreshResults();
|
||||
}
|
||||
// Province region.
|
||||
sax.selectRegionProvince = function ()
|
||||
@@ -227,12 +225,10 @@
|
||||
let $frmUsr = $frm.user;
|
||||
$('.UserRegionIdProvince', $frmUsr).val(rgn.id);
|
||||
$('.UserRegionCaptionProvince', $frmUsr).val(rgn.name);
|
||||
sax.refreshResults();
|
||||
}
|
||||
sax.clearRegionProvince = function ()
|
||||
{
|
||||
$('.UserRegionIdProvince,.UserRegionCaptionProvince', $frm.user).val('');
|
||||
sax.refreshResults();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
@@ -324,6 +324,9 @@
|
||||
<data name="label.contact.method" xml:space="preserve">
|
||||
<value>Contact method</value>
|
||||
</data>
|
||||
<data name="label.contacts" xml:space="preserve">
|
||||
<value>Contacts</value>
|
||||
</data>
|
||||
<data name="label.country" xml:space="preserve">
|
||||
<value>Country</value>
|
||||
</data>
|
||||
|
||||
@@ -30,16 +30,11 @@ namespace Saxonite.Net.Core.Web.Online.App
|
||||
private Dictionary<String, SaxAppConfig> appConfigs = new Dictionary<string, SaxAppConfig>();
|
||||
private Dictionary<String, SaxEmailConfig> emailConfigs = new Dictionary<string, SaxEmailConfig>();
|
||||
// Session contexts.
|
||||
protected class SessionContextData
|
||||
protected class SessionContextData_Online : SessionContextData_Web
|
||||
{
|
||||
public SessionContextData(SaxSessionContext_Web sessionContext)
|
||||
{
|
||||
SessionContext = sessionContext;
|
||||
public SessionContextData_Online(SaxSessionContext_Web sessionContext) : base(sessionContext) { }
|
||||
}
|
||||
public SaxSessionContext_Web SessionContext { get; }
|
||||
public ISacsDatabase CoreDatabase { get; set; }
|
||||
}
|
||||
private readonly Dictionary<int, SessionContextData> sessionContexts = new Dictionary<int, SessionContextData>();
|
||||
private readonly Dictionary<int, SessionContextData_Online> sessionContexts = new Dictionary<int, SessionContextData_Online>();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
@@ -64,9 +59,9 @@ namespace Saxonite.Net.Core.Web.Online.App
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public static SaxApplication_Online AppInstance { get; private set; }
|
||||
public override ISacsDatabase GetCoreDatabase(SaxSessionContext sessionContext)
|
||||
public override ISacsDatabase GetDatabase(SaxSessionContext sessionContext, Sax.Database databaseType)
|
||||
{
|
||||
return sessionContexts.GetValue(sessionContext.Index, null)?.CoreDatabase;
|
||||
return sessionContexts.GetValue(sessionContext.Index, null)?.Databases.GetValue(databaseType, null);
|
||||
}
|
||||
public override String SessionCookieName { get { return Sax.Config.Online.Session.Cookie.Name; } }
|
||||
// Configuration.
|
||||
@@ -124,16 +119,16 @@ namespace Saxonite.Net.Core.Web.Online.App
|
||||
|
||||
// Configure database connection.
|
||||
SacsDatabaseConsole.OdbcConfig config = new SacsDatabaseConsole.OdbcConfig();
|
||||
config.location = AppConfig.CoreDatabase.Location;
|
||||
config.user = AppConfig.CoreDatabase.User;
|
||||
config.pword = AppConfig.CoreDatabase.Password;
|
||||
config.location = AppConfig.Databases.Core.Location;
|
||||
config.user = AppConfig.Databases.Core.User;
|
||||
config.pword = AppConfig.Databases.Core.Password;
|
||||
SacsDatabase coreDatabase = SacsDatabaseConsole.OpenOdbcDatabase(config);
|
||||
if (coreDatabase.HasErrorState())
|
||||
SaLogger.Warn(fn + " Database initialisation error: " + coreDatabase.ErrorStateMessage);
|
||||
|
||||
// Session context - only one context available/necessary (for now).
|
||||
SessionContextData sessionContextData = new SessionContextData(new SaxSessionContext_Web(100, Sax.Application.Online));
|
||||
sessionContextData.CoreDatabase = coreDatabase;
|
||||
SessionContextData_Online sessionContextData = new SessionContextData_Online(new SaxSessionContext_Web(100, Sax.Application.Online));
|
||||
sessionContextData.Databases.Add(Sax.Database.Core, coreDatabase);
|
||||
sessionContexts.Add(sessionContextData.SessionContext.Index, sessionContextData);
|
||||
SessionContext = sessionContextData.SessionContext;
|
||||
|
||||
|
||||
@@ -74,6 +74,20 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
set { ProfileSportOfficiatingCode = SportOfficiatingCodes.GetCodeForType(value); }
|
||||
}
|
||||
public String ProfileSportAbout { get; set; }
|
||||
public class SportsContactsData
|
||||
{
|
||||
// Contacts.
|
||||
/// <summary>Placeholder field value to indicate the number of Contacts in form (even if none are populated).</summary>
|
||||
public String Count { get; set; }
|
||||
public String[] ContactType { get; set; }
|
||||
public String[] UserAccountId { get; set; }
|
||||
public String[] ContactName { get; set; }
|
||||
public String[] ContactPhone { get; set; }
|
||||
public String[] ContactEmail { get; set; }
|
||||
/// <summary>Sport Contacts to be populated during validation.</summary>
|
||||
public SaxSportContactsData SportContactsData { get; set; }
|
||||
}
|
||||
public SportsContactsData Contacts {get; } = new SportsContactsData();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Organisation properties.
|
||||
|
||||
@@ -113,9 +113,7 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
if (ExperienceAwards != null)
|
||||
{
|
||||
responseData.SetControlValue(nameof(ExperienceAwards), ExperienceAwards);
|
||||
if (StringUtil.IsEmpty(ExperienceAwards))
|
||||
responseData.SetControlError(nameof(ExperienceAwards), Localiser["msg.validation.mandatory.value"]);
|
||||
else if (StringUtil.GetLength(ExperienceAwards) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserSportExperience_Awards))
|
||||
if (StringUtil.GetLength(ExperienceAwards) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserSportExperience_Awards))
|
||||
responseData.SetControlError(nameof(ExperienceAwards), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserSportExperience_Awards)]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
@model Model_Account
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Account/Profile-Eligibility")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-pro-elg.js");
|
||||
}
|
||||
|
||||
<div class="sax-panel-section ProfileEligibility sax-populating">
|
||||
|
||||
@@ -171,4 +177,3 @@
|
||||
sax.dlg.title.removeUserEligibility = '@Localiser.GetJavascriptText("account.caption.profile.eligibility.remove")';
|
||||
sax.msg.removeUserEligibility = '@(Localiser.GetJavascriptText("msg.confirm.item.remove"))';
|
||||
</script>
|
||||
<script src="~/js/sax-pro-elg.js?@Model.HrefVersion"></script>
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
@model Model_Account
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Account/Profile-Organisations")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-pro-org.js");
|
||||
}
|
||||
|
||||
@* Profile Organisations *@
|
||||
<div class="sax-panel-section ProfileOrganisations sax-populating">
|
||||
|
||||
@@ -134,5 +141,3 @@
|
||||
</div>
|
||||
|
||||
<partial name="~/Views/Common/OrganisationRequest.cshtml" />
|
||||
|
||||
<script src="~/js/sax-usr-org.js?@Model.HrefVersion"></script>
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
/* Sport Experience panel - list experience for sport */
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Account/Profile-SportExperiences")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-spt-exp.js");
|
||||
}
|
||||
|
||||
@* Sport Experience panel - list experience for sport *@
|
||||
<div class="sax-panel sax-panel-info ProfileSportExperience hidden">
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -77,6 +83,7 @@
|
||||
<div class="row">
|
||||
<div class="col text-right pr12"><button type="button" class="sax-button" value="" onclick="sax.closeProfileSportExperience();">@Localiser["label.close"]</button></div>
|
||||
</div>
|
||||
<div class="spacer2"></div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -250,4 +257,4 @@
|
||||
<script type="text/javascript">
|
||||
sax.lbl.sportExperience = '@Localiser.GetJavascriptText("account.caption.profile.sports.experience")';
|
||||
</script>
|
||||
<script src="~/js/sax-pro-exp.js?@Model.HrefVersion"></script>
|
||||
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
@model Model_Account
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
/* Online Profile Sports. */
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Account/Profile-Sports")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-pro-spt.js");
|
||||
}
|
||||
|
||||
<div class="sax-panel-section ProfileSports sax-populating">
|
||||
|
||||
@@ -118,6 +125,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Contact controls *@
|
||||
<partial name="~/Views/Common/SportControls-Contacts.cshtml" />
|
||||
|
||||
@* Sport Participation *@
|
||||
<div class="sax-form-control ProfileSportParticipation">
|
||||
<div class="row">
|
||||
@@ -161,4 +171,3 @@
|
||||
sax.dlg.title.addUserSport = '@Localiser.GetJavascriptText("account.caption.profile.sport.add")';
|
||||
sax.dlg.title.updateUserSport = '@Localiser.GetJavascriptText("account.caption.profile.sport.update")';
|
||||
</script>
|
||||
<script src="~/js/sax-pro-spt.js?@Model.HrefVersion"></script>
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
ViewData["Title"] = "Profile - Sports";
|
||||
}
|
||||
|
||||
<partial name="~/Views/Account/Profile-Sports.cshtml" />
|
||||
<partial name="~/Views/Account/Profile-Sports.cshtml" />
|
||||
|
||||
<partial name="~/Views/Account/Profile-SportExperiences.cshtml" />
|
||||
<partial name="~/Views/Common/Sport-Contacts.cshtml" />
|
||||
|
||||
<partial name="~/Views/Common/SportSelect.cshtml" />
|
||||
<partial name="~/Views/Account/Profile-SportExperiences.cshtml" />
|
||||
|
||||
<partial name="~/Views/Common/SportSelect.cshtml" />
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/CodeSelect")) return;
|
||||
@{
|
||||
/* Online Code Select */
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/CodeSelect")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-code-sel.js");
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="~/css/sax-code-sel.css?@Model.HrefVersion" />
|
||||
<script src="~/js/sax-code-sel.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
|
||||
<div id="dlgCodeSelect" class="sax-dialog sax-form" style="padding-bottom:8px;">
|
||||
|
||||
@* Filter *@
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/ContactMethods")) return;
|
||||
|
||||
<script src="~/js/sax-cnt-mth.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
@{
|
||||
/* Online Contact Methods */
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/ContactMethods")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-cnt-mth.js");
|
||||
}
|
||||
|
||||
<div id="dlgContactMethod" class="sax-dialog sax-form" title="@Localiser["caption.contact.method"]">
|
||||
<div class="spacer4"></div>
|
||||
@@ -20,7 +21,7 @@
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sax-control">
|
||||
<select name="ContactMethod" class="ContactMethod sax-select" style="max-width:240px;" ></select>
|
||||
<select name="ContactMethod" class="ContactMethod sax-select" style="max-width:240px;"></select>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
@inject SaxLocaliser Localiser
|
||||
@* NB Organisation contact controls may be present more than once on a page, eg. Profile Organisation. *@
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/OrganisationControls-Contact")) return;
|
||||
|
||||
<style>
|
||||
.OrganisationContactMethods .ContactMethods
|
||||
{
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/OrganisationRequest")) return;
|
||||
|
||||
@{
|
||||
/* Online Organisation Request. */
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/OrganisationRequest")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-org-req.js");
|
||||
Microsoft.AspNetCore.Html.HtmlString regionIdCountry = new Microsoft.AspNetCore.Html.HtmlString(Model.ValidUserSession ? Model.GetEncryptedRegionId(Model.SessionData.User.RegionIdCountry) : "");
|
||||
String regionNameCountry = Model.ValidUserSession ? Localiser.EscapeJavascriptText(Model.GetRegionCaption(Model.SessionData.User.RegionIdCountry)) : "";
|
||||
}
|
||||
@@ -96,6 +99,5 @@
|
||||
|
||||
</div>
|
||||
|
||||
<script src="~/js/sax-org-req.js?@Model.HrefVersion"></script>
|
||||
<partial name="~/Views/Common/SportSelect.cshtml" />
|
||||
<partial name="~/Views/Common/RegionSelect.cshtml" />
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/OrganisationSelect")) return;
|
||||
@{
|
||||
/* Online Organisation Select. */
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/OrganisationSelect")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-org-sel.js");
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="~/css/sax-org-sel.css?@Model.HrefVersion" />
|
||||
<script type="text/javascript">
|
||||
sax.selectOrganisation = {};
|
||||
sax.selectOrganisation = sax.selectOrganisation || {};
|
||||
sax.selectOrganisation.dlgTitleSelectOrganisation = '@Localiser.GetJavascriptText("organisation.caption.organisation.select")';
|
||||
</script>
|
||||
|
||||
<div id="dlgSelectOrganisation" class="sax-dialog sax-form">
|
||||
|
||||
@* Filter *@
|
||||
@@ -46,5 +50,3 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="~/js/sax-org-sel.js?@Model.HrefVersion"></script>
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/RegionSelect")) return;
|
||||
@{
|
||||
/* Online Region Select */
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/RegionSelect")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-reg-sel.js");
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="~/css/sax-reg-sel.css?@Model.HrefVersion" />
|
||||
<script type="text/javascript">
|
||||
@@ -49,5 +54,3 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="~/js/sax-reg-sel.js?@Model.HrefVersion"></script>
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
/* Online Results Paging. */
|
||||
// NB View can be included more than once on a page.
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-res-pag.js");
|
||||
}
|
||||
|
||||
<script src="~/js/sax-res-pag.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
sax.mdl.resultsPaging = sax.mdl.resultsPaging || {msg:{}};
|
||||
sax.mdl.resultsPaging.msg.pageInfo = '@Localiser.GetJavascriptText("label.page.info","{0}","{1}")';
|
||||
</script>
|
||||
|
||||
|
||||
+7
-6
@@ -1,13 +1,14 @@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/SportSelect")) return;
|
||||
@{
|
||||
/* Sport Contacts */
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/Sport-Contacts")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-spt-cnt.js");
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="~/css/sax-spt-cnt.css?@Model.HrefVersion" />
|
||||
<script src="~/js/sax-spt-cnt.js?@Model.HrefVersion"></script>
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
|
||||
<div id="dlgCodeSelect" class="sax-dialog sax-form" style="padding-bottom:8px;">
|
||||
|
||||
@* Filter *@
|
||||
@@ -0,0 +1,78 @@
|
||||
@* Organisation controls - Contact *@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
@* NB Organisation contact controls may be present more than once on a page, eg. Profile Organisation. *@
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/SportControls-Contacts")) return;
|
||||
|
||||
<style>
|
||||
.SportContacts .Contacts
|
||||
{
|
||||
min-height: 32px;
|
||||
max-height: 64px;
|
||||
background-color: #fff;
|
||||
border: 1px solid #808080;
|
||||
border-top-left-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.SportContacts.Contacts table.sax-data tr:hover
|
||||
{
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
.SportContacts .Contacts table.sax-data .sax-label
|
||||
{
|
||||
margin: 0;
|
||||
padding: 0 8px 0 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@* Sport Contacts *@
|
||||
<div class="sax-form-control SportContacts">
|
||||
<input type="hidden" name="Sport.Contacts" value="0" />
|
||||
<div class="row">
|
||||
<div class="col-sm-3 row">
|
||||
<div class="col">
|
||||
<div class="sax-label">
|
||||
<label for=""><span>@Localiser["label.contacts"]</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fixed">
|
||||
@* Action to add new contact. *@
|
||||
<div class="sax-actions">
|
||||
<div class="sax-action sax-add pr4"><img src="~/img/action/add24.png" alt="@(Localiser["label.add"])" title="@(Localiser["label.add"])" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sax-control row">
|
||||
<div class="col">
|
||||
@* List of existing contacts with actions to edit/remove. *@
|
||||
<div class="Contacts">
|
||||
<table class="sax-data fullwidth"></table>
|
||||
</div>
|
||||
<table class="sax-panel-item-template">
|
||||
<tr class="Contact">
|
||||
<td style="width:20px;"><div class="sax-label nowrap"></div></td>
|
||||
<td class="sax-name" style="width:70%;word-break: break-all;"></td>
|
||||
<td class="sax-details" style="width:70%;word-break: break-all;"></td>
|
||||
<td class="sax-actions right nowrap" style="min-width:10px;">
|
||||
<input type="hidden" name="Contacts.ContactType" />
|
||||
<input type="hidden" name="Contacts.ContactName" />
|
||||
<input type="hidden" name="Contacts.ContactPhone" />
|
||||
<input type="hidden" name="Contacts.ContactEmail" />
|
||||
<div class="nowrap">
|
||||
<div class="inlineb sax-action sax-edit"><img src="~/img/action/edit16.png" alt="@(Localiser["label.edit"])" title="@(Localiser["label.edit"])" /></div>
|
||||
<div class="inlineb sax-action sax-remove"><img src="~/img/action/delete16.png" alt="@(Localiser["label.remove"])" title="@(Localiser["label.remove"])" /></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,12 +1,14 @@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/SportSelect")) return;
|
||||
@{
|
||||
/* Online Sport Select */
|
||||
// Ensure view is only included once in page.
|
||||
if (!Model.RegisterView("Views/Common/SportSelect")) return;
|
||||
// Scripts.
|
||||
Model.AdditionalFiles_JS.Add("js/sax-spt-sel.js");
|
||||
}
|
||||
|
||||
<link rel="stylesheet" href="~/css/sax-spt-sel.css?@Model.HrefVersion" />
|
||||
<script type="text/javascript">
|
||||
</script>
|
||||
|
||||
<div id="dlgSelectSport" class="sax-dialog sax-form">
|
||||
|
||||
<div class="container-fluid h-100">
|
||||
@@ -49,5 +51,3 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="~/js/sax-spt-sel.js?@Model.HrefVersion"></script>
|
||||
|
||||
@@ -3,11 +3,18 @@
|
||||
"Saxonite-Dev": {
|
||||
"Environments": [ "Development" ],
|
||||
"Instance": "Dev",
|
||||
"CoreDatabase": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Dev",
|
||||
"Databases": {
|
||||
"Core": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Core_Dev",
|
||||
"User": "saxonite",
|
||||
"Password": "sax-dev-2021"
|
||||
},
|
||||
"Support": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Support_Dev",
|
||||
"User": "saxonite",
|
||||
"Password": "sax-dev-2021"
|
||||
}
|
||||
},
|
||||
"Email": {
|
||||
"Context": "SAX-SF-Dev",
|
||||
"ContactUs": {
|
||||
@@ -24,10 +31,12 @@
|
||||
"Saxonite-Test": {
|
||||
"Environments": [ "Production" ],
|
||||
"Instance": "QC",
|
||||
"CoreDatabase": {
|
||||
"Location": "MsSql:Sarand106\\SQL2014.Saxonite_Dev",
|
||||
"Databases": {
|
||||
"Core": {
|
||||
"Location": "MsSql:Sarand110\\SQL2016.Saxonite_Core_Dev",
|
||||
"User": "saxonite",
|
||||
"Password": "sax-dev-2021"
|
||||
}
|
||||
},
|
||||
"Email": {
|
||||
"Context": "SAX-SF-Dev",
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
"SAX-Prod": {
|
||||
"Environments": [ "Production" ],
|
||||
"Instance": "",
|
||||
"CoreDatabase": {
|
||||
"Databases": {
|
||||
"Core": {
|
||||
"Location": "MsSql:.\\SQLExpress2012.Saxonite_Core_Demo",
|
||||
"User": "sax-demo-user",
|
||||
"Password": "sax-demo-202105"
|
||||
}
|
||||
},
|
||||
"Security": {
|
||||
"Password": {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* Account page scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
//--------------------------------------------------------------
|
||||
@@ -61,7 +60,5 @@
|
||||
setTimeout(sax.refreshProfile, 200);
|
||||
});
|
||||
//--------------------------------------------------------------
|
||||
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* Article page scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
@@ -10,7 +9,6 @@
|
||||
let am = sax.articleMgt = { ajax: {}, data: {}, $pnl: {}, $frm: {}, $dlg: {} };
|
||||
let $pnl = am.$pnl, $frm = am.$frm, $dlg = am.$dlg;
|
||||
let ac = sax.articleContent = sax.articleContent || {};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
am.refreshResults = function (delay)
|
||||
{
|
||||
@@ -77,7 +75,6 @@
|
||||
$bgr.toggle(!!$('.sax-dropdown-menu .sax-dropdown-item', $item).length);
|
||||
return $item;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
am.getFilterDropdownTemplate = function ()
|
||||
{
|
||||
@@ -107,7 +104,6 @@
|
||||
{
|
||||
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
am.selectFilterOrganisation = function ()
|
||||
{
|
||||
@@ -126,7 +122,6 @@
|
||||
$('#frmArticleFilter #ifFilterOrganisation').val(name);
|
||||
am.refreshResults(50);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
am.createItem = function ()
|
||||
{
|
||||
@@ -169,7 +164,6 @@
|
||||
sax.openDialog($dlg.article, 800, 1200);
|
||||
$('.ArticleHeadline.sax-input,.ArticleSummary.sax-textarea', $frm.article).trigger("input");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
am.updateItem = function (item, $item)
|
||||
{
|
||||
@@ -205,7 +199,6 @@
|
||||
am.populateArticleContent(item.content);
|
||||
am.openArticleDialog(sax.dlg.title.updateArticle);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
am.switchArticleHeader = function ()
|
||||
{
|
||||
@@ -215,7 +208,6 @@
|
||||
{
|
||||
$('.sax-article').removeClass('ArticleHeader').addClass('ArticleContent');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
am.selectArticleSport = function ()
|
||||
{
|
||||
@@ -226,7 +218,6 @@
|
||||
sax.clearControlError($('#ifArticleSportId').val(sport.id));
|
||||
$('#ifArticleSportCaption').val(sport ? sport.name : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
am.selectArticleRegion = function ()
|
||||
{
|
||||
@@ -237,7 +228,6 @@
|
||||
sax.clearControlError($('#ifArticleRegionId').val(region.id));
|
||||
$('#ifArticleRegionCaption').val(region ? region.name : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
am.segmentId = function (idx)
|
||||
{
|
||||
@@ -460,7 +450,6 @@
|
||||
$dlg.selectArticleImage.dialog('close');
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
am.storeItem = function ()
|
||||
{
|
||||
@@ -487,14 +476,12 @@
|
||||
}
|
||||
am.populateItem($item, item)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
am.refreshControlInfo = function (ctrl)
|
||||
{
|
||||
let $ctrl = $(ctrl);
|
||||
sax.setAvailableCharsInfo($ctrl, $ctrl.prop('maxlength'));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
@@ -532,7 +519,6 @@
|
||||
|
||||
setTimeout(am.refreshResults, 250);
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,13 +1,11 @@
|
||||
/*
|
||||
* Contact Methods script.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let cm = sax.mdl.contactMethods = { fn: {}, data: {}, ajax: {} };
|
||||
let $dlg = cm.$dlg = {};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
/*
|
||||
* Config:
|
||||
@@ -19,7 +17,6 @@
|
||||
*/
|
||||
sax.editContactMethod = cm.fn.edit = function (cfg)
|
||||
{
|
||||
cm.fn.init();
|
||||
cm.data.cfg = cfg || {};
|
||||
cm.$mth.empty();
|
||||
for (let mth of cfg.methods || [])
|
||||
@@ -29,9 +26,9 @@
|
||||
}
|
||||
cm.$mth.val(cfg.method).attr('disabled', cfg.method && cm.$mth.val() == cfg.method ? true : null);
|
||||
cm.$val.val(cfg.value);
|
||||
sax.clearControlErrors($dlg.conMth);
|
||||
sax.openDialog($dlg.conMth, 600, 240);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
cm.fn.applyChanges = function ()
|
||||
{
|
||||
@@ -50,20 +47,16 @@
|
||||
$dlg.conMth.dialog('close');
|
||||
if (cm.data.cfg.fnCallback) cm.data.cfg.fnCallback(cm.$mth.val(), $('option:selected', cm.$mth).text(), cm.$val.val());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
cm.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if ($dlg.conMth) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { cm.fn.applyChanges(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||
$dlg.conMth = $('#dlgContactMethod').dialog(opt);
|
||||
cm.$mth = $('.sax-select.ContactMethod', $dlg.conMth);
|
||||
cm.$val = $('.sax-input.ContactValue', $dlg.conMth);
|
||||
}
|
||||
|
||||
});
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,12 +1,10 @@
|
||||
/*
|
||||
* Code selection.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let cs = sax.codeSelect = sax.codeSelect || { fn: {}, $dlg: {} };
|
||||
|
||||
//--------------------------------------------------------------
|
||||
/*
|
||||
* Code selection config:
|
||||
@@ -23,7 +21,6 @@
|
||||
cs.fn.openCodeSelect = function (cfg)
|
||||
{
|
||||
//sax.debug('openSelectCode', cfg);
|
||||
cs.fn.init();
|
||||
cs.cfg = cfg;
|
||||
cs.selectedCodes = cfg.selectedCodes || [];
|
||||
cs.fn.displayCodes(cfg.codes);
|
||||
@@ -44,6 +41,7 @@
|
||||
else $codesAvail.append($code);
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
cs.fn.onClickCode = function (code, $code)
|
||||
{
|
||||
$('.sax-panel-item.Code').removeClass('sel');
|
||||
@@ -93,6 +91,7 @@
|
||||
for (const code of codes)
|
||||
$('.sax-panel-item.Code[aria-code="' + code + '"]').addClass('sel');
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
cs.fn.storeSelectCode = function ()
|
||||
{
|
||||
//sax.debug('storeSelectCode', cs.cfg, cs.selectedCodes);
|
||||
@@ -105,19 +104,16 @@
|
||||
delete cs.cfg;
|
||||
delete cs.selectedCodes;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
cs.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if (!cs.$dlg) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { cs.fn.storeSelectCode(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { cs.fn.cleanUp(); $(this).dialog('close'); };
|
||||
cs.$dlg = $('#dlgCodeSelect').dialog(opt);
|
||||
$('.sax-button.Select', cs.$dlg).on('click', function () { cs.fn.onClickSelect(); });
|
||||
$('.sax-button.Remove', cs.$dlg).on('click', function () { cs.fn.onClickRemove(); });
|
||||
}
|
||||
|
||||
});
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Home scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.refreshResults = function (delay)
|
||||
{
|
||||
@@ -57,7 +55,6 @@
|
||||
$('.ActivityPublishedOn', $item).text(item.publishedOnFmt);
|
||||
$item.on('click', '.sax-header .ActivityCaption', function () { sax.expandActivity(activity); }).on('dblclick', '.sax-content', function () { sax.expandActivity(activity); });
|
||||
$('.sax-panel-messages', sax.$pnl.results).hide().empty();
|
||||
|
||||
}
|
||||
sax.refreshItem = function (activity)
|
||||
{
|
||||
@@ -71,13 +68,11 @@
|
||||
for (let i = 1; i <= Math.min(5, activity.item.reaction); i++)
|
||||
$react.append($('<img>').prop('src', '../img/icon/star-gold-16.png'));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.getActivityTemplate = function ()
|
||||
{
|
||||
return $('.sax-panel-item-template .sax-panel-item.Activity', sax.$pnl.results).clone();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.expandActivity = function (activity)
|
||||
{
|
||||
@@ -148,7 +143,6 @@
|
||||
sax.setActivityReactionButton(sax.activity.item.reaction);
|
||||
sax.openDialog(sax.$dlg.activity, 800, dlgH);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
let selectedClass = 'sax-selected';
|
||||
sax.setActivityReactionButton = function (r)
|
||||
@@ -172,7 +166,6 @@
|
||||
sax.ajax.activityReact = sax.ajax.activityReact || { url: sax.url.base + 'Activity/Ajax/React', formId: 'frmActivityReact', callbackFn: fn, noWaitIcon: true };
|
||||
sax.doAjaxRequest(sax.ajax.activityReact, 20);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
@@ -188,8 +181,6 @@
|
||||
|
||||
setTimeout(sax.refreshResults, 250);
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,12 +1,10 @@
|
||||
/*
|
||||
* Main scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
win.sax = win.sax || {};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Utilities.
|
||||
sax.isDef = function (obj)
|
||||
@@ -73,7 +71,6 @@
|
||||
evt.stopPropagation();
|
||||
}
|
||||
sax.debug = sax.debugMode ? win.console.log.bind(win.console) : function () { };
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.compareCI = function (a, b)
|
||||
{
|
||||
@@ -88,7 +85,6 @@
|
||||
this.sort(function (a, b) { return sax.compareCI(a, b); });
|
||||
return this;
|
||||
};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.setOddDataRowClass = function (rowSel, cName)
|
||||
{
|
||||
@@ -142,7 +138,6 @@
|
||||
if (sax.mdl.resultsPaging.fn.refreshPaging)
|
||||
sax.mdl.resultsPaging.fn.refreshPaging(response.paging, context, refreshFn);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Page navigation.
|
||||
sax.navigateTo = function (action)
|
||||
@@ -155,7 +150,6 @@
|
||||
sax.doPleaseWait();
|
||||
location = sax.url.base + action;
|
||||
}
|
||||
|
||||
// Account action.
|
||||
sax.onAccountAction = function (select)
|
||||
{
|
||||
@@ -166,7 +160,6 @@
|
||||
else if (action == "Organisations")
|
||||
sax.navigateTo("Organisations");
|
||||
}
|
||||
|
||||
// Security.
|
||||
sax.redirectHome = function ()
|
||||
{
|
||||
@@ -185,7 +178,6 @@
|
||||
{
|
||||
sax.doAjaxRequest({ url: sax.url.base + 'Security/Ajax/SignOut', formId: 'frmNavigate' }, 50);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Dialogs.
|
||||
sax.openDialog = function ($dlg, width, height)
|
||||
@@ -273,7 +265,6 @@
|
||||
clearTimeout(sax.toShowProgress);
|
||||
sax.$dlg.progress.dialog('close');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Notifications.
|
||||
sax.showNotification = function (title, msg)
|
||||
@@ -310,7 +301,6 @@
|
||||
{
|
||||
if (sax.$pleaseWait) sax.$pleaseWait.stop(true, false).fadeOut(200);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Ajax.
|
||||
sax.doAjaxRequest = function (ajax, delay)
|
||||
@@ -376,7 +366,6 @@
|
||||
}
|
||||
ajax.request = $.ajax(cfgAjax);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Session.
|
||||
sax.configureKeepLoggedIn = function (single)
|
||||
@@ -434,7 +423,6 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Elements.
|
||||
sax.objBtm = function (sel)
|
||||
@@ -477,7 +465,6 @@
|
||||
var $obj = $(sel);
|
||||
return parseInt($obj.css('border-top-width'), 10) + parseInt($obj.css('border-bottom-width'), 10);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Viewport - Desktop or Mobile.
|
||||
sax.isMob = function () { return $('body.mob').length > 0; };
|
||||
@@ -503,7 +490,6 @@
|
||||
$ftr.css('visibility', 'visible');
|
||||
sax.onWinResizePage();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
@@ -526,9 +512,8 @@
|
||||
//defaultDate: 0,
|
||||
});
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
//--------------------------------------------------------------
|
||||
(function ()
|
||||
{
|
||||
@@ -538,5 +523,5 @@
|
||||
}
|
||||
if (!Array.prototype.sortBy) Array.prototype.sortCI = sax.arraySortCI;
|
||||
})();
|
||||
|
||||
//--------------------------------------------------------------
|
||||
/* The End */
|
||||
@@ -1,13 +1,11 @@
|
||||
/*
|
||||
* Organisation - Events page scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let oe = sax.OrgEvt = { data: {}, fn: {} };
|
||||
let $pnl = oe.$pnl = {}, $frm = oe.$frm = {}, $dlg = oe.$dlg = {};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oe.refreshResults = function (delay)
|
||||
{
|
||||
@@ -83,7 +81,6 @@
|
||||
$bgr.toggle(!!$('.sax-dropdown-menu .sax-dropdown-item', $item).length);
|
||||
return $item;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oe.getFilterDropdownTemplate = function ()
|
||||
{
|
||||
@@ -109,7 +106,6 @@
|
||||
{
|
||||
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oe.selectFilterOrganisation = function ()
|
||||
{
|
||||
@@ -141,7 +137,6 @@
|
||||
$('#frmEventFilter #ifFilterOrganisation').val(name);
|
||||
oe.refreshResults(50);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oe.selectSportPrimary = function ()
|
||||
{
|
||||
@@ -152,7 +147,6 @@
|
||||
sax.clearControlError($('.EventSportIdPrimary', $frm.evt).val(sport.id));
|
||||
$('.EventSportCaptionPrimary', $frm.evt).val(sport ? sport.name : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oe.selectRegionCountry = function ()
|
||||
{
|
||||
@@ -163,7 +157,6 @@
|
||||
sax.clearControlError($('.EventRegionIdCountry', $frm.evt).val(region.id));
|
||||
$('.EventRegionCaptionCountry', $frm.evt).val(region ? region.name : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oe.createItem = function ()
|
||||
{
|
||||
@@ -185,7 +178,6 @@
|
||||
$('.EventDate', $frm.evt).datepicker('setDate', 'today');
|
||||
sax.clearControlErrors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oe.updateItem = function (item, $item)
|
||||
{
|
||||
@@ -216,7 +208,6 @@
|
||||
$dlg.event.dialog('option', 'title', sax.dlg.title.updateEvent);
|
||||
sax.openDialog($dlg.event, 600, 600);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oe.storeItem = function ()
|
||||
{
|
||||
@@ -238,7 +229,6 @@
|
||||
}
|
||||
oe.populateItem(oe.$item, item)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
@@ -265,7 +255,6 @@
|
||||
|
||||
setTimeout(oe.refreshResults, 250);
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,13 +1,11 @@
|
||||
/*
|
||||
* Organisation - Members page scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let om = sax.OrgMbr = { data: {}, fn: {} };
|
||||
let $pnl = om.$pnl = {}, $frm = om.$frm = {}, $dlg = om.$dlg = {};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
om.refreshResults = function (delay)
|
||||
{
|
||||
@@ -74,7 +72,6 @@
|
||||
$bgr.toggle(!!$('.sax-dropdown-menu .sax-dropdown-item', $item).length);
|
||||
return $item;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
om.getFilterDropdownTemplate = function ()
|
||||
{
|
||||
@@ -100,7 +97,6 @@
|
||||
{
|
||||
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
om.selectFilterOrganisation = function ()
|
||||
{
|
||||
@@ -132,7 +128,6 @@
|
||||
$('#frmMemberFilter #ifFilterOrganisation').val(name);
|
||||
om.refreshResults(50);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
om.createItem = function ()
|
||||
{
|
||||
@@ -151,7 +146,6 @@
|
||||
$('.MemberDisplayName,.MemberTitle,.MemberFirstName,.MemberLastName', $frm.mbr).hide();
|
||||
sax.clearControlErrors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
om.updateItem = function (item, $item)
|
||||
{
|
||||
@@ -182,7 +176,6 @@
|
||||
$dlg.member.dialog('option', 'title', sax.dlg.title.updateMember);
|
||||
sax.openDialog($dlg.member, 600, 560);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Member Roles.
|
||||
om.selectMemberRoles = function ()
|
||||
@@ -212,7 +205,6 @@
|
||||
sax.data.memberRoles.some(function (value) { if (value.code == roleCode) { roleDesc = value.desc; return true; } return false; })
|
||||
return roleDesc || roleCode;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
om.storeItem = function ()
|
||||
{
|
||||
@@ -241,7 +233,6 @@
|
||||
om.populateItem(om.$item, item)
|
||||
delete om.$item;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
om.removeItem = function (item, $item)
|
||||
{
|
||||
@@ -265,7 +256,6 @@
|
||||
delete om.$item;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
om.activateItem = function (item, $item)
|
||||
{
|
||||
@@ -289,7 +279,6 @@
|
||||
delete om.$item;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
@@ -315,7 +304,6 @@
|
||||
|
||||
setTimeout(om.refreshResults, 250);
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,13 +1,11 @@
|
||||
/*
|
||||
* Organisation - Opportunities page scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let oo = sax.OrgOpp = { data: {}, fn: {} };
|
||||
let $pnl = oo.$pnl = {}, $frm = oo.$frm = {}, $dlg = oo.$dlg = {};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oo.refreshResults = function (delay)
|
||||
{
|
||||
@@ -81,7 +79,6 @@
|
||||
$bgr.toggle(!!$('.sax-dropdown-menu .sax-dropdown-item', $item).length);
|
||||
return $item;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oo.getFilterDropdownTemplate = function ()
|
||||
{
|
||||
@@ -107,7 +104,6 @@
|
||||
{
|
||||
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oo.selectFilterOrganisation = function ()
|
||||
{
|
||||
@@ -139,7 +135,6 @@
|
||||
$('#frmOpportunityFilter #ifFilterOrganisation').val(name);
|
||||
oo.refreshResults(50);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oo.selectSport = function ()
|
||||
{
|
||||
@@ -150,7 +145,6 @@
|
||||
sax.clearControlError($('#ifOpportunitySportId').val(sport.id));
|
||||
$('#ifOpportunitySportCaption').val(sport ? sport.name : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oo.selectRegion = function ()
|
||||
{
|
||||
@@ -161,7 +155,6 @@
|
||||
sax.clearControlError($('#ifOpportunityRegionId').val(region.id));
|
||||
$('#ifOpportunityRegionCaption').val(region ? region.name : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oo.createItem = function ()
|
||||
{
|
||||
@@ -182,7 +175,6 @@
|
||||
$('#cbOpportunityType', $frm.opp).find('option[value=""]').remove();
|
||||
sax.clearControlErrors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oo.updateItem = function (item, $item)
|
||||
{
|
||||
@@ -212,7 +204,6 @@
|
||||
$dlg.opportunity.dialog('option', 'title', sax.dlg.title.updateOpportunity);
|
||||
sax.openDialog($dlg.opportunity, 600, 600);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
oo.storeItem = function ()
|
||||
{
|
||||
@@ -234,7 +225,6 @@
|
||||
}
|
||||
oo.populateItem(oo.$item, item)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
@@ -260,7 +250,6 @@
|
||||
|
||||
setTimeout(oo.refreshResults, 250);
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,17 +1,14 @@
|
||||
/*
|
||||
* Organisation Request.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let or = sax.orgReq;
|
||||
or.fn = {}; or.ajax = {};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
or.fn.requestOrganisation = function ()
|
||||
{
|
||||
or.fn.init();
|
||||
$('input[type="text"],textarea,select,.OrganisationSportId,.OrganisationRegionIdCountry', or.$frm).val('');
|
||||
$('.OrganisationRegionIdPrimary', or.$frm).val(sax.data.regionIdCountryDefault);
|
||||
$('.OrganisationRegionNamePrimary', or.$frm).val(sax.data.regionNameCountryDefault);
|
||||
@@ -36,7 +33,6 @@
|
||||
or.fn.cleanUp = function ()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
or.selectOrgSport = function ()
|
||||
{
|
||||
@@ -47,7 +43,6 @@
|
||||
sax.clearControlError($('.OrganisationSportId', or.$frm).val(sport.id));
|
||||
$('.OrganisationSportName', or.$frm).val(sport ? sport.name : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
or.selectOrgRegionPrimary = function ()
|
||||
{
|
||||
@@ -59,11 +54,9 @@
|
||||
sax.clearControlError($('.OrganisationRegionIdPrimary', or.$frm).val(region.id));
|
||||
$('.OrganisationRegionNamePrimary', or.$frm).val(region ? region.name : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
or.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if (or.$dlg) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.title = sax.orgReq.dlgTitleRequestOrganisation;
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { or.fn.storeOrganisation(); };
|
||||
@@ -74,8 +67,7 @@
|
||||
or.$frm.on('dblclick', 'input.OrganisationRegionNamePrimary', or.selectOrgRegionPrimary).on('click', 'button.SelectOrganisationRegionPrimary', or.selectOrgRegionPrimary);
|
||||
$('.sax-input, .sax-textarea', or.$frm).on('input', function () { sax.clearControlError(this); });
|
||||
$('.sax-select', or.$frm).on('change', function () { sax.clearControlError(this); });
|
||||
}
|
||||
|
||||
});
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,13 +1,11 @@
|
||||
/*
|
||||
* Organisation selection.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let so = sax.selectOrganisation;
|
||||
let so = sax.selectOrganisation = sax.selectOrganisation || {};
|
||||
so.data = {}; so.fn = {};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
/*
|
||||
* Organisation selection config:
|
||||
@@ -20,7 +18,6 @@
|
||||
so.fn.selectOrganisation = function (cfg)
|
||||
{
|
||||
//sax.debug('openDialog', cfg);
|
||||
so.fn.init();
|
||||
so.cfg = cfg;
|
||||
sax.openDialog(so.$dlg.dialog('option', { title: cfg.caption || so.dlgTitleSelectOrganisation || 'Select Organisation' }), so.cfg.width || 480, so.cfg.height || 600);
|
||||
}
|
||||
@@ -99,11 +96,9 @@
|
||||
delete so.cfg;
|
||||
delete so.data.item;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
so.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if (so.$dlg) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.open = function () { so.fn.refreshResults(200); };
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { so.fn.confirmSelection(); };
|
||||
@@ -113,8 +108,7 @@
|
||||
so.$results = $('.sax-selection-results.Organisations', so.$dlg);
|
||||
so.$filter = $('.sax-panel-filter', so.$dlg);
|
||||
$('.sax-input.FilterOrganisation', so.$filter).on('input', function () { sax.selectOrganisation.fn.refreshResults(250); });
|
||||
}
|
||||
|
||||
});
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -16,5 +16,4 @@
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* Profile Eligibility scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
//--------------------------------------------------------------
|
||||
@@ -11,7 +10,6 @@
|
||||
//--------------------------------------------------------------
|
||||
sax.refreshProfileEligibilityInfo = function (delay)
|
||||
{
|
||||
ue.init();
|
||||
$pnl.infoTip.hide().find('.sax-info').text(sax.msg.eligibilityInfo);
|
||||
$pnl.usrElg.removeClass('sax-edit').addClass('sax-populating');
|
||||
$('.sax-property', $pnl.usrElg).hide();
|
||||
@@ -224,9 +222,8 @@
|
||||
ue.clearItem();
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
ue.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if ($pnl.usrElg) return;
|
||||
$pnl.usrElg = $('.sax-panel-section.ProfileEligibility');
|
||||
$pnl.usrElg.on('click', '.sax-action.sax-add', function (evt) { ue.addItem(); });
|
||||
$pnl.usrElg.on('click', '.sax-action.sax-info', function (evt) { ue.showInfoTip(); });
|
||||
@@ -248,7 +245,7 @@
|
||||
sax.initCalendars('#frmUserEligibility .sax-calendar', { changeMonth: true, changeYear: true, yearRange: '-99:+12', autoClose: true });
|
||||
ue.$dpExpiresOn.datepicker({ onSelect: function () { ue.onChangeExpiresOn(); }, onClose: function () { ue.onChangeExpiresOn(); } });
|
||||
sax.allowClearCalendar('#frmUserEligibility .sax-calendar');
|
||||
}
|
||||
});
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/*
|
||||
* Account page scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let po = sax.mdl.profileOrganisations = sax.mdl.profileOrganisations || { data: {}, ajax: {} };
|
||||
let $pnl = po.$pnl = {}, $dlg = po.$dlg = {}, $frm = po.$frm = {};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.refreshProfileOrganisationsInfo = function (delay)
|
||||
{
|
||||
@@ -62,7 +60,6 @@
|
||||
|
||||
return $item;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
po.getHeaderDropdownTemplate = function ()
|
||||
{
|
||||
@@ -88,7 +85,6 @@
|
||||
{
|
||||
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
po.updateOrganisation = function ($item, item)
|
||||
{
|
||||
@@ -155,7 +151,6 @@
|
||||
delete po.data.item;
|
||||
delete po.data.$item;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
po.selectOrgSport = function ()
|
||||
{
|
||||
@@ -166,7 +161,6 @@
|
||||
sax.clearControlError($('.OrganisationSportId', $frm.org).val(sport.id));
|
||||
$('.OrganisationSportName', $frm.org).val(sport ? sport.name : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
po.selectOrgRegionPrimary = function ()
|
||||
{
|
||||
@@ -177,7 +171,6 @@
|
||||
sax.clearControlError($('.OrganisationRegionIdPrimary', $frm.org).val(region.id));
|
||||
$('.OrganisationRegionNamePrimary', $frm.org).val(region ? region.name : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
po.getConMthCfg = function (usedMths, mth, val)
|
||||
{
|
||||
@@ -229,8 +222,8 @@
|
||||
po.clearConMth = function (mth)
|
||||
{
|
||||
$('#' + po.getConMthId(mth), $pnl.conMths).remove();
|
||||
po.sortConMths();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
@@ -248,9 +241,6 @@
|
||||
$pnl.conMths = $('.OrganisationContactMethods', $frm.org);
|
||||
$pnl.tblconMths = $('table.sax-data', $pnl.conMths);
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,7 +1,6 @@
|
||||
/*
|
||||
* Account page scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
//--------------------------------------------------------------
|
||||
@@ -11,7 +10,6 @@
|
||||
//--------------------------------------------------------------
|
||||
sax.refreshProfileSportsInfo = function (delay)
|
||||
{
|
||||
ps.init();
|
||||
$pnl.proSpt.removeClass('sax-edit').addClass('sax-populating');
|
||||
$('.sax-property', $pnl.proSpt).hide();
|
||||
sax.showDataRefreshingMsg($pnl.proSpt);
|
||||
@@ -64,28 +62,28 @@
|
||||
{
|
||||
//sax.debug('addProfileSport');
|
||||
ps.clearProfileSport();
|
||||
sax.openDialog($dlg.proSpt.dialog('option', 'title', sax.dlg.title.addUserSport), 640, 480);
|
||||
sax.openDialog($dlg.spt.dialog('option', 'title', sax.dlg.title.addUserSport), 640, 480);
|
||||
}
|
||||
ps.clearProfileSport = function ()
|
||||
{
|
||||
let dlg = $dlg.proSpt;
|
||||
let dlg = $dlg.spt;
|
||||
$('.UserSportId,.ProfileSportExists,#ifProfileSportId,input.sax-input,textarea.sax-textarea,select.sax-select', dlg).val('');
|
||||
$('.SelectSport', dlg).show();
|
||||
sax.clearControlErrors(dlg);
|
||||
}
|
||||
ps.updateProfileSport = function (item)
|
||||
{
|
||||
//sax.debug('updateProfileSport', item, $frm.proSptId);
|
||||
$('.UserSportId', $frm.proSptId).val(item.id);
|
||||
ps.ajax.profileSport = ps.ajax.profileSport || { url: sax.url.base + 'Account/Ajax/GetProfileSport', formId: $frm.proSptId.prop('id'), callbackFn: ps.doUpdateProfileSport };
|
||||
//sax.debug('updateProfileSport', item, $frm.sptId);
|
||||
$('.UserSportId', $frm.sptId).val(item.id);
|
||||
ps.ajax.profileSport = ps.ajax.profileSport || { url: sax.url.base + 'Account/Ajax/GetProfileSport', formId: $frm.sptId.prop('id'), callbackFn: ps.doUpdateProfileSport };
|
||||
sax.doAjaxRequest(ps.ajax.profileSport, 50);
|
||||
}
|
||||
ps.doUpdateProfileSport = function (response)
|
||||
{
|
||||
//sax.debug('doUpdateProfileSport', response);
|
||||
ps.clearProfileSport();
|
||||
let dlg = $dlg.proSpt;
|
||||
let frm = $frm.proSpt;
|
||||
let dlg = $dlg.spt;
|
||||
let frm = $frm.spt;
|
||||
let item = response.sport;
|
||||
$('.UserSportId', frm).val(item.id);
|
||||
$('.ProfileSportExists', frm).val(1);
|
||||
@@ -101,9 +99,9 @@
|
||||
ps.selectUserSport = function (sport)
|
||||
{
|
||||
//sax.debug('selectUserSport');
|
||||
if ($('.UserSportId', $frm.proSpt).val() > 0) return;
|
||||
if ($('.UserSportId', $frm.spt).val() > 0) return;
|
||||
let excludeIds = $.grep(sax.profile.sports.Ids, function (value) { return !sport || value != sport.id; });
|
||||
sax.mdl.selectSport.fn.selectSport({ caption: sax.dlg.title.selectSport, sportId: $('#ifProfileSportId', $frm.proSpt).val(), excludeIds: excludeIds, fnCallback: ps.onSelectUserSport })
|
||||
sax.mdl.selectSport.fn.selectSport({ caption: sax.dlg.title.selectSport, sportId: $('#ifProfileSportId', $frm.spt).val(), excludeIds: excludeIds, fnCallback: ps.onSelectUserSport })
|
||||
}
|
||||
ps.onSelectUserSport = function (sport)
|
||||
{
|
||||
@@ -111,37 +109,67 @@
|
||||
$('#ifProfileSport').val(sport ? sport.name : '');
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
ps.getSportContactCfg = function (contact)
|
||||
{
|
||||
let cfg = { fnCallback: ps.applySportContact, methods: ps.data.contactTypes, typesUsed: ps.getUsedContactTypes(), contact: contact};
|
||||
return cfg;
|
||||
}
|
||||
ps.getUsedContactTypes = function ()
|
||||
{
|
||||
return $('input[name="Contacts.ContactTypes"]', $frm.org).map(function () { return $(this).val(); }).get();
|
||||
}
|
||||
ps.addSportContact = function ()
|
||||
{
|
||||
sax.debug('addSportContact');
|
||||
ps.showSportContact(ps.getSportContactCfg());
|
||||
}
|
||||
ps.editSportContact= function (contact)
|
||||
{
|
||||
sax.debug('editSportContact');
|
||||
ps.showSportContact(ps.getSportContactCfg(contact));
|
||||
}
|
||||
ps.showSportContact=function(cfg)
|
||||
{
|
||||
sax.mdl.sportContact.showSportContact(cfg);
|
||||
}
|
||||
ps.getConId = function (contact)
|
||||
{
|
||||
return 'SptCon_' + contact.type;
|
||||
}
|
||||
ps.applySportContact = function ()
|
||||
{
|
||||
sax.debug('applySportContact');
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
ps.storeProfileSport = function ()
|
||||
{
|
||||
//sax.debug('storeProfileSport');
|
||||
sax.clearControlErrors();
|
||||
ps.ajax.storeProfileSport = ps.ajax.storeProfileSport || { url: sax.url.base + 'Account/Ajax/StoreProfileSport', formId: $frm.proSpt.prop('id'), callbackFn: ps.onStoreProfileSport };
|
||||
ps.ajax.storeProfileSport = ps.ajax.storeProfileSport || { url: sax.url.base + 'Account/Ajax/StoreProfileSport', formId: $frm.spt.prop('id'), callbackFn: ps.onStoreProfileSport };
|
||||
sax.doAjaxRequest(ps.ajax.storeProfileSport, 50);
|
||||
}
|
||||
ps.onStoreProfileSport = function (response)
|
||||
{
|
||||
sax.refreshControlValues(response.controlValues);
|
||||
if (!response || !response.success) return;
|
||||
$dlg.proSpt.dialog('close');
|
||||
$dlg.spt.dialog('close');
|
||||
sax.refreshProfileSportsInfo();
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
ps.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if ($pnl.proSpt) return;
|
||||
$pnl.proSpt = $('.sax-panel-section.ProfileSports');
|
||||
$('.sax-action.sax-add', $pnl.proSpt).on('click', function (evt) { ps.addProfileSport(); });
|
||||
$frm.proSptId = $('#frmProfileSportId', $pnl.proSpt);
|
||||
$frm.sptId = $('#frmProfileSportId', $pnl.proSpt);
|
||||
var opt = sax.dlgOpts();
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { ps.storeProfileSport(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||
$dlg.proSpt = $('#dlgProfileSport').dialog(opt);
|
||||
$frm.proSpt = $('#frmProfileSport', $dlg.proSpt);
|
||||
$frm.proSpt.on('dblclick', '.ProfileSport.sax-input', ps.selectUserSport);
|
||||
$frm.proSpt.on('click', '.SelectSport.sax-button', ps.selectUserSport);
|
||||
}
|
||||
$dlg.spt = $('#dlgProfileSport').dialog(opt);
|
||||
$frm.spt = $('#frmProfileSport', $dlg.spt);
|
||||
$frm.spt.on('dblclick', '.ProfileSport.sax-input', ps.selectUserSport);
|
||||
$frm.spt.on('click', '.SelectSport.sax-button', ps.selectUserSport);
|
||||
$frm.spt.on('click', '.SportContacts .sax-action.sax-add', ps.addSportContact);
|
||||
});
|
||||
//--------------------------------------------------------------
|
||||
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,12 +1,10 @@
|
||||
/*
|
||||
* Account page scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let $pnl = sax.$pnl, $dlg = sax.$dlg, $frm = sax.$frm;
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.refreshProfileContactInfo = function ()
|
||||
{
|
||||
@@ -86,7 +84,6 @@
|
||||
if (!response.success) return;
|
||||
sax.refreshProfileContactInfo();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.refreshDob = function ()
|
||||
{
|
||||
@@ -125,7 +122,6 @@
|
||||
$selDobDay.val('');
|
||||
$selDobDay.prop('disabled', !monthVal);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.selectRegionCountry = function ()
|
||||
{
|
||||
@@ -137,7 +133,6 @@
|
||||
sax.clearControlError($('#ifAccountRegionIdCountry').val(region.id));
|
||||
$('#ifAccountRegionCaptionCountry').val(region ? region.name : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.onDropContactImage = function (evt)
|
||||
{
|
||||
@@ -193,7 +188,6 @@
|
||||
let file = $fileCtrl[0].files[0];
|
||||
sax.onDropContactImageFile(file, dlg);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
@@ -215,9 +209,6 @@
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||
$dlg.selectContactImage = $('#dlgSelectContactImage').dialog(opt);
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,13 +1,11 @@
|
||||
/*
|
||||
* Region selection.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let sr = sax.mdl.selectRegion = sax.mdl.selectRegion || {};
|
||||
sr.regions = {}; sr.fn = {}; sr.ajax = {}; sr.itemIdPrefix = 'Rgn_';
|
||||
|
||||
//--------------------------------------------------------------
|
||||
/*
|
||||
* Region selection config:
|
||||
@@ -19,7 +17,6 @@
|
||||
*/
|
||||
sr.fn.selectRegion = function (cfg)
|
||||
{
|
||||
sr.fn.init();
|
||||
sr.cfg = cfg;
|
||||
sr.regionId = cfg.regionId;
|
||||
if (sr.regions.length) sr.fn.showSelectRegion();
|
||||
@@ -43,7 +40,6 @@
|
||||
sr.fn.displayRegions();
|
||||
sax.openDialog(sr.$dlg.dialog('option', { title: sr.cfg.caption || 'Select Region' }), sr.cfg.width || 400, sr.cfg.height || 800);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sr.fn.compareRegions = function (a, b)
|
||||
{
|
||||
@@ -52,7 +48,6 @@
|
||||
return a.name.localeCompare(b.name);
|
||||
return comparison;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sr.fn.displayRegions = function ()
|
||||
{
|
||||
@@ -90,7 +85,6 @@
|
||||
let region = sr.fn.getRegion(id);
|
||||
return region ? region.name : '';
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sr.fn.onClickRegion = function (region, $region)
|
||||
{
|
||||
@@ -117,26 +111,22 @@
|
||||
delete sr.cfg;
|
||||
delete sr.regionId;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sr.fn.onDlgSize = function ()
|
||||
{
|
||||
let $pnl = $('.sax-selectRegion-regions.AvailableRegions', sr.$dlg);
|
||||
$pnl.outerHeight(Math.floor(sr.$dlg.innerHeight() - $pnl.position().top - ($pnl.outerHeight(true) - $pnl.innerHeight())));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sr.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if (sr.$dlg) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.open = function (evt, ui) { sr.fn.onDlgSize(); };
|
||||
opt.resize = function (evt, ui) { sr.fn.onDlgSize(); };
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { sr.fn.storeSelectRegion(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { sr.fn.cleanUp(); $(this).dialog('close'); };
|
||||
sr.$dlg = $('#dlgSelectRegion').dialog(opt);
|
||||
}
|
||||
|
||||
});
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,12 +1,11 @@
|
||||
/*
|
||||
* Admin - Results paging.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let rp = sax.mdl.resultsPaging = sax.mdl.resultsPaging || { fn: {}, msg: {}, contexts: [] };
|
||||
|
||||
let rp = sax.mdl.resultsPaging = sax.mdl.resultsPaging || { msg: {} };
|
||||
rp.fn = {}; rp.contexts = [];
|
||||
//--------------------------------------------------------------
|
||||
rp.fn.refreshPaging = function (paging, contextSel, refreshFn)
|
||||
{
|
||||
@@ -20,7 +19,6 @@
|
||||
//$('.sax-paging-first,.sax-paging-prev', context.$rp).toggle(paging.pageNo > 1);
|
||||
//$('.sax-paging-next,.sax-paging-last', context.$rp).toggle(paging.pageNo < paging.pageCount);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
rp.fn.getContext = function (contextSel, refreshFn)
|
||||
{
|
||||
@@ -33,7 +31,6 @@
|
||||
rp.contexts.push(context);
|
||||
return context;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
rp.fn.firstPage = function (context)
|
||||
{
|
||||
@@ -63,7 +60,6 @@
|
||||
context.$pageNo.val(context.paging.pageCount);
|
||||
context.refreshFn();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
rp.fn.init = function (context)
|
||||
{
|
||||
@@ -77,7 +73,10 @@
|
||||
$('.sax-paging-next', context.$rp).off('click').on('click', function () { rp.fn.nextPage(context); });
|
||||
$('.sax-paging-last', context.$rp).off('click').on('click', function () { rp.fn.lastPage(context); });
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
});
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,11 +1,9 @@
|
||||
/*
|
||||
* Security page scripts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.doSignin = function ()
|
||||
{
|
||||
@@ -19,7 +17,6 @@
|
||||
if (!response.success) return;
|
||||
sax.goToPage('');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.doScorePassword = function ()
|
||||
{
|
||||
@@ -31,7 +28,6 @@
|
||||
var score = (response || {}).score || 0;
|
||||
sax.$prgPwordStrength.progressbar("option", "value", score).removeClass('amber green').addClass(score > 3 ? 'green' : score > 2 ? 'amber' : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.doChangePassword = function ()
|
||||
{
|
||||
@@ -47,7 +43,6 @@
|
||||
sax.goToPage('Security/Signin');
|
||||
else sax.goToPage('');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.doRequestPassword = function ()
|
||||
{
|
||||
@@ -67,7 +62,6 @@
|
||||
sax.doAlert($('.sax-page-caption').text(), response.successMsg, gotoSigninPage);
|
||||
else gotoSigninPage();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
@@ -85,8 +79,6 @@
|
||||
sax.$frm.reqPword.on('keypress', '#ifEmailAddress', function (e) { if (e.which == 13) sax.doRequestPassword(); });
|
||||
$('#pbRequestPassword', sax.$frm.reqPword).on('click', function () { sax.doRequestPassword(); }).on('keypress', function (e) { if (e.which == 13) sax.doRequestPassword(); });
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,12 +1,11 @@
|
||||
/*
|
||||
* Sport contact.
|
||||
* Sport contacts.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
//--------------------------------------------------------------
|
||||
"use strict";
|
||||
let sc = sax.mdl.sportContact = { ajax: {}, data: {}, $pnl: {}, $dlg: {}, $frm: {} };
|
||||
let sc = sax.mdl.sportContact = { fn: {}, ajax: {}, data: {}, $pnl: {}, $dlg: {}, $frm: {} };
|
||||
//--------------------------------------------------------------
|
||||
/*
|
||||
* Sport Contact config:
|
||||
@@ -19,28 +18,25 @@
|
||||
* - typesUsed
|
||||
* - fnCallback - method to call on completion to store details.
|
||||
*/
|
||||
sax.showSportContact = function (cfg)
|
||||
sc.showSportContact = function (cfg)
|
||||
{
|
||||
sc.fn.init();
|
||||
sc.data.cfg = cfg;
|
||||
sax.openDialog(sc.$dlg.dialog('option', { title: sc.data.cfg.caption || 'Select Sport' }), sc.data.cfg.width || 400, sc.data.cfg.height || 800);
|
||||
sax.openDialog(sc.$dlg.sptCnt.dialog('option', { title: sc.data.cfg.caption || 'Sport Contact' }), sc.data.cfg.width || 400, sc.data.cfg.height || 800);
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
sc.fn.displayContact = function ()
|
||||
{
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
sc.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if (sc.$dlg.sptCnt) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.open = function (evt, ui) { sc.fn.onDlgSize(); };
|
||||
opt.resize = function (evt, ui) { sc.fn.onDlgSize(); };
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { sc.fn.storeSelectSport(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { sc.fn.cleanUp(); $(this).dialog('close'); };
|
||||
sc.$dlg.sptCnt = $('#dlgSportContact').dialog(opt);
|
||||
}
|
||||
});
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
+2
-4
@@ -9,7 +9,6 @@
|
||||
//--------------------------------------------------------------
|
||||
sax.showSportExperience = function (usrSpt)
|
||||
{
|
||||
se.init();
|
||||
//sax.debug('showSportExperience', usrSpt);
|
||||
$('.sax-header .SportName', se.$pnl.sportExp).text(usrSpt.sportName);
|
||||
$('.sax-panel-section').slideUp(750, function () { se.$pnl.sportExp.slideDown(750); });
|
||||
@@ -131,9 +130,8 @@
|
||||
sax.refreshProfileSportsInfo(50);
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
se.init=function ()
|
||||
$(function ()
|
||||
{
|
||||
if (se.$pnl.sportExp) return;
|
||||
se.$pnl.sportExp = $('.sax-panel.ProfileSportExperience');
|
||||
se.$pnl.hdr = $('.sax-header', se.$pnl.sportExp);
|
||||
se.$pnl.results = $('.sax-panel-results.ProfileSportExperiences', se.$pnl.sportExp);
|
||||
@@ -151,7 +149,7 @@
|
||||
se.$dpPeriodTo = $('.sax-calendar.ExperiencePeriodTo', se.$frm.sportExp);
|
||||
se.$dpPeriodFrom.datepicker({ onSelect: function () { $(this).change(); } });
|
||||
sax.allowClearCalendar('#frmSportExperience .sax-calendar.ExperiencePeriodTo');
|
||||
}
|
||||
});
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
/*
|
||||
* Sport selection.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let ss = sax.mdl.selectSport = sax.mdl.selectSport || {};
|
||||
ss.sports = {}; ss.fn = {}; ss.ajax = {};;
|
||||
|
||||
//--------------------------------------------------------------
|
||||
/*
|
||||
* Sport selection config:
|
||||
@@ -18,7 +16,6 @@
|
||||
*/
|
||||
ss.fn.selectSport = function (cfg)
|
||||
{
|
||||
ss.fn.init();
|
||||
ss.cfg = cfg;
|
||||
ss.sportId = cfg.sportId;
|
||||
if (ss.sports.length) ss.fn.showSelectSport();
|
||||
@@ -42,7 +39,6 @@
|
||||
ss.fn.displaySports();
|
||||
sax.openDialog(ss.$dlg.dialog('option', { title: ss.cfg.caption || 'Select Sport' }), ss.cfg.width || 400, ss.cfg.height || 800);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
ss.fn.compareSports = function (a, b)
|
||||
{
|
||||
@@ -51,7 +47,6 @@
|
||||
return a.name.localeCompare(b.name);
|
||||
return comparison;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
ss.fn.displaySports = function ()
|
||||
{
|
||||
@@ -86,7 +81,6 @@
|
||||
let sport = ss.fn.getSport(id);
|
||||
return sport ? sport.name : '';
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
ss.fn.onClickSport = function (sport, $sport)
|
||||
{
|
||||
@@ -113,26 +107,22 @@
|
||||
delete ss.cfg;
|
||||
delete ss.sportId;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
ss.fn.onDlgSize = function ()
|
||||
{
|
||||
let $pnl = $('.sax-selectSport-sports.AvailableSports', ss.$dlg);
|
||||
$pnl.outerHeight(Math.floor(ss.$dlg.innerHeight() - $pnl.position().top - ($pnl.outerHeight(true) - $pnl.innerHeight())));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
ss.fn.init = function ()
|
||||
$(function ()
|
||||
{
|
||||
if (ss.$dlg) return;
|
||||
var opt = sax.dlgOpts();
|
||||
opt.open = function (evt, ui) { ss.fn.onDlgSize(); };
|
||||
opt.resize = function (evt, ui) { ss.fn.onDlgSize(); };
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { ss.fn.storeSelectSport(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { ss.fn.cleanUp(); $(this).dialog('close'); };
|
||||
ss.$dlg = $('#dlgSelectSport').dialog(opt);
|
||||
}
|
||||
|
||||
});
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,14 +1,12 @@
|
||||
/*
|
||||
* Search - Organisations.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let so = sax.searchOrganisations = {};
|
||||
so.ajax = {}; so.data = {}; so.fn = {};
|
||||
let $pnl = so.$pnl = {}, $frm = so.$frm = {}, $dlg = so.$dlg = {};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
so.refreshResults = function (delay)
|
||||
{
|
||||
@@ -63,7 +61,6 @@
|
||||
$bgr.toggle(!!$('.sax-dropdown-menu .sax-dropdown-item', $item).length);
|
||||
return $item;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
so.getFilterDropdownTemplate = function ()
|
||||
{
|
||||
@@ -89,7 +86,6 @@
|
||||
{
|
||||
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
so.selectFilterSport = function ()
|
||||
{
|
||||
@@ -107,7 +103,6 @@
|
||||
$('.FilterSportId,.FilterSportCaption', $frm.filter).val('');
|
||||
so.refreshResults();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
so.selectFilterRegion = function ()
|
||||
{
|
||||
@@ -125,7 +120,6 @@
|
||||
$('.FilterRegionId,.FilterRegionCaption', $frm.filter).val('');
|
||||
so.refreshResults();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
so.viewItem = function (item)
|
||||
{
|
||||
@@ -155,7 +149,6 @@
|
||||
$dlg.org.dialog('option', 'title', item.name || sax.dlg.title.organisation);
|
||||
sax.openDialog($dlg.org, 720, 800);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
@@ -177,7 +170,6 @@
|
||||
|
||||
setTimeout(so.refreshResults, 250);
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -1,14 +1,12 @@
|
||||
/*
|
||||
* Search - Users.
|
||||
*/
|
||||
|
||||
(function (win, doc, undef)
|
||||
{
|
||||
"use strict";
|
||||
let su = sax.searchUsers = {};
|
||||
su.ajax = {}; su.data = {}; su.fn = {};
|
||||
let $pnl = su.$pnl = {}, $frm = su.$frm = {}, $dlg = su.$dlg = {};
|
||||
|
||||
//--------------------------------------------------------------
|
||||
su.refreshResults = function (delay)
|
||||
{
|
||||
@@ -60,7 +58,6 @@
|
||||
$bgr.toggle(!!$('.sax-dropdown-menu .sax-dropdown-item', $item).length);
|
||||
return $item;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
su.getFilterDropdownTemplate = function ()
|
||||
{
|
||||
@@ -86,7 +83,6 @@
|
||||
{
|
||||
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
su.selectFilterSport = function ()
|
||||
{
|
||||
@@ -104,7 +100,6 @@
|
||||
$('.FilterSportId,.FilterSportCaption', $frm.filter).val('');
|
||||
su.refreshResults();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
su.selectFilterRegion = function ()
|
||||
{
|
||||
@@ -122,7 +117,6 @@
|
||||
$('.FilterRegionId,.FilterRegionCaption', $frm.filter).val('');
|
||||
su.refreshResults();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
su.viewItem = function (item)
|
||||
{
|
||||
@@ -141,7 +135,6 @@
|
||||
$dlg.usr.dialog('option', 'title', item.name || sax.dlg.title.user);
|
||||
sax.openDialog($dlg.usr, 600, 600);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
$(function ()
|
||||
{
|
||||
@@ -163,7 +156,6 @@
|
||||
|
||||
setTimeout(su.refreshResults, 250);
|
||||
});
|
||||
|
||||
//--------------------------------------------------------------
|
||||
}(window, window.document));
|
||||
|
||||
/* The End */
|
||||
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
public static class Version
|
||||
{
|
||||
private static String version { get; } = "1.2.9.2";
|
||||
private static String version { get; } = "1.2.10.0";
|
||||
// Retrieve version.
|
||||
public static String GetFullVersion () { return version; }
|
||||
public static String GetAppVersion ()
|
||||
@@ -40,6 +40,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
// Version history.
|
||||
//-------------------------------------------------------------------
|
||||
// 1.2.10 11-Oct-2022
|
||||
// - Online organisations display issue fixed.
|
||||
// 1.2.9 12-Oct-2022
|
||||
// - Online Sports Experience update bug resolved.
|
||||
// - Sports Experience Awards.
|
||||
|
||||
@@ -42,8 +42,15 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
public enum Application
|
||||
{
|
||||
Admin,
|
||||
Online,
|
||||
Online = 100,
|
||||
Admin = 900,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public enum Database
|
||||
{
|
||||
Core = 10,
|
||||
Support = 20,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -155,6 +162,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
/* Do not change the values - tied to database. */
|
||||
Journalist,
|
||||
SystemAdmin,
|
||||
SystemReviewer,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -20,8 +20,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
// Properties.
|
||||
public abstract SaxSystem System { get; }
|
||||
public abstract SaxConsoleHelper ConsoleHelper { get; }
|
||||
public abstract ISacsDatabase GetCoreDatabase(SaxSessionContext sessionContext);
|
||||
public abstract IDatabaseInfo CreateCoreDbInfo(SaxSessionContext sessionContext);
|
||||
public abstract ISacsDatabase GetDatabase(SaxSessionContext sessionContext, Sax.Database databaseType);
|
||||
public abstract IDatabaseInfo CreateDbInfo(SaxSessionContext sessionContext, Sax.Database databaseType);
|
||||
// Application instance.
|
||||
public abstract Sax.InstanceType InstanceType { get; }
|
||||
public bool IsLiveHost() { return InstanceType == Sax.InstanceType.Production; }
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Tue 15-Nov-2022 13:33:16
|
||||
// Code generated by Sarand Database Utilities Tue 6-Dec-2022 18:22:59
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Base.App
|
||||
{
|
||||
@@ -379,6 +379,7 @@ namespace Saxonite.Base.App
|
||||
UserSport_UserAccountId,
|
||||
UserSport_SportId,
|
||||
UserSport_About,
|
||||
UserSport_ContactsData,
|
||||
UserSport_Participation,
|
||||
UserSport_Officiating,
|
||||
UserSport_UserSportData,
|
||||
@@ -420,7 +421,7 @@ namespace Saxonite.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private static readonly int tableCount = 22;
|
||||
private static readonly int columnCount = 369;
|
||||
private static readonly int columnCount = 370;
|
||||
private static ulong maxTextLen = 0;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -947,6 +948,7 @@ namespace Saxonite.Base.App
|
||||
new ColumnDfn(21,"UserAccountId",4,4,false,10),
|
||||
new ColumnDfn(21,"SportId",4,4,false,10),
|
||||
new ColumnDfn(21,"About",0,-9,false,2000),
|
||||
new ColumnDfn(21,"ContactsData",0,-9,false,0),
|
||||
new ColumnDfn(21,"Participation",3,5,false,5),
|
||||
new ColumnDfn(21,"Officiating",3,5,false,5),
|
||||
new ColumnDfn(21,"UserSportData",0,-9,false,0),
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Tue 6-Dec-2022 18:22:59
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Base.App
|
||||
{
|
||||
public class SaxDbDfn_Support
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Table identifiers.
|
||||
public enum TableIdx
|
||||
{
|
||||
Unknown = 0,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Column identifiers.
|
||||
public enum ColumnIdx
|
||||
{
|
||||
Unknown = 0,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private static readonly int tableCount = 0;
|
||||
private static readonly int columnCount = 0;
|
||||
private static ulong maxTextLen = 0;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Retrieve Table details (eg. name: 'Company').
|
||||
public static int GetTableCount ()
|
||||
{
|
||||
return tableCount;
|
||||
}
|
||||
public static String GetTableName (TableIdx table, bool delimitReservedWords = true)
|
||||
{
|
||||
int tableIdx = (int)table - 1;
|
||||
if (tableIdx < 0 || tableIdx >= tableCount) return String.Empty;
|
||||
String tableName = tables[(int)tableIdx];
|
||||
if (delimitReservedWords) tableName = DelimitReservedWord(tableName);
|
||||
return tableName;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Identify the table that corresponds with the specified column.
|
||||
public static TableIdx GetTableForColumn (ColumnIdx column)
|
||||
{
|
||||
int columnIdx = (int)column - 1;
|
||||
if (columnIdx < 0 || columnIdx >= columnCount) return TableIdx.Unknown;
|
||||
return columns[columnIdx].TableIdx;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Retrieve the specified Column's name (Qualified include table name: '(<Table>.Column>)').
|
||||
public static String GetColumnName (ColumnIdx column, bool delimitReservedWords = true)
|
||||
{
|
||||
int columnIdx = (int)column - 1;
|
||||
if (columnIdx < 0 || columnIdx >= columnCount) return String.Empty;
|
||||
String columnName = columns[columnIdx].Name;
|
||||
if (delimitReservedWords) columnName = DelimitReservedWord(columnName);
|
||||
return columnName;
|
||||
}
|
||||
public static String GetColumnNameQual (ColumnIdx column, String tableAlias = "", bool braces = false)
|
||||
{
|
||||
String columnName = GetColumnName(column);
|
||||
if (!String.IsNullOrEmpty(columnName))
|
||||
{
|
||||
String tableName = StringUtil.EmptyOnNull(tableAlias);
|
||||
if (tableName.IsEmpty()) tableName = GetTableName(GetTableForColumn(column));
|
||||
columnName = tableName + (tableName.Length > 0 ? "." : "") + columnName;
|
||||
if (braces)
|
||||
columnName = "(" + columnName + ")";
|
||||
}
|
||||
return columnName;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Reserved words.
|
||||
private static DbReservedWordDelim reservedWordDelim = DbReservedWordDelim.SquareBrackets;
|
||||
public static void SetReservedWordDelim (DbReservedWordDelim reservedWordDelim)
|
||||
{
|
||||
SaxDbDfn_Support.reservedWordDelim = reservedWordDelim;
|
||||
}
|
||||
public static bool IsReservedWord (String word)
|
||||
{
|
||||
if (String.IsNullOrEmpty(word)) return false;
|
||||
if (reservedWords.Contains(word, StringComparer.OrdinalIgnoreCase)) return true;
|
||||
return false;
|
||||
}
|
||||
public static String DelimitReservedWord (String word)
|
||||
{
|
||||
if (!IsReservedWord(word)) return word;
|
||||
switch (reservedWordDelim)
|
||||
{
|
||||
case DbReservedWordDelim.None:
|
||||
break;
|
||||
case DbReservedWordDelim.DoubleQuotes:
|
||||
word = "\"" + word + "\"";
|
||||
break;
|
||||
case DbReservedWordDelim.SquareBrackets:
|
||||
default:
|
||||
word = "[" + word + "]";
|
||||
break;
|
||||
}
|
||||
return word;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Retrieve information about the specified Column.
|
||||
public static DbColumnDataType GetColDataType (ColumnIdx column)
|
||||
{
|
||||
int columnIdx = (int)column - 1;
|
||||
if (columnIdx < 0 || columnIdx >= columnCount) return DbColumnDataType.Unknown;
|
||||
return columns[columnIdx].DataType;
|
||||
}
|
||||
public static short GetColNativeDataType (ColumnIdx column)
|
||||
{
|
||||
int columnIdx = (int)column - 1;
|
||||
if (columnIdx < 0 || columnIdx >= columnCount) return 0;
|
||||
return columns[columnIdx].NativeDataType;
|
||||
}
|
||||
public static void SetMaxTextLen (ulong maxTextLen)
|
||||
{
|
||||
SaxDbDfn_Support.maxTextLen = maxTextLen;
|
||||
}
|
||||
public static bool IsColFmtText (ColumnIdx column)
|
||||
{
|
||||
int columnIdx = (int)column - 1;
|
||||
if (columnIdx < 0 || columnIdx >= columnCount) return false;
|
||||
return (columns[columnIdx].DataType == DbColumnDataType.VarChar);
|
||||
}
|
||||
public static ulong GetColTextLen (ColumnIdx column)
|
||||
{
|
||||
int columnIdx = (int)column - 1;
|
||||
if (columnIdx < 0 || columnIdx >= columnCount) return 0;
|
||||
if (columns[columnIdx].DataType == DbColumnDataType.VarChar)
|
||||
{
|
||||
ulong textLen = columns[columnIdx].DataLen;
|
||||
if (maxTextLen > 0 && textLen > maxTextLen) textLen = maxTextLen;
|
||||
return textLen;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
public static bool IsColFmtBool (ColumnIdx column)
|
||||
{
|
||||
int columnIdx = (int)column - 1;
|
||||
if (columnIdx < 0 || columnIdx >= columnCount) return false;
|
||||
return (columns[columnIdx].DataType == DbColumnDataType.Bit);
|
||||
}
|
||||
public static bool IsColFmtNumeric (ColumnIdx column)
|
||||
{
|
||||
int columnIdx = (int)column - 1;
|
||||
if (columnIdx < 0 || columnIdx >= columnCount) return false;
|
||||
switch (columns[columnIdx].DataType)
|
||||
{
|
||||
case DbColumnDataType.TinyInt:
|
||||
case DbColumnDataType.SmallInt:
|
||||
case DbColumnDataType.Int:
|
||||
case DbColumnDataType.BigInt:
|
||||
case DbColumnDataType.Single:
|
||||
case DbColumnDataType.Double:
|
||||
case DbColumnDataType.Decimal:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Table definitions.
|
||||
private static readonly String[] tables =
|
||||
{
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Table column definitions.
|
||||
private class ColumnDfn
|
||||
{
|
||||
internal TableIdx TableIdx { get; set; }
|
||||
internal String Name { get; set; }
|
||||
internal DbColumnDataType DataType { get; set; }
|
||||
internal short NativeDataType { get; set; }
|
||||
internal bool IsIdentity { get; set; }
|
||||
internal ulong DataLen { get; set; }
|
||||
internal ColumnDfn (int tableIdx, String name, int dataType, short nativeDataType, bool isIdentity, ulong dataLen)
|
||||
{
|
||||
this.TableIdx = (TableIdx)tableIdx;
|
||||
this.Name = name;
|
||||
this.DataType = (DbColumnDataType)dataType;
|
||||
this.NativeDataType = nativeDataType;
|
||||
this.IsIdentity = isIdentity;
|
||||
this.DataLen = dataLen;
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private static readonly ColumnDfn[] columns =
|
||||
{
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Reserved words.
|
||||
private static readonly List<String> reservedWords = new List<String>()
|
||||
{
|
||||
"ADD",
|
||||
"ALL",
|
||||
"ALTER",
|
||||
"AND",
|
||||
"ANY",
|
||||
"AS",
|
||||
"ASC",
|
||||
"AVG",
|
||||
"BEGIN",
|
||||
"BETWEEN",
|
||||
"BY",
|
||||
"CASE",
|
||||
"CAST",
|
||||
"COLUMN",
|
||||
"COMMIT",
|
||||
"CONSTRAINT",
|
||||
"CONVERT",
|
||||
"COUNT",
|
||||
"CREATE",
|
||||
"CURRENCY",
|
||||
"DEFAULT",
|
||||
"DELETE",
|
||||
"DESC",
|
||||
"DISTINCT",
|
||||
"DROP",
|
||||
"ELSE",
|
||||
"END",
|
||||
"EXECUTE",
|
||||
"EXISTS",
|
||||
"FALSE",
|
||||
"FROM",
|
||||
"GRANT",
|
||||
"GROUP",
|
||||
"HAVING",
|
||||
"IN",
|
||||
"INDEX",
|
||||
"INNER",
|
||||
"INSERT",
|
||||
"INTO",
|
||||
"IS",
|
||||
"JOIN",
|
||||
"KEY",
|
||||
"LEFT",
|
||||
"LIKE",
|
||||
"MAX",
|
||||
"MIN",
|
||||
"NOT",
|
||||
"NULL",
|
||||
"ON",
|
||||
"OR",
|
||||
"ORDER",
|
||||
"OUTER",
|
||||
"OUTPUT",
|
||||
"PRIMARY",
|
||||
"PROCEDURE",
|
||||
"REVOKE",
|
||||
"ROLLBACK",
|
||||
"ROWCOUNT",
|
||||
"SELECT",
|
||||
"SET",
|
||||
"SQL",
|
||||
"SUM",
|
||||
"TABLE",
|
||||
"THEN",
|
||||
"TRANSACTION",
|
||||
"TRUE",
|
||||
"UNION",
|
||||
"UNIQUE",
|
||||
"UPDATE",
|
||||
"USER",
|
||||
"VALUES",
|
||||
"VIEW",
|
||||
"WHEN",
|
||||
"WHERE",
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
}
|
||||
@@ -79,10 +79,10 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
public bool DebugMode { get; } = SacsSystem.DebugMode;
|
||||
public SaxSystem System { get; }
|
||||
public SaxSessionContext SessionContext { get; }
|
||||
public ISacsDatabase CoreDatabase { get { return SaxGlobals.App.GetCoreDatabase(SessionContext); } }
|
||||
public ISacsDatabase CoreDatabase { get { return SaxGlobals.App.GetDatabase(SessionContext, Sax.Database.Core); } }
|
||||
public IDatabaseInfo CreateCoreDbInfo()
|
||||
{
|
||||
return SaxGlobals.App.CreateCoreDbInfo(SessionContext);
|
||||
return SaxGlobals.App.CreateDbInfo(SessionContext, Sax.Database.Core);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -180,6 +180,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
// User roles.
|
||||
userRoleCodes.Add(Sax.UserRole.Journalist, "JRNLST", "Journalist");
|
||||
userRoleCodes.Add(Sax.UserRole.SystemAdmin, "SYSADM", "System Admin");
|
||||
userRoleCodes.Add(Sax.UserRole.SystemReviewer, "SYSRVR", "System Reviewer");
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Titles.
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
}
|
||||
|
||||
/// <summary>Clear all contact methods.</summary>
|
||||
public void ClearContactMethods(Sax.ContactMethod method)
|
||||
public void ClearContactMethods()
|
||||
{
|
||||
contactMethods.Clear();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
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.Linq;
|
||||
using System.Text;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Saxonite.Net.Standard.Base.Bus
|
||||
{
|
||||
//=======================================================================
|
||||
// Contact data - associated with Organisations, Users etc.
|
||||
//=======================================================================
|
||||
public class SaxSportContactsData
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Definitions.
|
||||
private static readonly String ElementName_Contacts = "Contacts";
|
||||
private static readonly String ElementName_Contact = "Contact";
|
||||
private static readonly String AttributeName_Type = "Type";
|
||||
private static readonly String ElementName_Type = "Type";
|
||||
private static readonly String ElementName_UserAccountId = "UserAccountId";
|
||||
private static readonly String ElementName_Name = "Name";
|
||||
private static readonly String ElementName_Phone = "Phone";
|
||||
private static readonly String ElementName_Email = "Email";
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private class ContactData
|
||||
{
|
||||
public Sax.SportContactType ContactType { get; set; }
|
||||
public SysId UserAccountId { get; set; }
|
||||
public String Name { get; set; }
|
||||
public String Phone { get; set; }
|
||||
public String Email { get; set; }
|
||||
}
|
||||
private Dictionary<Sax.SportContactType, ContactData> contacts { get; } = new Dictionary<Sax.SportContactType, ContactData>();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction - from serialised data.
|
||||
public SaxSportContactsData(String contactsData = "")
|
||||
{
|
||||
FromXml(contactsData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public List<Sax.SportContactType> ContactTypes { get { return contacts.Keys.ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Utilities.
|
||||
|
||||
/// <summary>Get the contact for the specified type.</summary>
|
||||
private ContactData GetContactData(Sax.SportContactType contactType)
|
||||
{
|
||||
if ((int)contactType < 1) return null;
|
||||
ContactData contact = contacts.GetValueOrDefault(contactType, null);
|
||||
if (contact == null)
|
||||
contacts.Add(contactType, contact = new ContactData() { ContactType = contactType });
|
||||
return contact;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Contacts.
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Extract the name associated with the specified type.</summary>
|
||||
public String GetContactName(Sax.SportContactType contactType)
|
||||
{
|
||||
return contacts.GetValueOrDefault(contactType, new ContactData()).Name;
|
||||
}
|
||||
|
||||
/// <summary>Extract the phone associated with the specified type.</summary>
|
||||
public String GetContactPhone(Sax.SportContactType contactType)
|
||||
{
|
||||
return contacts.GetValueOrDefault(contactType, new ContactData()).Phone;
|
||||
}
|
||||
|
||||
/// <summary>Extract the email associated with the specified type.</summary>
|
||||
public String GetContactEmail(Sax.SportContactType contactType)
|
||||
{
|
||||
return contacts.GetValueOrDefault(contactType, new ContactData()).Email;
|
||||
}
|
||||
|
||||
/// <summary>Set the name associated with the specified contact.</summary>
|
||||
public bool SetContactName(Sax.SportContactType contactType, String name)
|
||||
{
|
||||
if ((int)contactType < 1 || name.IsEmpty()) return false;
|
||||
ContactData contact = GetContactData(contactType);
|
||||
if (contact == null) return false;
|
||||
contact.Name = name;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>Set the phone associated with the specified contact.</summary>
|
||||
public bool SetContactPhone(Sax.SportContactType contactType, String phone)
|
||||
{
|
||||
if ((int)contactType < 1 || phone.IsEmpty()) return false;
|
||||
ContactData contact = GetContactData(contactType);
|
||||
if (contact == null) return false;
|
||||
contact.Phone = phone;
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>Set the email associated with the specified contact.</summary>
|
||||
public bool SetContactEmail(Sax.SportContactType contactType, String email)
|
||||
{
|
||||
if ((int)contactType < 1 || email.IsEmpty()) return false;
|
||||
ContactData contact = GetContactData(contactType);
|
||||
if (contact == null) return false;
|
||||
contact.Email = email;
|
||||
return true;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Clear the value associated with the specified method.</summary>
|
||||
public bool ClearContact(Sax.SportContactType contactType)
|
||||
{
|
||||
return contacts.Remove(contactType);
|
||||
}
|
||||
|
||||
/// <summary>Clear all contact methods.</summary>
|
||||
public void ClearContacts()
|
||||
{
|
||||
contacts.Clear();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Serialisation.
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Serialise as XML.</summary>
|
||||
public String ToXml()
|
||||
{
|
||||
String fn = typeof(SaxContactData).FullName + ".ToXml";
|
||||
try
|
||||
{
|
||||
XDocument doc = new XDocument();
|
||||
XElement contactsElement = doc.AppendElement(ElementName_Contacts);
|
||||
foreach (ContactData contactData in contacts.Values)
|
||||
{
|
||||
if ((int)contactData.ContactType < 1 || (!SysId.IsValid(contactData.UserAccountId) && contactData.Name.IsEmpty())) continue;
|
||||
XElement contactElement = contactsElement.AppendElement(ElementName_Contact);
|
||||
contactElement.SetAttribute(AttributeName_Type, ((int)contactData.ContactType).ToString());
|
||||
contactElement.AppendElement(ElementName_Type, contactData.ContactType.ToString());
|
||||
if (!StringUtil.IsBlank(contactData.Name))
|
||||
contactElement.AppendElement(ElementName_Name, contactData.Name);
|
||||
if (!StringUtil.IsBlank(contactData.Phone))
|
||||
contactElement.AppendElement(ElementName_Phone, contactData.Phone);
|
||||
if (!StringUtil.IsBlank(contactData.Email))
|
||||
contactElement.AppendElement(ElementName_Email, contactData.Email);
|
||||
}
|
||||
return doc.GetXml();
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
SaLogger.Warn(fn + " " + ExceptionUtil.GetLogMessage(exc));
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Deserialise from XML data.</summary>
|
||||
private void FromXml(String contactsData)
|
||||
{
|
||||
String fn = typeof(SaxContactData).FullName + ".FromXml";
|
||||
contacts.Clear();
|
||||
if (StringUtil.IsEmpty(contactsData)) return;
|
||||
|
||||
try
|
||||
{
|
||||
// Load XML data.
|
||||
XDocument doc = XDocument.Parse(contactsData);
|
||||
XElement rootElement = doc.Root;
|
||||
foreach (XElement rootChildElement in rootElement.GetChildElements())
|
||||
{
|
||||
String rootChildElementName = rootChildElement.GetLocalName();
|
||||
if (rootChildElementName.EqualsCI(ElementName_Contact))
|
||||
{
|
||||
// Contact.
|
||||
String contactTypeValue = rootChildElement.GetChildText(ElementName_Type);
|
||||
Sax.SportContactType contactType = EnumUtil.ParseEnum(contactTypeValue, Sax.SportContactType.Unknown);
|
||||
if (contactType != Sax.SportContactType.Unknown)
|
||||
{
|
||||
ContactData contactData = new ContactData()
|
||||
{
|
||||
ContactType = contactType,
|
||||
UserAccountId = rootChildElement.GetChildText(ElementName_UserAccountId).ToSysId(),
|
||||
Name = rootChildElement.GetChildText(ElementName_Name),
|
||||
Phone = rootChildElement.GetChildText(ElementName_Phone),
|
||||
Email = rootChildElement.GetChildText(ElementName_Email),
|
||||
};
|
||||
contacts.Add(contactType, contactData);
|
||||
}
|
||||
else SaLogger.Warn(fn + " Unrecognised contact type: " + contactType);
|
||||
}
|
||||
else SaLogger.Warn(fn + " Unexpected 'Root' child element: " + rootChildElementName);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
SaLogger.Warn(fn + " " + ExceptionUtil.GetLogMessage(exc));
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -54,6 +54,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public SysId UserAccountId { get; set; }
|
||||
public SysId SportId { get; set; }
|
||||
public String About { get; set; } = String.Empty;
|
||||
public String ContactsData { get; set; } = String.Empty;
|
||||
public Sax.SportParticipation Participation { get; set; }
|
||||
public Sax.SportOfficiating Officiating { get; set; }
|
||||
public String UserSportData { get; set; }
|
||||
@@ -86,6 +87,11 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
get { return data.About; }
|
||||
set { CheckChanged(data.About, value); data.About = value; }
|
||||
}
|
||||
public String ContactsData
|
||||
{
|
||||
get { return data.ContactsData; }
|
||||
set { CheckChanged(data.ContactsData, value); data.ContactsData = value; }
|
||||
}
|
||||
public Sax.SportParticipation Participation
|
||||
{
|
||||
get { return data.Participation; }
|
||||
@@ -107,6 +113,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
UserAccountId = data.UserAccountId;
|
||||
SportId = data.SportId;
|
||||
About = data.About;
|
||||
ContactsData = data.ContactsData;
|
||||
Participation = data.Participation;
|
||||
Officiating = data.Officiating;
|
||||
UserSportData = data.UserSportData;
|
||||
@@ -128,6 +135,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public ValidValue UserAccountId { get; set; } = ValidValue.Valid;
|
||||
public ValidValue SportId { get; set; } = ValidValue.Valid;
|
||||
public ValidValue About { get; set; } = ValidValue.Valid;
|
||||
public ValidValue ContactsAbout { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Participation { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Officiating { get; set; } = ValidValue.Valid;
|
||||
public ValidValue UserSportData { get; set; } = ValidValue.Valid;
|
||||
@@ -202,6 +210,11 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
get { return data.About; }
|
||||
set { data.About = value; }
|
||||
}
|
||||
public String ContactsData
|
||||
{
|
||||
get { return data.ContactsData; }
|
||||
set { data.ContactsData = value; }
|
||||
}
|
||||
public Sax.SportParticipation Participation
|
||||
{
|
||||
get { return data.Participation; }
|
||||
|
||||
@@ -128,6 +128,7 @@ namespace Saxonite.Net.Standard.Base.Consoles
|
||||
// Properties.
|
||||
protected SaxSessionContext SessionContext { get; }
|
||||
protected SaxInternals Internals { get { if (internals == null) internals = new SaxInternals(SessionContext); return internals; } }
|
||||
protected ISacsDatabase CoreDatabase { get { return Internals.CoreDatabase; } }
|
||||
protected List<Sax.DataItemType> ValidActivityItemTypes { get { return validActivityItemTypes.ToList(); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{ "Versions": [] }
|
||||
@@ -24,6 +24,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Resources\Data\Application\VersionHistory.json" />
|
||||
<None Remove="Resources\Email\Security\sax-email-account-activated.html" />
|
||||
<None Remove="Resources\Email\Shared\sax-email-footer.html" />
|
||||
<None Remove="Resources\Email\Shared\sax-email-header.html" />
|
||||
|
||||
@@ -9,6 +9,7 @@ using System.Reflection;
|
||||
using System.Text;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
|
||||
namespace Saxonite.Net.Standard.Dbas.App
|
||||
{
|
||||
@@ -17,17 +18,12 @@ namespace Saxonite.Net.Standard.Dbas.App
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
//public static readonly string messageTitle = "Saxonite database definition generator";
|
||||
public enum DatabaseInstance
|
||||
{
|
||||
Core
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// Generate database definitions.
|
||||
/// </summary>
|
||||
public static bool Generate(DatabaseInstance dbInstance, String connectionString)
|
||||
public static bool Generate(Sax.Database dbInstance, String connectionString)
|
||||
{
|
||||
String fn = nameof(SaxDbDfnGenerator) + ".Generate";
|
||||
|
||||
@@ -54,7 +50,7 @@ namespace Saxonite.Net.Standard.Dbas.App
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private static bool GenerateDatabaseDefinition(DatabaseInstance dbInstance, SacsDatabase database, String directory)
|
||||
private static bool GenerateDatabaseDefinition(Sax.Database dbInstance, SacsDatabase database, String directory)
|
||||
{
|
||||
DatabaseDefinitionGenerator.Config config = new DatabaseDefinitionGenerator.Config()
|
||||
{
|
||||
@@ -81,7 +77,7 @@ namespace Saxonite.Net.Standard.Dbas.App
|
||||
config.TableClass.Usings.Add("Sarand.Net.Standard.Base.Utils");
|
||||
config.TableClass.Usings.Add("Sarand.Net.Standard.Base.Dbas");
|
||||
config.TableClass.Namespace_BaseClass = "Saxonite.Net.Standard.Dbas.Data";
|
||||
config.TableClass.Namespace = "Saxonite.Net.Standard.Dbas.Internal";
|
||||
config.TableClass.Namespace = "Saxonite.Net.Standard.Dbas.Internal." + dbInstance.ToString();
|
||||
config.TableClass.BaseClass = "SaxDbDataItem";
|
||||
config.TableClass.ClassName_DatabaseInfo = "IDatabaseInfo";
|
||||
config.TableClass.MandatoryConstructorDbInfo = true;
|
||||
@@ -92,7 +88,7 @@ namespace Saxonite.Net.Standard.Dbas.App
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private static String GetOutputFolder(DatabaseInstance dbInstance)
|
||||
private static String GetOutputFolder(Sax.Database dbInstance)
|
||||
{
|
||||
String fn = nameof(SaxDbDfnGenerator) + ".GetOutputFolder";
|
||||
var assembly = Assembly.GetAssembly(typeof(DatabaseDefinitionGenerator));
|
||||
|
||||
@@ -1,221 +0,0 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Standard.Dbas.Data;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 9-Jun-2022 17:41:18
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal
|
||||
{
|
||||
internal class Association_Db : SaxDbDataItem
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Column definitions.
|
||||
public class ColumnsData
|
||||
{
|
||||
public ColumnDataInt16 _ItemTypeFrom { get; } = new ColumnDataInt16("ItemTypeFrom");
|
||||
public ColumnDataInt32 _ItemIdFrom { get; } = new ColumnDataInt32("ItemIdFrom");
|
||||
public ColumnDataInt16 _ItemTypeTo { get; } = new ColumnDataInt16("ItemTypeTo");
|
||||
public ColumnDataInt32 _ItemIdTo { get; } = new ColumnDataInt32("ItemIdTo");
|
||||
public ColumnDataInt16 _AssociationType { get; } = new ColumnDataInt16("AssociationType");
|
||||
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
|
||||
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
|
||||
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
|
||||
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
|
||||
public ColumnDataInt32 _CreateBy { get; } = new ColumnDataInt32("CreateBy");
|
||||
public ColumnDataString _CreateHost { get; } = new ColumnDataString("CreateHost");
|
||||
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
|
||||
public ColumnDataInt32 _UpdateBy { get; } = new ColumnDataInt32("UpdateBy");
|
||||
public ColumnDataString _UpdateHost { get; } = new ColumnDataString("UpdateHost");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
protected static List<String> fields { get; } = new List<String>()
|
||||
{
|
||||
"ItemTypeFrom",
|
||||
"ItemIdFrom",
|
||||
"ItemTypeTo",
|
||||
"ItemIdTo",
|
||||
"AssociationType",
|
||||
"Notes",
|
||||
"Flags",
|
||||
"Status",
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
"UpdateOn",
|
||||
"UpdateBy",
|
||||
"UpdateHost",
|
||||
};
|
||||
protected static List<String> fieldsId { get; } = new List<String>()
|
||||
{
|
||||
};
|
||||
protected static List<String> fieldsPrimary { get; } = new List<String>()
|
||||
{
|
||||
"ItemTypeFrom",
|
||||
"ItemIdFrom",
|
||||
"ItemTypeTo",
|
||||
"ItemIdTo",
|
||||
"AssociationType",
|
||||
};
|
||||
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
|
||||
{
|
||||
"CreateOn",
|
||||
"CreateBy",
|
||||
"CreateHost",
|
||||
};
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
internal Association_Db (IDatabaseInfo dbInfo) : base(dbInfo)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Properties.
|
||||
public override String SchemaName { get; } = "dbo";
|
||||
public override String TableName { get; } = "Association";
|
||||
public String TableNameFmt { get { return (!String.IsNullOrEmpty(SchemaName) ? "[" + SchemaName + "]." : "") + "[" + TableName + "]"; } }
|
||||
public static List<String> Fields { get { return new List<String>(fields); } }
|
||||
public static List<String> FieldsId { get { return new List<String>(fieldsId); } }
|
||||
public static List<String> FieldsNonId { get { return fields.FindAll(item => !fieldsId.ContainsCI(item)); } }
|
||||
// Columns.
|
||||
public ColumnsData Cols { get; } = new ColumnsData();
|
||||
public Int16 _ItemTypeFrom { get { return Cols._ItemTypeFrom.Value; } set { Cols._ItemTypeFrom.Value = value; } }
|
||||
public Int32 _ItemIdFrom { get { return Cols._ItemIdFrom.Value; } set { Cols._ItemIdFrom.Value = value; } }
|
||||
public Int16 _ItemTypeTo { get { return Cols._ItemTypeTo.Value; } set { Cols._ItemTypeTo.Value = value; } }
|
||||
public Int32 _ItemIdTo { get { return Cols._ItemIdTo.Value; } set { Cols._ItemIdTo.Value = value; } }
|
||||
public Int16 _AssociationType { get { return Cols._AssociationType.Value; } set { Cols._AssociationType.Value = value; } }
|
||||
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
|
||||
public Int16 _Flags { get { return Cols._Flags.Value; } set { Cols._Flags.Value = value; } }
|
||||
public String _Status { get { return Cols._Status.Value; } set { Cols._Status.Value = value; } }
|
||||
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
|
||||
public Int32 _CreateBy { get { return Cols._CreateBy.Value; } set { Cols._CreateBy.Value = value; } }
|
||||
public String _CreateHost { get { return Cols._CreateHost.Value; } set { Cols._CreateHost.Value = value; } }
|
||||
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
|
||||
public Int32 _UpdateBy { get { return Cols._UpdateBy.Value; } set { Cols._UpdateBy.Value = value; } }
|
||||
public String _UpdateHost { get { return Cols._UpdateHost.Value; } set { Cols._UpdateHost.Value = value; } }
|
||||
// Existing columns - confirmed on database if table exists.
|
||||
public List<String> ExistingColumnNames { get { return GetExistingColumnNames(Fields); } }
|
||||
public List<String> ExistingColumnNamesNonId { get { return GetExistingColumnNames(FieldsNonId); } }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Population.
|
||||
public override void PopulateFrom (DbCommand dbCommand, String tableAlias, String filter)
|
||||
{
|
||||
dbCommand.CommandText =
|
||||
"SELECT " + ExistingColumnNames.Concat(", ", (!String.IsNullOrEmpty(tableAlias) ? tableAlias + "." : "") + "[", "]") + " " +
|
||||
"FROM " + TableNameFmt + (!String.IsNullOrEmpty(tableAlias) ? " " + tableAlias : "") + " " +
|
||||
(!String.IsNullOrEmpty(filter) ? "WHERE " + filter : "");
|
||||
Log(GetType().Name + ".PopulateFrom", dbCommand.CommandText);
|
||||
using (DbDataReader dbDataReader = dbCommand.ExecuteReader())
|
||||
{
|
||||
dbDataReader.Read();
|
||||
PopulateFrom(dbDataReader);
|
||||
}
|
||||
}
|
||||
public override void PopulateFrom (DbDataReader dbDataReader)
|
||||
{
|
||||
_ItemTypeFrom = GetFieldInt16(dbDataReader, "ItemTypeFrom", _ItemTypeFrom);
|
||||
_ItemIdFrom = GetFieldInt32(dbDataReader, "ItemIdFrom", _ItemIdFrom);
|
||||
_ItemTypeTo = GetFieldInt16(dbDataReader, "ItemTypeTo", _ItemTypeTo);
|
||||
_ItemIdTo = GetFieldInt32(dbDataReader, "ItemIdTo", _ItemIdTo);
|
||||
_AssociationType = GetFieldInt16(dbDataReader, "AssociationType", _AssociationType);
|
||||
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
|
||||
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
|
||||
_Status = GetFieldString(dbDataReader, "Status", _Status);
|
||||
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
|
||||
_CreateBy = GetFieldInt32(dbDataReader, "CreateBy", _CreateBy);
|
||||
_CreateHost = GetFieldString(dbDataReader, "CreateHost", _CreateHost);
|
||||
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
|
||||
_UpdateBy = GetFieldInt32(dbDataReader, "UpdateBy", _UpdateBy);
|
||||
_UpdateHost = GetFieldString(dbDataReader, "UpdateHost", _UpdateHost);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Insert command.
|
||||
public override bool ExecuteInsertCommand (DbCommand dbCommand)
|
||||
{
|
||||
List<String> columnNames = ExistingColumnNamesNonId;
|
||||
// Construct query.
|
||||
String query =
|
||||
"INSERT INTO " + TableNameFmt + " " +
|
||||
"("+columnNames.Concat(",","[","]")+") ";
|
||||
if (dbCommand is SqlCommand)
|
||||
query += "VALUES (" + columnNames.Concat(",", "@", "") + ") ";
|
||||
else query += "VALUES (" + StringListUtil.CreateList("?", columnNames.Count).Concat(",") + ") ";
|
||||
dbCommand.CommandText = query;
|
||||
Log(GetType().Name + ".ExecuteInsertCommand", dbCommand.CommandText);
|
||||
// Populate parameters.
|
||||
dbCommand.Parameters.Clear();
|
||||
if (columnNames.ContainsCI("ItemTypeFrom")) AddCommandParameter(dbCommand, "@ItemTypeFrom", _ItemTypeFrom);
|
||||
if (columnNames.ContainsCI("ItemIdFrom")) AddCommandParameter(dbCommand, "@ItemIdFrom", _ItemIdFrom);
|
||||
if (columnNames.ContainsCI("ItemTypeTo")) AddCommandParameter(dbCommand, "@ItemTypeTo", _ItemTypeTo);
|
||||
if (columnNames.ContainsCI("ItemIdTo")) AddCommandParameter(dbCommand, "@ItemIdTo", _ItemIdTo);
|
||||
if (columnNames.ContainsCI("AssociationType")) AddCommandParameter(dbCommand, "@AssociationType", _AssociationType);
|
||||
if (columnNames.ContainsCI("Notes")) AddCommandParameter(dbCommand, "@Notes", _Notes);
|
||||
if (columnNames.ContainsCI("Flags")) AddCommandParameter(dbCommand, "@Flags", _Flags);
|
||||
if (columnNames.ContainsCI("Status")) AddCommandParameter(dbCommand, "@Status", _Status);
|
||||
if (columnNames.ContainsCI("CreateOn")) AddCommandParameter(dbCommand, "@CreateOn", _CreateOn);
|
||||
if (columnNames.ContainsCI("CreateBy")) AddCommandParameter(dbCommand, "@CreateBy", _CreateBy);
|
||||
if (columnNames.ContainsCI("CreateHost")) AddCommandParameter(dbCommand, "@CreateHost", _CreateHost);
|
||||
if (columnNames.ContainsCI("UpdateOn")) AddCommandParameter(dbCommand, "@UpdateOn", _UpdateOn);
|
||||
if (columnNames.ContainsCI("UpdateBy")) AddCommandParameter(dbCommand, "@UpdateBy", _UpdateBy);
|
||||
if (columnNames.ContainsCI("UpdateHost")) AddCommandParameter(dbCommand, "@UpdateHost", _UpdateHost);
|
||||
// Execute insert command.
|
||||
bool commandSuccess = false;
|
||||
int executeNonQuery = dbCommand.ExecuteNonQuery();
|
||||
if (executeNonQuery == 1)
|
||||
{
|
||||
commandSuccess = true;
|
||||
}
|
||||
return commandSuccess;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Update command.
|
||||
public override bool ExecuteUpdateCommand (DbCommand dbCommand)
|
||||
{
|
||||
// Columns to update.
|
||||
List<String> columnNames = ExistingColumnNamesNonId.Where(item => !fieldsPrimary.ContainsCI(item) && !fieldsIgnoreOnUpdate.ContainsCI(item)).ToList();
|
||||
// Construct query.
|
||||
String query = "UPDATE " + TableNameFmt + " SET ";
|
||||
if (dbCommand is SqlCommand)
|
||||
{
|
||||
query += StringPairList.CreateFrom(columnNames.Bracket("[","]"),columnNames).Concat("=@").Concat(", ") + " ";
|
||||
query += "WHERE ItemTypeFrom=@ItemTypeFrom AND ItemIdFrom=@ItemIdFrom AND ItemTypeTo=@ItemTypeTo AND ItemIdTo=@ItemIdTo AND AssociationType=@AssociationType;";
|
||||
}
|
||||
else
|
||||
{
|
||||
query += columnNames.Concat(", ", "", "=?") + " ";
|
||||
query += "WHERE ItemTypeFrom=? AND ItemIdFrom=? AND ItemTypeTo=? AND ItemIdTo=? AND AssociationType=?;";
|
||||
}
|
||||
dbCommand.CommandText = query;
|
||||
Log(GetType().Name + ".ExecuteUpdateCommand", dbCommand.CommandText);
|
||||
// Populate parameters.
|
||||
dbCommand.Parameters.Clear();
|
||||
if (columnNames.ContainsCI("Notes")) AddCommandParameter(dbCommand, "@Notes", _Notes);
|
||||
if (columnNames.ContainsCI("Flags")) AddCommandParameter(dbCommand, "@Flags", _Flags);
|
||||
if (columnNames.ContainsCI("Status")) AddCommandParameter(dbCommand, "@Status", _Status);
|
||||
if (columnNames.ContainsCI("UpdateOn")) AddCommandParameter(dbCommand, "@UpdateOn", _UpdateOn);
|
||||
if (columnNames.ContainsCI("UpdateBy")) AddCommandParameter(dbCommand, "@UpdateBy", _UpdateBy);
|
||||
if (columnNames.ContainsCI("UpdateHost")) AddCommandParameter(dbCommand, "@UpdateHost", _UpdateHost);
|
||||
AddCommandParameter(dbCommand, "@ItemTypeFrom", _ItemTypeFrom);
|
||||
AddCommandParameter(dbCommand, "@ItemIdFrom", _ItemIdFrom);
|
||||
AddCommandParameter(dbCommand, "@ItemTypeTo", _ItemTypeTo);
|
||||
AddCommandParameter(dbCommand, "@ItemIdTo", _ItemIdTo);
|
||||
AddCommandParameter(dbCommand, "@AssociationType", _AssociationType);
|
||||
int executeNonQueryResult = dbCommand.ExecuteNonQuery();
|
||||
return (executeNonQueryResult == 1);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -9,9 +9,9 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Tue 15-Nov-2022 13:33:16
|
||||
// Code generated by Sarand Database Utilities Tue 6-Dec-2022 18:22:59
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
internal class ActivityFeedback_Db : SaxDbDataItem
|
||||
{
|
||||
+2
-2
@@ -9,9 +9,9 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Tue 15-Nov-2022 13:33:16
|
||||
// Code generated by Sarand Database Utilities Tue 6-Dec-2022 18:22:59
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
internal class ActivityIndex_Db : SaxDbDataItem
|
||||
{
|
||||
+2
-2
@@ -9,9 +9,9 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Tue 15-Nov-2022 13:33:16
|
||||
// Code generated by Sarand Database Utilities Tue 6-Dec-2022 18:22:59
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
internal class Article_Db : SaxDbDataItem
|
||||
{
|
||||
+2
-2
@@ -9,9 +9,9 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Tue 15-Nov-2022 13:33:16
|
||||
// Code generated by Sarand Database Utilities Tue 6-Dec-2022 18:22:59
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
internal class ItemAddress_Db : SaxDbDataItem
|
||||
{
|
||||
+2
-2
@@ -9,9 +9,9 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Tue 15-Nov-2022 13:33:16
|
||||
// Code generated by Sarand Database Utilities Tue 6-Dec-2022 18:22:59
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
internal class ItemAssociation_Db : SaxDbDataItem
|
||||
{
|
||||
+2
-2
@@ -9,9 +9,9 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Tue 15-Nov-2022 13:33:16
|
||||
// Code generated by Sarand Database Utilities Tue 6-Dec-2022 18:22:59
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
internal class ItemImage_Db : SaxDbDataItem
|
||||
{
|
||||
+2
-2
@@ -9,9 +9,9 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Tue 15-Nov-2022 13:33:16
|
||||
// Code generated by Sarand Database Utilities Tue 6-Dec-2022 18:22:59
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
internal class ItemSport_Db : SaxDbDataItem
|
||||
{
|
||||
+2
-2
@@ -9,9 +9,9 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Tue 15-Nov-2022 13:33:16
|
||||
// Code generated by Sarand Database Utilities Tue 6-Dec-2022 18:22:59
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
internal class OrganisationEvent_Db : SaxDbDataItem
|
||||
{
|
||||
+2
-2
@@ -9,9 +9,9 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Tue 15-Nov-2022 13:33:16
|
||||
// Code generated by Sarand Database Utilities Tue 6-Dec-2022 18:22:59
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
internal class OrganisationOpportunity_Db : SaxDbDataItem
|
||||
{
|
||||
+2
-2
@@ -9,9 +9,9 @@ using System.Data.Common;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Tue 15-Nov-2022 13:33:16
|
||||
// Code generated by Sarand Database Utilities Tue 6-Dec-2022 18:22:59
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal
|
||||
namespace Saxonite.Net.Standard.Dbas.Internal.Core
|
||||
{
|
||||
internal class Organisation_Db : SaxDbDataItem
|
||||
{
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user