This commit is contained in:
2024-06-13 14:29:58 +01:00
parent 2f6395485a
commit 60427e8230
114 changed files with 2176 additions and 1124 deletions
@@ -68,7 +68,7 @@ namespace Saxonite.Net.Core.UnitTests.Web.Admin.App
SaxSessionData_Admin sessionDataDeserialised =
JsonConvert.DeserializeObject<SaxSessionData_Admin>(
sessionDataJson,
SaxController_Base.SessionStorage.JsonDeserialisationSettings
SaxController_Web.SessionStorage.JsonDeserialisationSettings
);
Assert.IsNotNull(sessionDataDeserialised);
@@ -96,7 +96,7 @@ namespace Saxonite.Net.Core.UnitTests.Web.Online.App
SaxSessionData_Online sessionDataDeserialised =
JsonConvert.DeserializeObject<SaxSessionData_Online>(
sessionDataJson,
SaxController_Base.SessionStorage.JsonDeserialisationSettings
SaxController_Web.SessionStorage.JsonDeserialisationSettings
);
Assert.IsNotNull(sessionDataDeserialised);
+1 -1
View File
@@ -227,7 +227,7 @@ namespace Saxonite.Net.Core.Web.Base.App
Sax.Database databaseType = EnumUtil.ParseEnum<Sax.Database>(databaseSection.Key);
if (databaseType <= 0)
{
SaLogger.Warn(GetType().Name + ".extractDatabaseConfig Unrecognised database: " + databaseSection.Key);
SaLogger.Warn($"{SysUtil.Fn} Unrecognised database: {databaseSection.Key}");
return;
}
// Extract database configuration.
+3 -3
View File
@@ -73,7 +73,7 @@ namespace Saxonite.Net.Core.Web.Base.App
}
}
if (text.ResourceNotFound && logMissingKey)
SaLogger.Debug(GetType().Name + ".GetText Key not found: " + key);
SaLogger.Debug($"{SysUtil.Fn} Key not found: {key}");
return text;
}
@@ -135,7 +135,7 @@ namespace Saxonite.Net.Core.Web.Base.App
//-------------------------------------------------------------------
public static String DateFormat_Default { get; } = "d-MMM-yyyy";
public static String DateWithWeekdayFormat_Default { get; } = "ddd d-MMM-yyyy";
public String FormatDate(DateTime value, Boolean includeWeekday = true)
public String FormatDate(DateTime? value, Boolean includeWeekday = true)
{
String dateFormat = includeWeekday ? DateWithWeekdayFormat_Default : DateFormat_Default;
return DateUtil.Format(value, dateFormat);
@@ -175,7 +175,7 @@ namespace Saxonite.Net.Core.Web.Base.App
private String GetCodeTypeCaption<T>(Sax.CodeType codeType, T type) where T : struct, IConvertible
{
if (!(type is Enum))
throw new ArgumentException(GetType().Name + ".GetCodeTypeCaption Type parameter must be an enumerated type. Type supplied: " + type.GetType().Name);
throw new ArgumentException($"{SysUtil.Fn} Type parameter must be an enumerated type. Type supplied: {type.GetType().Name}");
return GetCodeTypeCaption(codeType, (int)(type as IConvertible), type.ToString());
}
private String GetCodeTypeCaption(Sax.CodeType codeType, int type, String typeName)
+1 -1
View File
@@ -116,7 +116,7 @@ namespace Saxonite.Net.Core.Web.Base.App
LanguageViewLocationExpanderFormat.Suffix,
opts => { opts.ResourcesPath = resourcesPath; })
.AddDataAnnotationsLocalization()
// Ignore null values during object serisliation.
// Ignore null values during object serialiation.
.AddJsonOptions(options => { options.JsonSerializerOptions.DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull; });
// Configure localisation middleware.
@@ -1,37 +1,14 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Localization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Routing;
using Microsoft.Net.Http.Headers;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Sacs.Web.Components;
using Sacs.Web.Components;
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Dbas;
using Sarand.Net.Standard.Base.Email;
using Sarand.Net.Standard.Base.Helpers;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Core.Web.Base.App;
using Saxonite.Net.Core.Web.Base.Consoles;
using Saxonite.Net.Core.Web.Base.Models;
using Saxonite.Net.Standard.Base.App;
using Saxonite.Net.Standard.Base.Bus;
using Saxonite.Net.Standard.Base.Consoles;
using Saxonite.Net.Standard.Base.Mgr;
using Saxonite.Net.Standard.Base.Mgr.Reference;
using Saxonite.Net.Standard.Base.Mgr.Support;
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Web;
namespace Saxonite.Net.Core.Web.Base.Controllers
{
@@ -51,7 +28,7 @@ namespace Saxonite.Net.Core.Web.Base.Controllers
// Initialise console (debug) logging listener.
//if (Directory.Exists(App.LoggingRootFolder) && SaxSystem.DebugMode)
// SaxConsoleListener.ConfigureDebugListener(App.LoggingRootFolder);
if (DebugMode) SaLogger.Trace(GetType().Name + ".CTR");
if (DebugMode) SaLogger.Trace($"{GetType().Name}.CTR");
}
protected override void Dispose(bool disposing)
{
@@ -111,184 +88,6 @@ namespace Saxonite.Net.Core.Web.Base.Controllers
public SaEmailConfig EmailConfig { get { return App.EmailConfig; } }
public SaxEmailConsole EmailConsole { get { return Internals.EmailConsole; } }
//-------------------------------------------------------------------
// Action execution events.
//-------------------------------------------------------------------
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
//if (DebugMode) SaLogger.Debug(GetType().Name + ".OnActionExecuting" + (ViewData.Model != null ? " Model: " + ViewData.Model : ""));
// Refreh model properties.
SaxModel_Base baseModel = ViewData.Model as SaxModel_Base;
RefreshModel(baseModel);
base.OnActionExecuting(filterContext);
}
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
//if (DebugMode) SaLogger.Debug(GetType().Name + ".OnActionExecuted" + (ViewData.Model != null ? " Model: " + ViewData.Model : ""));
// Refreh model properties.
SaxModel_Base baseModel = ViewData.Model as SaxModel_Base;
RefreshModel(baseModel);
// Store session data if present - as potentially modfied.
if (SessionData != null)
{
// Most actions will store the session data in case it's been modified.
// Some actions (eg. score password) don't need to.
if (StoreSessionData)
{
String sessionDataJson = JsonConvert.SerializeObject(SessionData);
HttpContext.Session.Set(SessionStorage.SessionKey_SessionData, SessionStorage.sessionDataEncoding.GetBytes(sessionDataJson));
}
}
else HttpContext.Session.Remove(SessionStorage.SessionKey_SessionData);
// Response headers.
if (baseModel != null && baseModel.ProhibitCache)
{
if (Response.Headers.ContainsKey(HeaderNames.CacheControl))
Response.Headers.Remove(HeaderNames.CacheControl);
Response.Headers.Add(HeaderNames.CacheControl, "no-cache, no-store, must-revalidate");
Response.Headers.Add(HeaderNames.Pragma, "no-cache");
Response.Headers.Add(HeaderNames.Expires, "0");
}
base.OnActionExecuted(filterContext);
}
//-------------------------------------------------------------------
// Model.
//-------------------------------------------------------------------
protected void RefreshModel(SaxModel_Base model)
{
if (model == null) return;
// Session data.
model.Controller = this;
model.SessionData = SessionData;
// Redirect locations.
model.RedirectLocation.Base = GetRedirectLocation(RedirectLocation.WebAppBase);
model.RedirectLocation.Home = GetRedirectLocation(RedirectLocation.WebAppHome);
model.RedirectLocation.Home_SessionExpired = GetRedirectLocation(RedirectLocation.WebAppHome_SessionExpired);
}
//-------------------------------------------------------------------
// Parameters.
//-------------------------------------------------------------------
// Online Request Password encryption parameters (key & IV) are defined in
// the base Controller so that they can be shared with the Adnin application.
// NB IV value is generated from the key and fixed so that it doesn't change when the application restarts.
// IV Must be regenerated if key is changed.
protected static String Base64Key_RequestPassword_Online { get; } = SacsEncryptionHelper.EncodePlainKey("{~Saxonite@@Request^Password=}", SacsEncryptionHelper.KeyLength);
//private static String Base64IV_RequestPassword_Generated_Online { get; } = SacsEncryptionHelper.InitSymmetricEncryptionIV(Base64Key_RequestPassword_Online);
protected static String Base64IV_RequestPassword_Online { get; } = "1VAWYTW6d72n/6HDNhbqow==";
//-------------------------------------------------------------------
// Session.
//-------------------------------------------------------------------
private bool UserActiveRecorded { get; set; } = false;
public bool ValidUserSession
{
get
{
if (SessionData == null || !SessionData.ValidUserSession) return false;
SaxSessionDataConsole sessionDataConsole = SessionDataConsole;
if (sessionDataConsole != null && !UserActiveRecorded)
{
// Record the user as active once per request.
sessionDataConsole.RecordUserActive(SessionUserAccountId, CreatedAt);
UserActiveRecorded = true;
}
return true;
}
}
public SysId SessionUserAccountId { get { return SessionData?.User?.UserAccountId ?? null; } }
public DbUpdateInfo DbUpdateInfo { get { return SessionData?.DbUpdateInfo ?? new DbUpdateInfo(null, "", SaxSystem.ComputerName); } }
// Referrer.
public String Referer { get { return Request.Headers["Referer"].ToString(); } }
public bool ValidReferer { get { return !StringUtil.IsEmpty(Referer); } }
/// <summary>Store session data, eg. to start a new user session on sign-in.</summary>
protected bool SetSessionData(SaxSessionData sessionData)
{
if (sessionStorage.SessionData != null) return false;
sessionStorage.SessionData = sessionData;
return true;
}
protected void ClearSessionData()
{
if (HttpContext.Session.IsAvailable)
HttpContext.Session.Clear();
sessionStorage.SessionData = null;
}
//-------------------------------------------------------------------
// Session storage.
public class SessionStorage
{
public SaxSessionData SessionData { get; set; }
public static String SessionKey_SessionData { get; } = "SaxSessionData";
public static Encoding sessionDataEncoding { get; } = Encoding.UTF8;
//JSON Serialisation.
public class SaxSessionDataContractResolver : DefaultContractResolver
{
// To allow private properties to be deserialised.
// NB Only applies to top level properties in the serialised object.
protected override List<MemberInfo> GetSerializableMembers(Type objectType)
{
var flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
MemberInfo[] fields = objectType.GetFields(flags);
return fields
.Concat(objectType.GetProperties(flags).Where(propInfo => propInfo.CanWrite))
.ToList();
}
protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
{
return base.CreateProperties(type, MemberSerialization.Fields);
}
};
public static JsonSerializerSettings JsonDeserialisationSettings = new JsonSerializerSettings
{
ContractResolver = new SaxSessionDataContractResolver(),
// Force all deserialised objects to be replaced - to avoid proxy lists not populating.
ObjectCreationHandling = ObjectCreationHandling.Replace
};
}
private readonly SessionStorage sessionStorage = new SessionStorage();
protected JsonSerializerSettings SaxSessionDataJsonSerializerSettings { get { return SessionStorage.JsonDeserialisationSettings; } }
//-------------------------------------------------------------------
public SaxSessionData SessionData
{
get
{
try
{
// Retrieve session data if not already in controller.
if (sessionStorage.SessionData == null)
{
byte[] sessionDataBytes = null;
HttpContext.Session.TryGetValue(SessionStorage.SessionKey_SessionData, out sessionDataBytes);
if (sessionDataBytes != null)
{
String sessionDataJson = SessionStorage.sessionDataEncoding.GetString(sessionDataBytes);
sessionStorage.SessionData = DeserializeSessionData(sessionDataJson);
}
}
return sessionStorage.SessionData;
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".SessionData " + exc.GetType().Name + " - " + exc.Message + exc.GetStackEntries().Concat("", "\n\t"));
}
return null;
}
}
protected abstract SaxSessionData DeserializeSessionData(String sessionDataJson);
//-------------------------------------------------------------------
}
//=======================================================================
@@ -0,0 +1,225 @@
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Net.Http.Headers;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Dbas;
using Sarand.Net.Standard.Base.Helpers;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Core.Web.Base.App;
using Saxonite.Net.Core.Web.Base.Models;
using Saxonite.Net.Standard.Base.App;
using Saxonite.Net.Standard.Base.Consoles;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
namespace Saxonite.Net.Core.Web.Base.Controllers
{
//=======================================================================
public abstract class SaxController_Web : SaxController_Base
{
//-------------------------------------------------------------------
// Data members.
//-------------------------------------------------------------------
// Protected construction.
protected SaxController_Web(SaxLocaliser localiser) : base(localiser)
{
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
}
base.Dispose(disposing);
}
//-------------------------------------------------------------------
// Properties.
//-------------------------------------------------------------------
// Action execution events.
//-------------------------------------------------------------------
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
//if (DebugMode) SaLogger.Debug($"{SysUtil.Fn}" + (ViewData.Model != null ? " Model: " + ViewData.Model : ""));
// Refreh model properties.
SaxModel_Base baseModel = ViewData.Model as SaxModel_Base;
RefreshModel(baseModel);
base.OnActionExecuting(filterContext);
}
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
//if (DebugMode) SaLogger.Debug($"{SysUtil.Fn}" + (ViewData.Model != null ? " Model: " + ViewData.Model : ""));
// Refreh model properties.
SaxModel_Base baseModel = ViewData.Model as SaxModel_Base;
RefreshModel(baseModel);
// Store session data if present - as potentially modfied.
if (SessionData != null)
{
// Most actions will store the session data in case it's been modified.
// Some actions (eg. score password) don't need to.
if (StoreSessionData)
{
String sessionDataJson = JsonConvert.SerializeObject(SessionData);
HttpContext.Session.Set(SessionStorage.SessionKey_SessionData, SessionStorage.sessionDataEncoding.GetBytes(sessionDataJson));
}
}
else HttpContext.Session.Remove(SessionStorage.SessionKey_SessionData);
// Response headers.
if (baseModel != null && baseModel.ProhibitCache)
{
if (Response.Headers.ContainsKey(HeaderNames.CacheControl))
Response.Headers.Remove(HeaderNames.CacheControl);
Response.Headers.Add(HeaderNames.CacheControl, "no-cache, no-store, must-revalidate");
Response.Headers.Add(HeaderNames.Pragma, "no-cache");
Response.Headers.Add(HeaderNames.Expires, "0");
}
base.OnActionExecuted(filterContext);
}
//-------------------------------------------------------------------
// Model.
//-------------------------------------------------------------------
protected void RefreshModel(SaxModel_Base model)
{
if (model == null) return;
// Session data.
model.Controller = this;
model.SessionData = SessionData;
// Redirect locations.
model.RedirectLocation.Base = GetRedirectLocation(RedirectLocation.WebAppBase);
model.RedirectLocation.Home = GetRedirectLocation(RedirectLocation.WebAppHome);
model.RedirectLocation.Home_SessionExpired = GetRedirectLocation(RedirectLocation.WebAppHome_SessionExpired);
}
//-------------------------------------------------------------------
// Parameters.
//-------------------------------------------------------------------
// Online Request Password encryption parameters (key & IV) are defined in
// the base Controller so that they can be shared with the Adnin application.
// NB IV value is generated from the key and fixed so that it doesn't change when the application restarts.
// IV Must be regenerated if key is changed.
protected static String Base64Key_RequestPassword_Online { get; } = SacsEncryptionHelper.EncodePlainKey("{~Saxonite@@Request^Password=}", SacsEncryptionHelper.KeyLength);
//private static String Base64IV_RequestPassword_Generated_Online { get; } = SacsEncryptionHelper.InitSymmetricEncryptionIV(Base64Key_RequestPassword_Online);
protected static String Base64IV_RequestPassword_Online { get; } = "1VAWYTW6d72n/6HDNhbqow==";
//-------------------------------------------------------------------
// Session.
//-------------------------------------------------------------------
private bool UserActiveRecorded { get; set; } = false;
public bool ValidUserSession
{
get
{
if (SessionData == null || !SessionData.ValidUserSession) return false;
SaxSessionDataConsole sessionDataConsole = SessionDataConsole;
if (sessionDataConsole != null && !UserActiveRecorded)
{
// Record the user as active once per request.
sessionDataConsole.RecordUserActive(SessionUserAccountId, CreatedAt);
UserActiveRecorded = true;
}
return true;
}
}
public SysId SessionUserAccountId { get { return SessionData?.User?.UserAccountId ?? null; } }
public DbUpdateInfo DbUpdateInfo { get { return SessionData?.DbUpdateInfo ?? new DbUpdateInfo(null, "", SaxSystem.ComputerName); } }
// Referrer.
public String Referer { get { return Request.Headers["Referer"].ToString(); } }
public bool ValidReferer { get { return !StringUtil.IsEmpty(Referer); } }
/// <summary>Store session data, eg. to start a new user session on sign-in.</summary>
protected bool SetSessionData(SaxSessionData sessionData)
{
if (sessionStorage.SessionData != null) return false;
sessionStorage.SessionData = sessionData;
return true;
}
protected void ClearSessionData()
{
if (HttpContext.Session.IsAvailable)
HttpContext.Session.Clear();
sessionStorage.SessionData = null;
}
//-------------------------------------------------------------------
// Session storage.
public class SessionStorage
{
public SaxSessionData SessionData { get; set; }
public static String SessionKey_SessionData { get; } = "SaxSessionData";
public static Encoding sessionDataEncoding { get; } = Encoding.UTF8;
//JSON Serialisation.
public class SaxSessionDataContractResolver : DefaultContractResolver
{
// To allow private properties to be deserialised.
// NB Only applies to top level properties in the serialised object.
protected override List<MemberInfo> GetSerializableMembers(Type objectType)
{
var flags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic;
MemberInfo[] fields = objectType.GetFields(flags);
return fields
.Concat(objectType.GetProperties(flags).Where(propInfo => propInfo.CanWrite))
.ToList();
}
protected override IList<JsonProperty> CreateProperties(Type type, MemberSerialization memberSerialization)
{
return base.CreateProperties(type, MemberSerialization.Fields);
}
};
public static JsonSerializerSettings JsonDeserialisationSettings = new JsonSerializerSettings
{
ContractResolver = new SaxSessionDataContractResolver(),
// Force all deserialised objects to be replaced - to avoid proxy lists not populating.
ObjectCreationHandling = ObjectCreationHandling.Replace
};
}
private readonly SessionStorage sessionStorage = new SessionStorage();
protected JsonSerializerSettings SaxSessionDataJsonSerializerSettings { get { return SessionStorage.JsonDeserialisationSettings; } }
//-------------------------------------------------------------------
public SaxSessionData SessionData
{
get
{
try
{
// Retrieve session data if not already in controller.
if (sessionStorage.SessionData == null)
{
byte[] sessionDataBytes = null;
HttpContext.Session.TryGetValue(SessionStorage.SessionKey_SessionData, out sessionDataBytes);
if (sessionDataBytes != null)
{
String sessionDataJson = SessionStorage.sessionDataEncoding.GetString(sessionDataBytes);
sessionStorage.SessionData = DeserializeSessionData(sessionDataJson);
}
}
return sessionStorage.SessionData;
}
catch (Exception exc)
{
SaLogger.Warn($"{SysUtil.Fn} {exc.GetType().Name} - {exc.Message}{exc.GetStackEntries().Concat("", "\n\t")}");
}
return null;
}
}
protected abstract SaxSessionData DeserializeSessionData(String sessionDataJson);
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -12,6 +12,9 @@ using System.Text;
using System.Text.RegularExpressions;
using static Saxonite.Net.Standard.Base.App.Sax.Config.Security;
// Ignore obsolete warning on ComplexTypeModelBinder.
#pragma warning disable 0618
namespace Saxonite.Net.Core.Web.Base.Middleware
{
//=======================================================================
+9 -1
View File
@@ -215,10 +215,18 @@ namespace Saxonite.Net.Core.Web.Base.Models
//-------------------------------------------------------------------
// Display data - Dates.
public String FormatDateForDisplay(DateTime value)
{
return FormatDateForDisplay((DateTime?)value);
}
public String FormatDateForDisplay(DateTime? value)
{
return DateUtil.Format(value, "d-MMM-yy", SessionCulture);
}
public String FormatDateTimeForDisplay(DateTime value)
{
return FormatDateTimeForDisplay((DateTime?)value);
}
public String FormatDateTimeForDisplay(DateTime? value)
{
return StringUtil.TrimAll(DateUtil.Format(value, "d-MMM-yy HH:mm", SessionCulture));
}
@@ -249,7 +257,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
return "dd-M-yy";
}
}
public String FormatDateForForm(DateTime value)
public String FormatDateForForm(DateTime? value)
{
return DateUtil.Format(value, "dd-MMM-yyyy", SessionCulture);
}
@@ -66,7 +66,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
// Check USGA Country Province population.
List<SaxGolfUsgaCountry> usgaCountriesWithProvinces = new List<SaxGolfUsgaCountry>();
List<SaxGolfUsgaCountry> usgaCountriesWithNoProvinces = new List<SaxGolfUsgaCountry>();
foreach (SaxGolfUsgaCountry usgaCountry in usgaCountries.OrderBy(_ => SacsRandomHelper.GetInt32(Int32.MaxValue)))
foreach (SaxGolfUsgaCountry usgaCountry in usgaCountries.OrderBy(item => item.Priority ? 0 : 1).ThenBy(_ => SacsRandomHelper.GetInt32(Int32.MaxValue)))
{
SaxGolfUsgaProvince.Params prmUsgaProvince = new SaxGolfUsgaProvince.Params();
prmUsgaProvince.CountryIdsIncluded.Add(usgaCountry.Id);
@@ -77,7 +77,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
{
// Country has no Provinces - look them up.
List<SaxGolfUsgaDataLookup.ProvinceData> provincesData = usgaDataLookup.LookupUsgaProvincesForCountry(usgaCountry.CountryCode);
SaLogger.Info($"{SysUtil.Fn} USGA Provinces populated for {usgaCountry.CountryCode} {usgaCountry.CountryName}: {provincesData.Count}.", true);
SaLogger.Info($"{SysUtil.Fn} USGA Provinces populated for {usgaCountry.CountryCode} {usgaCountry.CountryName}" + (usgaCountry.Priority ? " [Priority]" : "") + $": {provincesData.Count}.", true);
return;
}
}
@@ -100,12 +100,12 @@ namespace Saxonite.Net.Core.Web.Base.Procs
{
SaxGolfUsgaProvince.Params prmUsgaProvince = new SaxGolfUsgaProvince.Params();
prmUsgaProvince.CountryIdsIncluded.Add(usgaCountry.Id);
List<SaxGolfUsgaProvince> usgaProvinces = internals.ReferenceGolfMgr.GetUsgaProvinceList(prmUsgaProvince).OrderBy(_ => SacsRandomHelper.GetInt32(Int32.MaxValue)).ToList();
List<SaxGolfUsgaProvince> usgaProvinces = internals.ReferenceGolfMgr.GetUsgaProvinceList(prmUsgaProvince).OrderBy(item => item.Priority ? 0 : 1).ThenBy(_ => SacsRandomHelper.GetInt32(Int32.MaxValue)).ToList();
if (usgaProvinces.Any())
{
// Refresh Country Provinces.
List<SaxGolfUsgaDataLookup.ProvinceData> provincesData = usgaDataLookup.LookupUsgaProvincesForCountry(usgaCountry.CountryCode);
SaLogger.Info($"{SysUtil.Fn} USGA Provinces refreshed for {usgaCountry.CountryCode} {usgaCountry.CountryName}: {provincesData.Count}.", true);
SaLogger.Info($"{SysUtil.Fn} USGA Provinces refreshed for {usgaCountry.CountryCode} {usgaCountry.CountryName}" + (usgaCountry.Priority ? " [Priority]" : "") + $": {provincesData.Count}.", true);
return;
}
}
@@ -124,7 +124,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
List<SaxGolfUsgaProvince> usgaProvincesWithNoFacilities = new List<SaxGolfUsgaProvince>();
SaxGolfUsgaProvince.Params prmUsgaProvince = new SaxGolfUsgaProvince.Params();
prmUsgaProvince.CountryIdsIncluded.Add(usgaCountry.Id);
foreach (SaxGolfUsgaProvince usgaProvince in internals.ReferenceGolfMgr.GetUsgaProvinceList(prmUsgaProvince).OrderBy(_ => SacsRandomHelper.GetInt32(Int32.MaxValue)))
foreach (SaxGolfUsgaProvince usgaProvince in internals.ReferenceGolfMgr.GetUsgaProvinceList(prmUsgaProvince).OrderBy(item => item.Priority ? 0 : 1).ThenBy(_ => SacsRandomHelper.GetInt32(Int32.MaxValue)))
{
SaxGolfUsgaFacility.Params prmUsgaFacility = new SaxGolfUsgaFacility.Params();
prmUsgaFacility.ProvinceIdsIncluded.Add(usgaProvince.Id);
@@ -135,7 +135,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
{
// Province has no Facilities - look up the courses.
List<SaxGolfUsgaDataLookup.CourseData> coursesData = usgaDataLookup.LookupUsgaCoursesForCountryAndProvince(usgaCountry.CountryCode, usgaProvince.ProvinceCode);
SaLogger.Info($"{SysUtil.Fn} USGA Courses populated for {usgaCountry.CountryCode} {usgaCountry.CountryName} - {usgaProvince.ProvinceCode} {usgaProvince.ProvinceName}: {coursesData.Count}.", true);
SaLogger.Info($"{SysUtil.Fn} USGA Courses populated for {usgaCountry.CountryCode} {usgaCountry.CountryName} - {usgaProvince.ProvinceCode} {usgaProvince.ProvinceName}" + (usgaProvince.Priority ? " [Priority]" : "") + $": {coursesData.Count}.", true);
return;
}
}
@@ -158,14 +158,14 @@ namespace Saxonite.Net.Core.Web.Base.Procs
{
// Refresh Courses for Province with Facilities.
List<SaxGolfUsgaDataLookup.CourseData> coursesData = usgaDataLookup.LookupUsgaCoursesForCountryAndProvince(usgaCountry.CountryCode, usgaProvince.ProvinceCode);
SaLogger.Info($"{SysUtil.Fn} USGA Courses refreshed for {usgaCountry.CountryCode} {usgaCountry.CountryName} - {usgaProvince.ProvinceCode} {usgaProvince.ProvinceName}: {coursesData.Count}.", true);
SaLogger.Info($"{SysUtil.Fn} USGA Courses refreshed for {usgaCountry.CountryCode} {usgaCountry.CountryName} - {usgaProvince.ProvinceCode} {usgaProvince.ProvinceName}" + (usgaProvince.Priority ? " [Priority]" : "") + $": {coursesData.Count}.", true);
return;
}
// Compile list of Courses for this province.
SaxGolfUsgaCourse.Params prmCourse = new SaxGolfUsgaCourse.Params();
prmCourse.ProvinceIdsIncluded.Add(usgaProvince.Id);
List<SaxGolfUsgaCourse> usgaCourses = internals.ReferenceGolfMgr.GetUsgaCourseList(prmCourse).OrderBy(_ => SacsRandomHelper.GetInt32(Int32.MaxValue)).ToList();
List<SaxGolfUsgaCourse> usgaCourses = internals.ReferenceGolfMgr.GetUsgaCourseList(prmCourse).OrderBy(item => item.Priority ? 0 : 1).ThenBy(_ => SacsRandomHelper.GetInt32(Int32.MaxValue)).ToList();
List<SaxGolfUsgaCourse> usgaCoursesWithMarkers = new List<SaxGolfUsgaCourse>();
foreach (SaxGolfUsgaCourse usgaCourse in usgaCourses)
{
@@ -175,7 +175,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
{
// Populate Markers for first course without markers.
List<SaxGolfUsgaDataLookup.MarkerData> markersData = usgaDataLookup.LookupUsgaMarkersForCourse(usgaCourse.CourseId);
SaLogger.Info($"{SysUtil.Fn} USGA Markers populated for {usgaCountry.CountryCode} {usgaCountry.CountryName} - {usgaProvince.ProvinceCode} {usgaProvince.ProvinceName} - {usgaCourse.Caption} [Id: {usgaCourse.CourseId}]: {markersData.Count}.", true);
SaLogger.Info($"{SysUtil.Fn} USGA Markers populated for {usgaCountry.CountryCode} {usgaCountry.CountryName} - {usgaProvince.ProvinceCode} {usgaProvince.ProvinceName} - {usgaCourse.Caption} [Id: {usgaCourse.CourseId}" + (usgaCourse.Priority ? ", Priority" : "") + $"]: {markersData.Count}.", true);
return;
}
else usgaCoursesWithMarkers.Add(usgaCourse);
@@ -185,7 +185,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
// Populate Markers for first course with markers.
SaxGolfUsgaCourse usgaCourse = usgaCoursesWithMarkers[0];
List<SaxGolfUsgaDataLookup.MarkerData> markersData = usgaDataLookup.LookupUsgaMarkersForCourse(usgaCourse.CourseId);
SaLogger.Info($"{SysUtil.Fn} USGA Markers refreshed for {usgaCountry.CountryCode} {usgaCountry.CountryName} - {usgaProvince.ProvinceCode} {usgaProvince.ProvinceName} - {usgaCourse.Caption} [Id: {usgaCourse.CourseId}]: {markersData.Count}.", true);
SaLogger.Info($"{SysUtil.Fn} USGA Markers refreshed for {usgaCountry.CountryCode} {usgaCountry.CountryName} - {usgaProvince.ProvinceCode} {usgaProvince.ProvinceName} - {usgaCourse.Caption} [Id: {usgaCourse.CourseId}" + (usgaCourse.Priority ? ", Priority" : "") + $"]: {markersData.Count}.", true);
return;
}
}
@@ -198,7 +198,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
if (usgaCountry != null && usgaProvince != null && usgaCountry.Id.Equals(usgaProvince.CountryId))
{
List<SaxGolfUsgaDataLookup.CourseData> coursesData = usgaDataLookup.LookupUsgaCoursesForCountryAndProvince(usgaCountry.CountryCode, usgaProvince.ProvinceCode);
SaLogger.Info($"{SysUtil.Fn} USGA Courses populated for {usgaCountry.CountryCode} {usgaCountry.CountryName} - {usgaProvince.ProvinceCode} {usgaProvince.ProvinceName}: {coursesData.Count}. [Fallback]", true);
SaLogger.Info($"{SysUtil.Fn} USGA Courses populated for {usgaCountry.CountryCode} {usgaCountry.CountryName} - {usgaProvince.ProvinceCode} {usgaProvince.ProvinceName}" + (usgaProvince.Priority ? " [Priority]" : "") + $": {coursesData.Count}. [Fallback]", true);
return;
}
}
@@ -212,7 +212,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
if (usgaCountry != null)
{
List<SaxGolfUsgaDataLookup.ProvinceData> provincesData = usgaDataLookup.LookupUsgaProvincesForCountry(usgaCountry.CountryCode);
SaLogger.Info($"{SysUtil.Fn} USGA Provinces populated for {usgaCountry.CountryCode} {usgaCountry.CountryName}: {provincesData.Count}. [Fallback]", true);
SaLogger.Info($"{SysUtil.Fn} USGA Provinces populated for {usgaCountry.CountryCode} {usgaCountry.CountryName}" + (usgaCountry.Priority ? " [Priority]" : "") + $": {provincesData.Count}. [Fallback]", true);
return;
}
}
@@ -2,6 +2,7 @@
using HtmlAgilityPack;
using MailKit;
using Microsoft.Net.Http.Headers;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Bus;
@@ -11,6 +12,7 @@ using Sarand.Net.Standard.Base.Helpers;
using Sarand.Net.Standard.Base.Net;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Standard.Base.App;
using Saxonite.Net.Standard.Base.Bus.Reference;
using Saxonite.Net.Standard.Base.Mgr.Reference;
using System;
using System.Collections.Generic;
@@ -108,8 +110,8 @@ namespace Saxonite.Net.Core.Web.Base.Procs
public SysId CourseId { get; }
public SysId MarkerId { get; set; }
public string Caption { get { return StringUtil.TrimWhitespace(StringUtil.OnBlank(Tee) + " " + StringUtil.OnBlank(HolesCaption) + " " + StringUtil.OnBlank(Gender)); } }
public short Holes { get; }
public string HolesCaption { get; }
public short Holes { get; set; }
public string HolesCaption { get; set; }
public string Tee { get; set; }
public string Gender { get; set; }
public short SlopeRating { get; set; }
@@ -117,15 +119,16 @@ namespace Saxonite.Net.Core.Web.Base.Procs
public decimal CourseRating { get; set; }
public decimal BogeyRating { get; set; }
public short Length { get; set; }
public bool IsValid()
public bool IsValid(bool ignorePar = false)
{
if (!SysId.IsValid(CourseId)) return false;
if (!SysId.IsValid(MarkerId)) return false;
// 9 hole markers do not have there own Id.
//if (!SysId.IsValid(MarkerId)) return false;
if (Holes < 1) return false;
if (StringUtil.IsBlank(Tee)) return false;
if (StringUtil.IsBlank(Gender)) return false;
if (SlopeRating == 0) return false;
if (Par == 0) return false;
if (!ignorePar && Par == 0) return false;
if (CourseRating == 0) return false;
return true;
}
@@ -240,7 +243,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
try
{
// Query countries on USGA website.
// Query Countries on USGA website.
CancellationToken cancelToken = new CancellationToken();
SacsHttpRequestData request = new SacsHttpRequestData(cancelToken) { Url = "https://ncrdb.usga.org/" };
SacsHttpResponseData response = SacsHttpClient.DoRequest(request).Result;
@@ -285,7 +288,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
countryData.CountryName = usgaCountry.Name;
countriesData.Add(countryData);
}
ReferenceGolfMgr.BulkUpdateUsgaCountries(countriesData, config.DbUpdateInfo);
ReferenceGolfMgr.BulkUpdateUsgaCountries(countriesData, DbUpdateInfo);
if (ReferenceGolfMgr.HasErrorState())
SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA countries: {ReferenceGolfMgr.ErrorStateMessage}.");
@@ -308,77 +311,95 @@ namespace Saxonite.Net.Core.Web.Base.Procs
UsgaRequestData usgaRequestData = GetUsgaRequestData();
try
using (DisposableCollection<SacsDisposable> disposableItems = new DisposableCollection<SacsDisposable>())
{
// Query countries on USGA website.
CancellationToken cancelToken = new CancellationToken();
SacsHttpRequestData request = new SacsHttpRequestData(cancelToken) { Url = "https://ncrdb.usga.org/NCRListing?handler=LoadStates" };
// Headers.
request.RequestHeaders.Add(HeaderNames.Accept, "*/*");
request.RequestHeaders.Add(HeaderNames.AcceptEncoding, "gzip, deflate, br, zstd");
request.RequestHeaders.Add(HeaderNames.AcceptLanguage, "en-GB,en;q=0.9");
request.RequestHeaders.Add(HeaderNames.DNT, "1");
request.RequestHeaders.Add(HeaderNames.Origin, "https://ncrdb.usga.org/");
request.RequestHeaders.Add("Priority", "u=1, i");
request.RequestHeaders.Add(HeaderNames.Referer, "https://ncrdb.usga.org/");
if (!StringUtil.IsBlank(usgaRequestData.RequestVerificationToken))
request.RequestHeaders.Add("Requestverificationtoken", usgaRequestData.RequestVerificationToken);
// Content.
request.FormData.Add(new KeyValuePair<string, string>("countryCode", countryCode));
request.ContentHeaders.Add(HeaderNames.ContentType, "application/x-www-form-urlencoded; charset=UTF-8");
// Request.
SacsHttpResponseData response = SacsHttpClient.DoRequest(request).Result;
String data = response.Data;
if (!StringUtil.IsBlank(response.Data))
// Retrieve and validate country.
SaxGolfUsgaCountry usgaCountry = ReferenceGolfMgr.GetUsgaCountry(new SaxGolfUsgaCountry.Params() { CountryCodeFull = countryCode });
disposableItems.Add(usgaCountry);
if (usgaCountry == null)
{
dynamic provincesJson = SacsJsonHelper.DeserializeJsonObject(response.Data);
if (provincesJson is JArray)
SaLogger.Warn($"{SysUtil.Fn} USGA Country not found for code '{countryCode}'.");
return usgaProvinces;
}
try
{
// Query Provinces for Country on USGA website.
CancellationToken cancelToken = new CancellationToken();
SacsHttpRequestData request = new SacsHttpRequestData(cancelToken) { Url = "https://ncrdb.usga.org/NCRListing?handler=LoadStates" };
// Headers.
request.RequestHeaders.Add(HeaderNames.Accept, "*/*");
request.RequestHeaders.Add(HeaderNames.AcceptEncoding, "gzip, deflate, br, zstd");
request.RequestHeaders.Add(HeaderNames.AcceptLanguage, "en-GB,en;q=0.9");
request.RequestHeaders.Add(HeaderNames.DNT, "1");
request.RequestHeaders.Add(HeaderNames.Origin, "https://ncrdb.usga.org/");
request.RequestHeaders.Add("Priority", "u=1, i");
request.RequestHeaders.Add(HeaderNames.Referer, "https://ncrdb.usga.org/");
if (!StringUtil.IsBlank(usgaRequestData.RequestVerificationToken))
request.RequestHeaders.Add("Requestverificationtoken", usgaRequestData.RequestVerificationToken);
// Content.
request.FormData.Add(new KeyValuePair<string, string>("countryCode", countryCode));
request.ContentHeaders.Add(HeaderNames.ContentType, "application/x-www-form-urlencoded; charset=UTF-8");
// Request.
SacsHttpResponseData response = SacsHttpClient.DoRequest(request).Result;
String data = response.Data;
if (!StringUtil.IsBlank(response.Data))
{
JArray provincesArray = provincesJson as JArray;
foreach (var provinceToken in provincesArray)
dynamic provincesJson = SacsJsonHelper.DeserializeJsonObject(response.Data);
if (provincesJson is JArray)
{
// Province properties.
ProvinceData provinceData = new ProvinceData();
foreach (var propertyToken in provinceToken)
JArray provincesArray = provincesJson as JArray;
foreach (var provinceToken in provincesArray)
{
if (propertyToken is JProperty)
// Province properties.
ProvinceData provinceData = new ProvinceData();
foreach (var propertyToken in provinceToken)
{
JProperty provinceProperty = propertyToken as JProperty;
String propertyName = provinceProperty.Name;
String propertyStringValue = StringUtil.TrimWhitespace(provinceProperty.Value.ToString());
if (propertyName.EqualsCI("text"))
provinceData.Name = propertyStringValue;
else if (propertyName.EqualsCI("value"))
provinceData.Code = propertyStringValue;
else if (propertyName.EqualsCI("group")) { }
else if (propertyName.EqualsCI("selected")) { }
else if (propertyName.EqualsCI("disabled")) { }
if (propertyToken is JProperty)
{
JProperty provinceProperty = propertyToken as JProperty;
String propertyName = provinceProperty.Name;
String propertyStringValue = StringUtil.TrimWhitespace(provinceProperty.Value.ToString());
if (propertyName.EqualsCI("text"))
provinceData.Name = propertyStringValue;
else if (propertyName.EqualsCI("value"))
provinceData.Code = propertyStringValue;
else if (propertyName.EqualsCI("group")) { }
else if (propertyName.EqualsCI("selected")) { }
else if (propertyName.EqualsCI("disabled")) { }
}
}
if (!StringUtil.IsBlank(provinceData.Code) && !provinceData.Code.EqualsCI("(Select)") && !StringUtil.IsBlank(provinceData.Name))
usgaProvinces.Add(provinceData);
}
if (!StringUtil.IsBlank(provinceData.Code) && !provinceData.Code.EqualsCI("(Select)") && !StringUtil.IsBlank(provinceData.Name))
usgaProvinces.Add(provinceData);
}
}
}
// Store provinces.
List<SaxReferenceGolfMgr.UsgaProvinceData> provincesData = new List<SaxReferenceGolfMgr.UsgaProvinceData>();
foreach (ProvinceData usgaProvince in usgaProvinces)
{
SaxReferenceGolfMgr.UsgaProvinceData provinceData = new SaxReferenceGolfMgr.UsgaProvinceData();
provinceData.CountryCode = countryCode;
provinceData.ProvinceCode = usgaProvince.Code;
provinceData.ProvinceName = usgaProvince.Name;
provincesData.Add(provinceData);
// Store provinces.
List<SaxReferenceGolfMgr.UsgaProvinceData> provincesData = new List<SaxReferenceGolfMgr.UsgaProvinceData>();
foreach (ProvinceData usgaProvince in usgaProvinces)
{
SaxReferenceGolfMgr.UsgaProvinceData provinceData = new SaxReferenceGolfMgr.UsgaProvinceData();
provinceData.CountryCode = countryCode;
provinceData.ProvinceCode = usgaProvince.Code;
provinceData.ProvinceName = usgaProvince.Name;
provincesData.Add(provinceData);
}
ReferenceGolfMgr.BulkUpdateUsgaProvinces(provincesData, DbUpdateInfo);
if (!ReferenceGolfMgr.HasErrorState())
{
// Provinces updates OK.
// Clear country 'priority' flag.
usgaCountry.Priority = false;
ReferenceGolfMgr.UpdateUsgaCountry(usgaCountry, DbUpdateInfo);
}
else SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA provinces: {ReferenceGolfMgr.ErrorStateMessage}.");
}
catch (Exception exc)
{
SaLogger.Warn(SysUtil.Fn + " " + ExceptionUtil.GetLogMessage(exc, $"querying USGA provinces for {countryCode}", 0));
}
ReferenceGolfMgr.BulkUpdateUsgaProvinces(provincesData, config.DbUpdateInfo);
if (ReferenceGolfMgr.HasErrorState())
SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA provinces: {ReferenceGolfMgr.ErrorStateMessage}.");
}
catch (Exception exc)
{
SaLogger.Warn(SysUtil.Fn + " " + ExceptionUtil.GetLogMessage(exc, $"querying USGA provinces for {countryCode}", 0));
}
return usgaProvinces;
}
@@ -394,179 +415,205 @@ namespace Saxonite.Net.Core.Web.Base.Procs
UsgaRequestData usgaRequestData = GetUsgaRequestData();
try
using (DisposableCollection<SacsDisposable> disposableItems = new DisposableCollection<SacsDisposable>())
{
// Query countries on USGA website.
CancellationToken cancelToken = new CancellationToken();
SacsHttpRequestData request = new SacsHttpRequestData(cancelToken) { Url = "https://ncrdb.usga.org/NCRListing?handler=LoadCourses" };
// Headers.
request.RequestHeaders.Add(HeaderNames.Accept, "*/*");
request.RequestHeaders.Add(HeaderNames.AcceptEncoding, "gzip, deflate, br, zstd");
request.RequestHeaders.Add(HeaderNames.AcceptLanguage, "en-GB,en;q=0.9");
request.RequestHeaders.Add(HeaderNames.DNT, "1");
request.RequestHeaders.Add(HeaderNames.Origin, "https://ncrdb.usga.org/");
request.RequestHeaders.Add("Priority", "u=1, i");
request.RequestHeaders.Add(HeaderNames.Referer, "https://ncrdb.usga.org/");
if (!StringUtil.IsBlank(usgaRequestData.RequestVerificationToken))
request.RequestHeaders.Add("Requestverificationtoken", usgaRequestData.RequestVerificationToken);
// Content.
request.FormData.Add(new KeyValuePair<string, string>("clubName", ""));
request.FormData.Add(new KeyValuePair<string, string>("clubCity", ""));
request.FormData.Add(new KeyValuePair<string, string>("clubState", provinceCode));
request.FormData.Add(new KeyValuePair<string, string>("clubCountry", countryCode));
request.ContentHeaders.Add(HeaderNames.ContentType, "application/x-www-form-urlencoded; charset=UTF-8");
// Request.
SacsHttpResponseData response = SacsHttpClient.DoRequest(request).Result;
String data = response.Data;
if (!StringUtil.IsBlank(response.Data))
// Retrieve and validate country.
SaxGolfUsgaCountry usgaCountry = ReferenceGolfMgr.GetUsgaCountry(new SaxGolfUsgaCountry.Params() { CountryCodeFull = countryCode });
disposableItems.Add(usgaCountry);
if (usgaCountry == null)
{
HashSet<String> UnrecognisedCourseProperties = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
dynamic coursesJson = SacsJsonHelper.DeserializeJsonObject(response.Data);
if (coursesJson is JArray)
SaLogger.Warn($"{SysUtil.Fn} USGA Country not found for code '{countryCode}'.");
return usgaCourses;
}
// Retrieve and validate province.
SaxGolfUsgaProvince usgaProvince = ReferenceGolfMgr.GetUsgaProvince(new SaxGolfUsgaProvince.Params() { ProvinceCodeFull = provinceCode });
disposableItems.Add(usgaProvince);
if (usgaProvince == null)
{
SaLogger.Warn($"{SysUtil.Fn} USGA Province not found for code '{provinceCode}'.");
return usgaCourses;
}
try
{
// Query Courses for Country & Province on USGA website.
CancellationToken cancelToken = new CancellationToken();
SacsHttpRequestData request = new SacsHttpRequestData(cancelToken) { Url = "https://ncrdb.usga.org/NCRListing?handler=LoadCourses" };
// Headers.
request.RequestHeaders.Add(HeaderNames.Accept, "*/*");
request.RequestHeaders.Add(HeaderNames.AcceptEncoding, "gzip, deflate, br, zstd");
request.RequestHeaders.Add(HeaderNames.AcceptLanguage, "en-GB,en;q=0.9");
request.RequestHeaders.Add(HeaderNames.DNT, "1");
request.RequestHeaders.Add(HeaderNames.Origin, "https://ncrdb.usga.org/");
request.RequestHeaders.Add("Priority", "u=1, i");
request.RequestHeaders.Add(HeaderNames.Referer, "https://ncrdb.usga.org/");
if (!StringUtil.IsBlank(usgaRequestData.RequestVerificationToken))
request.RequestHeaders.Add("Requestverificationtoken", usgaRequestData.RequestVerificationToken);
// Content.
request.FormData.Add(new KeyValuePair<string, string>("clubName", ""));
request.FormData.Add(new KeyValuePair<string, string>("clubCity", ""));
request.FormData.Add(new KeyValuePair<string, string>("clubState", provinceCode));
request.FormData.Add(new KeyValuePair<string, string>("clubCountry", countryCode));
request.ContentHeaders.Add(HeaderNames.ContentType, "application/x-www-form-urlencoded; charset=UTF-8");
// Request.
SacsHttpResponseData response = SacsHttpClient.DoRequest(request).Result;
String data = response.Data;
if (!StringUtil.IsBlank(response.Data))
{
JArray coursesArray = coursesJson as JArray;
foreach (var courseToken in coursesArray)
HashSet<String> UnrecognisedCourseProperties = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
dynamic coursesJson = SacsJsonHelper.DeserializeJsonObject(response.Data);
if (coursesJson is JArray)
{
// Course properties.
CourseData courseData = new CourseData();
foreach (var propertyToken in courseToken)
JArray coursesArray = coursesJson as JArray;
foreach (var courseToken in coursesArray)
{
if (propertyToken is JProperty)
// Course properties.
CourseData courseData = new CourseData();
foreach (var propertyToken in courseToken)
{
JProperty courseProperty = propertyToken as JProperty;
String propertyName = courseProperty.Name;
String propertyStringValue = StringUtil.TrimWhitespace(courseProperty.Value.ToString());
if (propertyName.EqualsCI("courseId"))
courseData.CourseId = propertyStringValue;
else if (propertyName.EqualsCI("legacyCRPCourseId"))
courseData.LegacyCrpCourseId = propertyStringValue;
else if (propertyName.EqualsCI("courseName"))
courseData.CourseName = propertyStringValue;
else if (propertyName.EqualsCI("facilityId"))
courseData.FacilityId = propertyStringValue;
else if (propertyName.EqualsCI("facilityName"))
courseData.FacilityName = propertyStringValue;
else if (propertyName.EqualsCI("fullName"))
courseData.FullName = propertyStringValue;
else if (propertyName.EqualsCI("address1"))
courseData.Address1 = propertyStringValue;
else if (propertyName.EqualsCI("address2"))
courseData.Address2 = propertyStringValue;
else if (propertyName.EqualsCI("city"))
courseData.City = propertyStringValue;
else if (propertyName.EqualsCI("entStateCode"))
courseData.EntProvinceCode = propertyStringValue;
else if (propertyName.EqualsCI("state"))
courseData.ProvinceCode = propertyStringValue;
else if (propertyName.EqualsCI("stateDisplay"))
courseData.Province = propertyStringValue;
else if (propertyName.EqualsCI("country"))
courseData.CountryCode = propertyStringValue;
else if (propertyName.EqualsCI("entCountryCode"))
courseData.EntCountryCode = propertyStringValue;
else if (propertyName.EqualsCI("email"))
courseData.Email = propertyStringValue;
else if (propertyName.EqualsCI("telephone"))
courseData.Telephone = propertyStringValue;
else if (propertyName.EqualsCI("ratings"))
if (propertyToken is JProperty)
{
if (courseProperty.Value.Count() > 0)
courseData.Ratings.Add("");
JProperty courseProperty = propertyToken as JProperty;
String propertyName = courseProperty.Name;
String propertyStringValue = StringUtil.TrimWhitespace(courseProperty.Value.ToString());
if (propertyName.EqualsCI("courseId"))
courseData.CourseId = propertyStringValue;
else if (propertyName.EqualsCI("legacyCRPCourseId"))
courseData.LegacyCrpCourseId = propertyStringValue;
else if (propertyName.EqualsCI("courseName"))
courseData.CourseName = propertyStringValue;
else if (propertyName.EqualsCI("facilityId"))
courseData.FacilityId = propertyStringValue;
else if (propertyName.EqualsCI("facilityName"))
courseData.FacilityName = propertyStringValue;
else if (propertyName.EqualsCI("fullName"))
courseData.FullName = propertyStringValue;
else if (propertyName.EqualsCI("address1"))
courseData.Address1 = propertyStringValue;
else if (propertyName.EqualsCI("address2"))
courseData.Address2 = propertyStringValue;
else if (propertyName.EqualsCI("city"))
courseData.City = propertyStringValue;
else if (propertyName.EqualsCI("entStateCode"))
courseData.EntProvinceCode = propertyStringValue;
else if (propertyName.EqualsCI("state"))
courseData.ProvinceCode = propertyStringValue;
else if (propertyName.EqualsCI("stateDisplay"))
courseData.Province = propertyStringValue;
else if (propertyName.EqualsCI("country"))
courseData.CountryCode = propertyStringValue;
else if (propertyName.EqualsCI("entCountryCode"))
courseData.EntCountryCode = propertyStringValue;
else if (propertyName.EqualsCI("email"))
courseData.Email = propertyStringValue;
else if (propertyName.EqualsCI("telephone"))
courseData.Telephone = propertyStringValue;
else if (propertyName.EqualsCI("ratings"))
{
if (courseProperty.Value.Count() > 0)
courseData.Ratings.Add("");
}
else UnrecognisedCourseProperties.Add(propertyName);
}
else UnrecognisedCourseProperties.Add(propertyName);
}
if (!StringUtil.IsBlank(courseData.CourseId) && !StringUtil.IsBlank(courseData.CourseName))
{
// Populate caption and add to list.
SetCourseCaption(courseData);
usgaCourses.Add(courseData);
}
}
if (!StringUtil.IsBlank(courseData.CourseId) && !StringUtil.IsBlank(courseData.CourseName))
{
// Populate caption and add to list.
SetCourseCaption(courseData);
usgaCourses.Add(courseData);
}
}
if (UnrecognisedCourseProperties.Any())
SaLogger.Warn(SysUtil.Fn + " Unrecognised USGA course properties: " + String.Join(", ", UnrecognisedCourseProperties));
}
if (UnrecognisedCourseProperties.Any())
SaLogger.Warn(SysUtil.Fn + " Unrecognised USGA course properties: " + String.Join(", ", UnrecognisedCourseProperties));
}
// Store countries.
Dictionary<String, SaxReferenceGolfMgr.UsgaCountryData> countriesData = new Dictionary<String, SaxReferenceGolfMgr.UsgaCountryData>();
foreach (CourseData usgaCourse in usgaCourses)
{
SaxReferenceGolfMgr.UsgaCountryData countryData = new SaxReferenceGolfMgr.UsgaCountryData();
countryData.CountryCode = usgaCourse.CountryCode;
countryData.EntCountryCode = usgaCourse.EntCountryCode;
countriesData[countryData.CountryCode] = countryData;
}
ReferenceGolfMgr.BulkUpdateUsgaCountries(countriesData.Values.ToList(), config.DbUpdateInfo);
if (ReferenceGolfMgr.HasErrorState())
SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA countries: {ReferenceGolfMgr.ErrorStateMessage}.");
// Store provinces.
Dictionary<String, SaxReferenceGolfMgr.UsgaProvinceData> provincesData = new Dictionary<String, SaxReferenceGolfMgr.UsgaProvinceData>();
foreach (CourseData usgaCourse in usgaCourses)
{
SaxReferenceGolfMgr.UsgaProvinceData provinceData = new SaxReferenceGolfMgr.UsgaProvinceData();
provinceData.CountryCode = usgaCourse.CountryCode;
provinceData.ProvinceCode = usgaCourse.ProvinceCode;
provinceData.EntProvinceCode = usgaCourse.EntProvinceCode;
provincesData[provinceData.ProvinceCode] = provinceData;
}
ReferenceGolfMgr.BulkUpdateUsgaProvinces(provincesData.Values.ToList(), config.DbUpdateInfo);
if (ReferenceGolfMgr.HasErrorState())
SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA provinces: {ReferenceGolfMgr.ErrorStateMessage}.");
// Store facilities.
Dictionary<SysId, SaxReferenceGolfMgr.UsgaFacilityData> facilitiesData = new Dictionary<SysId, SaxReferenceGolfMgr.UsgaFacilityData>();
foreach (CourseData usgaCourse in usgaCourses)
{
if (StringUtil.IsBlank(usgaCourse.FacilityId)) continue;
SaxReferenceGolfMgr.UsgaFacilityData facilityData = new SaxReferenceGolfMgr.UsgaFacilityData();
facilityData.ProvinceCode = provinceCode;
facilityData.FacilityId = StringUtil.ToSysId(usgaCourse.FacilityId);
facilityData.FacilityName = usgaCourse.FacilityName;
if (!SysId.IsValid(facilityData.FacilityId))
// Store countries.
Dictionary<String, SaxReferenceGolfMgr.UsgaCountryData> countriesData = new Dictionary<String, SaxReferenceGolfMgr.UsgaCountryData>();
foreach (CourseData usgaCourse in usgaCourses)
{
SaLogger.Warn($"{SysUtil.Fn} Invalid Facility Id for {usgaCourse.CourseName}: {usgaCourse.FacilityId}.");
continue;
SaxReferenceGolfMgr.UsgaCountryData countryData = new SaxReferenceGolfMgr.UsgaCountryData();
countryData.CountryCode = usgaCourse.CountryCode;
countryData.EntCountryCode = usgaCourse.EntCountryCode;
countriesData[countryData.CountryCode] = countryData;
}
facilitiesData[facilityData.FacilityId] = facilityData;
}
ReferenceGolfMgr.BulkUpdateUsgaFacilities(facilitiesData.Values.ToList(), config.DbUpdateInfo);
if (ReferenceGolfMgr.HasErrorState())
SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA facilities: {ReferenceGolfMgr.ErrorStateMessage}.");
ReferenceGolfMgr.BulkUpdateUsgaCountries(countriesData.Values.ToList(), DbUpdateInfo);
if (ReferenceGolfMgr.HasErrorState())
SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA countries: {ReferenceGolfMgr.ErrorStateMessage}.");
// Store courses.
Dictionary<SysId, SaxReferenceGolfMgr.UsgaCourseData> coursesData = new Dictionary<SysId, SaxReferenceGolfMgr.UsgaCourseData>();
foreach (CourseData usgaCourse in usgaCourses)
{
if (StringUtil.IsBlank(usgaCourse.CourseId)) continue;
SaxReferenceGolfMgr.UsgaCourseData courseData = new SaxReferenceGolfMgr.UsgaCourseData();
courseData.FacilityId = StringUtil.ToSysId(usgaCourse.FacilityId);
courseData.CourseId = StringUtil.ToSysId(usgaCourse.CourseId);
courseData.LegacyCrpCourseId = StringUtil.ToSysId(usgaCourse.LegacyCrpCourseId);
courseData.Caption = usgaCourse.Caption;
courseData.CourseName = usgaCourse.CourseName;
courseData.FullName = usgaCourse.FullName;
courseData.Address1 = usgaCourse.Address1;
courseData.Address2 = usgaCourse.Address2;
courseData.City = usgaCourse.City;
courseData.Email = usgaCourse.Email;
courseData.Telephone = usgaCourse.Telephone;
if (!SysId.IsValid(courseData.CourseId))
// Store provinces.
Dictionary<String, SaxReferenceGolfMgr.UsgaProvinceData> provincesData = new Dictionary<String, SaxReferenceGolfMgr.UsgaProvinceData>();
foreach (CourseData usgaCourse in usgaCourses)
{
SaLogger.Warn($"{SysUtil.Fn} Invalid Course Id for {usgaCourse.CourseName}: {usgaCourse.CourseId}.");
continue;
SaxReferenceGolfMgr.UsgaProvinceData provinceData = new SaxReferenceGolfMgr.UsgaProvinceData();
provinceData.CountryCode = usgaCourse.CountryCode;
provinceData.ProvinceCode = usgaCourse.ProvinceCode;
provinceData.EntProvinceCode = usgaCourse.EntProvinceCode;
provincesData[provinceData.ProvinceCode] = provinceData;
}
coursesData[courseData.CourseId] = courseData;
ReferenceGolfMgr.BulkUpdateUsgaProvinces(provincesData.Values.ToList(), DbUpdateInfo);
if (ReferenceGolfMgr.HasErrorState())
SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA provinces: {ReferenceGolfMgr.ErrorStateMessage}.");
// Store facilities.
Dictionary<SysId, SaxReferenceGolfMgr.UsgaFacilityData> facilitiesData = new Dictionary<SysId, SaxReferenceGolfMgr.UsgaFacilityData>();
foreach (CourseData usgaCourse in usgaCourses)
{
if (StringUtil.IsBlank(usgaCourse.FacilityId)) continue;
SaxReferenceGolfMgr.UsgaFacilityData facilityData = new SaxReferenceGolfMgr.UsgaFacilityData();
facilityData.ProvinceCode = provinceCode;
facilityData.FacilityId = StringUtil.ToSysId(usgaCourse.FacilityId);
facilityData.FacilityName = usgaCourse.FacilityName;
if (!SysId.IsValid(facilityData.FacilityId))
{
SaLogger.Warn($"{SysUtil.Fn} Invalid Facility Id for {usgaCourse.CourseName}: {usgaCourse.FacilityId}.");
continue;
}
facilitiesData[facilityData.FacilityId] = facilityData;
}
ReferenceGolfMgr.BulkUpdateUsgaFacilities(facilitiesData.Values.ToList(), DbUpdateInfo);
if (ReferenceGolfMgr.HasErrorState())
SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA facilities: {ReferenceGolfMgr.ErrorStateMessage}.");
// Store courses.
Dictionary<SysId, SaxReferenceGolfMgr.UsgaCourseData> coursesData = new Dictionary<SysId, SaxReferenceGolfMgr.UsgaCourseData>();
foreach (CourseData usgaCourse in usgaCourses)
{
if (StringUtil.IsBlank(usgaCourse.CourseId)) continue;
SaxReferenceGolfMgr.UsgaCourseData courseData = new SaxReferenceGolfMgr.UsgaCourseData();
courseData.FacilityId = StringUtil.ToSysId(usgaCourse.FacilityId);
courseData.CourseId = StringUtil.ToSysId(usgaCourse.CourseId);
courseData.LegacyCrpCourseId = StringUtil.ToSysId(usgaCourse.LegacyCrpCourseId);
courseData.Caption = usgaCourse.Caption;
courseData.CourseName = usgaCourse.CourseName;
courseData.FullName = usgaCourse.FullName;
courseData.Address1 = usgaCourse.Address1;
courseData.Address2 = usgaCourse.Address2;
courseData.City = usgaCourse.City;
courseData.Email = usgaCourse.Email;
courseData.Telephone = usgaCourse.Telephone;
if (!SysId.IsValid(courseData.CourseId))
{
SaLogger.Warn($"{SysUtil.Fn} Invalid Course Id for {usgaCourse.CourseName}: {usgaCourse.CourseId}.");
continue;
}
coursesData[courseData.CourseId] = courseData;
}
ReferenceGolfMgr.BulkUpdateUsgaCourses(coursesData.Values.ToList(), DbUpdateInfo);
if (!ReferenceGolfMgr.HasErrorState())
{
// Courses updates OK.
// Clear province 'priority' flag.
usgaProvince.Priority = false;
ReferenceGolfMgr.UpdateUsgaProvince(usgaProvince, DbUpdateInfo);
}
else SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA courses: {ReferenceGolfMgr.ErrorStateMessage}.");
}
catch (Exception exc)
{
SaLogger.Warn(SysUtil.Fn + " " + ExceptionUtil.GetLogMessage(exc, $"querying USGA courses for {countryCode}", 0));
}
ReferenceGolfMgr.BulkUpdateUsgaCourses(coursesData.Values.ToList(), config.DbUpdateInfo);
if (ReferenceGolfMgr.HasErrorState())
SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA courses: {ReferenceGolfMgr.ErrorStateMessage}.");
}
catch (Exception exc)
{
SaLogger.Warn(SysUtil.Fn + " " + ExceptionUtil.GetLogMessage(exc, $"querying USGA courses for {countryCode}", 0));
}
return usgaCourses;
}
@@ -649,196 +696,240 @@ namespace Saxonite.Net.Core.Web.Base.Procs
public int ColIdx_Length { get; set; } = -1;
}
/// <summary>
/// Class to allow markers list to be serialised as 'Markers'.
/// </summary>
private class MarkersData
{
public List<MarkerData> Markers { get; } = new List<MarkerData>();
}
/// <summary>
/// USGA Markers for course.
/// </summary>
public List<MarkerData> LookupUsgaMarkersForCourse(SysId usgaCourseId)
{
List<MarkerData> usgaMarkers = new List<MarkerData>();
if (!SysId.IsValid(usgaCourseId)) return usgaMarkers;
MarkersData markersData = new MarkersData();
if (!SysId.IsValid(usgaCourseId)) return markersData.Markers;
MarkerColumnData markerColumns = new MarkerColumnData();
try
using (DisposableCollection<SacsDisposable> disposableItems = new DisposableCollection<SacsDisposable>())
{
// Query countries on USGA website.
CancellationToken cancelToken = new CancellationToken();
SacsHttpRequestData request = new SacsHttpRequestData(cancelToken) { Url = $"https://ncrdb.usga.org/courseTeeInfo?CourseID={usgaCourseId}" };
SacsHttpResponseData response = SacsHttpClient.DoRequest(request).Result;
String data = response.Data;
if (!StringUtil.IsBlank(response.Data))
// Retrieve and validate course.
SaxGolfUsgaCourse.Params prmCourse = new SaxGolfUsgaCourse.Params();
prmCourse.CourseIdsIncluded.Add(usgaCourseId);
SaxGolfUsgaCourse usgaCourse = ReferenceGolfMgr.GetUsgaCourse(prmCourse);
disposableItems.Add(usgaCourse);
if (usgaCourse == null)
{
// Parse HTML.
HtmlDocument htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(response.Data);
SaLogger.Warn($"{SysUtil.Fn} USGA Course not found for Id '{usgaCourseId}'.");
return markersData.Markers;
}
// Locate countries list.
HtmlNode teeTableNode = htmlDoc.GetElementbyId("gvTee");
if (teeTableNode != null)
try
{
// Query course markers on USGA website.
CancellationToken cancelToken = new CancellationToken();
SacsHttpRequestData request = new SacsHttpRequestData(cancelToken) { Url = $"https://ncrdb.usga.org/courseTeeInfo?CourseID={usgaCourseId}" };
SacsHttpResponseData response = SacsHttpClient.DoRequest(request).Result;
String data = response.Data;
if (!StringUtil.IsBlank(response.Data))
{
// Identify marker columns.
int teeColumnIdx = -1;
foreach (HtmlNode teeHeaderNode in teeTableNode.SelectNodes("./tr[1]/th"))
// Parse HTML.
HtmlDocument htmlDoc = new HtmlDocument();
htmlDoc.LoadHtml(response.Data);
// Locate countries list.
HtmlNode teeTableNode = htmlDoc.GetElementbyId("gvTee");
if (teeTableNode != null)
{
teeColumnIdx++;
String headerText = StringUtil.TrimWhitespace(WebUtil.HtmlDecode(teeHeaderNode.InnerText));
if (StringUtil.IsBlank(headerText) || headerText.EqualsCI("CH"))
{
// Columns ignored.
}
else if (headerText.EqualsCI("Tee Name")) markerColumns.ColIdx_Tee = teeColumnIdx;
else if (headerText.EqualsCI("Gender")) markerColumns.ColIdx_Gender = teeColumnIdx;
else if (headerText.EqualsCI("Par")) markerColumns.ColIdx_Par = teeColumnIdx;
else if (headerText.EqualsCI("TeeId")) markerColumns.ColIdx_MarkerId = teeColumnIdx;
else if (headerText.EqualsCI("Length")) markerColumns.ColIdx_Length = teeColumnIdx;
// Specific part-course (9 holes) values.
else if (headerText.EqualsCI("RatingF9")) markerColumns.ColIdx_Front9CourseRating = teeColumnIdx;
else if (headerText.EqualsCI("RatingB9")) markerColumns.ColIdx_Back9CourseRating = teeColumnIdx;
else if (headerText.EqualsCI("Front (9)")) markerColumns.ColIdx_Front9 = teeColumnIdx;
else if (headerText.EqualsCI("Back (9)")) markerColumns.ColIdx_Back9 = teeColumnIdx;
else if (headerText.EqualsCI("Bogey Rating (F9)")) markerColumns.ColIdx_Front9BogeyRating = teeColumnIdx;
else if (headerText.EqualsCI("Bogey Rating (B9)")) markerColumns.ColIdx_Back9BogeyRating = teeColumnIdx;
else if (headerText.EqualsCI("Slope (F9)")) markerColumns.ColIdx_Front9SlopeRating = teeColumnIdx;
else if (headerText.EqualsCI("Slope (B9)")) markerColumns.ColIdx_Back9SlopeRating = teeColumnIdx;
// Less specific full-course (commonly 18 holes) values.
else if (headerText.IsMatchCI("Course Rating")) markerColumns.ColIdx_CourseRating = teeColumnIdx;
else if (headerText.IsMatchCI("Bogey Rating")) markerColumns.ColIdx_BogeyRating = teeColumnIdx;
else if (headerText.IsMatchCI("Slope Rating")) markerColumns.ColIdx_SlopeRating = teeColumnIdx;
else SaLogger.Info($"{SysUtil.Fn} Unexpected Marker column header: {headerText}");
}
foreach (HtmlNode teeRowNode in teeTableNode.SelectNodes("./tr[position()>1]"))
{
MarkerData markerData18 = new MarkerData(usgaCourseId, 18, "18");
MarkerData markerDataF9 = new MarkerData(usgaCourseId, 9, "F9");
MarkerData markerDataB9 = new MarkerData(usgaCourseId, 9, "B9");
teeColumnIdx = -1;
foreach (HtmlNode teePropertyNode in teeRowNode.SelectNodes("./td"))
// Identify marker columns.
int teeColumnIdx = -1;
foreach (HtmlNode teeHeaderNode in teeTableNode.SelectNodes("./tr[1]/th"))
{
teeColumnIdx++;
String propertyText = StringUtil.TrimWhitespace(WebUtil.HtmlDecode(teePropertyNode.InnerText));
if (markerColumns.ColIdx_Tee == teeColumnIdx)
String headerText = StringUtil.TrimWhitespace(WebUtil.HtmlDecode(teeHeaderNode.InnerText));
if (StringUtil.IsBlank(headerText) || headerText.EqualsCI("CH"))
{
markerData18.Tee = propertyText;
markerDataF9.Tee = propertyText;
markerDataB9.Tee = propertyText;
}
else if (markerColumns.ColIdx_Gender == teeColumnIdx)
{
markerData18.Gender = propertyText;
markerDataF9.Gender = propertyText;
markerDataB9.Gender = propertyText;
}
else if (markerColumns.ColIdx_Par == teeColumnIdx)
{
markerData18.Par = StringUtil.ToShort(propertyText);
}
else if (markerColumns.ColIdx_CourseRating == teeColumnIdx)
{
markerData18.CourseRating = StringUtil.ToDecimal(propertyText);
}
else if (markerColumns.ColIdx_BogeyRating == teeColumnIdx)
{
markerData18.BogeyRating = StringUtil.ToDecimal(propertyText);
}
else if (markerColumns.ColIdx_SlopeRating == teeColumnIdx)
{
markerData18.SlopeRating = StringUtil.ToShort(propertyText);
}
else if (markerColumns.ColIdx_Front9CourseRating == teeColumnIdx)
{
if (markerDataF9.CourseRating == 0)
markerDataF9.CourseRating = StringUtil.ToDecimal(propertyText);
}
else if (markerColumns.ColIdx_Back9CourseRating == teeColumnIdx)
{
if (markerDataB9.CourseRating == 0)
markerDataB9.CourseRating = StringUtil.ToDecimal(propertyText);
}
else if (markerColumns.ColIdx_Front9 == teeColumnIdx)
{
// Format: CourseRating / SlopeRating.
markerDataF9.CourseRating = StringUtil.ToDecimal(Regex.Replace(propertyText, "\\s*/.*$", ""));
markerDataF9.SlopeRating = StringUtil.ToShort(Regex.Replace(propertyText, "^.*/\\s*", ""));
}
else if (markerColumns.ColIdx_Back9 == teeColumnIdx)
{
// Format: CourseRating / SlopeRating.
markerDataB9.CourseRating = StringUtil.ToDecimal(Regex.Replace(propertyText, "\\s*/.*$", ""));
markerDataB9.SlopeRating = StringUtil.ToShort(Regex.Replace(propertyText, "^.*/\\s*", ""));
}
else if (markerColumns.ColIdx_Front9BogeyRating == teeColumnIdx)
{
markerDataF9.BogeyRating = StringUtil.ToDecimal(propertyText);
}
else if (markerColumns.ColIdx_Back9BogeyRating == teeColumnIdx)
{
markerDataB9.BogeyRating = StringUtil.ToDecimal(propertyText);
}
else if (markerColumns.ColIdx_Front9SlopeRating == teeColumnIdx)
{
if (markerDataF9.SlopeRating == 0)
markerDataF9.SlopeRating = StringUtil.ToShort(propertyText);
}
else if (markerColumns.ColIdx_Back9SlopeRating == teeColumnIdx)
{
// Back 9 Slope Rating populated with value for Front 9.
//markerDataB9.SlopeRating = StringUtil.ToInt(propertyText);
}
else if (markerColumns.ColIdx_MarkerId == teeColumnIdx)
{
markerData18.MarkerId = StringUtil.ToSysId(propertyText);
// Unclear if Tee Id is relevant to 9 holes.
//markerDataF9.MarkerId = StringUtil.ToSysId(propertyText);
//markerDataB9.MarkerId = StringUtil.ToSysId(propertyText);
}
else if (markerColumns.ColIdx_Length == teeColumnIdx)
{
markerData18.Length = StringUtil.ToShort(propertyText);
// Columns ignored.
}
else if (headerText.EqualsCI("Tee Name")) markerColumns.ColIdx_Tee = teeColumnIdx;
else if (headerText.EqualsCI("Gender")) markerColumns.ColIdx_Gender = teeColumnIdx;
else if (headerText.EqualsCI("Par")) markerColumns.ColIdx_Par = teeColumnIdx;
else if (headerText.EqualsCI("TeeId")) markerColumns.ColIdx_MarkerId = teeColumnIdx;
else if (headerText.EqualsCI("Length")) markerColumns.ColIdx_Length = teeColumnIdx;
// Specific part-course (9 holes) values.
else if (headerText.EqualsCI("RatingF9")) markerColumns.ColIdx_Front9CourseRating = teeColumnIdx;
else if (headerText.EqualsCI("RatingB9")) markerColumns.ColIdx_Back9CourseRating = teeColumnIdx;
else if (headerText.EqualsCI("Front (9)")) markerColumns.ColIdx_Front9 = teeColumnIdx;
else if (headerText.EqualsCI("Back (9)")) markerColumns.ColIdx_Back9 = teeColumnIdx;
else if (headerText.EqualsCI("Bogey Rating (F9)")) markerColumns.ColIdx_Front9BogeyRating = teeColumnIdx;
else if (headerText.EqualsCI("Bogey Rating (B9)")) markerColumns.ColIdx_Back9BogeyRating = teeColumnIdx;
else if (headerText.EqualsCI("Slope (F9)")) markerColumns.ColIdx_Front9SlopeRating = teeColumnIdx;
else if (headerText.EqualsCI("Slope (B9)")) markerColumns.ColIdx_Back9SlopeRating = teeColumnIdx;
// Less specific full-course (commonly 18 holes) values.
else if (headerText.IsMatchCI("Course Rating")) markerColumns.ColIdx_CourseRating = teeColumnIdx;
else if (headerText.IsMatchCI("Bogey Rating")) markerColumns.ColIdx_BogeyRating = teeColumnIdx;
else if (headerText.IsMatchCI("Slope Rating")) markerColumns.ColIdx_SlopeRating = teeColumnIdx;
else SaLogger.Info($"{SysUtil.Fn} Unexpected Marker column header: {headerText}");
}
foreach (HtmlNode teeRowNode in teeTableNode.SelectNodes("./tr[position()>1]"))
{
MarkerData markerData18 = new MarkerData(usgaCourseId, 18, "18");
MarkerData markerDataF9 = new MarkerData(usgaCourseId, 9, "F9");
MarkerData markerDataB9 = new MarkerData(usgaCourseId, 9, "B9");
teeColumnIdx = -1;
foreach (HtmlNode teePropertyNode in teeRowNode.SelectNodes("./td"))
{
teeColumnIdx++;
String propertyText = StringUtil.TrimWhitespace(WebUtil.HtmlDecode(teePropertyNode.InnerText));
if (markerColumns.ColIdx_Tee == teeColumnIdx)
{
markerData18.Tee = propertyText;
markerDataF9.Tee = propertyText;
markerDataB9.Tee = propertyText;
}
else if (markerColumns.ColIdx_Gender == teeColumnIdx)
{
markerData18.Gender = propertyText;
markerDataF9.Gender = propertyText;
markerDataB9.Gender = propertyText;
}
else if (markerColumns.ColIdx_Par == teeColumnIdx)
{
markerData18.Par = StringUtil.ToShort(propertyText);
if (markerData18.Par <= 50)
{
markerData18.Holes = 9;
markerData18.HolesCaption = "9";
}
}
else if (markerColumns.ColIdx_CourseRating == teeColumnIdx)
{
markerData18.CourseRating = StringUtil.ToDecimal(propertyText);
}
else if (markerColumns.ColIdx_BogeyRating == teeColumnIdx)
{
markerData18.BogeyRating = StringUtil.ToDecimal(propertyText);
}
else if (markerColumns.ColIdx_SlopeRating == teeColumnIdx)
{
markerData18.SlopeRating = StringUtil.ToShort(propertyText);
}
else if (markerColumns.ColIdx_Front9CourseRating == teeColumnIdx)
{
if (markerDataF9.CourseRating == 0)
markerDataF9.CourseRating = StringUtil.ToDecimal(propertyText);
}
else if (markerColumns.ColIdx_Back9CourseRating == teeColumnIdx)
{
if (markerDataB9.CourseRating == 0)
markerDataB9.CourseRating = StringUtil.ToDecimal(propertyText);
}
else if (markerColumns.ColIdx_Front9 == teeColumnIdx)
{
// Format: CourseRating / SlopeRating.
markerDataF9.CourseRating = StringUtil.ToDecimal(Regex.Replace(propertyText, "\\s*/.*$", ""));
markerDataF9.SlopeRating = StringUtil.ToShort(Regex.Replace(propertyText, "^.*/\\s*", ""));
}
else if (markerColumns.ColIdx_Back9 == teeColumnIdx)
{
// Format: CourseRating / SlopeRating.
markerDataB9.CourseRating = StringUtil.ToDecimal(Regex.Replace(propertyText, "\\s*/.*$", ""));
markerDataB9.SlopeRating = StringUtil.ToShort(Regex.Replace(propertyText, "^.*/\\s*", ""));
}
else if (markerColumns.ColIdx_Front9BogeyRating == teeColumnIdx)
{
markerDataF9.BogeyRating = StringUtil.ToDecimal(propertyText);
}
else if (markerColumns.ColIdx_Back9BogeyRating == teeColumnIdx)
{
markerDataB9.BogeyRating = StringUtil.ToDecimal(propertyText);
}
else if (markerColumns.ColIdx_Front9SlopeRating == teeColumnIdx)
{
if (markerDataF9.SlopeRating == 0)
markerDataF9.SlopeRating = StringUtil.ToShort(propertyText);
}
else if (markerColumns.ColIdx_Back9SlopeRating == teeColumnIdx)
{
// Back 9 Slope Rating populated with value for Front 9.
//markerDataB9.SlopeRating = StringUtil.ToInt(propertyText);
}
else if (markerColumns.ColIdx_MarkerId == teeColumnIdx)
{
markerData18.MarkerId = StringUtil.ToSysId(propertyText);
// Unclear if Tee Id is relevant to 9 holes.
//markerDataF9.MarkerId = StringUtil.ToSysId(propertyText);
//markerDataB9.MarkerId = StringUtil.ToSysId(propertyText);
}
else if (markerColumns.ColIdx_Length == teeColumnIdx)
{
markerData18.Length = StringUtil.ToShort(propertyText);
}
}
// Add valid markers to list.
if (markerData18.IsValid())
usgaMarkers.Add(markerData18);
if (markerDataF9.IsValid())
usgaMarkers.Add(markerDataF9);
if (markerDataB9.IsValid())
usgaMarkers.Add(markerDataB9);
// Front and Back 9 likely missing par values - derive from course ratings.
if (markerData18.IsValid() && markerDataF9.IsValid(true) && markerDataF9.Par == 0 && markerDataB9.IsValid(true) && markerDataB9.Par == 0)
{
decimal combined9sCourseRating = markerDataF9.CourseRating + markerDataB9.CourseRating;
markerDataF9.Par = (short)Math.Round(markerData18.Par * markerDataF9.CourseRating / combined9sCourseRating);
markerDataB9.Par = (short)(markerData18.Par - markerDataF9.Par);
}
// Add valid markers to list.
if (markerData18.IsValid())
markersData.Markers.Add(markerData18);
if (markerDataF9.IsValid())
markersData.Markers.Add(markerDataF9);
if (markerDataB9.IsValid())
markersData.Markers.Add(markerDataB9);
}
}
else SaLogger.Warn(SysUtil.Fn + " Tee table not found.");
}
// Store markers.
List<SaxReferenceGolfMgr.UsgaMarkerData> markersUpdateData = new List<SaxReferenceGolfMgr.UsgaMarkerData>();
foreach (MarkerData usgaMarker in markersData.Markers)
{
if (!SysId.IsValid(usgaMarker.CourseId)) continue;
//if (!SysId.IsValid(usgaMarker.MarkerId)) continue;
if (StringUtil.IsBlank(usgaMarker.Caption)) continue;
SaxReferenceGolfMgr.UsgaMarkerData markerData = new SaxReferenceGolfMgr.UsgaMarkerData();
markerData.CourseId = usgaMarker.CourseId;
markerData.MarkerId = usgaMarker.MarkerId;
markerData.Caption = usgaMarker.Caption;
markerData.Holes = usgaMarker.Holes;
markerData.HolesCaption = usgaMarker.HolesCaption;
markerData.Tee = usgaMarker.Tee;
markerData.Gender = usgaMarker.Gender;
markerData.SlopeRating = usgaMarker.SlopeRating;
markerData.Par = usgaMarker.Par;
markerData.CourseRating = usgaMarker.CourseRating;
markerData.BogeyRating = usgaMarker.BogeyRating;
markerData.Length = usgaMarker.Length;
markersUpdateData.Add(markerData);
}
ReferenceGolfMgr.BulkUpdateUsgaMarkers(markersUpdateData, DbUpdateInfo);
if (!ReferenceGolfMgr.HasErrorState())
{
// Courses updates OK.
// Store Marker data and clear Course 'priority' flag.
if (markersData.Markers.Any())
{
usgaCourse.MarkersData = JsonConvert.SerializeObject(markersData);
usgaCourse.Priority = false;
ReferenceGolfMgr.UpdateUsgaCourse(usgaCourse, DbUpdateInfo);
}
}
else SaLogger.Warn(SysUtil.Fn + " Tee table not found.");
else SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA markers: {ReferenceGolfMgr.ErrorStateMessage}.");
}
// Store markers.
List<SaxReferenceGolfMgr.UsgaMarkerData> markersData = new List<SaxReferenceGolfMgr.UsgaMarkerData>();
foreach (MarkerData usgaMarker in usgaMarkers)
catch (Exception exc)
{
if (!SysId.IsValid(usgaMarker.CourseId)) continue;
//if (!SysId.IsValid(usgaMarker.MarkerId)) continue;
if (StringUtil.IsBlank(usgaMarker.Caption)) continue;
SaxReferenceGolfMgr.UsgaMarkerData markerData = new SaxReferenceGolfMgr.UsgaMarkerData();
markerData.CourseId = usgaMarker.CourseId;
markerData.MarkerId = usgaMarker.MarkerId;
markerData.Caption = usgaMarker.Caption;
markerData.Holes = usgaMarker.Holes;
markerData.HolesCaption = usgaMarker.HolesCaption;
markerData.Tee = usgaMarker.Tee;
markerData.Gender = usgaMarker.Gender;
markerData.SlopeRating = usgaMarker.SlopeRating;
markerData.Par = usgaMarker.Par;
markerData.CourseRating = usgaMarker.CourseRating;
markerData.BogeyRating = usgaMarker.BogeyRating;
markerData.Length = usgaMarker.Length;
markersData.Add(markerData);
SaLogger.Warn(SysUtil.Fn + " " + ExceptionUtil.GetLogMessage(exc, $"querying USGA markers for course Id: {usgaCourseId}", 0));
}
ReferenceGolfMgr.BulkUpdateUsgaMarkers(markersData, config.DbUpdateInfo);
if (ReferenceGolfMgr.HasErrorState())
SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA markers: {ReferenceGolfMgr.ErrorStateMessage}.");
}
catch (Exception exc)
{
SaLogger.Warn(SysUtil.Fn + " " + ExceptionUtil.GetLogMessage(exc, $"querying USGA markers for course Id: {usgaCourseId}", 0));
}
return usgaMarkers;
return markersData.Markers;
}
//------------------------------------------------------------------
@@ -31,7 +31,7 @@ namespace Saxonite.Net.Core.Web.Admin.App
{
//-------------------------------------------------------------------
// Data members.
private bool generateDatabaseDefinitions = true;
private bool generateDatabaseDefinitions = false;
private bool populateRegions = false;
private Dictionary<String, SaxAppConfig> appConfigs = new Dictionary<string, SaxAppConfig>();
private Dictionary<String, SaxEmailConfig> emailConfigs = new Dictionary<string, SaxEmailConfig>();
@@ -55,7 +55,7 @@ namespace Saxonite.Net.Core.Web.Admin.App
}
catch (Exception exc)
{
SaLogger.Error(GetType().Name + ".CTR " + ExceptionUtil.GetErrorStateMessage(exc));
SaLogger.Error($"{GetType().Name}.CTR {ExceptionUtil.GetErrorStateMessage(exc)}");
throw;
}
}
@@ -1,4 +1,5 @@
using Saxonite.Net.Core.Web.Admin.App;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Core.Web.Admin.App;
using Saxonite.Net.Core.Web.Base.Consoles;
using Saxonite.Net.Standard.Base.App;
using Saxonite.Net.Standard.Base.Consoles;
@@ -58,7 +59,7 @@ namespace Saxonite.Net.Core.Web.Admin.Consoles
private Dictionary<ushort, SaxProcessConsole_Admin> processConsoles { get; } = new Dictionary<ushort, SaxProcessConsole_Admin>();
public SaxProcessConsole GetProcessConsole(SaxSessionContext sessionContext)
{
if (sessionContext == null) throw new NotSupportedException(GetType().Name + ".GetProcessConsole Session Context must be specified");
if (sessionContext == null) throw new NotSupportedException($"{SysUtil.Fn} Session Context must be specified.");
SaxProcessConsole_Admin processConsole = processConsoles.GetValueOrDefault(sessionContext.Index, null);
if (processConsole == null)
{
@@ -21,7 +21,7 @@ using System.Web;
namespace Saxonite.Net.Core.Web.Admin.Controllers
{
//=======================================================================
public class SaxController_Admin : SaxController_Base
public class SaxController_Admin : SaxController_Web
{
//-------------------------------------------------------------------
// Data members.
@@ -98,7 +98,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
userRole.KeepLoggedIn = keepLoggedIn;
userRole.LastLoginAt = DateTime.Now;
userRole.InvalidLoginCount = 0;
userRole.LastInvalidLoginAt = DateTime.MinValue;
userRole.LastInvalidLoginAt = null;
if (!AccountMgr.UpdateUserRole(userRole, DbUpdateInfo))
{
SaLogger.Warn(fn + " Failed to update Admin user role for " + userAccount.EmailAddress + ": " + AccountMgr.ErrorStateMessage);
@@ -197,7 +197,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
if (StringUtil.IsEmpty(GetRequestCookie(KeepLoggedIn.CookieName))) return;
// Clear cookie by setting expiry date in the past.
SetResponseCookie(KeepLoggedIn.CookieName, "", DateTime.Today.AddDays(-7), true);
SaLogger.Info(GetType().Name + ".ClearKeepLoggedInCookie 'Keep Logged In' cookie cleared.");
SaLogger.Info($"{SysUtil.Fn} 'Keep Logged In' cookie cleared.");
}
//-------------------------------------------------------------------
@@ -245,7 +245,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
NameValueCollection linkParams = DecryptParameters(encryptedParams, KeepLoggedIn.Base64IV, KeepLoggedIn.Base64Key);
keepLoggedInParams.UserAccountId = new SysId(StringUtil.ToInt(linkParams.Get(ParamName_KeepLoggedIn_UserAccountId)));
}
if (DebugMode) SaLogger.Info(GetType().Name + ".ExtractKeepLoggedInParams UserAccountId: " + SysId.ToString(keepLoggedInParams.UserAccountId));
if (DebugMode) SaLogger.Info($"{SysUtil.Fn} UserAccountId: " + SysId.ToString(keepLoggedInParams.UserAccountId));
return keepLoggedInParams;
}
@@ -67,6 +67,11 @@
text-align: right;
}
.sax-panel-filter .sax-content .sax-value
{
padding-top: 2px;
}
.sax-panel-filter .sax-content input[type="text"],
.sax-panel-filter .sax-content select
{
@@ -199,8 +199,8 @@
.sax-form .sax-form-control .sax-message
{
display: none;
margin-top: 8px;
padding-left: 16px;
margin-top: 4px;
padding-left: 24px;
font-size: 1.00rem;
background-position: left top;
background-repeat: no-repeat;
@@ -208,6 +208,7 @@
.sax-form .sax-form-control.sax-error .sax-message
{
min-height: 18px;
display: block;
color: #e3120b;
background-image: url("../img/icon/error-18.png");
+1 -1
View File
@@ -95,7 +95,7 @@
var items = response.items;
if (!items.length)
return $msgs.append($('<div class="sax-message">' + sax.msg.dbSchemaValid + '</div>')).fadeIn(500);
sax.debug(ah.getDbSchemaTemplate());
//sax.debug(ah.getDbSchemaTemplate());
for (let itemIdx = 0; itemIdx < items.length; itemIdx++)
$items.append(ah.populateDbSchemaItem(ah.getDbSchemaTemplate(), items[itemIdx]));
$items.slideDown(750);
@@ -21,22 +21,22 @@
od.downloadOrgData = function ()
{
sax.debug("downloadOrgData");
//sax.debug("downloadOrgData");
$('.FilterOrganisation', $frm.orgDnl).val($('.FilterOrganisation', $frm.orgFlt).val());
$('.FilterOrganisationCategory', $frm.orgDnl).val($('.FilterOrganisationCategory', $frm.orgFlt).val());
sax.debug($('.FilterOrganisationSportId', $frm.orgFlt));
sax.debug($('.FilterOrganisationSportId', $frm.orgFlt).val());
//sax.debug($('.FilterOrganisationSportId', $frm.orgFlt));
//sax.debug($('.FilterOrganisationSportId', $frm.orgFlt).val());
$('.FilterOrganisationSportId', $frm.orgDnl).val($('.FilterOrganisationSportId', $frm.orgFlt).val());
$('.FilterOrganisationRegionId', $frm.orgDnl).val($('.FilterOrganisationRegionId', $frm.orgFlt).val());
$('.FilterOrganisationStatusCategory', $frm.orgDnl).val($('.FilterOrganisationStatusCategory', $frm.orgFlt).val());
sax.debug($frm.orgDnl);
//sax.debug($frm.orgDnl);
if (!$frm.orgDnl.length) return;
$frm.orgDnl.prop('target', '_blank').prop('action', '/Organisation/Download').submit();
}
od.onDownloadOrgData = function (response)
{
sax.debug('onDownloadOrgData', response);
//sax.debug('onDownloadOrgData', response);
}
//--------------------------------------------------------------
@@ -89,7 +89,7 @@
$ctrl.cbYears.append($('<option value="' + items[itemIdx].name + '">' + items[itemIdx].name + '</option>'));
if (sax.data.logYear) $ctrl.cbYears.val(sax.data.logYear);
delete sax.data.logYear;
$ctrl.cbYears.trigger('change');
if ($ctrl.cbYears.val()) $ctrl.cbYears.trigger('change');
}
//--------------------------------------------------------------
@@ -112,6 +112,7 @@
sax.refreshControlValues(response.controlValues);
$pnl.msgs.hide().empty();
if (!response.success) return;
sax.data.logYear = $ctrl.cbYears.val();
// Months.
var items = response.months;
if (!items.length)
@@ -119,8 +120,9 @@
for (let itemIdx = 0; itemIdx < items.length; itemIdx++)
$ctrl.cbMonths.append($('<option value="' + items[itemIdx].name + '">' + items[itemIdx].name + '</option>'));
if (sax.data.logMonth) $ctrl.cbMonths.val(sax.data.logMonth);
if (!$ctrl.cbMonths.val() && items.length) $ctrl.cbMonths.val(items[0].name);
delete sax.data.logMonth;
$ctrl.cbMonths.trigger('change');
if ($ctrl.cbMonths.val()) $ctrl.cbMonths.trigger('change');
}
//--------------------------------------------------------------
@@ -137,13 +139,14 @@
}
sl.doRefreshFiles = function (response)
{
sax.debug('doRefreshFiles', response);
//sax.debug('doRefreshFiles', response);
delete sl.data.awaitingRefreshFilesResponse;
sl.clearFiles();
sax.refreshControlValues(response.controlValues);
$pnl.msgs.hide().empty();
var $items = $('.sax-panel-item-list', $pnl.results).hide().empty();
if (!response.success) return;
sax.data.logMonth = $ctrl.cbMonths.val();
// Files.
var items = response.files;
if (!items.length)
@@ -152,11 +155,11 @@
$items.append(sl.populateItem(sl.getFileTemplate(), items[itemIdx]));
$items.fadeIn(50);
}
sl.populateItem = function ($item,item)
sl.populateItem = function ($item, item)
{
if (!item) return $item;
$('.Filename', $item).text(item.name).off('click').on('click', function () { sl.getFile(item.name) });
$('.Length', $item).text(sax.formatFileSize(item.size,2));
$('.Length', $item).text(sax.formatFileSize(item.size, 2));
return $item;
}
sl.getFileTemplate = function ()
@@ -178,7 +181,7 @@
}
sl.doGetFiles = function (response)
{
sax.debug('doGetFiles', response);
//sax.debug('doGetFiles', response);
delete sl.data.awaitingGetFileResponse;
$pnl.msgs.hide().empty();
if (!response.success) return;
@@ -207,7 +210,7 @@
var opt = sax.dlgOpts();
opt.buttons[sax.dlg.btn.close] = function () { $(this).dialog('close'); };
$dlg.file= $('#dlgLogFile').dialog(opt);
$dlg.file = $('#dlgLogFile').dialog(opt);
setTimeout(sl.refreshFolders, 250);
});
@@ -50,7 +50,7 @@ namespace Saxonite.Net.Core.Web.Online.App
}
catch (Exception exc)
{
SaLogger.Error(GetType().Name + ".CTR " + ExceptionUtil.GetErrorStateMessage(exc));
SaLogger.Error($"{GetType().Name}.CTR {ExceptionUtil.GetErrorStateMessage(exc)}");
throw;
}
}
@@ -1,4 +1,5 @@
using Saxonite.Net.Core.Web.Base.Consoles;
using Sarand.Net.Standard.Base.Utils;
using Saxonite.Net.Core.Web.Base.Consoles;
using Saxonite.Net.Core.Web.Online.App;
using Saxonite.Net.Standard.Base.App;
using Saxonite.Net.Standard.Base.Consoles;
@@ -43,7 +44,7 @@ namespace Saxonite.Net.Core.Web.Online.Consoles
private readonly Dictionary<ushort, SaxDataCacheConsole_Online> dataCacheConsoles = new Dictionary<ushort, SaxDataCacheConsole_Online>();
public override SaxDataCacheConsole GetDataCacheConsole(SaxSessionContext sessionContext)
{
if (sessionContext == null) throw new NotSupportedException(GetType().Name + ".GetDataCacheConsole Session Context must be specified");
if (sessionContext == null) throw new NotSupportedException($"{SysUtil.Fn} Session Context must be specified.");
SaxDataCacheConsole_Online dataCacheConsole = dataCacheConsoles.GetValueOrDefault(sessionContext.Index, null);
if (dataCacheConsole == null)
{
@@ -57,7 +58,7 @@ namespace Saxonite.Net.Core.Web.Online.Consoles
private readonly Dictionary<ushort, SaxSessionDataConsole_Online> sessionDataConsoles = new Dictionary<ushort, SaxSessionDataConsole_Online>();
public override SaxSessionDataConsole GetSessionDataConsole(SaxSessionContext sessionContext)
{
if (sessionContext == null) throw new NotSupportedException(GetType().Name + ".GetSessionDataConsole Session Context must be specified");
if (sessionContext == null) throw new NotSupportedException($"{SysUtil.Fn} Session Context must be specified.");
SaxSessionDataConsole_Online sessionDataConsole = sessionDataConsoles.GetValueOrDefault(sessionContext.Index, null);
if (sessionDataConsole == null)
{
@@ -98,7 +98,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
data.RegionIdPrimary = model.GetEncryptedRegionId(article.RegionIdPrimary);
data.SportIdPrimary = model.GetEncryptedSportId(article.SportIdPrimary);
data.Published = DateUtil.IsValid(article.PublishedAt) ? true : (bool?)null;
data.PublishedInFuture = (data.Published == true && article.PublishedAt.CompareTo(DateTime.Today) >= 0) ? true : (bool?)null;
data.PublishedInFuture = (data.Published == true && article.PublishedAt != null && ((DateTime)article.PublishedAt).CompareTo(DateTime.Today) >= 0) ? true : (bool?)null;
data.PublishedOn_YYYYMMDD = DateUtil.Format(article.PublishedAt, "yyyyMMdd");
data.PublishedOn_Calendar = model.FormatDateForForm(article.PublishedAt);
@@ -635,7 +635,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
if (model.ArticlePublish)
article.PublishedAt = model.GetArticlePublishOn();
else
article.PublishedAt = DateTime.MinValue;
article.PublishedAt = null;
}
if (model.ArticleStatusCode != null)
article.Status = model.ArticleStatus;
@@ -21,7 +21,7 @@ using System.Web;
namespace Saxonite.Net.Core.Web.Online.Controllers
{
//=======================================================================
public class SaxController_Online : SaxController_Base
public class SaxController_Online : SaxController_Web
{
//-------------------------------------------------------------------
// Data members.
@@ -78,7 +78,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
userAccount.KeepLoggedIn = keepLoggedIn;
userAccount.LastLoginAt = DateTime.Now;
userAccount.InvalidLoginCount = 0;
userAccount.LastInvalidLoginAt = DateTime.MinValue;
//userAccount.LastInvalidLoginAt = null;
if (!AccountMgr.UpdateUserAccount(userAccount, DbUpdateInfo))
{
SaLogger.Warn(fn + " Failed to update account for " + userAccount.EmailAddress + ": " + AccountMgr.ErrorStateMessage);
@@ -227,7 +227,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
if (StringUtil.IsEmpty(GetRequestCookie(KeepLoggedIn.CookieName))) return;
// Clear cookie by setting expiry date in the past.
SetResponseCookie(KeepLoggedIn.CookieName, "", DateTime.Today.AddDays(-7), true);
SaLogger.Info(GetType().Name + ".ClearKeepLoggedInCookie 'Keep Logged In' cookie cleared.");
SaLogger.Info($"{SysUtil.Fn} 'Keep Logged In' cookie cleared.");
}
//-------------------------------------------------------------------
@@ -276,7 +276,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
NameValueCollection linkParams = DecryptParameters(encryptedParams, KeepLoggedIn.Base64IV, KeepLoggedIn.Base64Key);
keepLoggedInParams.UserAccountId = new SysId(StringUtil.ToInt(linkParams.Get(ParamName_KeepLoggedIn_UserAccountId)));
}
if (DebugMode) SaLogger.Info(GetType().Name + ".ExtractKeepLoggedInParams UserAccountId: " + SysId.ToString(keepLoggedInParams.UserAccountId));
if (DebugMode) SaLogger.Info($"{SysUtil.Fn} UserAccountId: {SysId.ToString(keepLoggedInParams.UserAccountId)}");
return keepLoggedInParams;
}
@@ -215,7 +215,7 @@
display: none;
margin-top: 4px;
padding-left: 24px;
font-size: 1.00Rem;
font-size: 1.00rem;
background-position: left top;
background-repeat: no-repeat;
}
+1 -1
View File
@@ -176,7 +176,7 @@ namespace Saxonite.Net.Standard.Base.App
public static class UsgaGolfDataLookup
{
public static bool Enabled { get; set; } = SacsSystem.DebugMode ? true : true;
public static int MinsBetweenExecution { get; set; } = SacsSystem.DebugMode ? 12 : 20;
public static int MinsBetweenExecution { get; set; } = SacsSystem.DebugMode ? 8 : 20;
public static int HoursBetweenCountryLookup { get; set; } = SacsSystem.DebugMode ? 24 : 24 * 5;
}
}
+1 -1
View File
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
//-------------------------------------------------------------------
public static class Version
{
private static String version { get; } = "1.2.11.4";
private static String version { get; } = "1.2.11.5";
// Retrieve version.
public static String GetFullVersion () { return version; }
public static String GetAppVersion ()
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Base.App
{
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Base.App
{
@@ -52,8 +52,12 @@ namespace Saxonite.Base.App
UsgaCourse_Address1,
UsgaCourse_Address2,
UsgaCourse_City,
UsgaCourse_PostalCode,
UsgaCourse_Latitude,
UsgaCourse_Longitude,
UsgaCourse_Email,
UsgaCourse_Telephone,
UsgaCourse_MarkersData,
UsgaCourse_Notes,
UsgaCourse_Flags,
UsgaCourse_Status,
@@ -67,6 +71,14 @@ namespace Saxonite.Base.App
UsgaFacility_ProvinceId,
UsgaFacility_FacilityId,
UsgaFacility_FacilityName,
UsgaFacility_Address1,
UsgaFacility_Address2,
UsgaFacility_City,
UsgaFacility_PostalCode,
UsgaFacility_Latitude,
UsgaFacility_Longitude,
UsgaFacility_Email,
UsgaFacility_Telephone,
UsgaFacility_Notes,
UsgaFacility_Flags,
UsgaFacility_Status,
@@ -117,7 +129,7 @@ namespace Saxonite.Base.App
//-------------------------------------------------------------------
// Data members.
private static readonly int tableCount = 5;
private static readonly int columnCount = 83;
private static readonly int columnCount = 95;
private static ulong maxTextLen = 0;
//-------------------------------------------------------------------
@@ -341,8 +353,12 @@ namespace Saxonite.Base.App
new ColumnDfn(2,"Address1",0,-9,false,200),
new ColumnDfn(2,"Address2",0,-9,false,200),
new ColumnDfn(2,"City",0,-9,false,200),
new ColumnDfn(2,"PostalCode",0,-9,false,20),
new ColumnDfn(2,"Latitude",8,3,false,9),
new ColumnDfn(2,"Longitude",8,3,false,9),
new ColumnDfn(2,"Email",0,-9,false,200),
new ColumnDfn(2,"Telephone",0,-9,false,200),
new ColumnDfn(2,"MarkersData",0,-9,false,0),
new ColumnDfn(2,"Notes",0,-9,false,2000),
new ColumnDfn(2,"Flags",3,5,false,5),
new ColumnDfn(2,"Status",0,12,false,3),
@@ -356,6 +372,14 @@ namespace Saxonite.Base.App
new ColumnDfn(3,"ProvinceId",5,-5,false,19),
new ColumnDfn(3,"FacilityId",5,-5,false,19),
new ColumnDfn(3,"FacilityName",0,-9,false,200),
new ColumnDfn(3,"Address1",0,-9,false,200),
new ColumnDfn(3,"Address2",0,-9,false,200),
new ColumnDfn(3,"City",0,-9,false,200),
new ColumnDfn(3,"PostalCode",0,-9,false,20),
new ColumnDfn(3,"Latitude",8,3,false,9),
new ColumnDfn(3,"Longitude",8,3,false,9),
new ColumnDfn(3,"Email",0,-9,false,200),
new ColumnDfn(3,"Telephone",0,-9,false,200),
new ColumnDfn(3,"Notes",0,-9,false,2000),
new ColumnDfn(3,"Flags",3,5,false,5),
new ColumnDfn(3,"Status",0,12,false,3),
@@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:56
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Base.App
{
@@ -201,7 +201,7 @@ namespace Saxonite.Net.Standard.Base.App
foreach (SaxRegion.Data regionData in regions)
regionCache[regionData.Id] = regionData.Clone();
regionCacheFullyPopulated = true;
//if (DebugMode) SaLogger.Debug(GetType().Name + ".PopulateRegionCache(regions) Regions populated: " + regionCache.Count);
//if (DebugMode) SaLogger.Debug($"{SysUtil.Fn}(regions) Regions populated: {regionCache.Count}.");
}
public void RefreshRegionCache()
{
@@ -217,7 +217,7 @@ namespace Saxonite.Net.Standard.Base.App
region.Dispose();
}
regionCacheFullyPopulated = true;
SaLogger.Debug(GetType().Name + ".RefreshRegionCache() Regions queried: " + regionsQueried + ". Regions in cache: " + regionCache.Count + ". Elapsed: " + DateUtil.FormatNumberOfSeconds((DateTime.Now - startedAt).TotalSeconds));
SaLogger.Debug($"{SysUtil.Fn} Regions queried: {regionsQueried}. Regions in cache: {regionCache.Count}. Elapsed: {DateUtil.FormatNumberOfSeconds((DateTime.Now - startedAt).TotalSeconds)}.");
}
private void QueryRegionsToCache(List<SysId> regionsIds)
{
@@ -236,7 +236,7 @@ namespace Saxonite.Net.Standard.Base.App
regionCache[region.Id] = region.GetData();
region.Dispose();
}
SaLogger.Debug(GetType().Name + ".QueryRegionsToCache(regionIds) Regions queried: " + regionsQueried + ". Regions in cache: " + regionCache.Count + ". Elapsed: " + DateUtil.FormatNumberOfSeconds((DateTime.Now - startedAt).TotalSeconds));
SaLogger.Debug($"{SysUtil.Fn}(regionIds) Regions queried: {regionsQueried}. Regions in cache: {regionCache.Count}. Elapsed: {DateUtil.FormatNumberOfSeconds((DateTime.Now - startedAt).TotalSeconds)}.");
}
}
public SaxRegion.Data GetRegion(SysId regionId)
@@ -269,7 +269,7 @@ namespace Saxonite.Net.Standard.Base.App
foreach (SaxSport.Data sportData in sports)
sportCache[sportData.Id] = sportData.Clone();
sportCacheFullyPopulated = true;
//if (DebugMode) SaLogger.Debug(GetType().Name + ".PopulateSportCache(sports) Sports populated: " + sportCache.Count);
//if (DebugMode) SaLogger.Debug($"{SysUtil.Fn}(sports) Sports populated: {sportCache.Count}.");
}
public void RefreshSportCache()
{
@@ -285,7 +285,7 @@ namespace Saxonite.Net.Standard.Base.App
sport.Dispose();
}
sportCacheFullyPopulated = true;
SaLogger.Debug(GetType().Name + ".RefreshSportCache() Sports queried: " + sportsQueried + ". Sports in cache: " + sportCache.Count + ". Elapsed: " + DateUtil.FormatNumberOfSeconds((DateTime.Now - startedAt).TotalSeconds));
SaLogger.Debug($"{SysUtil.Fn} Sports queried: {sportsQueried}. Sports in cache: {sportCache.Count}. Elapsed: {DateUtil.FormatNumberOfSeconds((DateTime.Now - startedAt).TotalSeconds)}.");
}
private void QuerySportsToCache(List<SysId> sportsIds)
{
@@ -304,7 +304,7 @@ namespace Saxonite.Net.Standard.Base.App
sportCache[sport.Id] = sport.GetData();
sport.Dispose();
}
SaLogger.Debug(GetType().Name + ".QuerySportsToCache(sportIds) Sports queried: " + sportsQueried + ". Sports in cache: " + sportCache.Count + ". Elapsed: " + DateUtil.FormatNumberOfSeconds((DateTime.Now - startedAt).TotalSeconds));
SaLogger.Debug($"{SysUtil.Fn}(sportIds) Sports queried: {sportsQueried}. Sports in cache: {sportCache.Count}. Elapsed: {DateUtil.FormatNumberOfSeconds((DateTime.Now - startedAt).TotalSeconds)}.");
}
}
public SaxSport.Data GetSport(SysId sportId)
@@ -165,6 +165,12 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
//-------------------------------------------------------------------
// Flags - positions 1-16 available.
public const byte Flag_Priority = 0x01;
public bool Priority
{
get { return GetFlag(Flag_Priority); }
set { SetFlag(Flag_Priority, value); }
}
//-------------------------------------------------------------------
// A s s o c i a t e d D a t a
@@ -176,10 +182,10 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
// List parameters.
public enum StatusCat
{
Any,
NotDeleted = 0,
ActiveOnly,
InactiveOnly,
NotDeleted,
Any,
DeletedOnly,
}
/// <summary>
@@ -35,6 +35,7 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
Address1,
Address2,
City,
PostalCode,
Email,
Telephone,
// Associated data.
@@ -61,8 +62,12 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
public String Address1 { get; set; } = String.Empty;
public String Address2 { get; set; } = String.Empty;
public String City { get; set; } = String.Empty;
public String PostalCode { get; set; } = String.Empty;
public Decimal? Latitude { get; set; } = null;
public Decimal? Longitude { get; set; } = null;
public String Email { get; set; } = String.Empty;
public String Telephone { get; set; } = String.Empty;
public String MarkersData { get; set; } = String.Empty;
}
//-------------------------------------------------------------------
@@ -122,6 +127,21 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
get { return data.City; }
set { CheckChanged(data.City, value); data.City = value; }
}
public String PostalCode
{
get { return data.PostalCode; }
set { CheckChanged(data.PostalCode, value); data.PostalCode = value; }
}
public decimal? Latitude
{
get { return data.Latitude; }
set { CheckChangedNullable(data.Latitude, value); data.Latitude = value; }
}
public decimal? Longitude
{
get { return data.Longitude; }
set { CheckChangedNullable(data.Longitude, value); data.Longitude = value; }
}
public String Email
{
get { return data.Email; }
@@ -132,6 +152,11 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
get { return data.Telephone; }
set { CheckChanged(data.Telephone, value); data.Telephone = value; }
}
public String MarkersData
{
get { return data.MarkersData; }
set { CheckChanged(data.MarkersData, value); data.MarkersData = value; }
}
// Population.
internal void PopulateFrom(Data data)
{
@@ -144,8 +169,12 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
Address1 = data.Address1;
Address2 = data.Address2;
City = data.City;
PostalCode = data.PostalCode;
Latitude = data.Latitude;
Longitude = data.Longitude;
Email = data.Email;
Telephone = data.Telephone;
MarkersData = data.MarkersData;
base.PopulateFrom(data);
}
public Data Clone()
@@ -170,8 +199,12 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
public ValidValue Address1 { get; set; } = ValidValue.Valid;
public ValidValue Address2 { get; set; } = ValidValue.Valid;
public ValidValue City { get; set; } = ValidValue.Valid;
public ValidValue PostalCode { get; set; } = ValidValue.Valid;
public ValidValue Latitude { get; set; } = ValidValue.Valid;
public ValidValue Longitude { get; set; } = ValidValue.Valid;
public ValidValue Email { get; set; } = ValidValue.Valid;
public ValidValue Telephone { get; set; } = ValidValue.Valid;
public ValidValue MarkersData { get; set; } = ValidValue.Valid;
}
//-------------------------------------------------------------------
@@ -268,6 +301,21 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
get { return data.City; }
set { data.City = value; }
}
public String PostalCode
{
get { return data.PostalCode; }
set { data.PostalCode = value; }
}
public decimal? Latitude
{
get { return data.Latitude; }
set { data.Latitude = value; }
}
public decimal? Longitude
{
get { return data.Longitude; }
set { data.Longitude = value; }
}
public String Email
{
get { return data.Email; }
@@ -278,9 +326,20 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
get { return data.Telephone; }
set { data.Telephone = value; }
}
public String MarkersData
{
get { return data.MarkersData; }
set { data.MarkersData = value; }
}
//-------------------------------------------------------------------
// Flags - positions 1-16 available.
public const byte Flag_Priority = 0x01;
public bool Priority
{
get { return GetFlag(Flag_Priority); }
set { SetFlag(Flag_Priority, value); }
}
//-------------------------------------------------------------------
// A s s o c i a t e d D a t a
@@ -292,10 +351,10 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
// List parameters.
public enum StatusCat
{
Any,
NotDeleted = 0,
ActiveOnly,
InactiveOnly,
NotDeleted,
Any,
DeletedOnly,
}
/// <summary>
@@ -27,6 +27,12 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
Province_Name,
FacilityId,
FacilityName,
Address1,
Address2,
City,
PostalCode,
Email,
Telephone,
// Associated data.
// Common.
Notes,
@@ -45,6 +51,14 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
public SysId ProvinceId { get; set; }
public SysId FacilityId { get; set; }
public String FacilityName { get; set; } = String.Empty;
public String Address1 { get; set; } = String.Empty;
public String Address2 { get; set; } = String.Empty;
public String City { get; set; } = String.Empty;
public String PostalCode { get; set; } = String.Empty;
public Decimal? Latitude { get; set; } = null;
public Decimal? Longitude { get; set; } = null;
public String Email { get; set; } = String.Empty;
public String Telephone { get; set; } = String.Empty;
}
//-------------------------------------------------------------------
@@ -74,12 +88,60 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
get { return data.FacilityName; }
set { CheckChanged(data.FacilityName, value); data.FacilityName = value; }
}
public String Address1
{
get { return data.Address1; }
set { CheckChanged(data.Address1, value); data.Address1 = value; }
}
public String Address2
{
get { return data.Address2; }
set { CheckChanged(data.Address2, value); data.Address2 = value; }
}
public String City
{
get { return data.City; }
set { CheckChanged(data.City, value); data.City = value; }
}
public String PostalCode
{
get { return data.PostalCode; }
set { CheckChanged(data.PostalCode, value); data.PostalCode = value; }
}
public decimal? Latitude
{
get { return data.Latitude; }
set { CheckChangedNullable(data.Latitude, value); data.Latitude = value; }
}
public decimal? Longitude
{
get { return data.Longitude; }
set { CheckChangedNullable(data.Longitude, value); data.Longitude = value; }
}
public String Email
{
get { return data.Email; }
set { CheckChanged(data.Email, value); data.Email = value; }
}
public String Telephone
{
get { return data.Telephone; }
set { CheckChanged(data.Telephone, value); data.Telephone = value; }
}
// Population.
internal void PopulateFrom(Data data)
{
ProvinceId = data.ProvinceId;
FacilityId = data.FacilityId;
FacilityName = data.FacilityName;
Address1 = data.Address1;
Address2 = data.Address2;
City = data.City;
PostalCode = data.PostalCode;
Latitude = data.Latitude;
Longitude = data.Longitude;
Email = data.Email;
Telephone = data.Telephone;
base.PopulateFrom(data);
}
public Data Clone()
@@ -98,6 +160,14 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
public ValidValue ProvinceId { get; set; } = ValidValue.Valid;
public ValidValue FacilityId { get; set; } = ValidValue.Valid;
public ValidValue FacilityName { get; set; } = ValidValue.Valid;
public ValidValue Address1 { get; set; } = ValidValue.Valid;
public ValidValue Address2 { get; set; } = ValidValue.Valid;
public ValidValue City { get; set; } = ValidValue.Valid;
public ValidValue PostalCode { get; set; } = ValidValue.Valid;
public ValidValue Latitude { get; set; } = ValidValue.Valid;
public ValidValue Longitude { get; set; } = ValidValue.Valid;
public ValidValue Email { get; set; } = ValidValue.Valid;
public ValidValue Telephone { get; set; } = ValidValue.Valid;
}
//-------------------------------------------------------------------
@@ -164,6 +234,46 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
get { return data.FacilityName; }
set { data.FacilityName = value; }
}
public String Address1
{
get { return data.Address1; }
set { data.Address1 = value; }
}
public String Address2
{
get { return data.Address2; }
set { data.Address2 = value; }
}
public String City
{
get { return data.City; }
set { data.City = value; }
}
public String PostalCode
{
get { return data.PostalCode; }
set { data.PostalCode = value; }
}
public decimal? Latitude
{
get { return data.Latitude; }
set { data.Latitude = value; }
}
public decimal? Longitude
{
get { return data.Longitude; }
set { data.Longitude = value; }
}
public String Email
{
get { return data.Email; }
set { data.Email = value; }
}
public String Telephone
{
get { return data.Telephone; }
set { data.Telephone = value; }
}
//-------------------------------------------------------------------
// Flags - positions 1-16 available.
@@ -178,10 +288,10 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
// List parameters.
public enum StatusCat
{
Any,
NotDeleted = 0,
ActiveOnly,
InactiveOnly,
NotDeleted,
Any,
DeletedOnly,
}
/// <summary>
@@ -308,10 +308,10 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
// List parameters.
public enum StatusCat
{
Any,
NotDeleted = 0,
ActiveOnly,
InactiveOnly,
NotDeleted,
Any,
DeletedOnly,
}
/// <summary>
@@ -179,6 +179,12 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
//-------------------------------------------------------------------
// Flags - positions 1-16 available.
public const byte Flag_Priority = 0x01;
public bool Priority
{
get { return GetFlag(Flag_Priority); }
set { SetFlag(Flag_Priority, value); }
}
//-------------------------------------------------------------------
// A s s o c i a t e d D a t a
@@ -190,10 +196,10 @@ namespace Saxonite.Net.Standard.Base.Bus.Reference
// List parameters.
public enum StatusCat
{
Any,
NotDeleted = 0,
ActiveOnly,
InactiveOnly,
NotDeleted,
Any,
DeletedOnly,
}
/// <summary>
@@ -71,7 +71,7 @@ namespace Saxonite.Net.Standard.Base.Bus
public SysId SportId { get; set; }
public SysId RegionId { get; set; }
public DateTime EffectiveOn { get; set; }
public DateTime ExpiresOn { get; set; }
public DateTime? ExpiresOn { get; set; } = null;
}
//-------------------------------------------------------------------
@@ -121,14 +121,14 @@ namespace Saxonite.Net.Standard.Base.Bus
data.EffectiveOn = value.Date;
}
}
public DateTime ExpiresOn
public DateTime? ExpiresOn
{
get { return data.ExpiresOn; }
set
{
// Values are restricted to whole date, ie. no time.
CheckChanged(data.ExpiresOn, value.Date);
data.ExpiresOn = value.Date;
CheckChangedNullable(data.ExpiresOn, value?.Date);
data.ExpiresOn = value?.Date;
}
}
// Population.
@@ -262,7 +262,7 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.EffectiveOn; }
set { data.EffectiveOn = value; }
}
public DateTime ExpiresOn
public DateTime? ExpiresOn
{
get { return data.ExpiresOn; }
set { data.ExpiresOn = value; }
+4 -4
View File
@@ -68,7 +68,7 @@ namespace Saxonite.Net.Standard.Base.Bus
public SysId SportIdPrimary { get; set; }
public SysId RegionIdPrimary { get; set; }
public String BodyData { get; set; } = String.Empty;
public DateTime PublishedAt { get; set; }
public DateTime? PublishedAt { get; set; } = null;
}
//-------------------------------------------------------------------
@@ -123,10 +123,10 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.BodyData; }
set { CheckChanged(data.BodyData, value); data.BodyData = value; }
}
public DateTime PublishedAt
public DateTime? PublishedAt
{
get { return data.PublishedAt; }
set { CheckChanged(data.PublishedAt, value); data.PublishedAt = value; }
set { CheckChangedNullable(data.PublishedAt, value); data.PublishedAt = value; }
}
// Population.
internal void PopulateFrom(Data data)
@@ -260,7 +260,7 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.BodyData; }
set { data.BodyData = value; }
}
public DateTime PublishedAt
public DateTime? PublishedAt
{
get { return data.PublishedAt; }
set { data.PublishedAt = value; }
+16 -16
View File
@@ -73,13 +73,13 @@ namespace Saxonite.Net.Standard.Base.Bus
public String PhoneMain { get; set; }
// Location.
public String LocationSource { get; set; }
public DateTime LocationStoredAt { get; set; }
public DateTime? LocationStoredAt { get; set; } = null;
public bool LocationUpdateRequired { get; set; }
public String LocationData { get; set; }
public String LocationFormattedAddress { get; set; }
public Decimal LocationLatitude { get; set; }
public Decimal LocationLongitude { get; set; }
public Decimal LocationAltitude { get; set; }
public Decimal? LocationLatitude { get; set; } = null;
public Decimal? LocationLongitude { get; set; } = null;
public Decimal? LocationAltitude { get; set; } = null;
}
//-------------------------------------------------------------------
@@ -166,10 +166,10 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.LocationSource; }
set { CheckChanged(data.LocationSource, value); data.LocationSource = value; }
}
public DateTime LocationStoredAt
public DateTime? LocationStoredAt
{
get { return data.LocationStoredAt; }
set { CheckChanged(data.LocationStoredAt, value); data.LocationStoredAt = value; }
set { CheckChangedNullable(data.LocationStoredAt, value); data.LocationStoredAt = value; }
}
public bool LocationUpdateRequired
{
@@ -186,20 +186,20 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.LocationFormattedAddress; }
set { CheckChanged(data.LocationFormattedAddress, value); data.LocationFormattedAddress = value; }
}
public Decimal LocationLatitude
public Decimal? LocationLatitude
{
get { return data.LocationLatitude; }
set { CheckChanged(data.LocationLatitude, value); data.LocationLatitude = value; }
set { CheckChangedNullable(data.LocationLatitude, value); data.LocationLatitude = value; }
}
public Decimal LocationLongitude
public Decimal? LocationLongitude
{
get { return data.LocationLongitude; }
set { CheckChanged(data.LocationLongitude, value); data.LocationLongitude = value; }
set { CheckChangedNullable(data.LocationLongitude, value); data.LocationLongitude = value; }
}
public Decimal LocationAltitude
public Decimal? LocationAltitude
{
get { return data.LocationAltitude; }
set { CheckChanged(data.LocationAltitude, value); data.LocationAltitude = value; }
set { CheckChangedNullable(data.LocationAltitude, value); data.LocationAltitude = value; }
}
// Population.
internal void PopulateFrom(Data data)
@@ -393,7 +393,7 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.LocationSource; }
set { data.LocationSource = value; }
}
public DateTime LocationStoredAt
public DateTime? LocationStoredAt
{
get { return data.LocationStoredAt; }
set { data.LocationStoredAt = value; }
@@ -413,17 +413,17 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.LocationFormattedAddress; }
set { data.LocationFormattedAddress = value; }
}
public Decimal LocationLatitude
public Decimal? LocationLatitude
{
get { return data.LocationLatitude; }
set { data.LocationLatitude = value; }
}
public Decimal LocationLongitude
public Decimal? LocationLongitude
{
get { return data.LocationLongitude; }
set { data.LocationLongitude = value; }
}
public Decimal LocationAltitude
public Decimal? LocationAltitude
{
get { return data.LocationAltitude; }
set { data.LocationAltitude = value; }
@@ -62,8 +62,8 @@ namespace Saxonite.Net.Standard.Base.Bus
public String Summary { get; set; } = String.Empty;
public String Details { get; set; } = String.Empty;
public String EventData { get; set; } = String.Empty;
public DateTime PublishedAt { get; set; }
public DateTime ExpiresAt { get; set; }
public DateTime? PublishedAt { get; set; } = null;
public DateTime? ExpiresAt { get; set; } = null;
}
//-------------------------------------------------------------------
@@ -118,15 +118,15 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.EventData; }
set { CheckChanged(data.EventData, value); data.EventData = value; }
}
public DateTime PublishedAt
public DateTime? PublishedAt
{
get { return data.PublishedAt; }
set { CheckChanged(data.PublishedAt, value); data.PublishedAt = value; }
set { CheckChangedNullable(data.PublishedAt, value); data.PublishedAt = value; }
}
public DateTime ExpiresAt
public DateTime? ExpiresAt
{
get { return data.ExpiresAt; }
set { CheckChanged(data.ExpiresAt, value); data.ExpiresAt = value; }
set { CheckChangedNullable(data.ExpiresAt, value); data.ExpiresAt = value; }
}
// Population.
internal void PopulateFrom(Data data)
@@ -259,12 +259,12 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.EventData; }
set { data.EventData = value; }
}
public DateTime PublishedAt
public DateTime? PublishedAt
{
get { return data.PublishedAt; }
set { data.PublishedAt = value; }
}
public DateTime ExpiresAt
public DateTime? ExpiresAt
{
get { return data.ExpiresAt; }
set { data.ExpiresAt = value; }
@@ -59,8 +59,8 @@ namespace Saxonite.Net.Standard.Base.Bus
public String Position { get; set; } = String.Empty;
public String Outline { get; set; } = String.Empty;
public String OpportunityData { get; set; } = String.Empty;
public DateTime PublishedAt { get; set; }
public DateTime ExpiresAt { get; set; }
public DateTime? PublishedAt { get; set; } = null;
public DateTime? ExpiresAt { get; set; } = null;
}
//-------------------------------------------------------------------
@@ -110,15 +110,15 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.OpportunityData; }
set { CheckChanged(data.OpportunityData, value); data.OpportunityData = value; }
}
public DateTime PublishedAt
public DateTime? PublishedAt
{
get { return data.PublishedAt; }
set { CheckChanged(data.PublishedAt, value); data.PublishedAt = value; }
set { CheckChangedNullable(data.PublishedAt, value); data.PublishedAt = value; }
}
public DateTime ExpiresAt
public DateTime? ExpiresAt
{
get { return data.ExpiresAt; }
set { CheckChanged(data.ExpiresAt, value); data.ExpiresAt = value; }
set { CheckChangedNullable(data.ExpiresAt, value); data.ExpiresAt = value; }
}
// Population.
internal void PopulateFrom(Data data)
@@ -244,12 +244,12 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.OpportunityData; }
set { data.OpportunityData = value; }
}
public DateTime PublishedAt
public DateTime? PublishedAt
{
get { return data.PublishedAt; }
set { data.PublishedAt = value; }
}
public DateTime ExpiresAt
public DateTime? ExpiresAt
{
get { return data.ExpiresAt; }
set { data.ExpiresAt = value; }
+8 -8
View File
@@ -46,8 +46,8 @@ namespace Saxonite.Net.Standard.Base.Bus
public Sax.RegionType RegionType { get; set; } = Sax.RegionType.Unknown;
public String CountryIso2Code { get; set; } = String.Empty;
public String Name { get; set; } = String.Empty;
public Decimal Latitude { get; set; }
public Decimal Longitude { get; set; }
public Decimal? Latitude { get; set; } = null;
public Decimal? Longitude { get; set; } = null;
public SysId RegionIdParent { get; set; }
}
@@ -78,15 +78,15 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.Name; }
set { CheckChanged(data.Name, value); data.Name = value; }
}
public Decimal Latitude
public Decimal? Latitude
{
get { return data.Latitude; }
set { CheckChanged(data.Latitude, value); data.Latitude = value; }
set { CheckChangedNullable(data.Latitude, value); data.Latitude = value; }
}
public Decimal Longitude
public Decimal? Longitude
{
get { return data.Longitude; }
set { CheckChanged(data.Longitude, value); data.Longitude = value; }
set { CheckChangedNullable(data.Longitude, value); data.Longitude = value; }
}
public SysId RegionIdParent
{
@@ -227,12 +227,12 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.Name; }
set { data.Name = value; }
}
public Decimal Latitude
public Decimal? Latitude
{
get { return data.Latitude; }
set { data.Latitude = value; }
}
public Decimal Longitude
public Decimal? Longitude
{
get { return data.Longitude; }
set { data.Longitude = value; }
+24 -24
View File
@@ -79,19 +79,19 @@ namespace Saxonite.Net.Standard.Base.Bus
public String PhoneMobile { get; set; } = String.Empty;
public Sax.Gender Gender { get; set; }
public String GenderOther { get; set; }
public byte DateOfBirthDay { get; set; }
public byte DateOfBirthMonth { get; set; }
public short DateOfBirthYear { get; set; }
public byte? DateOfBirthDay { get; set; } = null;
public byte? DateOfBirthMonth { get; set; } = null;
public short? DateOfBirthYear { get; set; } = null;
public SysId RegionIdCountry { get; set; }
public SysId RegionIdProvince { get; set; }
// Security.
public String PasswordHashed { get; set; } = String.Empty;
public List<String> PasswordHistory { get; } = new List<string>();
public String PasswordToken { get; set; } = String.Empty;
public DateTime PasswordChangedAt { get; set; } = DateTime.MinValue;
public DateTime? PasswordChangedAt { get; set; } = null;
// Login.
public DateTime LastLoginAt { get; set; } = DateTime.MinValue;
public DateTime LastInvalidLoginAt { get; set; } = DateTime.MinValue;
public DateTime? LastLoginAt { get; set; } = null;
public DateTime? LastInvalidLoginAt { get; set; } = null;
public short InvalidLoginCount { get; set; }
}
@@ -157,20 +157,20 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.GenderOther; }
set { CheckChanged(data.GenderOther, value); data.GenderOther = value; }
}
public byte DateOfBirthDay
public byte? DateOfBirthDay
{
get { return data.DateOfBirthDay; }
set { CheckChanged(data.DateOfBirthDay, value); data.DateOfBirthDay = value; }
set { if ((value??0) < 1) value = null; CheckChangedNullable(data.DateOfBirthDay, value); data.DateOfBirthDay = value; }
}
public byte DateOfBirthMonth
public byte? DateOfBirthMonth
{
get { return data.DateOfBirthMonth; }
set { CheckChanged(data.DateOfBirthMonth, value); data.DateOfBirthMonth = value; }
set { if ((value ?? 0) < 1) value = null; CheckChangedNullable(data.DateOfBirthMonth, value); data.DateOfBirthMonth = value; }
}
public short DateOfBirthYear
public short? DateOfBirthYear
{
get { return data.DateOfBirthYear; }
set { CheckChanged(data.DateOfBirthYear, value); data.DateOfBirthYear = value; }
set { if ((value ?? 0) < 1) value = null; CheckChangedNullable(data.DateOfBirthYear, value); data.DateOfBirthYear = value; }
}
public SysId RegionIdCountry
{
@@ -203,21 +203,21 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.PasswordToken; }
set { CheckChanged(data.PasswordToken, value); data.PasswordToken = value; }
}
public DateTime PasswordChangedAt
public DateTime? PasswordChangedAt
{
get { return data.PasswordChangedAt; }
set { CheckChanged(data.PasswordChangedAt, value); data.PasswordChangedAt = value; }
set { CheckChangedNullable(data.PasswordChangedAt, value); data.PasswordChangedAt = value; }
}
// Login.
public DateTime LastLoginAt
public DateTime? LastLoginAt
{
get { return data.LastLoginAt; }
set { CheckChanged(data.LastLoginAt, value); data.LastLoginAt = value; }
set { CheckChangedNullable(data.LastLoginAt, value); data.LastLoginAt = value; }
}
public DateTime LastInvalidLoginAt
public DateTime? LastInvalidLoginAt
{
get { return data.LastInvalidLoginAt; }
set { CheckChanged(data.LastInvalidLoginAt, value); data.LastInvalidLoginAt = value; }
set { CheckChangedNullable(data.LastInvalidLoginAt, value); data.LastInvalidLoginAt = value; }
}
public short InvalidLoginCount
{
@@ -406,17 +406,17 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.GenderOther; }
set { data.GenderOther = value; }
}
public byte DateOfBirthDay
public byte? DateOfBirthDay
{
get { return data.DateOfBirthDay; }
set { data.DateOfBirthDay = value; }
}
public byte DateOfBirthMonth
public byte? DateOfBirthMonth
{
get { return data.DateOfBirthMonth; }
set { data.DateOfBirthMonth = value; }
}
public short DateOfBirthYear
public short? DateOfBirthYear
{
get { return data.DateOfBirthYear; }
set { data.DateOfBirthYear = value; }
@@ -448,19 +448,19 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.PasswordToken; }
set { data.PasswordToken = value; }
}
public DateTime PasswordChangedAt
public DateTime ?PasswordChangedAt
{
get { return data.PasswordChangedAt; }
set { data.PasswordChangedAt = value; }
}
// Login.
public DateTime LastLoginAt
public DateTime? LastLoginAt
{
get { return data.LastLoginAt; }
set { data.LastLoginAt = value; }
}
public DateTime LastInvalidLoginAt
public DateTime? LastInvalidLoginAt
{
get { return data.LastInvalidLoginAt; }
set { data.LastInvalidLoginAt = value; }
@@ -56,12 +56,12 @@ namespace Saxonite.Net.Standard.Base.Bus
public ItemId ItemId { get; set; } = new ItemId();
public bool CurrentlyListed {get; set; }
public DateTime ListedAtFirst { get; set; }
public DateTime ListedAtLast { get; set; }
public DateTime ViewedAtFirst { get; set; }
public DateTime ViewedAtLast { get; set; }
public DateTime? ListedAtLast { get; set; } = null;
public DateTime? ViewedAtFirst { get; set; } = null;
public DateTime? ViewedAtLast { get; set; } = null;
public Sax.ActivityReaction Reaction { get; set; }
public DateTime ReactedAtFirst { get; set; }
public DateTime ReactedAtLast { get; set; }
public DateTime? ReactedAtFirst { get; set; } = null;
public DateTime? ReactedAtLast { get; set; } = null;
public String UserActivityData { get; set; }
}
@@ -97,35 +97,35 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.ListedAtFirst; }
set { CheckChanged(data.ListedAtFirst, value); data.ListedAtFirst = value; }
}
public DateTime ListedAtLast
public DateTime? ListedAtLast
{
get { return data.ListedAtLast; }
set { CheckChanged(data.ListedAtLast, value); data.ListedAtLast = value; }
set { CheckChangedNullable(data.ListedAtLast, value); data.ListedAtLast = value; }
}
public DateTime ViewedAtFirst
public DateTime? ViewedAtFirst
{
get { return data.ViewedAtFirst; }
set { CheckChanged(data.ViewedAtFirst, value); data.ViewedAtFirst = value; }
set { CheckChangedNullable(data.ViewedAtFirst, value); data.ViewedAtFirst = value; }
}
public DateTime ViewedAtLast
public DateTime? ViewedAtLast
{
get { return data.ViewedAtLast; }
set { CheckChanged(data.ViewedAtLast, value); data.ViewedAtLast = value; }
set { CheckChangedNullable(data.ViewedAtLast, value); data.ViewedAtLast = value; }
}
public Sax.ActivityReaction Reaction
{
get { return data.Reaction; }
set { CheckChanged((int)data.Reaction, (int)value); data.Reaction = value; }
}
public DateTime ReactedAtFirst
public DateTime? ReactedAtFirst
{
get { return data.ReactedAtFirst; }
set { CheckChanged(data.ReactedAtFirst, value); data.ReactedAtFirst = value; }
set { CheckChangedNullable(data.ReactedAtFirst, value); data.ReactedAtFirst = value; }
}
public DateTime ReactedAtLast
public DateTime? ReactedAtLast
{
get { return data.ReactedAtLast; }
set { CheckChanged(data.ReactedAtLast, value); data.ReactedAtLast = value; }
set { CheckChangedNullable(data.ReactedAtLast, value); data.ReactedAtLast = value; }
}
public String UserActivityData
{
@@ -248,17 +248,17 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.ListedAtFirst; }
set { data.ListedAtFirst = value; }
}
public DateTime ListedAtLast
public DateTime? ListedAtLast
{
get { return data.ListedAtLast; }
set { data.ListedAtLast = value; }
}
public DateTime ViewedAtFirst
public DateTime? ViewedAtFirst
{
get { return data.ViewedAtFirst; }
set { data.ViewedAtFirst = value; }
}
public DateTime ViewedAtLast
public DateTime? ViewedAtLast
{
get { return data.ViewedAtLast; }
set { data.ViewedAtLast = value; }
@@ -268,12 +268,12 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.Reaction; }
set { data.Reaction = value; }
}
public DateTime ReactedAtFirst
public DateTime? ReactedAtFirst
{
get { return data.ReactedAtFirst; }
set { data.ReactedAtFirst = value; }
}
public DateTime ReactedAtLast
public DateTime? ReactedAtLast
{
get { return data.ReactedAtLast; }
set { data.ReactedAtLast = value; }
@@ -58,7 +58,7 @@ namespace Saxonite.Net.Standard.Base.Bus
public SysId RegionId { get; set; }
public String Info { get; set; }
public Sax.EligibilityType EligibilityType { get; set; }
public DateTime ExpiresOn { get; set; } = DateTime.MinValue;
public DateTime? ExpiresOn { get; set; } = null;
}
//-------------------------------------------------------------------
@@ -93,10 +93,10 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.Info; }
set { CheckChanged(data.Info, value); data.Info = value; }
}
public DateTime ExpiresOn
public DateTime? ExpiresOn
{
get { return data.ExpiresOn; }
set { CheckChanged(data.ExpiresOn, value); data.ExpiresOn = value; }
set { CheckChangedNullable(data.ExpiresOn, value); data.ExpiresOn = value; }
}
// Population.
internal void PopulateFrom(Data data)
@@ -254,7 +254,7 @@ namespace Saxonite.Net.Standard.Base.Bus
set { data.Info = value; }
}
public DateTime ExpiresOn
public DateTime? ExpiresOn
{
get { return data.ExpiresOn; }
set { data.ExpiresOn = value; }
+12 -12
View File
@@ -51,9 +51,9 @@ namespace Saxonite.Net.Standard.Base.Bus
public SysId UserAccountId { get; set; }
public Sax.UserRole UserRole { get; set; }
// Login.
public DateTime LastLoginAt { get; set; } = DateTime.MinValue;
public DateTime LastInvalidLoginAt { get; set; } = DateTime.MinValue;
public short InvalidLoginCount { get; set; }
public DateTime? LastLoginAt { get; set; } = null;
public DateTime? LastInvalidLoginAt { get; set; } = null;
public short? InvalidLoginCount { get; set; } = null;
}
//-------------------------------------------------------------------
@@ -79,20 +79,20 @@ namespace Saxonite.Net.Standard.Base.Bus
set { CheckChanged((int)data.UserRole, (int)value); data.UserRole = value; }
}
// Login.
public DateTime LastLoginAt
public DateTime? LastLoginAt
{
get { return data.LastLoginAt; }
set { CheckChanged(data.LastLoginAt, value); data.LastLoginAt = value; }
set { CheckChangedNullable(data.LastLoginAt, value); data.LastLoginAt = value; }
}
public DateTime LastInvalidLoginAt
public DateTime? LastInvalidLoginAt
{
get { return data.LastInvalidLoginAt; }
set { CheckChanged(data.LastInvalidLoginAt, value); data.LastInvalidLoginAt = value; }
set { CheckChangedNullable(data.LastInvalidLoginAt, value); data.LastInvalidLoginAt = value; }
}
public short InvalidLoginCount
public short? InvalidLoginCount
{
get { return data.InvalidLoginCount; }
set { CheckChanged(data.InvalidLoginCount, value); data.InvalidLoginCount = value; }
set { CheckChangedNullable(data.InvalidLoginCount, value); data.InvalidLoginCount = value; }
}
// Population.
internal void PopulateFrom(Data data)
@@ -199,17 +199,17 @@ namespace Saxonite.Net.Standard.Base.Bus
}
// Login - Admin application for System Admin role.
public DateTime LastLoginAt
public DateTime? LastLoginAt
{
get { return data.LastLoginAt; }
set { data.LastLoginAt = value; }
}
public DateTime LastInvalidLoginAt
public DateTime? LastInvalidLoginAt
{
get { return data.LastInvalidLoginAt; }
set { data.LastInvalidLoginAt = value; }
}
public short InvalidLoginCount
public short? InvalidLoginCount
{
get { return data.InvalidLoginCount; }
set { data.InvalidLoginCount = value; }
@@ -60,7 +60,7 @@ namespace Saxonite.Net.Standard.Base.Bus
{
public SysId UserSportId { get; set; }
public DateTime PeriodFrom { get; set; }
public DateTime PeriodTo { get; set; }
public DateTime? PeriodTo { get; set; }
public SysId OrganisationId { get; set; }
public String OrganisationName { get; set; }
public String Summary { get; set; }
@@ -96,10 +96,10 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.PeriodFrom; }
set { CheckChanged(data.PeriodFrom, value); data.PeriodFrom = value; }
}
public DateTime PeriodTo
public DateTime? PeriodTo
{
get { return data.PeriodTo; }
set { CheckChanged(data.PeriodTo, value); data.PeriodTo = value; }
set { CheckChangedNullable(data.PeriodTo, value); data.PeriodTo = value; }
}
public SysId OrganisationId
{
@@ -277,7 +277,7 @@ namespace Saxonite.Net.Standard.Base.Bus
get { return data.PeriodFrom; }
set { data.PeriodFrom = value; }
}
public DateTime PeriodTo
public DateTime? PeriodTo
{
get { return data.PeriodTo; }
set { data.PeriodTo = value; }
@@ -165,7 +165,7 @@ namespace Saxonite.Net.Standard.Base.Consoles
indexData.OrganisationIdOwner = article.OrganisationId;
indexData.SportIds.Add(article.SportIdPrimary);
indexData.RegionIds.Add(article.RegionIdPrimary);
indexData.EffectiveOn = DateUtil.OnInvalid(article.PublishedAt.Date, article.CreateStamp.On.Date);
indexData.EffectiveOn = DateUtil.OnInvalid(article.PublishedAt?.Date, article.CreateStamp.On.Date);
return StoreActivityIndexData(indexData, dbUpdateInfo);
}
return ClearActivityIndex(article.GetItemId(), dbUpdateInfo);
@@ -193,8 +193,8 @@ namespace Saxonite.Net.Standard.Base.Consoles
indexData.OrganisationIdOwner = organisationEvent.OrganisationId;
indexData.SportIds.Add(organisationEvent.SportIdPrimary);
indexData.RegionIds.Add(organisationEvent.RegionIdCountry);
indexData.EffectiveOn = DateUtil.OnInvalid(organisationEvent.PublishedAt.Date, organisationEvent.CreateStamp.On.Date);
indexData.ExpiresOn = DateUtil.OnInvalid(organisationEvent.ExpiresAt.Date, DateUtil.IncrementDate(indexData.EffectiveOn, 7));
indexData.EffectiveOn = DateUtil.OnInvalid(organisationEvent.PublishedAt?.Date, organisationEvent.CreateStamp.On.Date);
indexData.ExpiresOn = DateUtil.OnInvalid(organisationEvent.ExpiresAt?.Date, DateUtil.IncrementDate(indexData.EffectiveOn, 7));
return StoreActivityIndexData(indexData, dbUpdateInfo);
}
public bool ClearActivityIndex(SaxOrganisationEvent organisationEvent, DbUpdateInfo dbUpdateInfo)
@@ -220,8 +220,8 @@ namespace Saxonite.Net.Standard.Base.Consoles
indexData.OrganisationIdOwner = opportunity.OrganisationId;
indexData.SportIds.Add(opportunity.SportIdPrimary);
indexData.RegionIds.Add(opportunity.RegionIdPrimary);
indexData.EffectiveOn = DateUtil.OnInvalid(opportunity.PublishedAt.Date, opportunity.CreateStamp.On.Date);
indexData.ExpiresOn = DateUtil.OnInvalid(opportunity.ExpiresAt.Date, DateUtil.IncrementDate(indexData.EffectiveOn, 28));
indexData.EffectiveOn = DateUtil.OnInvalid(opportunity.PublishedAt?.Date, opportunity.CreateStamp.On.Date);
indexData.ExpiresOn = DateUtil.OnInvalid(opportunity.ExpiresAt?.Date, DateUtil.IncrementDate(indexData.EffectiveOn, 28));
return StoreActivityIndexData(indexData, dbUpdateInfo);
}
public bool ClearActivityIndex(SaxOrganisationOpportunity opportunity, DbUpdateInfo dbUpdateInfo)
@@ -274,7 +274,7 @@ namespace Saxonite.Net.Standard.Base.Consoles
public SysId SportId { get; }
public SysId RegionId { get; }
public DateTime EffectiveOn { get; }
public DateTime ExpiresOn { get; }
public DateTime? ExpiresOn { get; }
public bool IsValid()
{
if (!ItemId.IsValid(ItemId)) return false;
@@ -109,6 +109,12 @@ namespace Saxonite.Net.Standard.Base.Mgr.Reference
errField.City = SacsHierarchyItem.ValidValue.Invalid;
return false;
}
// Postal Code.
if (errField.PostalCode != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.PostalCode, "postal code", (long)SaxDbDfn_Reference.GetColTextLen(SaxDbDfn_Reference.ColumnIdx.UsgaCourse_PostalCode)))
{
errField.PostalCode = SacsHierarchyItem.ValidValue.Invalid;
return false;
}
// Email.
if (errField.Email != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Email, "email", (long)SaxDbDfn_Reference.GetColTextLen(SaxDbDfn_Reference.ColumnIdx.UsgaCourse_Email)))
{
@@ -184,14 +190,15 @@ namespace Saxonite.Net.Standard.Base.Mgr.Reference
public SysId FacilityId { get; set; }
public SysId CourseId { get; set; }
public SysId LegacyCrpCourseId { get; set; }
public string Caption { get; set; }
public string CourseName { get; set; }
public string FullName { get; set; }
public string Address1 { get; set; }
public string Address2 { get; set; }
public string City { get; set; }
public string Email { get; set; }
public string Telephone { get; set; }
public string Caption { get; set; } = null;
public string CourseName { get; set; } = null;
public string FullName { get; set; } = null;
public string Address1 { get; set; } = null;
public string Address2 { get; set; } = null;
public string City { get; set; } = null;
public string PostalCode { get; set; } = null;
public string Email { get; set; } = null;
public string Telephone { get; set; } = null;
}
/// <summary>
/// Bulk update USGA Courses.
@@ -142,6 +142,12 @@ namespace Saxonite.Net.Standard.Base.Mgr.Reference
public String ProvinceCode { get; set; }
public SysId FacilityId { get; set; }
public String FacilityName { get; set; } = null;
public string Address1 { get; set; } = null;
public string Address2 { get; set; } = null;
public string City { get; set; } = null;
public string PostalCode { get; set; } = null;
public string Email { get; set; } = null;
public string Telephone { get; set; } = null;
}
/// <summary>
/// Bulk update USGA Facilities.
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -50,6 +50,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
"ItemType",
"ItemId",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -23,10 +23,10 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnDataInt64 _ItemId { get; } = new ColumnDataInt64("ItemId");
public ColumnDataInt32 _SportId { get; } = new ColumnDataInt32("SportId");
public ColumnDataInt32 _RegionId { get; } = new ColumnDataInt32("RegionId");
public ColumnDataInt32 _UserAccountIdOwner { get; } = new ColumnDataInt32("UserAccountIdOwner");
public ColumnDataInt32 _OrganisationIdOwner { get; } = new ColumnDataInt32("OrganisationIdOwner");
public ColumnDataInt32Nullable _UserAccountIdOwner { get; } = new ColumnDataInt32Nullable("UserAccountIdOwner");
public ColumnDataInt32Nullable _OrganisationIdOwner { get; } = new ColumnDataInt32Nullable("OrganisationIdOwner");
public ColumnDataDateTime _EffectiveOn { get; } = new ColumnDataDateTime("EffectiveOn");
public ColumnDataDateTime _ExpiresOn { get; } = new ColumnDataDateTime("ExpiresOn");
public ColumnDataDateTimeNullable _ExpiresOn { get; } = new ColumnDataDateTimeNullable("ExpiresOn");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
@@ -70,6 +70,12 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
"SportId",
"RegionId",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"UserAccountIdOwner",
"OrganisationIdOwner",
"ExpiresOn",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -97,10 +103,10 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public Int64 _ItemId { get { return Cols._ItemId.Value; } set { Cols._ItemId.Value = value; } }
public Int32 _SportId { get { return Cols._SportId.Value; } set { Cols._SportId.Value = value; } }
public Int32 _RegionId { get { return Cols._RegionId.Value; } set { Cols._RegionId.Value = value; } }
public Int32 _UserAccountIdOwner { get { return Cols._UserAccountIdOwner.Value; } set { Cols._UserAccountIdOwner.Value = value; } }
public Int32 _OrganisationIdOwner { get { return Cols._OrganisationIdOwner.Value; } set { Cols._OrganisationIdOwner.Value = value; } }
public Int32? _UserAccountIdOwner { get { return Cols._UserAccountIdOwner.Value; } set { Cols._UserAccountIdOwner.Value = value; } }
public Int32? _OrganisationIdOwner { get { return Cols._OrganisationIdOwner.Value; } set { Cols._OrganisationIdOwner.Value = value; } }
public DateTime _EffectiveOn { get { return Cols._EffectiveOn.Value; } set { Cols._EffectiveOn.Value = value; } }
public DateTime _ExpiresOn { get { return Cols._ExpiresOn.Value; } set { Cols._ExpiresOn.Value = value; } }
public DateTime? _ExpiresOn { get { return Cols._ExpiresOn.Value; } set { Cols._ExpiresOn.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; } }
@@ -135,10 +141,10 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
_ItemId = GetFieldInt64(dbDataReader, "ItemId", _ItemId);
_SportId = GetFieldInt32(dbDataReader, "SportId", _SportId);
_RegionId = GetFieldInt32(dbDataReader, "RegionId", _RegionId);
_UserAccountIdOwner = GetFieldInt32(dbDataReader, "UserAccountIdOwner", _UserAccountIdOwner);
_OrganisationIdOwner = GetFieldInt32(dbDataReader, "OrganisationIdOwner", _OrganisationIdOwner);
_UserAccountIdOwner = GetFieldInt32Nullable(dbDataReader, "UserAccountIdOwner", _UserAccountIdOwner);
_OrganisationIdOwner = GetFieldInt32Nullable(dbDataReader, "OrganisationIdOwner", _OrganisationIdOwner);
_EffectiveOn = GetFieldDateTime(dbDataReader, "EffectiveOn", _EffectiveOn);
_ExpiresOn = GetFieldDateTime(dbDataReader, "ExpiresOn", _ExpiresOn);
_ExpiresOn = GetFieldDateTimeNullable(dbDataReader, "ExpiresOn", _ExpiresOn);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
_Status = GetFieldString(dbDataReader, "Status", _Status);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -26,9 +26,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnDataInt32 _RegionIdPrimary { get; } = new ColumnDataInt32("RegionIdPrimary");
public ColumnDataString _Headline { get; } = new ColumnDataString("Headline");
public ColumnDataString _Summary { get; } = new ColumnDataString("Summary");
public ColumnDataInt32 _ItemImageIdThumbnail { get; } = new ColumnDataInt32("ItemImageIdThumbnail");
public ColumnDataInt32Nullable _ItemImageIdThumbnail { get; } = new ColumnDataInt32Nullable("ItemImageIdThumbnail");
public ColumnDataString _BodyData { get; } = new ColumnDataString("BodyData");
public ColumnDataDateTime _PublishedAt { get; } = new ColumnDataDateTime("PublishedAt");
public ColumnDataDateTimeNullable _PublishedAt { get; } = new ColumnDataDateTimeNullable("PublishedAt");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
@@ -72,6 +72,11 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"ItemImageIdThumbnail",
"PublishedAt",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -102,9 +107,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public Int32 _RegionIdPrimary { get { return Cols._RegionIdPrimary.Value; } set { Cols._RegionIdPrimary.Value = value; } }
public String _Headline { get { return Cols._Headline.Value; } set { Cols._Headline.Value = value; } }
public String _Summary { get { return Cols._Summary.Value; } set { Cols._Summary.Value = value; } }
public Int32 _ItemImageIdThumbnail { get { return Cols._ItemImageIdThumbnail.Value; } set { Cols._ItemImageIdThumbnail.Value = value; } }
public Int32? _ItemImageIdThumbnail { get { return Cols._ItemImageIdThumbnail.Value; } set { Cols._ItemImageIdThumbnail.Value = value; } }
public String _BodyData { get { return Cols._BodyData.Value; } set { Cols._BodyData.Value = value; } }
public DateTime _PublishedAt { get { return Cols._PublishedAt.Value; } set { Cols._PublishedAt.Value = value; } }
public DateTime? _PublishedAt { get { return Cols._PublishedAt.Value; } set { Cols._PublishedAt.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; } }
@@ -142,9 +147,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
_RegionIdPrimary = GetFieldInt32(dbDataReader, "RegionIdPrimary", _RegionIdPrimary);
_Headline = GetFieldString(dbDataReader, "Headline", _Headline);
_Summary = GetFieldString(dbDataReader, "Summary", _Summary);
_ItemImageIdThumbnail = GetFieldInt32(dbDataReader, "ItemImageIdThumbnail", _ItemImageIdThumbnail);
_ItemImageIdThumbnail = GetFieldInt32Nullable(dbDataReader, "ItemImageIdThumbnail", _ItemImageIdThumbnail);
_BodyData = GetFieldString(dbDataReader, "BodyData", _BodyData);
_PublishedAt = GetFieldDateTime(dbDataReader, "PublishedAt", _PublishedAt);
_PublishedAt = GetFieldDateTimeNullable(dbDataReader, "PublishedAt", _PublishedAt);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
_Status = GetFieldString(dbDataReader, "Status", _Status);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -35,13 +35,13 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnDataString _PostalCode { get; } = new ColumnDataString("PostalCode");
public ColumnDataString _PhoneMain { get; } = new ColumnDataString("PhoneMain");
public ColumnDataString _LocationSource { get; } = new ColumnDataString("LocationSource");
public ColumnDataDateTime _LocationStoredAt { get; } = new ColumnDataDateTime("LocationStoredAt");
public ColumnDataDateTimeNullable _LocationStoredAt { get; } = new ColumnDataDateTimeNullable("LocationStoredAt");
public ColumnDataBoolean _LocationUpdateRequired { get; } = new ColumnDataBoolean("LocationUpdateRequired");
public ColumnDataString _LocationData { get; } = new ColumnDataString("LocationData");
public ColumnDataString _LocationFormattedAddress { get; } = new ColumnDataString("LocationFormattedAddress");
public ColumnDataDecimal _LocationLatitude { get; } = new ColumnDataDecimal("LocationLatitude");
public ColumnDataDecimal _LocationLongitude { get; } = new ColumnDataDecimal("LocationLongitude");
public ColumnDataDecimal _LocationAltitude { get; } = new ColumnDataDecimal("LocationAltitude");
public ColumnDataDecimalNullable _LocationLatitude { get; } = new ColumnDataDecimalNullable("LocationLatitude");
public ColumnDataDecimalNullable _LocationLongitude { get; } = new ColumnDataDecimalNullable("LocationLongitude");
public ColumnDataDecimalNullable _LocationAltitude { get; } = new ColumnDataDecimalNullable("LocationAltitude");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
@@ -98,6 +98,13 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"LocationStoredAt",
"LocationLatitude",
"LocationLongitude",
"LocationAltitude",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -137,13 +144,13 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public String _PostalCode { get { return Cols._PostalCode.Value; } set { Cols._PostalCode.Value = value; } }
public String _PhoneMain { get { return Cols._PhoneMain.Value; } set { Cols._PhoneMain.Value = value; } }
public String _LocationSource { get { return Cols._LocationSource.Value; } set { Cols._LocationSource.Value = value; } }
public DateTime _LocationStoredAt { get { return Cols._LocationStoredAt.Value; } set { Cols._LocationStoredAt.Value = value; } }
public DateTime? _LocationStoredAt { get { return Cols._LocationStoredAt.Value; } set { Cols._LocationStoredAt.Value = value; } }
public Boolean _LocationUpdateRequired { get { return Cols._LocationUpdateRequired.Value; } set { Cols._LocationUpdateRequired.Value = value; } }
public String _LocationData { get { return Cols._LocationData.Value; } set { Cols._LocationData.Value = value; } }
public String _LocationFormattedAddress { get { return Cols._LocationFormattedAddress.Value; } set { Cols._LocationFormattedAddress.Value = value; } }
public Decimal _LocationLatitude { get { return Cols._LocationLatitude.Value; } set { Cols._LocationLatitude.Value = value; } }
public Decimal _LocationLongitude { get { return Cols._LocationLongitude.Value; } set { Cols._LocationLongitude.Value = value; } }
public Decimal _LocationAltitude { get { return Cols._LocationAltitude.Value; } set { Cols._LocationAltitude.Value = value; } }
public Decimal? _LocationLatitude { get { return Cols._LocationLatitude.Value; } set { Cols._LocationLatitude.Value = value; } }
public Decimal? _LocationLongitude { get { return Cols._LocationLongitude.Value; } set { Cols._LocationLongitude.Value = value; } }
public Decimal? _LocationAltitude { get { return Cols._LocationAltitude.Value; } set { Cols._LocationAltitude.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; } }
@@ -190,13 +197,13 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
_PostalCode = GetFieldString(dbDataReader, "PostalCode", _PostalCode);
_PhoneMain = GetFieldString(dbDataReader, "PhoneMain", _PhoneMain);
_LocationSource = GetFieldString(dbDataReader, "LocationSource", _LocationSource);
_LocationStoredAt = GetFieldDateTime(dbDataReader, "LocationStoredAt", _LocationStoredAt);
_LocationStoredAt = GetFieldDateTimeNullable(dbDataReader, "LocationStoredAt", _LocationStoredAt);
_LocationUpdateRequired = GetFieldBoolean(dbDataReader, "LocationUpdateRequired", _LocationUpdateRequired);
_LocationData = GetFieldString(dbDataReader, "LocationData", _LocationData);
_LocationFormattedAddress = GetFieldString(dbDataReader, "LocationFormattedAddress", _LocationFormattedAddress);
_LocationLatitude = GetFieldDecimal(dbDataReader, "LocationLatitude", _LocationLatitude);
_LocationLongitude = GetFieldDecimal(dbDataReader, "LocationLongitude", _LocationLongitude);
_LocationAltitude = GetFieldDecimal(dbDataReader, "LocationAltitude", _LocationAltitude);
_LocationLatitude = GetFieldDecimalNullable(dbDataReader, "LocationLatitude", _LocationLatitude);
_LocationLongitude = GetFieldDecimalNullable(dbDataReader, "LocationLongitude", _LocationLongitude);
_LocationAltitude = GetFieldDecimalNullable(dbDataReader, "LocationAltitude", _LocationAltitude);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
_Status = GetFieldString(dbDataReader, "Status", _Status);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -64,6 +64,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -78,6 +78,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -62,6 +62,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -28,8 +28,8 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnDataString _Summary { get; } = new ColumnDataString("Summary");
public ColumnDataString _Details { get; } = new ColumnDataString("Details");
public ColumnDataString _EventData { get; } = new ColumnDataString("EventData");
public ColumnDataDateTime _PublishedAt { get; } = new ColumnDataDateTime("PublishedAt");
public ColumnDataDateTime _ExpiresAt { get; } = new ColumnDataDateTime("ExpiresAt");
public ColumnDataDateTimeNullable _PublishedAt { get; } = new ColumnDataDateTimeNullable("PublishedAt");
public ColumnDataDateTimeNullable _ExpiresAt { get; } = new ColumnDataDateTimeNullable("ExpiresAt");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
@@ -74,6 +74,11 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"PublishedAt",
"ExpiresAt",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -106,8 +111,8 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public String _Summary { get { return Cols._Summary.Value; } set { Cols._Summary.Value = value; } }
public String _Details { get { return Cols._Details.Value; } set { Cols._Details.Value = value; } }
public String _EventData { get { return Cols._EventData.Value; } set { Cols._EventData.Value = value; } }
public DateTime _PublishedAt { get { return Cols._PublishedAt.Value; } set { Cols._PublishedAt.Value = value; } }
public DateTime _ExpiresAt { get { return Cols._ExpiresAt.Value; } set { Cols._ExpiresAt.Value = value; } }
public DateTime? _PublishedAt { get { return Cols._PublishedAt.Value; } set { Cols._PublishedAt.Value = value; } }
public DateTime? _ExpiresAt { get { return Cols._ExpiresAt.Value; } set { Cols._ExpiresAt.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; } }
@@ -147,8 +152,8 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
_Summary = GetFieldString(dbDataReader, "Summary", _Summary);
_Details = GetFieldString(dbDataReader, "Details", _Details);
_EventData = GetFieldString(dbDataReader, "EventData", _EventData);
_PublishedAt = GetFieldDateTime(dbDataReader, "PublishedAt", _PublishedAt);
_ExpiresAt = GetFieldDateTime(dbDataReader, "ExpiresAt", _ExpiresAt);
_PublishedAt = GetFieldDateTimeNullable(dbDataReader, "PublishedAt", _PublishedAt);
_ExpiresAt = GetFieldDateTimeNullable(dbDataReader, "ExpiresAt", _ExpiresAt);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
_Status = GetFieldString(dbDataReader, "Status", _Status);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -27,8 +27,8 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnDataString _Position { get; } = new ColumnDataString("Position");
public ColumnDataString _Outline { get; } = new ColumnDataString("Outline");
public ColumnDataString _OpportunityData { get; } = new ColumnDataString("OpportunityData");
public ColumnDataDateTime _PublishedAt { get; } = new ColumnDataDateTime("PublishedAt");
public ColumnDataDateTime _ExpiresAt { get; } = new ColumnDataDateTime("ExpiresAt");
public ColumnDataDateTimeNullable _PublishedAt { get; } = new ColumnDataDateTimeNullable("PublishedAt");
public ColumnDataDateTimeNullable _ExpiresAt { get; } = new ColumnDataDateTimeNullable("ExpiresAt");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
@@ -72,6 +72,11 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"PublishedAt",
"ExpiresAt",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -103,8 +108,8 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public String _Position { get { return Cols._Position.Value; } set { Cols._Position.Value = value; } }
public String _Outline { get { return Cols._Outline.Value; } set { Cols._Outline.Value = value; } }
public String _OpportunityData { get { return Cols._OpportunityData.Value; } set { Cols._OpportunityData.Value = value; } }
public DateTime _PublishedAt { get { return Cols._PublishedAt.Value; } set { Cols._PublishedAt.Value = value; } }
public DateTime _ExpiresAt { get { return Cols._ExpiresAt.Value; } set { Cols._ExpiresAt.Value = value; } }
public DateTime? _PublishedAt { get { return Cols._PublishedAt.Value; } set { Cols._PublishedAt.Value = value; } }
public DateTime? _ExpiresAt { get { return Cols._ExpiresAt.Value; } set { Cols._ExpiresAt.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; } }
@@ -143,8 +148,8 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
_Position = GetFieldString(dbDataReader, "Position", _Position);
_Outline = GetFieldString(dbDataReader, "Outline", _Outline);
_OpportunityData = GetFieldString(dbDataReader, "OpportunityData", _OpportunityData);
_PublishedAt = GetFieldDateTime(dbDataReader, "PublishedAt", _PublishedAt);
_ExpiresAt = GetFieldDateTime(dbDataReader, "ExpiresAt", _ExpiresAt);
_PublishedAt = GetFieldDateTimeNullable(dbDataReader, "PublishedAt", _PublishedAt);
_ExpiresAt = GetFieldDateTimeNullable(dbDataReader, "ExpiresAt", _ExpiresAt);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
_Status = GetFieldString(dbDataReader, "Status", _Status);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -23,8 +23,8 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnDataString _Name { get; } = new ColumnDataString("Name");
public ColumnDataString _OrganisationType { get; } = new ColumnDataString("OrganisationType");
public ColumnDataString _OrganisationCategory { get; } = new ColumnDataString("OrganisationCategory");
public ColumnDataInt32 _SportIdPrimary { get; } = new ColumnDataInt32("SportIdPrimary");
public ColumnDataInt32 _RegionIdPrimary { get; } = new ColumnDataInt32("RegionIdPrimary");
public ColumnDataInt32Nullable _SportIdPrimary { get; } = new ColumnDataInt32Nullable("SportIdPrimary");
public ColumnDataInt32Nullable _RegionIdPrimary { get; } = new ColumnDataInt32Nullable("RegionIdPrimary");
public ColumnDataString _About { get; } = new ColumnDataString("About");
public ColumnDataString _Facilities { get; } = new ColumnDataString("Facilities");
public ColumnDataString _ContactData { get; } = new ColumnDataString("ContactData");
@@ -72,6 +72,14 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"SportIdPrimary",
"RegionIdPrimary",
"About",
"Facilities",
"ContactData",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -99,8 +107,8 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public String _Name { get { return Cols._Name.Value; } set { Cols._Name.Value = value; } }
public String _OrganisationType { get { return Cols._OrganisationType.Value; } set { Cols._OrganisationType.Value = value; } }
public String _OrganisationCategory { get { return Cols._OrganisationCategory.Value; } set { Cols._OrganisationCategory.Value = value; } }
public Int32 _SportIdPrimary { get { return Cols._SportIdPrimary.Value; } set { Cols._SportIdPrimary.Value = value; } }
public Int32 _RegionIdPrimary { get { return Cols._RegionIdPrimary.Value; } set { Cols._RegionIdPrimary.Value = value; } }
public Int32? _SportIdPrimary { get { return Cols._SportIdPrimary.Value; } set { Cols._SportIdPrimary.Value = value; } }
public Int32? _RegionIdPrimary { get { return Cols._RegionIdPrimary.Value; } set { Cols._RegionIdPrimary.Value = value; } }
public String _About { get { return Cols._About.Value; } set { Cols._About.Value = value; } }
public String _Facilities { get { return Cols._Facilities.Value; } set { Cols._Facilities.Value = value; } }
public String _ContactData { get { return Cols._ContactData.Value; } set { Cols._ContactData.Value = value; } }
@@ -139,8 +147,8 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
_Name = GetFieldString(dbDataReader, "Name", _Name);
_OrganisationType = GetFieldString(dbDataReader, "OrganisationType", _OrganisationType);
_OrganisationCategory = GetFieldString(dbDataReader, "OrganisationCategory", _OrganisationCategory);
_SportIdPrimary = GetFieldInt32(dbDataReader, "SportIdPrimary", _SportIdPrimary);
_RegionIdPrimary = GetFieldInt32(dbDataReader, "RegionIdPrimary", _RegionIdPrimary);
_SportIdPrimary = GetFieldInt32Nullable(dbDataReader, "SportIdPrimary", _SportIdPrimary);
_RegionIdPrimary = GetFieldInt32Nullable(dbDataReader, "RegionIdPrimary", _RegionIdPrimary);
_About = GetFieldString(dbDataReader, "About", _About);
_Facilities = GetFieldString(dbDataReader, "Facilities", _Facilities);
_ContactData = GetFieldString(dbDataReader, "ContactData", _ContactData);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -23,8 +23,8 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnDataInt16 _RegionType { get; } = new ColumnDataInt16("RegionType");
public ColumnDataString _CountryIso2Code { get; } = new ColumnDataString("CountryIso2Code");
public ColumnDataString _Name { get; } = new ColumnDataString("Name");
public ColumnDataDecimal _Latitude { get; } = new ColumnDataDecimal("Latitude");
public ColumnDataDecimal _Longitude { get; } = new ColumnDataDecimal("Longitude");
public ColumnDataDecimalNullable _Latitude { get; } = new ColumnDataDecimalNullable("Latitude");
public ColumnDataDecimalNullable _Longitude { get; } = new ColumnDataDecimalNullable("Longitude");
public ColumnDataInt32 _RegionIdParent { get; } = new ColumnDataInt32("RegionIdParent");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
@@ -66,6 +66,11 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"Latitude",
"Longitude",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -93,8 +98,8 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public Int16 _RegionType { get { return Cols._RegionType.Value; } set { Cols._RegionType.Value = value; } }
public String _CountryIso2Code { get { return Cols._CountryIso2Code.Value; } set { Cols._CountryIso2Code.Value = value; } }
public String _Name { get { return Cols._Name.Value; } set { Cols._Name.Value = value; } }
public Decimal _Latitude { get { return Cols._Latitude.Value; } set { Cols._Latitude.Value = value; } }
public Decimal _Longitude { get { return Cols._Longitude.Value; } set { Cols._Longitude.Value = value; } }
public Decimal? _Latitude { get { return Cols._Latitude.Value; } set { Cols._Latitude.Value = value; } }
public Decimal? _Longitude { get { return Cols._Longitude.Value; } set { Cols._Longitude.Value = value; } }
public Int32 _RegionIdParent { get { return Cols._RegionIdParent.Value; } set { Cols._RegionIdParent.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; } }
@@ -130,8 +135,8 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
_RegionType = GetFieldInt16(dbDataReader, "RegionType", _RegionType);
_CountryIso2Code = GetFieldString(dbDataReader, "CountryIso2Code", _CountryIso2Code);
_Name = GetFieldString(dbDataReader, "Name", _Name);
_Latitude = GetFieldDecimal(dbDataReader, "Latitude", _Latitude);
_Longitude = GetFieldDecimal(dbDataReader, "Longitude", _Longitude);
_Latitude = GetFieldDecimalNullable(dbDataReader, "Latitude", _Latitude);
_Longitude = GetFieldDecimalNullable(dbDataReader, "Longitude", _Longitude);
_RegionIdParent = GetFieldInt32(dbDataReader, "RegionIdParent", _RegionIdParent);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -20,9 +20,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public class ColumnsData
{
public ColumnDataInt32 _Id { get; } = new ColumnDataInt32("Id", true);
public ColumnDataInt32 _SportIdParent { get; } = new ColumnDataInt32("SportIdParent");
public ColumnDataInt32Nullable _SportIdParent { get; } = new ColumnDataInt32Nullable("SportIdParent");
public ColumnDataString _Name { get; } = new ColumnDataString("Name");
public ColumnDataInt16 _SpecialityLabel { get; } = new ColumnDataInt16("SpecialityLabel");
public ColumnDataInt16Nullable _SpecialityLabel { get; } = new ColumnDataInt16Nullable("SpecialityLabel");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
@@ -60,6 +60,11 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"SportIdParent",
"SpecialityLabel",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -84,9 +89,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
// Columns.
public ColumnsData Cols { get; } = new ColumnsData();
public Int32 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
public Int32 _SportIdParent { get { return Cols._SportIdParent.Value; } set { Cols._SportIdParent.Value = value; } }
public Int32? _SportIdParent { get { return Cols._SportIdParent.Value; } set { Cols._SportIdParent.Value = value; } }
public String _Name { get { return Cols._Name.Value; } set { Cols._Name.Value = value; } }
public Int16 _SpecialityLabel { get { return Cols._SpecialityLabel.Value; } set { Cols._SpecialityLabel.Value = value; } }
public Int16? _SpecialityLabel { get { return Cols._SpecialityLabel.Value; } set { Cols._SpecialityLabel.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; } }
@@ -118,9 +123,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public override void PopulateFrom (DbDataReader dbDataReader)
{
_Id = GetFieldInt32(dbDataReader, "Id", _Id);
_SportIdParent = GetFieldInt32(dbDataReader, "SportIdParent", _SportIdParent);
_SportIdParent = GetFieldInt32Nullable(dbDataReader, "SportIdParent", _SportIdParent);
_Name = GetFieldString(dbDataReader, "Name", _Name);
_SpecialityLabel = GetFieldInt16(dbDataReader, "SpecialityLabel", _SpecialityLabel);
_SpecialityLabel = GetFieldInt16Nullable(dbDataReader, "SpecialityLabel", _SpecialityLabel);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
_Status = GetFieldString(dbDataReader, "Status", _Status);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -29,20 +29,20 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnDataString _PhoneMain { get; } = new ColumnDataString("PhoneMain");
public ColumnDataString _PhoneMobile { get; } = new ColumnDataString("PhoneMobile");
public ColumnDataString _PhoneAlt { get; } = new ColumnDataString("PhoneAlt");
public ColumnDataByte _Gender { get; } = new ColumnDataByte("Gender");
public ColumnDataByteNullable _Gender { get; } = new ColumnDataByteNullable("Gender");
public ColumnDataString _GenderOther { get; } = new ColumnDataString("GenderOther");
public ColumnDataByte _DateOfBirthDay { get; } = new ColumnDataByte("DateOfBirthDay");
public ColumnDataByte _DateOfBirthMonth { get; } = new ColumnDataByte("DateOfBirthMonth");
public ColumnDataInt16 _DateOfBirthYear { get; } = new ColumnDataInt16("DateOfBirthYear");
public ColumnDataInt32 _RegionIdCountry { get; } = new ColumnDataInt32("RegionIdCountry");
public ColumnDataInt32 _RegionIdProvince { get; } = new ColumnDataInt32("RegionIdProvince");
public ColumnDataByteNullable _DateOfBirthDay { get; } = new ColumnDataByteNullable("DateOfBirthDay");
public ColumnDataByteNullable _DateOfBirthMonth { get; } = new ColumnDataByteNullable("DateOfBirthMonth");
public ColumnDataInt16Nullable _DateOfBirthYear { get; } = new ColumnDataInt16Nullable("DateOfBirthYear");
public ColumnDataInt32Nullable _RegionIdCountry { get; } = new ColumnDataInt32Nullable("RegionIdCountry");
public ColumnDataInt32Nullable _RegionIdProvince { get; } = new ColumnDataInt32Nullable("RegionIdProvince");
public ColumnDataString _JournalistData { get; } = new ColumnDataString("JournalistData");
public ColumnDataString _PasswordToken { get; } = new ColumnDataString("PasswordToken");
public ColumnDataString _PasswordHashed { get; } = new ColumnDataString("PasswordHashed");
public ColumnDataString _PasswordHistory { get; } = new ColumnDataString("PasswordHistory");
public ColumnDataDateTime _PasswordChangedAt { get; } = new ColumnDataDateTime("PasswordChangedAt");
public ColumnDataDateTime _LastLoginAt { get; } = new ColumnDataDateTime("LastLoginAt");
public ColumnDataDateTime _LastInvalidLoginAt { get; } = new ColumnDataDateTime("LastInvalidLoginAt");
public ColumnDataDateTimeNullable _PasswordChangedAt { get; } = new ColumnDataDateTimeNullable("PasswordChangedAt");
public ColumnDataDateTimeNullable _LastLoginAt { get; } = new ColumnDataDateTimeNullable("LastLoginAt");
public ColumnDataDateTimeNullable _LastInvalidLoginAt { get; } = new ColumnDataDateTimeNullable("LastInvalidLoginAt");
public ColumnDataInt16 _InvalidLoginCount { get; } = new ColumnDataInt16("InvalidLoginCount");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
@@ -102,6 +102,22 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"About",
"Gender",
"GenderOther",
"DateOfBirthDay",
"DateOfBirthMonth",
"DateOfBirthYear",
"RegionIdCountry",
"RegionIdProvince",
"JournalistData",
"PasswordToken",
"PasswordChangedAt",
"LastLoginAt",
"LastInvalidLoginAt",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -135,20 +151,20 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public String _PhoneMain { get { return Cols._PhoneMain.Value; } set { Cols._PhoneMain.Value = value; } }
public String _PhoneMobile { get { return Cols._PhoneMobile.Value; } set { Cols._PhoneMobile.Value = value; } }
public String _PhoneAlt { get { return Cols._PhoneAlt.Value; } set { Cols._PhoneAlt.Value = value; } }
public Byte _Gender { get { return Cols._Gender.Value; } set { Cols._Gender.Value = value; } }
public Byte? _Gender { get { return Cols._Gender.Value; } set { Cols._Gender.Value = value; } }
public String _GenderOther { get { return Cols._GenderOther.Value; } set { Cols._GenderOther.Value = value; } }
public Byte _DateOfBirthDay { get { return Cols._DateOfBirthDay.Value; } set { Cols._DateOfBirthDay.Value = value; } }
public Byte _DateOfBirthMonth { get { return Cols._DateOfBirthMonth.Value; } set { Cols._DateOfBirthMonth.Value = value; } }
public Int16 _DateOfBirthYear { get { return Cols._DateOfBirthYear.Value; } set { Cols._DateOfBirthYear.Value = value; } }
public Int32 _RegionIdCountry { get { return Cols._RegionIdCountry.Value; } set { Cols._RegionIdCountry.Value = value; } }
public Int32 _RegionIdProvince { get { return Cols._RegionIdProvince.Value; } set { Cols._RegionIdProvince.Value = value; } }
public Byte? _DateOfBirthDay { get { return Cols._DateOfBirthDay.Value; } set { Cols._DateOfBirthDay.Value = value; } }
public Byte? _DateOfBirthMonth { get { return Cols._DateOfBirthMonth.Value; } set { Cols._DateOfBirthMonth.Value = value; } }
public Int16? _DateOfBirthYear { get { return Cols._DateOfBirthYear.Value; } set { Cols._DateOfBirthYear.Value = value; } }
public Int32? _RegionIdCountry { get { return Cols._RegionIdCountry.Value; } set { Cols._RegionIdCountry.Value = value; } }
public Int32? _RegionIdProvince { get { return Cols._RegionIdProvince.Value; } set { Cols._RegionIdProvince.Value = value; } }
public String _JournalistData { get { return Cols._JournalistData.Value; } set { Cols._JournalistData.Value = value; } }
public String _PasswordToken { get { return Cols._PasswordToken.Value; } set { Cols._PasswordToken.Value = value; } }
public String _PasswordHashed { get { return Cols._PasswordHashed.Value; } set { Cols._PasswordHashed.Value = value; } }
public String _PasswordHistory { get { return Cols._PasswordHistory.Value; } set { Cols._PasswordHistory.Value = value; } }
public DateTime _PasswordChangedAt { get { return Cols._PasswordChangedAt.Value; } set { Cols._PasswordChangedAt.Value = value; } }
public DateTime _LastLoginAt { get { return Cols._LastLoginAt.Value; } set { Cols._LastLoginAt.Value = value; } }
public DateTime _LastInvalidLoginAt { get { return Cols._LastInvalidLoginAt.Value; } set { Cols._LastInvalidLoginAt.Value = value; } }
public DateTime? _PasswordChangedAt { get { return Cols._PasswordChangedAt.Value; } set { Cols._PasswordChangedAt.Value = value; } }
public DateTime? _LastLoginAt { get { return Cols._LastLoginAt.Value; } set { Cols._LastLoginAt.Value = value; } }
public DateTime? _LastInvalidLoginAt { get { return Cols._LastInvalidLoginAt.Value; } set { Cols._LastInvalidLoginAt.Value = value; } }
public Int16 _InvalidLoginCount { get { return Cols._InvalidLoginCount.Value; } set { Cols._InvalidLoginCount.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; } }
@@ -190,20 +206,20 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
_PhoneMain = GetFieldString(dbDataReader, "PhoneMain", _PhoneMain);
_PhoneMobile = GetFieldString(dbDataReader, "PhoneMobile", _PhoneMobile);
_PhoneAlt = GetFieldString(dbDataReader, "PhoneAlt", _PhoneAlt);
_Gender = GetFieldByte(dbDataReader, "Gender", _Gender);
_Gender = GetFieldByteNullable(dbDataReader, "Gender", _Gender);
_GenderOther = GetFieldString(dbDataReader, "GenderOther", _GenderOther);
_DateOfBirthDay = GetFieldByte(dbDataReader, "DateOfBirthDay", _DateOfBirthDay);
_DateOfBirthMonth = GetFieldByte(dbDataReader, "DateOfBirthMonth", _DateOfBirthMonth);
_DateOfBirthYear = GetFieldInt16(dbDataReader, "DateOfBirthYear", _DateOfBirthYear);
_RegionIdCountry = GetFieldInt32(dbDataReader, "RegionIdCountry", _RegionIdCountry);
_RegionIdProvince = GetFieldInt32(dbDataReader, "RegionIdProvince", _RegionIdProvince);
_DateOfBirthDay = GetFieldByteNullable(dbDataReader, "DateOfBirthDay", _DateOfBirthDay);
_DateOfBirthMonth = GetFieldByteNullable(dbDataReader, "DateOfBirthMonth", _DateOfBirthMonth);
_DateOfBirthYear = GetFieldInt16Nullable(dbDataReader, "DateOfBirthYear", _DateOfBirthYear);
_RegionIdCountry = GetFieldInt32Nullable(dbDataReader, "RegionIdCountry", _RegionIdCountry);
_RegionIdProvince = GetFieldInt32Nullable(dbDataReader, "RegionIdProvince", _RegionIdProvince);
_JournalistData = GetFieldString(dbDataReader, "JournalistData", _JournalistData);
_PasswordToken = GetFieldString(dbDataReader, "PasswordToken", _PasswordToken);
_PasswordHashed = GetFieldString(dbDataReader, "PasswordHashed", _PasswordHashed);
_PasswordHistory = GetFieldString(dbDataReader, "PasswordHistory", _PasswordHistory);
_PasswordChangedAt = GetFieldDateTime(dbDataReader, "PasswordChangedAt", _PasswordChangedAt);
_LastLoginAt = GetFieldDateTime(dbDataReader, "LastLoginAt", _LastLoginAt);
_LastInvalidLoginAt = GetFieldDateTime(dbDataReader, "LastInvalidLoginAt", _LastInvalidLoginAt);
_PasswordChangedAt = GetFieldDateTimeNullable(dbDataReader, "PasswordChangedAt", _PasswordChangedAt);
_LastLoginAt = GetFieldDateTimeNullable(dbDataReader, "LastLoginAt", _LastLoginAt);
_LastInvalidLoginAt = GetFieldDateTimeNullable(dbDataReader, "LastInvalidLoginAt", _LastInvalidLoginAt);
_InvalidLoginCount = GetFieldInt16(dbDataReader, "InvalidLoginCount", _InvalidLoginCount);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -25,12 +25,12 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnDataInt64 _ItemId { get; } = new ColumnDataInt64("ItemId");
public ColumnDataBoolean _CurrentlyListed { get; } = new ColumnDataBoolean("CurrentlyListed");
public ColumnDataDateTime _ListedAtFirst { get; } = new ColumnDataDateTime("ListedAtFirst");
public ColumnDataDateTime _ListedAtLast { get; } = new ColumnDataDateTime("ListedAtLast");
public ColumnDataDateTime _ViewedAtFirst { get; } = new ColumnDataDateTime("ViewedAtFirst");
public ColumnDataDateTime _ViewedAtLast { get; } = new ColumnDataDateTime("ViewedAtLast");
public ColumnDataDateTimeNullable _ListedAtLast { get; } = new ColumnDataDateTimeNullable("ListedAtLast");
public ColumnDataDateTimeNullable _ViewedAtFirst { get; } = new ColumnDataDateTimeNullable("ViewedAtFirst");
public ColumnDataDateTimeNullable _ViewedAtLast { get; } = new ColumnDataDateTimeNullable("ViewedAtLast");
public ColumnDataInt16 _Reaction { get; } = new ColumnDataInt16("Reaction");
public ColumnDataDateTime _ReactedAtFirst { get; } = new ColumnDataDateTime("ReactedAtFirst");
public ColumnDataDateTime _ReactedAtLast { get; } = new ColumnDataDateTime("ReactedAtLast");
public ColumnDataDateTimeNullable _ReactedAtFirst { get; } = new ColumnDataDateTimeNullable("ReactedAtFirst");
public ColumnDataDateTimeNullable _ReactedAtLast { get; } = new ColumnDataDateTimeNullable("ReactedAtLast");
public ColumnDataString _UserActivityData { get; } = new ColumnDataString("UserActivityData");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
@@ -78,6 +78,14 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"ListedAtLast",
"ViewedAtFirst",
"ViewedAtLast",
"ReactedAtFirst",
"ReactedAtLast",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -107,12 +115,12 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public Int64 _ItemId { get { return Cols._ItemId.Value; } set { Cols._ItemId.Value = value; } }
public Boolean _CurrentlyListed { get { return Cols._CurrentlyListed.Value; } set { Cols._CurrentlyListed.Value = value; } }
public DateTime _ListedAtFirst { get { return Cols._ListedAtFirst.Value; } set { Cols._ListedAtFirst.Value = value; } }
public DateTime _ListedAtLast { get { return Cols._ListedAtLast.Value; } set { Cols._ListedAtLast.Value = value; } }
public DateTime _ViewedAtFirst { get { return Cols._ViewedAtFirst.Value; } set { Cols._ViewedAtFirst.Value = value; } }
public DateTime _ViewedAtLast { get { return Cols._ViewedAtLast.Value; } set { Cols._ViewedAtLast.Value = value; } }
public DateTime? _ListedAtLast { get { return Cols._ListedAtLast.Value; } set { Cols._ListedAtLast.Value = value; } }
public DateTime? _ViewedAtFirst { get { return Cols._ViewedAtFirst.Value; } set { Cols._ViewedAtFirst.Value = value; } }
public DateTime? _ViewedAtLast { get { return Cols._ViewedAtLast.Value; } set { Cols._ViewedAtLast.Value = value; } }
public Int16 _Reaction { get { return Cols._Reaction.Value; } set { Cols._Reaction.Value = value; } }
public DateTime _ReactedAtFirst { get { return Cols._ReactedAtFirst.Value; } set { Cols._ReactedAtFirst.Value = value; } }
public DateTime _ReactedAtLast { get { return Cols._ReactedAtLast.Value; } set { Cols._ReactedAtLast.Value = value; } }
public DateTime? _ReactedAtFirst { get { return Cols._ReactedAtFirst.Value; } set { Cols._ReactedAtFirst.Value = value; } }
public DateTime? _ReactedAtLast { get { return Cols._ReactedAtLast.Value; } set { Cols._ReactedAtLast.Value = value; } }
public String _UserActivityData { get { return Cols._UserActivityData.Value; } set { Cols._UserActivityData.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; } }
@@ -150,12 +158,12 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
_ItemId = GetFieldInt64(dbDataReader, "ItemId", _ItemId);
_CurrentlyListed = GetFieldBoolean(dbDataReader, "CurrentlyListed", _CurrentlyListed);
_ListedAtFirst = GetFieldDateTime(dbDataReader, "ListedAtFirst", _ListedAtFirst);
_ListedAtLast = GetFieldDateTime(dbDataReader, "ListedAtLast", _ListedAtLast);
_ViewedAtFirst = GetFieldDateTime(dbDataReader, "ViewedAtFirst", _ViewedAtFirst);
_ViewedAtLast = GetFieldDateTime(dbDataReader, "ViewedAtLast", _ViewedAtLast);
_ListedAtLast = GetFieldDateTimeNullable(dbDataReader, "ListedAtLast", _ListedAtLast);
_ViewedAtFirst = GetFieldDateTimeNullable(dbDataReader, "ViewedAtFirst", _ViewedAtFirst);
_ViewedAtLast = GetFieldDateTimeNullable(dbDataReader, "ViewedAtLast", _ViewedAtLast);
_Reaction = GetFieldInt16(dbDataReader, "Reaction", _Reaction);
_ReactedAtFirst = GetFieldDateTime(dbDataReader, "ReactedAtFirst", _ReactedAtFirst);
_ReactedAtLast = GetFieldDateTime(dbDataReader, "ReactedAtLast", _ReactedAtLast);
_ReactedAtFirst = GetFieldDateTimeNullable(dbDataReader, "ReactedAtFirst", _ReactedAtFirst);
_ReactedAtLast = GetFieldDateTimeNullable(dbDataReader, "ReactedAtLast", _ReactedAtLast);
_UserActivityData = GetFieldString(dbDataReader, "UserActivityData", _UserActivityData);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -21,7 +21,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
public ColumnDataInt64 _Id { get; } = new ColumnDataInt64("Id", true);
public ColumnDataInt32 _UserAccountId { get; } = new ColumnDataInt32("UserAccountId");
public ColumnDataInt16 _ConfigType { get; } = new ColumnDataInt16("ConfigType");
public ColumnDataInt16Nullable _ConfigType { get; } = new ColumnDataInt16Nullable("ConfigType");
public ColumnDataString _ConfigData { get; } = new ColumnDataString("ConfigData");
public ColumnDataDateTime _CreateOn { get; } = new ColumnDataDateTime("CreateOn");
public ColumnDataDateTime _UpdateOn { get; } = new ColumnDataDateTime("UpdateOn");
@@ -46,6 +46,10 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"ConfigType",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -71,7 +75,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnsData Cols { get; } = new ColumnsData();
public Int64 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
public Int32 _UserAccountId { get { return Cols._UserAccountId.Value; } set { Cols._UserAccountId.Value = value; } }
public Int16 _ConfigType { get { return Cols._ConfigType.Value; } set { Cols._ConfigType.Value = value; } }
public Int16? _ConfigType { get { return Cols._ConfigType.Value; } set { Cols._ConfigType.Value = value; } }
public String _ConfigData { get { return Cols._ConfigData.Value; } set { Cols._ConfigData.Value = value; } }
public DateTime _CreateOn { get { return Cols._CreateOn.Value; } set { Cols._CreateOn.Value = value; } }
public DateTime _UpdateOn { get { return Cols._UpdateOn.Value; } set { Cols._UpdateOn.Value = value; } }
@@ -98,7 +102,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
_Id = GetFieldInt64(dbDataReader, "Id", _Id);
_UserAccountId = GetFieldInt32(dbDataReader, "UserAccountId", _UserAccountId);
_ConfigType = GetFieldInt16(dbDataReader, "ConfigType", _ConfigType);
_ConfigType = GetFieldInt16Nullable(dbDataReader, "ConfigType", _ConfigType);
_ConfigData = GetFieldString(dbDataReader, "ConfigData", _ConfigData);
_CreateOn = GetFieldDateTime(dbDataReader, "CreateOn", _CreateOn);
_UpdateOn = GetFieldDateTime(dbDataReader, "UpdateOn", _UpdateOn);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -21,10 +21,10 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
public ColumnDataInt64 _Id { get; } = new ColumnDataInt64("Id", true);
public ColumnDataInt32 _UserAccountId { get; } = new ColumnDataInt32("UserAccountId");
public ColumnDataInt32 _RegionId { get; } = new ColumnDataInt32("RegionId");
public ColumnDataInt32Nullable _RegionId { get; } = new ColumnDataInt32Nullable("RegionId");
public ColumnDataInt16 _EligibilityType { get; } = new ColumnDataInt16("EligibilityType");
public ColumnDataString _Info { get; } = new ColumnDataString("Info");
public ColumnDataDateTime _ExpiresOn { get; } = new ColumnDataDateTime("ExpiresOn");
public ColumnDataDateTimeNullable _ExpiresOn { get; } = new ColumnDataDateTimeNullable("ExpiresOn");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
@@ -64,6 +64,11 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"RegionId",
"ExpiresOn",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -89,10 +94,10 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnsData Cols { get; } = new ColumnsData();
public Int64 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
public Int32 _UserAccountId { get { return Cols._UserAccountId.Value; } set { Cols._UserAccountId.Value = value; } }
public Int32 _RegionId { get { return Cols._RegionId.Value; } set { Cols._RegionId.Value = value; } }
public Int32? _RegionId { get { return Cols._RegionId.Value; } set { Cols._RegionId.Value = value; } }
public Int16 _EligibilityType { get { return Cols._EligibilityType.Value; } set { Cols._EligibilityType.Value = value; } }
public String _Info { get { return Cols._Info.Value; } set { Cols._Info.Value = value; } }
public DateTime _ExpiresOn { get { return Cols._ExpiresOn.Value; } set { Cols._ExpiresOn.Value = value; } }
public DateTime? _ExpiresOn { get { return Cols._ExpiresOn.Value; } set { Cols._ExpiresOn.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; } }
@@ -125,10 +130,10 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
_Id = GetFieldInt64(dbDataReader, "Id", _Id);
_UserAccountId = GetFieldInt32(dbDataReader, "UserAccountId", _UserAccountId);
_RegionId = GetFieldInt32(dbDataReader, "RegionId", _RegionId);
_RegionId = GetFieldInt32Nullable(dbDataReader, "RegionId", _RegionId);
_EligibilityType = GetFieldInt16(dbDataReader, "EligibilityType", _EligibilityType);
_Info = GetFieldString(dbDataReader, "Info", _Info);
_ExpiresOn = GetFieldDateTime(dbDataReader, "ExpiresOn", _ExpiresOn);
_ExpiresOn = GetFieldDateTimeNullable(dbDataReader, "ExpiresOn", _ExpiresOn);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
_Status = GetFieldString(dbDataReader, "Status", _Status);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -37,6 +37,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"UserAccountId",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -64,6 +64,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -22,9 +22,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnDataInt64 _Id { get; } = new ColumnDataInt64("Id", true);
public ColumnDataInt32 _UserAccountId { get; } = new ColumnDataInt32("UserAccountId");
public ColumnDataString _UserRoleCode { get; } = new ColumnDataString("UserRoleCode");
public ColumnDataDateTime _LastLoginAt { get; } = new ColumnDataDateTime("LastLoginAt");
public ColumnDataDateTime _LastInvalidLoginAt { get; } = new ColumnDataDateTime("LastInvalidLoginAt");
public ColumnDataInt16 _InvalidLoginCount { get; } = new ColumnDataInt16("InvalidLoginCount");
public ColumnDataDateTimeNullable _LastLoginAt { get; } = new ColumnDataDateTimeNullable("LastLoginAt");
public ColumnDataDateTimeNullable _LastInvalidLoginAt { get; } = new ColumnDataDateTimeNullable("LastInvalidLoginAt");
public ColumnDataInt16Nullable _InvalidLoginCount { get; } = new ColumnDataInt16Nullable("InvalidLoginCount");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
@@ -64,6 +64,12 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"LastLoginAt",
"LastInvalidLoginAt",
"InvalidLoginCount",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -90,9 +96,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public Int64 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
public Int32 _UserAccountId { get { return Cols._UserAccountId.Value; } set { Cols._UserAccountId.Value = value; } }
public String _UserRoleCode { get { return Cols._UserRoleCode.Value; } set { Cols._UserRoleCode.Value = value; } }
public DateTime _LastLoginAt { get { return Cols._LastLoginAt.Value; } set { Cols._LastLoginAt.Value = value; } }
public DateTime _LastInvalidLoginAt { get { return Cols._LastInvalidLoginAt.Value; } set { Cols._LastInvalidLoginAt.Value = value; } }
public Int16 _InvalidLoginCount { get { return Cols._InvalidLoginCount.Value; } set { Cols._InvalidLoginCount.Value = value; } }
public DateTime? _LastLoginAt { get { return Cols._LastLoginAt.Value; } set { Cols._LastLoginAt.Value = value; } }
public DateTime? _LastInvalidLoginAt { get { return Cols._LastInvalidLoginAt.Value; } set { Cols._LastInvalidLoginAt.Value = value; } }
public Int16? _InvalidLoginCount { get { return Cols._InvalidLoginCount.Value; } set { Cols._InvalidLoginCount.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; } }
@@ -126,9 +132,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
_Id = GetFieldInt64(dbDataReader, "Id", _Id);
_UserAccountId = GetFieldInt32(dbDataReader, "UserAccountId", _UserAccountId);
_UserRoleCode = GetFieldString(dbDataReader, "UserRoleCode", _UserRoleCode);
_LastLoginAt = GetFieldDateTime(dbDataReader, "LastLoginAt", _LastLoginAt);
_LastInvalidLoginAt = GetFieldDateTime(dbDataReader, "LastInvalidLoginAt", _LastInvalidLoginAt);
_InvalidLoginCount = GetFieldInt16(dbDataReader, "InvalidLoginCount", _InvalidLoginCount);
_LastLoginAt = GetFieldDateTimeNullable(dbDataReader, "LastLoginAt", _LastLoginAt);
_LastInvalidLoginAt = GetFieldDateTimeNullable(dbDataReader, "LastInvalidLoginAt", _LastInvalidLoginAt);
_InvalidLoginCount = GetFieldInt16Nullable(dbDataReader, "InvalidLoginCount", _InvalidLoginCount);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
_Status = GetFieldString(dbDataReader, "Status", _Status);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -45,6 +45,11 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"UserAccountId",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"ActivityIndexIds",
"UserSessionData",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -22,7 +22,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnDataInt64 _Id { get; } = new ColumnDataInt64("Id", true);
public ColumnDataInt64 _UserSportId { get; } = new ColumnDataInt64("UserSportId");
public ColumnDataDateTime _PeriodFrom { get; } = new ColumnDataDateTime("PeriodFrom");
public ColumnDataDateTime _PeriodTo { get; } = new ColumnDataDateTime("PeriodTo");
public ColumnDataDateTimeNullable _PeriodTo { get; } = new ColumnDataDateTimeNullable("PeriodTo");
public ColumnDataInt32 _OrganisationId { get; } = new ColumnDataInt32("OrganisationId");
public ColumnDataString _OrganisationName { get; } = new ColumnDataString("OrganisationName");
public ColumnDataString _Summary { get; } = new ColumnDataString("Summary");
@@ -82,6 +82,11 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"PeriodTo",
"Awards",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -108,7 +113,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public Int64 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
public Int64 _UserSportId { get { return Cols._UserSportId.Value; } set { Cols._UserSportId.Value = value; } }
public DateTime _PeriodFrom { get { return Cols._PeriodFrom.Value; } set { Cols._PeriodFrom.Value = value; } }
public DateTime _PeriodTo { get { return Cols._PeriodTo.Value; } set { Cols._PeriodTo.Value = value; } }
public DateTime? _PeriodTo { get { return Cols._PeriodTo.Value; } set { Cols._PeriodTo.Value = value; } }
public Int32 _OrganisationId { get { return Cols._OrganisationId.Value; } set { Cols._OrganisationId.Value = value; } }
public String _OrganisationName { get { return Cols._OrganisationName.Value; } set { Cols._OrganisationName.Value = value; } }
public String _Summary { get { return Cols._Summary.Value; } set { Cols._Summary.Value = value; } }
@@ -153,7 +158,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
_Id = GetFieldInt64(dbDataReader, "Id", _Id);
_UserSportId = GetFieldInt64(dbDataReader, "UserSportId", _UserSportId);
_PeriodFrom = GetFieldDateTime(dbDataReader, "PeriodFrom", _PeriodFrom);
_PeriodTo = GetFieldDateTime(dbDataReader, "PeriodTo", _PeriodTo);
_PeriodTo = GetFieldDateTimeNullable(dbDataReader, "PeriodTo", _PeriodTo);
_OrganisationId = GetFieldInt32(dbDataReader, "OrganisationId", _OrganisationId);
_OrganisationName = GetFieldString(dbDataReader, "OrganisationName", _OrganisationName);
_Summary = GetFieldString(dbDataReader, "Summary", _Summary);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
@@ -24,9 +24,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public ColumnDataInt32 _SportId { get; } = new ColumnDataInt32("SportId");
public ColumnDataString _About { get; } = new ColumnDataString("About");
public ColumnDataString _ContactsData { get; } = new ColumnDataString("ContactsData");
public ColumnDataInt16 _Participating { get; } = new ColumnDataInt16("Participating");
public ColumnDataInt16 _Preparing { get; } = new ColumnDataInt16("Preparing");
public ColumnDataInt16 _Officiating { get; } = new ColumnDataInt16("Officiating");
public ColumnDataInt16Nullable _Participating { get; } = new ColumnDataInt16Nullable("Participating");
public ColumnDataInt16Nullable _Preparing { get; } = new ColumnDataInt16Nullable("Preparing");
public ColumnDataInt16Nullable _Officiating { get; } = new ColumnDataInt16Nullable("Officiating");
public ColumnDataString _UserSportData { get; } = new ColumnDataString("UserSportData");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
@@ -70,6 +70,15 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"About",
"ContactsData",
"Participating",
"Preparing",
"Officiating",
"UserSportData",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -98,9 +107,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
public Int32 _SportId { get { return Cols._SportId.Value; } set { Cols._SportId.Value = value; } }
public String _About { get { return Cols._About.Value; } set { Cols._About.Value = value; } }
public String _ContactsData { get { return Cols._ContactsData.Value; } set { Cols._ContactsData.Value = value; } }
public Int16 _Participating { get { return Cols._Participating.Value; } set { Cols._Participating.Value = value; } }
public Int16 _Preparing { get { return Cols._Preparing.Value; } set { Cols._Preparing.Value = value; } }
public Int16 _Officiating { get { return Cols._Officiating.Value; } set { Cols._Officiating.Value = value; } }
public Int16? _Participating { get { return Cols._Participating.Value; } set { Cols._Participating.Value = value; } }
public Int16? _Preparing { get { return Cols._Preparing.Value; } set { Cols._Preparing.Value = value; } }
public Int16? _Officiating { get { return Cols._Officiating.Value; } set { Cols._Officiating.Value = value; } }
public String _UserSportData { get { return Cols._UserSportData.Value; } set { Cols._UserSportData.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; } }
@@ -137,9 +146,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Core
_SportId = GetFieldInt32(dbDataReader, "SportId", _SportId);
_About = GetFieldString(dbDataReader, "About", _About);
_ContactsData = GetFieldString(dbDataReader, "ContactsData", _ContactsData);
_Participating = GetFieldInt16(dbDataReader, "Participating", _Participating);
_Preparing = GetFieldInt16(dbDataReader, "Preparing", _Preparing);
_Officiating = GetFieldInt16(dbDataReader, "Officiating", _Officiating);
_Participating = GetFieldInt16Nullable(dbDataReader, "Participating", _Participating);
_Preparing = GetFieldInt16Nullable(dbDataReader, "Preparing", _Preparing);
_Officiating = GetFieldInt16Nullable(dbDataReader, "Officiating", _Officiating);
_UserSportData = GetFieldString(dbDataReader, "UserSportData", _UserSportData);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Reference
{
@@ -60,6 +60,10 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"EntCountryCode",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Reference
{
@@ -29,8 +29,12 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
public ColumnDataString _Address1 { get; } = new ColumnDataString("Address1");
public ColumnDataString _Address2 { get; } = new ColumnDataString("Address2");
public ColumnDataString _City { get; } = new ColumnDataString("City");
public ColumnDataString _PostalCode { get; } = new ColumnDataString("PostalCode");
public ColumnDataDecimalNullable _Latitude { get; } = new ColumnDataDecimalNullable("Latitude");
public ColumnDataDecimalNullable _Longitude { get; } = new ColumnDataDecimalNullable("Longitude");
public ColumnDataString _Email { get; } = new ColumnDataString("Email");
public ColumnDataString _Telephone { get; } = new ColumnDataString("Telephone");
public ColumnDataString _MarkersData { get; } = new ColumnDataString("MarkersData");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
@@ -56,8 +60,12 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
"Address1",
"Address2",
"City",
"PostalCode",
"Latitude",
"Longitude",
"Email",
"Telephone",
"MarkersData",
"Notes",
"Flags",
"Status",
@@ -76,6 +84,11 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"Latitude",
"Longitude",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -109,8 +122,12 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
public String _Address1 { get { return Cols._Address1.Value; } set { Cols._Address1.Value = value; } }
public String _Address2 { get { return Cols._Address2.Value; } set { Cols._Address2.Value = value; } }
public String _City { get { return Cols._City.Value; } set { Cols._City.Value = value; } }
public String _PostalCode { get { return Cols._PostalCode.Value; } set { Cols._PostalCode.Value = value; } }
public Decimal? _Latitude { get { return Cols._Latitude.Value; } set { Cols._Latitude.Value = value; } }
public Decimal? _Longitude { get { return Cols._Longitude.Value; } set { Cols._Longitude.Value = value; } }
public String _Email { get { return Cols._Email.Value; } set { Cols._Email.Value = value; } }
public String _Telephone { get { return Cols._Telephone.Value; } set { Cols._Telephone.Value = value; } }
public String _MarkersData { get { return Cols._MarkersData.Value; } set { Cols._MarkersData.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; } }
@@ -151,8 +168,12 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
_Address1 = GetFieldString(dbDataReader, "Address1", _Address1);
_Address2 = GetFieldString(dbDataReader, "Address2", _Address2);
_City = GetFieldString(dbDataReader, "City", _City);
_PostalCode = GetFieldString(dbDataReader, "PostalCode", _PostalCode);
_Latitude = GetFieldDecimalNullable(dbDataReader, "Latitude", _Latitude);
_Longitude = GetFieldDecimalNullable(dbDataReader, "Longitude", _Longitude);
_Email = GetFieldString(dbDataReader, "Email", _Email);
_Telephone = GetFieldString(dbDataReader, "Telephone", _Telephone);
_MarkersData = GetFieldString(dbDataReader, "MarkersData", _MarkersData);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
_Status = GetFieldString(dbDataReader, "Status", _Status);
@@ -192,8 +213,12 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
if (columnNames.ContainsCI("Address1")) AddCommandParameter(dbCommand, "@Address1", _Address1);
if (columnNames.ContainsCI("Address2")) AddCommandParameter(dbCommand, "@Address2", _Address2);
if (columnNames.ContainsCI("City")) AddCommandParameter(dbCommand, "@City", _City);
if (columnNames.ContainsCI("PostalCode")) AddCommandParameter(dbCommand, "@PostalCode", _PostalCode);
if (columnNames.ContainsCI("Latitude")) AddCommandParameter(dbCommand, "@Latitude", _Latitude);
if (columnNames.ContainsCI("Longitude")) AddCommandParameter(dbCommand, "@Longitude", _Longitude);
if (columnNames.ContainsCI("Email")) AddCommandParameter(dbCommand, "@Email", _Email);
if (columnNames.ContainsCI("Telephone")) AddCommandParameter(dbCommand, "@Telephone", _Telephone);
if (columnNames.ContainsCI("MarkersData")) AddCommandParameter(dbCommand, "@MarkersData", _MarkersData);
if (columnNames.ContainsCI("Notes")) AddCommandParameter(dbCommand, "@Notes", _Notes);
if (columnNames.ContainsCI("Flags")) AddCommandParameter(dbCommand, "@Flags", _Flags);
if (columnNames.ContainsCI("Status")) AddCommandParameter(dbCommand, "@Status", _Status);
@@ -248,8 +273,12 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
if (columnNames.ContainsCI("Address1")) AddCommandParameter(dbCommand, "@Address1", _Address1);
if (columnNames.ContainsCI("Address2")) AddCommandParameter(dbCommand, "@Address2", _Address2);
if (columnNames.ContainsCI("City")) AddCommandParameter(dbCommand, "@City", _City);
if (columnNames.ContainsCI("PostalCode")) AddCommandParameter(dbCommand, "@PostalCode", _PostalCode);
if (columnNames.ContainsCI("Latitude")) AddCommandParameter(dbCommand, "@Latitude", _Latitude);
if (columnNames.ContainsCI("Longitude")) AddCommandParameter(dbCommand, "@Longitude", _Longitude);
if (columnNames.ContainsCI("Email")) AddCommandParameter(dbCommand, "@Email", _Email);
if (columnNames.ContainsCI("Telephone")) AddCommandParameter(dbCommand, "@Telephone", _Telephone);
if (columnNames.ContainsCI("MarkersData")) AddCommandParameter(dbCommand, "@MarkersData", _MarkersData);
if (columnNames.ContainsCI("Notes")) AddCommandParameter(dbCommand, "@Notes", _Notes);
if (columnNames.ContainsCI("Flags")) AddCommandParameter(dbCommand, "@Flags", _Flags);
if (columnNames.ContainsCI("Status")) AddCommandParameter(dbCommand, "@Status", _Status);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Reference
{
@@ -23,6 +23,14 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
public ColumnDataInt64 _ProvinceId { get; } = new ColumnDataInt64("ProvinceId");
public ColumnDataInt64 _FacilityId { get; } = new ColumnDataInt64("FacilityId");
public ColumnDataString _FacilityName { get; } = new ColumnDataString("FacilityName");
public ColumnDataString _Address1 { get; } = new ColumnDataString("Address1");
public ColumnDataString _Address2 { get; } = new ColumnDataString("Address2");
public ColumnDataString _City { get; } = new ColumnDataString("City");
public ColumnDataString _PostalCode { get; } = new ColumnDataString("PostalCode");
public ColumnDataDecimalNullable _Latitude { get; } = new ColumnDataDecimalNullable("Latitude");
public ColumnDataDecimalNullable _Longitude { get; } = new ColumnDataDecimalNullable("Longitude");
public ColumnDataString _Email { get; } = new ColumnDataString("Email");
public ColumnDataString _Telephone { get; } = new ColumnDataString("Telephone");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
public ColumnDataInt16 _Flags { get; } = new ColumnDataInt16("Flags");
public ColumnDataString _Status { get; } = new ColumnDataString("Status");
@@ -42,6 +50,14 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
"ProvinceId",
"FacilityId",
"FacilityName",
"Address1",
"Address2",
"City",
"PostalCode",
"Latitude",
"Longitude",
"Email",
"Telephone",
"Notes",
"Flags",
"Status",
@@ -60,6 +76,11 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"Latitude",
"Longitude",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -87,6 +108,14 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
public Int64 _ProvinceId { get { return Cols._ProvinceId.Value; } set { Cols._ProvinceId.Value = value; } }
public Int64 _FacilityId { get { return Cols._FacilityId.Value; } set { Cols._FacilityId.Value = value; } }
public String _FacilityName { get { return Cols._FacilityName.Value; } set { Cols._FacilityName.Value = value; } }
public String _Address1 { get { return Cols._Address1.Value; } set { Cols._Address1.Value = value; } }
public String _Address2 { get { return Cols._Address2.Value; } set { Cols._Address2.Value = value; } }
public String _City { get { return Cols._City.Value; } set { Cols._City.Value = value; } }
public String _PostalCode { get { return Cols._PostalCode.Value; } set { Cols._PostalCode.Value = value; } }
public Decimal? _Latitude { get { return Cols._Latitude.Value; } set { Cols._Latitude.Value = value; } }
public Decimal? _Longitude { get { return Cols._Longitude.Value; } set { Cols._Longitude.Value = value; } }
public String _Email { get { return Cols._Email.Value; } set { Cols._Email.Value = value; } }
public String _Telephone { get { return Cols._Telephone.Value; } set { Cols._Telephone.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; } }
@@ -121,6 +150,14 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
_ProvinceId = GetFieldInt64(dbDataReader, "ProvinceId", _ProvinceId);
_FacilityId = GetFieldInt64(dbDataReader, "FacilityId", _FacilityId);
_FacilityName = GetFieldString(dbDataReader, "FacilityName", _FacilityName);
_Address1 = GetFieldString(dbDataReader, "Address1", _Address1);
_Address2 = GetFieldString(dbDataReader, "Address2", _Address2);
_City = GetFieldString(dbDataReader, "City", _City);
_PostalCode = GetFieldString(dbDataReader, "PostalCode", _PostalCode);
_Latitude = GetFieldDecimalNullable(dbDataReader, "Latitude", _Latitude);
_Longitude = GetFieldDecimalNullable(dbDataReader, "Longitude", _Longitude);
_Email = GetFieldString(dbDataReader, "Email", _Email);
_Telephone = GetFieldString(dbDataReader, "Telephone", _Telephone);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
_Flags = GetFieldInt16(dbDataReader, "Flags", _Flags);
_Status = GetFieldString(dbDataReader, "Status", _Status);
@@ -154,6 +191,14 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
if (columnNames.ContainsCI("ProvinceId")) AddCommandParameter(dbCommand, "@ProvinceId", _ProvinceId);
if (columnNames.ContainsCI("FacilityId")) AddCommandParameter(dbCommand, "@FacilityId", _FacilityId);
if (columnNames.ContainsCI("FacilityName")) AddCommandParameter(dbCommand, "@FacilityName", _FacilityName);
if (columnNames.ContainsCI("Address1")) AddCommandParameter(dbCommand, "@Address1", _Address1);
if (columnNames.ContainsCI("Address2")) AddCommandParameter(dbCommand, "@Address2", _Address2);
if (columnNames.ContainsCI("City")) AddCommandParameter(dbCommand, "@City", _City);
if (columnNames.ContainsCI("PostalCode")) AddCommandParameter(dbCommand, "@PostalCode", _PostalCode);
if (columnNames.ContainsCI("Latitude")) AddCommandParameter(dbCommand, "@Latitude", _Latitude);
if (columnNames.ContainsCI("Longitude")) AddCommandParameter(dbCommand, "@Longitude", _Longitude);
if (columnNames.ContainsCI("Email")) AddCommandParameter(dbCommand, "@Email", _Email);
if (columnNames.ContainsCI("Telephone")) AddCommandParameter(dbCommand, "@Telephone", _Telephone);
if (columnNames.ContainsCI("Notes")) AddCommandParameter(dbCommand, "@Notes", _Notes);
if (columnNames.ContainsCI("Flags")) AddCommandParameter(dbCommand, "@Flags", _Flags);
if (columnNames.ContainsCI("Status")) AddCommandParameter(dbCommand, "@Status", _Status);
@@ -202,6 +247,14 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
if (columnNames.ContainsCI("ProvinceId")) AddCommandParameter(dbCommand, "@ProvinceId", _ProvinceId);
if (columnNames.ContainsCI("FacilityId")) AddCommandParameter(dbCommand, "@FacilityId", _FacilityId);
if (columnNames.ContainsCI("FacilityName")) AddCommandParameter(dbCommand, "@FacilityName", _FacilityName);
if (columnNames.ContainsCI("Address1")) AddCommandParameter(dbCommand, "@Address1", _Address1);
if (columnNames.ContainsCI("Address2")) AddCommandParameter(dbCommand, "@Address2", _Address2);
if (columnNames.ContainsCI("City")) AddCommandParameter(dbCommand, "@City", _City);
if (columnNames.ContainsCI("PostalCode")) AddCommandParameter(dbCommand, "@PostalCode", _PostalCode);
if (columnNames.ContainsCI("Latitude")) AddCommandParameter(dbCommand, "@Latitude", _Latitude);
if (columnNames.ContainsCI("Longitude")) AddCommandParameter(dbCommand, "@Longitude", _Longitude);
if (columnNames.ContainsCI("Email")) AddCommandParameter(dbCommand, "@Email", _Email);
if (columnNames.ContainsCI("Telephone")) AddCommandParameter(dbCommand, "@Telephone", _Telephone);
if (columnNames.ContainsCI("Notes")) AddCommandParameter(dbCommand, "@Notes", _Notes);
if (columnNames.ContainsCI("Flags")) AddCommandParameter(dbCommand, "@Flags", _Flags);
if (columnNames.ContainsCI("Status")) AddCommandParameter(dbCommand, "@Status", _Status);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Reference
{
@@ -78,6 +78,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:55
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Reference
{
@@ -62,6 +62,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Reference
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:56
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Support
{
@@ -21,7 +21,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Support
{
public ColumnDataInt64 _Id { get; } = new ColumnDataInt64("Id", true);
public ColumnDataInt64 _UserReportId { get; } = new ColumnDataInt64("UserReportId");
public ColumnDataDateTime _RecordedAt { get; } = new ColumnDataDateTime("RecordedAt");
public ColumnDataDateTimeNullable _RecordedAt { get; } = new ColumnDataDateTimeNullable("RecordedAt");
public ColumnDataInt32 _UserAccountId { get; } = new ColumnDataInt32("UserAccountId");
public ColumnDataString _CommentData { get; } = new ColumnDataString("CommentData");
public ColumnDataString _Notes { get; } = new ColumnDataString("Notes");
@@ -62,6 +62,10 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Support
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
"RecordedAt",
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -87,7 +91,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Support
public ColumnsData Cols { get; } = new ColumnsData();
public Int64 _Id { get { return Cols._Id.Value; } set { Cols._Id.Value = value; } }
public Int64 _UserReportId { get { return Cols._UserReportId.Value; } set { Cols._UserReportId.Value = value; } }
public DateTime _RecordedAt { get { return Cols._RecordedAt.Value; } set { Cols._RecordedAt.Value = value; } }
public DateTime? _RecordedAt { get { return Cols._RecordedAt.Value; } set { Cols._RecordedAt.Value = value; } }
public Int32 _UserAccountId { get { return Cols._UserAccountId.Value; } set { Cols._UserAccountId.Value = value; } }
public String _CommentData { get { return Cols._CommentData.Value; } set { Cols._CommentData.Value = value; } }
public String _Notes { get { return Cols._Notes.Value; } set { Cols._Notes.Value = value; } }
@@ -122,7 +126,7 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Support
{
_Id = GetFieldInt64(dbDataReader, "Id", _Id);
_UserReportId = GetFieldInt64(dbDataReader, "UserReportId", _UserReportId);
_RecordedAt = GetFieldDateTime(dbDataReader, "RecordedAt", _RecordedAt);
_RecordedAt = GetFieldDateTimeNullable(dbDataReader, "RecordedAt", _RecordedAt);
_UserAccountId = GetFieldInt32(dbDataReader, "UserAccountId", _UserAccountId);
_CommentData = GetFieldString(dbDataReader, "CommentData", _CommentData);
_Notes = GetFieldString(dbDataReader, "Notes", _Notes);
@@ -9,7 +9,7 @@ using System.Data.Common;
using System.Linq;
//---------------------------------------------------------------------------
// Code generated by Sarand Database Utilities Wed 22-May-2024 12:21:56
// Code generated by Sarand Database Utilities Thu 13-Jun-2024 12:44:40
//---------------------------------------------------------------------------
namespace Saxonite.Net.Standard.Dbas.Internal.Support
{
@@ -66,6 +66,9 @@ namespace Saxonite.Net.Standard.Dbas.Internal.Support
{
"Id",
};
protected static List<String> fieldsNullable { get; } = new List<String>()
{
};
protected static List<String> fieldsIgnoreOnUpdate { get; } = new List<String>()
{
"CreateOn",
@@ -82,7 +82,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUsgaCountry\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return usgaCountry;
@@ -398,14 +398,17 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
public override List<string> GetUsgaCountryQueryFilter(SaxGolfUsgaCountry.Params prm)
{
List<String> filter = new List<String>();
String col_Id = SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_Id, aliasUsgaCountry);
// Item Ids.
String idsIncluded = prm.IdsIncluded.Concat(",");
if (!idsIncluded.IsEmpty())
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_Id, aliasUsgaCountry) + " IN (" + idsIncluded + ")");
String idsExcluded = prm.IdsExcluded.Concat(",");
if (!idsExcluded.IsEmpty())
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_Id, aliasUsgaCountry) + " NOT IN (" + idsExcluded + ")");
if (prm.IdsIncluded.HasValidIds())
filter.Add($"{col_Id} IN ({prm.IdsIncluded.Concat(",")})");
if (prm.IdsExcluded.HasValidIds() )
filter.Add($"{col_Id} NOT IN ({prm.IdsExcluded.Concat(",")})");
// Country code.
if (!StringUtil.IsBlank(prm.CountryCodeFull))
filter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_CountryCode, aliasUsgaCountry)}='{DbQuery.FormatForCondition(prm.CountryCodeFull)}'");
if (!StringUtil.IsBlank(prm.CountryFilter))
{
@@ -416,21 +419,21 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
foreach (String filterWord in filterWords)
{
List<String> articleFilter = new List<String>();
articleFilter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_CountryCode, aliasUsgaCountry) + " Like '%" + DbQuery.FormatForLike(filterWord, true) + "%'");
articleFilter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_CountryName, aliasUsgaCountry) + " Like '%" + DbQuery.FormatForLike(filterWord, true) + "%'");
articleFilter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_CountryCode, aliasUsgaCountry)} Like '%{DbQuery.FormatForLike(filterWord, true)}%'");
articleFilter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_CountryName, aliasUsgaCountry)} Like '%{DbQuery.FormatForLike(filterWord, true)}%'");
filter.Add(articleFilter.Concat(" OR ", "(", ")"));
}
}
// Name.
if (!StringUtil.IsEmpty(prm.CountryNameFull))
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_CountryName, aliasUsgaCountry) + "='" + DbQuery.FormatForCondition(prm.CountryNameFull) + "'");
filter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_CountryName, aliasUsgaCountry)}='{DbQuery.FormatForCondition(prm.CountryNameFull)}'");
if (!StringUtil.IsEmpty(prm.CountryNamePartial))
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_CountryName, aliasUsgaCountry) + " LIKE '%" + DbQuery.FormatForLike(prm.CountryNamePartial) + "%'");
filter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_CountryName, aliasUsgaCountry)} LIKE '%{DbQuery.FormatForLike(prm.CountryNamePartial)}%'");
// Notes.
if (!StringUtil.IsEmpty(prm.NotesPartial))
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_Notes, aliasUsgaCountry) + " LIKE '%" + DbQuery.FormatForLike(prm.NotesPartial) + "%'");
filter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCountry_Notes, aliasUsgaCountry)} LIKE '%{DbQuery.FormatForLike(prm.NotesPartial)}%'");
// Status.
if (prm.StatusCat != SaxGolfUsgaCountry.StatusCat.Any)
@@ -442,13 +445,13 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
internal static String GetUsgaCountryStatusCatFilterCondition(SaxGolfUsgaCountry.StatusCat statusCat)
{
if (statusCat == SaxGolfUsgaCountry.StatusCat.ActiveOnly)
return "='" + SacsSystem.GetStatusCode(SaStatus.Active) + "'";
return $"='{SacsSystem.GetStatusCode(SaStatus.Active)}'";
if (statusCat == SaxGolfUsgaCountry.StatusCat.InactiveOnly)
return "='" + SacsSystem.GetStatusCode(SaStatus.Inactive) + "'";
return $"='{SacsSystem.GetStatusCode(SaStatus.Inactive)}'";
if (statusCat == SaxGolfUsgaCountry.StatusCat.NotDeleted)
return "!='" + SacsSystem.GetStatusCode(SaStatus.Deleted) + "'";
return $"!='{SacsSystem.GetStatusCode(SaStatus.Deleted)}'";
if (statusCat == SaxGolfUsgaCountry.StatusCat.DeletedOnly)
return "='" + SacsSystem.GetStatusCode(SaStatus.Deleted) + "'";
return $"='{SacsSystem.GetStatusCode(SaStatus.Deleted)}'";
return "";
}
// Item sort columns.
@@ -502,6 +505,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
// Item list.
public override List<SaxGolfUsgaCountry> GetUsgaCountryList(SaxGolfUsgaCountry.Params prm)
{
ClearErrorState();
List<SaxGolfUsgaCountry> userRoles = new List<SaxGolfUsgaCountry>();
DbQuery qry = new DbQuery(ReferenceDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Reference.GetTableNameQual(SaxDbDfn_Reference.TableIdx.UsgaCountry), aliasUsgaCountry);
@@ -529,7 +533,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUsgaCountryList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userRoles;
@@ -83,7 +83,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUsgaCourse\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return usgaCourse;
@@ -222,8 +222,12 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
dbUsgaCourse._Address1 = usgaCourse.Address1;
dbUsgaCourse._Address2 = usgaCourse.Address2;
dbUsgaCourse._City = usgaCourse.City;
dbUsgaCourse._PostalCode = usgaCourse.PostalCode;
dbUsgaCourse._Latitude = usgaCourse.Latitude;
dbUsgaCourse._Longitude = usgaCourse.Longitude;
dbUsgaCourse._Email = usgaCourse.Email;
dbUsgaCourse._Telephone = usgaCourse.Telephone;
dbUsgaCourse._MarkersData = usgaCourse.MarkersData;
// Common.
dbUsgaCourse._Notes = usgaCourse.Notes;
dbUsgaCourse._Status = SacsSystem.GetStatusCode(usgaCourse.Status);
@@ -250,8 +254,12 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
usgaCourse.Address1 = dbUsgaCourse._Address1;
usgaCourse.Address2 = dbUsgaCourse._Address2;
usgaCourse.City = dbUsgaCourse._City;
usgaCourse.PostalCode = dbUsgaCourse._PostalCode;
usgaCourse.Latitude = dbUsgaCourse._Latitude;
usgaCourse.Longitude = dbUsgaCourse._Longitude;
usgaCourse.Email = dbUsgaCourse._Email;
usgaCourse.Telephone = dbUsgaCourse._Telephone;
usgaCourse.MarkersData = dbUsgaCourse._MarkersData;
// Common.
usgaCourse.Notes = dbUsgaCourse._Notes;
usgaCourse.Status = SacsSystem.GetStatusForCode(dbUsgaCourse._Status);
@@ -304,10 +312,10 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
query.Add($"Into {SaxDbDfn_Reference.GetTableNameQual(SaxDbDfn_Reference.TableIdx.UsgaCourse)} uCrs");
query.Add("Using");
query.Add("(");
query.Add("Select dFty.Id FacilityId, dCrs.CourseId, dCrs.LegacyCrpCourseId, dCrs.Caption, dCrs.CourseName, dCrs.FullName, dCrs.Address1, dCrs.Address2, dCrs.City, dCrs.Email, dCrs.Telephone");
query.Add("Select dFty.Id FacilityId, dCrs.CourseId, dCrs.LegacyCrpCourseId, dCrs.Caption, dCrs.CourseName, dCrs.FullName, dCrs.Address1, dCrs.Address2, dCrs.City, dCrs.PostalCode, dCrs.Email, dCrs.Telephone");
query.Add("From");
query.Add("(");
query.Add("Select 0 FacilityId, 0 CourseId, 0 LegacyCrpCourseId, '' Caption, '' CourseName, '' FullName, '' Address1, '' Address2, '' City, '' Email, '' Telephone");
query.Add("Select 0 FacilityId, 0 CourseId, 0 LegacyCrpCourseId, '' Caption, '' CourseName, '' FullName, '' Address1, '' Address2, '' City, '' PostalCode, '' Email, '' Telephone");
foreach (UsgaCourseData course in coursesToUpdate.ExtractRange(0, batchSize))
query.Add($"Union Select {course.FacilityId}, {course.CourseId}, " +
(SysId.IsValid(course.LegacyCrpCourseId) ? $"{course.LegacyCrpCourseId}" : "Null") + "," +
@@ -317,13 +325,14 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
(course.Address1 != null ? $"'{DbQuery.FormatForCondition(course.Address1)}'" : "Null") + "," +
(course.Address2 != null ? $"'{DbQuery.FormatForCondition(course.Address2)}'" : "Null") + "," +
(course.City != null ? $"'{DbQuery.FormatForCondition(course.City)}'" : "Null") + "," +
(course.PostalCode != null ? $"'{DbQuery.FormatForCondition(course.PostalCode)}'" : "Null") + "," +
(course.Email != null ? $"'{DbQuery.FormatForCondition(course.Email)}'" : "Null") + "," +
(course.Telephone != null ? $"'{DbQuery.FormatForCondition(course.Telephone)}'" : "Null"));
query.Add(") dCrs");
query.Add($"Inner Join {SaxDbDfn_Reference.GetTableNameQual(SaxDbDfn_Reference.TableIdx.UsgaFacility)} dFty On dFty.FacilityId=dCrs.FacilityId");
query.Add(") dCrs");
query.Add("On uCrs.FacilityId=dCrs.FacilityId And uCrs.CourseId=dCrs.CourseId");
query.Add("When Matched And ((dCrs.LegacyCrpCourseId Is Not Null And uCrs.LegacyCrpCourseId!=dCrs.LegacyCrpCourseId) Or (dCrs.Caption Is Not Null And uCrs.Caption!=dCrs.Caption) Or (dCrs.CourseName Is Not Null And uCrs.CourseName!=dCrs.CourseName) Or (dCrs.FullName Is Not Null And uCrs.FullName!=dCrs.FullName) Or (dCrs.Address1 Is Not Null And uCrs.Address1!=dCrs.Address1) Or (dCrs.Address2 Is Not Null And uCrs.Address2!=dCrs.Address2) Or (dCrs.City Is Not Null And uCrs.City!=dCrs.City) Or (dCrs.Email Is Not Null And uCrs.Email!=dCrs.Email) Or (dCrs.Telephone Is Not Null And uCrs.Telephone!=dCrs.Telephone) Or uCrs.Status!=@statusActive)");
query.Add("When Matched And ((dCrs.LegacyCrpCourseId Is Not Null And uCrs.LegacyCrpCourseId!=dCrs.LegacyCrpCourseId) Or (dCrs.Caption Is Not Null And uCrs.Caption!=dCrs.Caption) Or (dCrs.CourseName Is Not Null And uCrs.CourseName!=dCrs.CourseName) Or (dCrs.FullName Is Not Null And uCrs.FullName!=dCrs.FullName) Or (dCrs.Address1 Is Not Null And uCrs.Address1!=dCrs.Address1) Or (dCrs.Address2 Is Not Null And uCrs.Address2!=dCrs.Address2) Or (dCrs.City Is Not Null And uCrs.City!=dCrs.City) Or (dCrs.PostalCode Is Not Null And uCrs.PostalCode!=dCrs.PostalCode) Or (dCrs.Email Is Not Null And uCrs.Email!=dCrs.Email) Or (dCrs.Telephone Is Not Null And uCrs.Telephone!=dCrs.Telephone) Or uCrs.Status!=@statusActive)");
query.Add("Then Update Set");
query.Add(" LegacyCrpCourseId=Coalesce(dCrs.LegacyCrpCourseId,uCrs.LegacyCrpCourseId),");
query.Add(" Caption=Coalesce(dCrs.Caption,uCrs.Caption),");
@@ -332,6 +341,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
query.Add(" Address1=Coalesce(dCrs.Address1,uCrs.Address1),");
query.Add(" Address2=Coalesce(dCrs.Address2,uCrs.Address2),");
query.Add(" City=Coalesce(dCrs.City,uCrs.City),");
query.Add(" PostalCode=Coalesce(dCrs.PostalCode,uCrs.PostalCode),");
query.Add(" Email=Coalesce(dCrs.Email,uCrs.Email),");
query.Add(" Telephone=Coalesce(dCrs.Telephone,uCrs.Telephone),");
query.Add(" Status=@statusActive,");
@@ -339,8 +349,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
query.Add(" UpdateBy=@updateBy,");
query.Add(" UpdateHost=@updateHost");
query.Add("When Not Matched And Len(Coalesce(dCrs.Caption,''))>0");
query.Add("Then Insert (FacilityId,CourseId,LegacyCrpCourseId,Caption,CourseName,FullName,Address1,Address2,City,Email,Telephone,Notes,Flags,Status,CreateOn,CreateBy,CreateHost,UpdateOn,UpdateBy,UpdateHost)");
query.Add($"Values (dCrs.FacilityId,dCrs.CourseId,Coalesce(dCrs.LegacyCrpCourseId,0),dCrs.Caption,Coalesce(dCrs.CourseName,''),Coalesce(dCrs.FullName,''),Coalesce(dCrs.Address1,''),Coalesce(dCrs.Address2,''),Coalesce(dCrs.City,''),Coalesce(dCrs.Email,''),Coalesce(dCrs.Telephone,''),'',0,@statusActive,@updateOn,@updateBy,@updateHost,@updateOn,@updateBy,@updateHost)");
query.Add("Then Insert (FacilityId,CourseId,LegacyCrpCourseId,Caption,CourseName,FullName,Address1,Address2,City,PostalCode,Email,Telephone,MarkersData,Notes,Flags,Status,CreateOn,CreateBy,CreateHost,UpdateOn,UpdateBy,UpdateHost)");
query.Add($"Values (dCrs.FacilityId,dCrs.CourseId,Coalesce(dCrs.LegacyCrpCourseId,0),dCrs.Caption,Coalesce(dCrs.CourseName,''),Coalesce(dCrs.FullName,''),Coalesce(dCrs.Address1,''),Coalesce(dCrs.Address2,''),Coalesce(dCrs.City,''),Coalesce(dCrs.PostalCode,''),Coalesce(dCrs.Email,''),Coalesce(dCrs.Telephone,''),'','',0,@statusActive,@updateOn,@updateBy,@updateHost,@updateOn,@updateBy,@updateHost)");
query.Add(";");
//SaLogger.Info($"{SysUtil.Fn} Bulk USGA Course update query:\n\t{query.Concat("\n\t")}");
@@ -482,29 +492,32 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
public override List<string> GetUsgaCourseQueryFilter(SaxGolfUsgaCourse.Params prm)
{
List<String> filter = new List<String>();
String col_Id = SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCourse_Id, aliasUsgaCourse);
String col_FacilityId = SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCourse_FacilityId, aliasUsgaCourse);
// Item Ids.
String idsIncluded = prm.IdsIncluded.Concat(",");
if (!idsIncluded.IsEmpty())
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCourse_Id, aliasUsgaCourse) + " IN (" + idsIncluded + ")");
String idsExcluded = prm.IdsExcluded.Concat(",");
if (!idsExcluded.IsEmpty())
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCourse_Id, aliasUsgaCourse) + " NOT IN (" + idsExcluded + ")");
if (prm.IdsIncluded.HasValidIds())
filter.Add($"{col_Id} IN ({prm.IdsIncluded.Concat(",")})");
if (prm.IdsExcluded.HasValidIds())
filter.Add($"{col_Id} NOT IN ({prm.IdsExcluded.Concat(",")})");
// Provinces.
String provinceIdsIncluded = prm.ProvinceIdsIncluded.Concat(",");
if (!provinceIdsIncluded.IsEmpty())
if (prm.ProvinceIdsIncluded.HasValidIds())
{
String provinceIdsIncluded = prm.ProvinceIdsIncluded.Concat(",");
if (StringUtil.IsBlank(prm.Alias_Province))
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCourse_FacilityId, aliasUsgaCourse) + " IN (SELECT Id FROM " + SaxDbDfn_Reference.GetTableNameQual(SaxDbDfn_Reference.TableIdx.UsgaFacility) + " WHERE ProvinceId IN (" + provinceIdsIncluded + "))");
filter.Add($"{col_FacilityId} IN (SELECT Id FROM {SaxDbDfn_Reference.GetTableNameQual(SaxDbDfn_Reference.TableIdx.UsgaFacility)} WHERE ProvinceId IN ({provinceIdsIncluded}))");
else
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_Id, prm.Alias_Province) + " IN (" + provinceIdsIncluded + ")");
filter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_Id, prm.Alias_Province)} IN ({provinceIdsIncluded})");
}
// Facilities.
String facilityIdsIncluded = prm.FacilityIdsIncluded.Concat(",");
if (!facilityIdsIncluded.IsEmpty())
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCourse_FacilityId, aliasUsgaCourse) + " IN (" + facilityIdsIncluded + ")");
if (prm.FacilityIdsIncluded.HasValidIds())
filter.Add($"{col_FacilityId} IN ({prm.FacilityIdsIncluded.Concat(",")})");
// Course Ids.
if (prm.CourseIdsIncluded.HasValidIds())
filter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaCourse_CourseId, aliasUsgaCourse)} IN ({prm.CourseIdsIncluded.Concat(",")})");
if (!StringUtil.IsBlank(prm.CourseFilter))
{
@@ -604,6 +617,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
// Item list.
public override List<SaxGolfUsgaCourse> GetUsgaCourseList(SaxGolfUsgaCourse.Params prm)
{
ClearErrorState();
List<SaxGolfUsgaCourse> userRoles = new List<SaxGolfUsgaCourse>();
DbQuery qry = new DbQuery(ReferenceDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Reference.GetTableNameQual(SaxDbDfn_Reference.TableIdx.UsgaCourse), aliasUsgaCourse);
@@ -631,7 +645,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUsgaCourseList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userRoles;
@@ -83,7 +83,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUsgaFacility\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return usgaFacility;
@@ -216,6 +216,14 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
dbUsgaFacility._ProvinceId = SysId.ToInt(usgaFacility.ProvinceId);
dbUsgaFacility._FacilityId = SysId.ToLong(usgaFacility.FacilityId);
dbUsgaFacility._FacilityName = usgaFacility.FacilityName;
dbUsgaFacility._Address1 = usgaFacility.Address1;
dbUsgaFacility._Address2 = usgaFacility.Address2;
dbUsgaFacility._City = usgaFacility.City;
dbUsgaFacility._PostalCode = usgaFacility.PostalCode;
dbUsgaFacility._Latitude = usgaFacility.Latitude;
dbUsgaFacility._Longitude = usgaFacility.Longitude;
dbUsgaFacility._Email = usgaFacility.Email;
dbUsgaFacility._Telephone = usgaFacility.Telephone;
// Common.
dbUsgaFacility._Notes = usgaFacility.Notes;
dbUsgaFacility._Status = SacsSystem.GetStatusCode(usgaFacility.Status);
@@ -236,6 +244,14 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
usgaFacility.ProvinceId = new SysId(dbUsgaFacility._ProvinceId);
usgaFacility.FacilityId = new SysId(dbUsgaFacility._FacilityId);
usgaFacility.FacilityName = dbUsgaFacility._FacilityName;
usgaFacility.Address1 = dbUsgaFacility._Address1;
usgaFacility.Address2 = dbUsgaFacility._Address2;
usgaFacility.City = dbUsgaFacility._City;
usgaFacility.PostalCode = dbUsgaFacility._PostalCode;
usgaFacility.Latitude = dbUsgaFacility._Latitude;
usgaFacility.Longitude = dbUsgaFacility._Longitude;
usgaFacility.Email = dbUsgaFacility._Email;
usgaFacility.Telephone = dbUsgaFacility._Telephone;
// Common.
usgaFacility.Notes = dbUsgaFacility._Notes;
usgaFacility.Status = SacsSystem.GetStatusForCode(dbUsgaFacility._Status);
@@ -266,6 +282,11 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
if (!IsValidValue(facility.ProvinceCode, "province", (long)SaxDbDfn_Reference.GetColTextLen(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_ProvinceCode), true)) return false;
if (!SysId.IsValid(facility.FacilityId)) return SetErrorState("Facility Id must be supplied");
if (facility.FacilityName != null && !IsValidValue(facility.FacilityName, "name", (long)SaxDbDfn_Reference.GetColTextLen(SaxDbDfn_Reference.ColumnIdx.UsgaFacility_FacilityName))) return false;
if (facility.Address1 != null && !IsValidValue(facility.Address1, "address 1", (long)SaxDbDfn_Reference.GetColTextLen(SaxDbDfn_Reference.ColumnIdx.UsgaFacility_Address1))) return false;
if (facility.Address2 != null && !IsValidValue(facility.Address2, "address 2", (long)SaxDbDfn_Reference.GetColTextLen(SaxDbDfn_Reference.ColumnIdx.UsgaFacility_Address2))) return false;
if (facility.City != null && !IsValidValue(facility.City, "city", (long)SaxDbDfn_Reference.GetColTextLen(SaxDbDfn_Reference.ColumnIdx.UsgaFacility_City))) return false;
if (facility.Email != null && !IsValidValue(facility.Email, "email", (long)SaxDbDfn_Reference.GetColTextLen(SaxDbDfn_Reference.ColumnIdx.UsgaFacility_Email))) return false;
if (facility.Telephone != null && !IsValidValue(facility.Telephone, "telephone", (long)SaxDbDfn_Reference.GetColTextLen(SaxDbDfn_Reference.ColumnIdx.UsgaFacility_Telephone))) return false;
facilitiesToUpdate.Add(facility);
}
int MaxBulkUpdateBatchSize = 64;
@@ -281,26 +302,39 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
query.Add($"Into {SaxDbDfn_Reference.GetTableNameQual(SaxDbDfn_Reference.TableIdx.UsgaFacility)} uFty");
query.Add("Using");
query.Add("(");
query.Add("Select dPrv.Id ProvinceId, dFty.ProvinceCode, dFty.FacilityId, dFty.FacilityName");
query.Add("Select dPrv.Id ProvinceId, dFty.ProvinceCode, dFty.FacilityId, dFty.FacilityName, dFty.Address1, dFty.Address2, dFty.City, dFty.PostalCode, dFty.Email, dFty.Telephone");
query.Add("From");
query.Add("(");
query.Add("Select '' ProvinceCode, '' FacilityId, '' FacilityName");
query.Add("Select '' ProvinceCode, '' FacilityId, '' FacilityName, '' Address1, '' Address2, '' City, '' PostalCode, '' Email, '' Telephone");
foreach (UsgaFacilityData facility in facilitiesToUpdate.ExtractRange(0, batchSize))
query.Add($"Union Select '{DbQuery.FormatForCondition(facility.ProvinceCode)}', {SysId.ToString(facility.FacilityId)}, " + (facility.FacilityName != null ? $"'{DbQuery.FormatForCondition(facility.FacilityName)}'" : "Null"));
query.Add($"Union Select '{DbQuery.FormatForCondition(facility.ProvinceCode)}', {SysId.ToString(facility.FacilityId)}, " +
(facility.FacilityName != null ? $"'{DbQuery.FormatForCondition(facility.FacilityName)}'" : "Null") + "," +
(facility.Address1 != null ? $"'{DbQuery.FormatForCondition(facility.Address1)}'" : "Null") + "," +
(facility.Address2 != null ? $"'{DbQuery.FormatForCondition(facility.Address2)}'" : "Null") + "," +
(facility.City != null ? $"'{DbQuery.FormatForCondition(facility.City)}'" : "Null") + "," +
(facility.PostalCode != null ? $"'{DbQuery.FormatForCondition(facility.PostalCode)}'" : "Null") + "," +
(facility.Email != null ? $"'{DbQuery.FormatForCondition(facility.Email)}'" : "Null") + "," +
(facility.Telephone != null ? $"'{DbQuery.FormatForCondition(facility.Telephone)}'" : "Null"));
query.Add(") dFty");
query.Add($"Inner Join {SaxDbDfn_Reference.GetTableNameQual(SaxDbDfn_Reference.TableIdx.UsgaProvince)} dPrv On dPrv.ProvinceCode=dFty.ProvinceCode");
query.Add(") dFty");
query.Add("On uFty.ProvinceId=dFty.ProvinceId And uFty.FacilityId=dFty.FacilityId");
query.Add("When Matched And ((dFty.FacilityName Is Not Null And uFty.FacilityName!=dFty.FacilityName) Or uFty.Status!=@statusActive)");
query.Add("When Matched And ((dFty.FacilityName Is Not Null And uFty.FacilityName!=dFty.FacilityName) Or (dFty.Address1 Is Not Null And uFty.Address1!=dFty.Address1) Or (dFty.Address2 Is Not Null And uFty.Address2!=dFty.Address2) Or (dFty.City Is Not Null And uFty.City!=dFty.City) Or (dFty.PostalCode Is Not Null And uFty.PostalCode!=dFty.PostalCode) Or (dFty.Email Is Not Null And uFty.Email!=dFty.Email) Or (dFty.Telephone Is Not Null And uFty.Telephone!=dFty.Telephone) Or uFty.Status!=@statusActive)");
query.Add("Then Update Set");
query.Add(" FacilityName=Coalesce(dFty.FacilityName,uFty.FacilityName),");
query.Add(" Address1=Coalesce(dFty.Address1,uFty.Address1),");
query.Add(" Address2=Coalesce(dFty.Address2,uFty.Address2),");
query.Add(" City=Coalesce(dFty.City,uFty.City),");
query.Add(" PostalCode=Coalesce(dFty.PostalCode,uFty.PostalCode),");
query.Add(" Email=Coalesce(dFty.Email,uFty.Email),");
query.Add(" Telephone=Coalesce(dFty.Telephone,uFty.Telephone),");
query.Add(" Status=@statusActive,");
query.Add(" UpdateOn=@updateOn,");
query.Add(" UpdateBy=@updateBy,");
query.Add(" UpdateHost=@updateHost");
query.Add("When Not Matched And Len(IsNull(dFty.FacilityName,''))>0");
query.Add("Then Insert (ProvinceId,FacilityId,FacilityName,Notes,Flags,Status,CreateOn,CreateBy,CreateHost,UpdateOn,UpdateBy,UpdateHost)");
query.Add($"Values (dFty.ProvinceId,dFty.FacilityId,dFty.FacilityName,'',0,@statusActive,@updateOn,@updateBy,@updateHost,@updateOn,@updateBy,@updateHost)");
query.Add("Then Insert (ProvinceId,FacilityId,FacilityName,Address1,Address2,City,PostalCode,Email,Telephone,Notes,Flags,Status,CreateOn,CreateBy,CreateHost,UpdateOn,UpdateBy,UpdateHost)");
query.Add($"Values (dFty.ProvinceId,dFty.FacilityId,dFty.FacilityName,Coalesce(dFty.Address1,''),Coalesce(dFty.Address2,''),Coalesce(dFty.City,''),Coalesce(dFty.PostalCode,''),Coalesce(dFty.Email,''),Coalesce(dFty.Telephone,''),'',0,@statusActive,@updateOn,@updateBy,@updateHost,@updateOn,@updateBy,@updateHost)");
query.Add(";");
//SaLogger.Info($"{SysUtil.Fn} Bulk USGA Facility update query:\n\t{query.Concat("\n\t")}");
@@ -522,6 +556,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
// Item list.
public override List<SaxGolfUsgaFacility> GetUsgaFacilityList(SaxGolfUsgaFacility.Params prm)
{
ClearErrorState();
List<SaxGolfUsgaFacility> userRoles = new List<SaxGolfUsgaFacility>();
DbQuery qry = new DbQuery(ReferenceDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Reference.GetTableNameQual(SaxDbDfn_Reference.TableIdx.UsgaFacility), aliasUsgaFacility);
@@ -549,7 +584,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUsgaFacilityList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userRoles;
@@ -83,7 +83,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUsgaMarker\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return usgaMarker;
@@ -282,7 +282,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
// Validate marker properties.
// Course and Marker Codes are mandatory, other values only validated if non-null.
if (!SysId.IsValid(marker.CourseId)) return SetErrorState("Course Id must be supplied");
if (!SysId.IsValid(marker.MarkerId)) return SetErrorState("Marker Id must be supplied");
// 9 hole markers missing Id: if (!SysId.IsValid(marker.MarkerId)) return SetErrorState("Marker Id must be supplied");
if (marker.Caption != null && !IsValidValue(marker.HolesCaption, "caption", (long)SaxDbDfn_Reference.GetColTextLen(SaxDbDfn_Reference.ColumnIdx.UsgaMarker_HolesCaption))) return false;
if (marker.Holes < 1) return SetErrorState("Holes must be supplied");
if (marker.HolesCaption != null && !IsValidValue(marker.HolesCaption, "full name", (long)SaxDbDfn_Reference.GetColTextLen(SaxDbDfn_Reference.ColumnIdx.UsgaMarker_HolesCaption))) return false;
@@ -311,7 +311,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
query.Add("(");
query.Add("Select 0 CourseId, 0 MarkerId, '' Caption, 0 Holes, '' HolesCaption, '' Tee, '' Gender, 0 SlopeRating, 0 Par, 0 CourseRating, 0 BogeyRating, 0 Length");
foreach (UsgaMarkerData marker in markersToUpdate.ExtractRange(0, batchSize))
query.Add($"Union Select {marker.CourseId},{marker.MarkerId}," +
query.Add($"Union Select {marker.CourseId},{StringUtil.OnBlank(SysId.ToString(marker.MarkerId),"0")}," +
(marker.Caption != null ? $"'{DbQuery.FormatForCondition(marker.Caption)}'" : "Null") + "," +
$"{marker.Holes}," +
(marker.HolesCaption != null ? $"'{DbQuery.FormatForCondition(marker.HolesCaption)}'" : "Null") + "," +
@@ -598,6 +598,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
// Item list.
public override List<SaxGolfUsgaMarker> GetUsgaMarkerList(SaxGolfUsgaMarker.Params prm)
{
ClearErrorState();
List<SaxGolfUsgaMarker> userRoles = new List<SaxGolfUsgaMarker>();
DbQuery qry = new DbQuery(ReferenceDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Reference.GetTableNameQual(SaxDbDfn_Reference.TableIdx.UsgaMarker), aliasUsgaMarker);
@@ -625,7 +626,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUsgaMarkerList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userRoles;
@@ -83,7 +83,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUsgaProvince\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return usgaProvince;
@@ -418,19 +418,21 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
public override List<string> GetUsgaProvinceQueryFilter(SaxGolfUsgaProvince.Params prm)
{
List<String> filter = new List<String>();
String col_Id = SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_Id, aliasUsgaProvince);
// Item Ids.
String idsIncluded = prm.IdsIncluded.Concat(",");
if (!idsIncluded.IsEmpty())
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_Id, aliasUsgaProvince) + " IN (" + idsIncluded + ")");
String idsExcluded = prm.IdsExcluded.Concat(",");
if (!idsExcluded.IsEmpty())
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_Id, aliasUsgaProvince) + " NOT IN (" + idsExcluded + ")");
if (prm.IdsIncluded.HasValidIds())
filter.Add($"{col_Id} IN ({prm.IdsIncluded.Concat(",")})");
if (prm.IdsExcluded.HasValidIds())
filter.Add($"{col_Id} NOT IN ({prm.IdsExcluded.Concat(",")})");
// Countries.
String countryIdsIncluded = prm.CountryIdsIncluded.Concat(",");
if (!countryIdsIncluded.IsEmpty())
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_CountryId, aliasUsgaProvince) + " IN (" + countryIdsIncluded + ")");
if (prm.CountryIdsIncluded.HasValidIds())
filter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_CountryId, aliasUsgaProvince)} IN ({prm.CountryIdsIncluded.Concat(",")})");
// Province code.
if (!StringUtil.IsEmpty(prm.ProvinceCodeFull))
filter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_ProvinceCode, aliasUsgaProvince)}='{DbQuery.FormatForCondition(prm.ProvinceCodeFull)}'");
if (!StringUtil.IsBlank(prm.ProvinceFilter))
{
@@ -441,21 +443,21 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
foreach (String filterWord in filterWords)
{
List<String> articleFilter = new List<String>();
articleFilter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_ProvinceCode, aliasUsgaProvince) + " Like '%" + DbQuery.FormatForLike(filterWord, true) + "%'");
articleFilter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_ProvinceName, aliasUsgaProvince) + " Like '%" + DbQuery.FormatForLike(filterWord, true) + "%'");
articleFilter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_ProvinceCode, aliasUsgaProvince)} Like '%{DbQuery.FormatForLike(filterWord, true)}%'");
articleFilter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_ProvinceName, aliasUsgaProvince)} Like '%{DbQuery.FormatForLike(filterWord, true)}%'");
filter.Add(articleFilter.Concat(" OR ", "(", ")"));
}
}
// Name.
if (!StringUtil.IsEmpty(prm.ProvinceNameFull))
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_ProvinceName, aliasUsgaProvince) + "='" + DbQuery.FormatForCondition(prm.ProvinceNameFull) + "'");
filter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_ProvinceName, aliasUsgaProvince)}='{DbQuery.FormatForCondition(prm.ProvinceNameFull)}'");
if (!StringUtil.IsEmpty(prm.ProvinceNamePartial))
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_ProvinceName, aliasUsgaProvince) + " LIKE '%" + DbQuery.FormatForLike(prm.ProvinceNamePartial) + "%'");
filter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_ProvinceName, aliasUsgaProvince)} LIKE '%{DbQuery.FormatForLike(prm.ProvinceNamePartial)}%'");
// Notes.
if (!StringUtil.IsEmpty(prm.NotesPartial))
filter.Add(SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_Notes, aliasUsgaProvince) + " LIKE '%" + DbQuery.FormatForLike(prm.NotesPartial) + "%'");
filter.Add($"{SaxDbDfn_Reference.GetColumnNameQual(SaxDbDfn_Reference.ColumnIdx.UsgaProvince_Notes, aliasUsgaProvince)} LIKE '%{DbQuery.FormatForLike(prm.NotesPartial)}%'");
// Status.
if (prm.StatusCat != SaxGolfUsgaProvince.StatusCat.Any)
@@ -467,13 +469,13 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
internal static String GetUsgaProvinceStatusCatFilterCondition(SaxGolfUsgaProvince.StatusCat statusCat)
{
if (statusCat == SaxGolfUsgaProvince.StatusCat.ActiveOnly)
return "='" + SacsSystem.GetStatusCode(SaStatus.Active) + "'";
return $"='{SacsSystem.GetStatusCode(SaStatus.Active)}'";
if (statusCat == SaxGolfUsgaProvince.StatusCat.InactiveOnly)
return "='" + SacsSystem.GetStatusCode(SaStatus.Inactive) + "'";
return $"='{SacsSystem.GetStatusCode(SaStatus.Inactive)}'";
if (statusCat == SaxGolfUsgaProvince.StatusCat.NotDeleted)
return "!='" + SacsSystem.GetStatusCode(SaStatus.Deleted) + "'";
return $"!='{SacsSystem.GetStatusCode(SaStatus.Deleted)}'";
if (statusCat == SaxGolfUsgaProvince.StatusCat.DeletedOnly)
return "='" + SacsSystem.GetStatusCode(SaStatus.Deleted) + "'";
return $"='{SacsSystem.GetStatusCode(SaStatus.Deleted)}'";
return "";
}
// Item sort columns.
@@ -527,6 +529,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
// Item list.
public override List<SaxGolfUsgaProvince> GetUsgaProvinceList(SaxGolfUsgaProvince.Params prm)
{
ClearErrorState();
List<SaxGolfUsgaProvince> userRoles = new List<SaxGolfUsgaProvince>();
DbQuery qry = new DbQuery(ReferenceDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Reference.GetTableNameQual(SaxDbDfn_Reference.TableIdx.UsgaProvince), aliasUsgaProvince);
@@ -554,7 +557,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr.Reference
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUsgaProvinceList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userRoles;
@@ -82,7 +82,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetOrganisation\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return organisation;
@@ -240,8 +240,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
organisation.Name = dbOrganisation._Name;
organisation.OrganisationType = (Sax.OrganisationType)OrganisationTypeCodes.GetTypeForCode(dbOrganisation._OrganisationType);
organisation.OrganisationCategory = (Sax.OrganisationCategory)OrganisationCategoryCodes.GetTypeForCode(dbOrganisation._OrganisationCategory);
organisation.SportIdPrimary = new SysId(dbOrganisation._SportIdPrimary);
organisation.RegionIdPrimary = new SysId(dbOrganisation._RegionIdPrimary);
organisation.SportIdPrimary = new SysId(dbOrganisation._SportIdPrimary ?? 0);
organisation.RegionIdPrimary = new SysId(dbOrganisation._RegionIdPrimary ?? 0);
organisation.About = dbOrganisation._About;
organisation.Facilities = dbOrganisation._Facilities;
organisation.ContactData = dbOrganisation._ContactData;
@@ -553,6 +553,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxOrganisation> GetOrganisationList(SaxOrganisation.Params prm)
{
ClearErrorState();
List<SaxOrganisation> userAccounts = new List<SaxOrganisation>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.Organisation), aliasOrganisation);
@@ -580,7 +581,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetOrganisationList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userAccounts;
@@ -82,7 +82,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUserAccount\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userAccount;
@@ -263,9 +263,9 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
userAccount.Gender = (Sax.Gender)dbUserAccount._Gender;
userAccount.DateOfBirthDay = dbUserAccount._DateOfBirthDay;
userAccount.DateOfBirthMonth = dbUserAccount._DateOfBirthMonth;
userAccount.DateOfBirthYear = dbUserAccount._DateOfBirthYear;
userAccount.RegionIdCountry = new SysId(dbUserAccount._RegionIdCountry);
userAccount.RegionIdProvince = new SysId(dbUserAccount._RegionIdProvince);
userAccount.DateOfBirthYear = dbUserAccount._DateOfBirthYear ?? 0;
userAccount.RegionIdCountry = new SysId(dbUserAccount._RegionIdCountry ?? 0);
userAccount.RegionIdProvince = new SysId(dbUserAccount._RegionIdProvince ?? 0);
// Security.
userAccount.PasswordHashed = dbUserAccount._PasswordHashed;
userAccount.PasswordToken = dbUserAccount._PasswordToken;
@@ -702,6 +702,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxUserAccount> GetUserAccountList(SaxUserAccount.Params prm)
{
ClearErrorState();
List<SaxUserAccount> userAccounts = new List<SaxUserAccount>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserAccount), aliasUserAccount);
@@ -729,7 +730,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUserAccountList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userAccounts;
@@ -82,7 +82,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUserConfig\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userConfig;
@@ -381,6 +381,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxUserConfig> GetUserConfigList(SaxUserConfig.Params prm)
{
ClearErrorState();
List<SaxUserConfig> userConfigs = new List<SaxUserConfig>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserConfig), aliasUserConfig);
@@ -408,7 +409,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUserConfigList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userConfigs;
@@ -49,7 +49,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
private SaxUserEligibility_Dbas CreateUserEligibility(UserEligibility_Db dbUserEligibility)
{
ClearErrorState();
SaxUserEligibility_Dbas userEligibility = new SaxUserEligibility_Dbas(CoreDatabase, new SysId(dbUserEligibility._Id), new SysId(dbUserEligibility._UserAccountId), new SysId(dbUserEligibility._RegionId), (Sax.EligibilityType)dbUserEligibility._EligibilityType, (ushort)dbUserEligibility._Flags);
SaxUserEligibility_Dbas userEligibility = new SaxUserEligibility_Dbas(CoreDatabase, new SysId(dbUserEligibility._Id), new SysId(dbUserEligibility._UserAccountId), new SysId(dbUserEligibility._RegionId ?? 0), (Sax.EligibilityType)dbUserEligibility._EligibilityType, (ushort)dbUserEligibility._Flags);
PopulateFrom(dbUserEligibility, userEligibility);
return userEligibility;
}
@@ -86,7 +86,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUserEligibility\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userEligibility;
@@ -504,6 +504,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxUserEligibility> GetUserEligibilityList(SaxUserEligibility.Params prm)
{
ClearErrorState();
List<SaxUserEligibility> userEligibilitys = new List<SaxUserEligibility>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserEligibility), aliasUserEligibility);
@@ -531,7 +532,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUserEligibilityList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userEligibilitys;
@@ -123,7 +123,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUserOnline\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userOnline;
@@ -461,6 +461,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxUserOnline> GetUserOnlineList(SaxUserOnline.Params prm)
{
ClearErrorState();
List<SaxUserOnline> userOnlines = new List<SaxUserOnline>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserOnline), aliasUserOnline);
@@ -488,7 +489,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUserOnlineList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userOnlines;
@@ -84,7 +84,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUserOrganisation\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userOrganisation;
@@ -610,6 +610,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxUserOrganisation> GetUserOrganisationList(SaxUserOrganisation.Params prm)
{
ClearErrorState();
List<SaxUserOrganisation> userOrganisations = new List<SaxUserOrganisation>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserOrganisation), aliasUserOrganisation);
@@ -637,7 +638,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUserOrganisationList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userOrganisations;
@@ -83,7 +83,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUserRole\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userRole;
@@ -474,6 +474,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxUserRole> GetUserRoleList(SaxUserRole.Params prm)
{
ClearErrorState();
List<SaxUserRole> userRoles = new List<SaxUserRole>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserRole), aliasUserRole);
@@ -501,7 +502,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUserRoleList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userRoles;
@@ -80,7 +80,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUserSession\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userSession;
@@ -373,6 +373,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxUserSession> GetUserSessionList(SaxUserSession.Params prm)
{
ClearErrorState();
List<SaxUserSession> userSessions = new List<SaxUserSession>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserSession), aliasUserSession);
@@ -400,7 +401,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUserSessionList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userSessions;
@@ -83,7 +83,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUserSport\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userSport;
@@ -496,6 +496,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxUserSport> GetUserSportList(SaxUserSport.Params prm)
{
ClearErrorState();
List<SaxUserSport> userSports = new List<SaxUserSport>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserSport), aliasUserSport);
@@ -523,7 +524,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUserSportList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userSports;
@@ -84,7 +84,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUserSportExperience\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userSportExperience;
@@ -515,6 +515,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxUserSportExperience> GetUserSportExperienceList(SaxUserSportExperience.Params prm)
{
ClearErrorState();
List<SaxUserSportExperience> userSportExperiences = new List<SaxUserSportExperience>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserSportExperience), aliasUserSportExperience);
@@ -542,7 +543,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUserSportExperienceList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userSportExperiences;
@@ -82,7 +82,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetActivityFeedback\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return activityFeedback;
@@ -400,6 +400,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxActivityFeedback> GetActivityFeedbackList(SaxActivityFeedback.Params prm)
{
ClearErrorState();
List<SaxActivityFeedback> userActivitys = new List<SaxActivityFeedback>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.ActivityFeedback), aliasActivityFeedback);
@@ -427,7 +428,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetActivityFeedbackList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userActivitys;
@@ -84,7 +84,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetActivityIndex\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return activityIndex;
@@ -232,8 +232,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
//activityIndex.ItemId = new ItemId(dbActivityIndex._ItemType, new SysId(dbActivityIndex._ItemId);
//activityIndex.SportId = new SysId(dbActivityIndex._SportId);
//activityIndex.RegionId = new SysId(dbActivityIndex._RegionId);
activityIndex.UserAccountIdOwner = new SysId(dbActivityIndex._UserAccountIdOwner);
activityIndex.OrganisationIdOwner = new SysId(dbActivityIndex._OrganisationIdOwner);
activityIndex.UserAccountIdOwner = new SysId(dbActivityIndex._UserAccountIdOwner ?? 0);
activityIndex.OrganisationIdOwner = new SysId(dbActivityIndex._OrganisationIdOwner ?? 0);
activityIndex.EffectiveOn = dbActivityIndex._EffectiveOn;
activityIndex.ExpiresOn = dbActivityIndex._ExpiresOn;
activityIndex.Notes = dbActivityIndex._Notes;
@@ -546,6 +546,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxActivityIndex> GetActivityIndexList(SaxActivityIndex.Params prm)
{
ClearErrorState();
List<SaxActivityIndex> userActivitys = new List<SaxActivityIndex>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.ActivityIndex), aliasActivityIndex);
@@ -573,7 +574,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetActivityIndexList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userActivitys;
@@ -84,7 +84,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetArticle\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return article;
@@ -245,7 +245,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
article.RegionIdPrimary = new SysId(dbArticle._RegionIdPrimary);
article.Headline = dbArticle._Headline;
article.Summary = dbArticle._Summary;
article.ItemImageIdThumbnail = new SysId(dbArticle._ItemImageIdThumbnail);
article.ItemImageIdThumbnail = new SysId(dbArticle._ItemImageIdThumbnail ?? 0);
article.BodyData = dbArticle._BodyData;
article.PublishedAt = dbArticle._PublishedAt;
article.Notes = dbArticle._Notes;
@@ -571,6 +571,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxArticle> GetArticleList(SaxArticle.Params prm)
{
ClearErrorState();
List<SaxArticle> userActivitys = new List<SaxArticle>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.Article), aliasArticle);
@@ -598,7 +599,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetArticleList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userActivitys;
@@ -84,7 +84,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetOrganisationEvent\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return organisationEvent;
@@ -559,6 +559,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxOrganisationEvent> GetOrganisationEventList(SaxOrganisationEvent.Params prm)
{
ClearErrorState();
List<SaxOrganisationEvent> userActivitys = new List<SaxOrganisationEvent>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.OrganisationEvent), aliasOrganisationEvent);
@@ -586,7 +587,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetOrganisationEventList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userActivitys;
@@ -84,7 +84,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetOrganisationOpportunity\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return organisationOpportunity;
@@ -553,6 +553,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxOrganisationOpportunity> GetOrganisationOpportunityList(SaxOrganisationOpportunity.Params prm)
{
ClearErrorState();
List<SaxOrganisationOpportunity> userActivitys = new List<SaxOrganisationOpportunity>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.OrganisationOpportunity), aliasOrganisationOpportunity);
@@ -580,7 +581,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetOrganisationOpportunityList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userActivitys;
@@ -83,7 +83,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetUserActivity\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userActivity;
@@ -171,7 +171,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
return !HasErrorState();
}
private bool UpdateActivityFeedback (SaxUserActivity userActivity, SaxUserActivity userActivity_Previous, DbUpdateInfo dbUpdateInfo)
private bool UpdateActivityFeedback(SaxUserActivity userActivity, SaxUserActivity userActivity_Previous, DbUpdateInfo dbUpdateInfo)
{
// Calculate changes in feedback for this user activity compared to the previous instance.
// User activity status - deleted are ignored.
@@ -523,6 +523,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxUserActivity> GetUserActivityList(SaxUserActivity.Params prm)
{
ClearErrorState();
List<SaxUserActivity> userActivitys = new List<SaxUserActivity>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserActivity), aliasUserActivity);
@@ -550,7 +551,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetUserActivityList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return userActivitys;
@@ -85,7 +85,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
catch (Exception exc)
{
SetErrorState("Database query exception");
SaLogger.Warn(GetType().Name + ".GetItemAddress\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return itemAddress;
@@ -265,7 +265,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
itemAddress.RegionIdProvince = new SysId(dbItemAddress._RegionIdProvince);
itemAddress.Country = dbItemAddress._Country;
itemAddress.RegionIdCountry = new SysId(dbItemAddress._RegionIdCountry);
itemAddress.PostalCode= dbItemAddress._PostalCode;
itemAddress.PostalCode = dbItemAddress._PostalCode;
// Location.
itemAddress.LocationSource = dbItemAddress._LocationSource;
itemAddress.LocationStoredAt = dbItemAddress._LocationStoredAt;
@@ -540,6 +540,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
// Item list.
public override List<SaxItemAddress> GetItemAddressList(SaxItemAddress.Params prm)
{
ClearErrorState();
List<SaxItemAddress> itemAddresss = new List<SaxItemAddress>();
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.ItemAddress), aliasItemAddress);
@@ -567,7 +568,8 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
}
catch (Exception exc)
{
SaLogger.Warn(GetType().Name + ".GetItemAddressList\n\tQuery: " + dbCommand.CommandText + "\n\t" + ExceptionUtil.GetLogMessage(exc));
SetErrorState("Database query exception");
SaLogger.Warn($"{SysUtil.Fn}\n\tQuery: {dbCommand.CommandText}\n\t{ExceptionUtil.GetErrorStateMessage(exc)}");
}
}
return itemAddresss;

Some files were not shown because too many files have changed in this diff Show More