v1.1.4.1
This commit is contained in:
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
public static class Version
|
||||
{
|
||||
private static String version { get; } = "1.1.4.0";
|
||||
private static String version { get; } = "1.1.4.1";
|
||||
// Retrieve version.
|
||||
public static String GetFullVersion () { return version; }
|
||||
public static String GetAppVersion ()
|
||||
|
||||
@@ -89,6 +89,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
{
|
||||
YesNo,
|
||||
DataItemType,
|
||||
Gender,
|
||||
SportParticipation,
|
||||
SportOfficiating,
|
||||
RegionType,
|
||||
@@ -154,6 +155,19 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
ItemSport = 420,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public enum Gender
|
||||
{
|
||||
Unknown = 0,
|
||||
/* Do not change the numeric values - tied to database. */
|
||||
Female = 1,
|
||||
Male = 2,
|
||||
TransFemale = 10,
|
||||
TransMale = 11,
|
||||
Nonconforming = 20,
|
||||
PreferNotToSay = 99,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
public enum RegionType
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Fri 6-Aug-2021 19:02:06
|
||||
// Code generated by Sarand Database Utilities Wed 11-Aug-2021 17:31:26
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Base.App
|
||||
{
|
||||
@@ -212,7 +212,10 @@ namespace Saxonite.Base.App
|
||||
UserAccount_PhoneMain,
|
||||
UserAccount_PhoneMobile,
|
||||
UserAccount_PhoneAlt,
|
||||
UserAccount_DateOfBirth,
|
||||
UserAccount_Gender,
|
||||
UserAccount_DateOfBirthDay,
|
||||
UserAccount_DateOfBirthMonth,
|
||||
UserAccount_DateOfBirthYear,
|
||||
UserAccount_RegionIdCountry,
|
||||
UserAccount_RegionIdProvince,
|
||||
UserAccount_PasswordToken,
|
||||
@@ -306,7 +309,7 @@ namespace Saxonite.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private static readonly int tableCount = 15;
|
||||
private static readonly int columnCount = 262;
|
||||
private static readonly int columnCount = 265;
|
||||
private static ulong maxTextLen = 0;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -666,7 +669,10 @@ namespace Saxonite.Base.App
|
||||
new ColumnDfn(10,"PhoneMain",0,-9,false,50),
|
||||
new ColumnDfn(10,"PhoneMobile",0,-9,false,50),
|
||||
new ColumnDfn(10,"PhoneAlt",0,-9,false,50),
|
||||
new ColumnDfn(10,"DateOfBirth",9,93,false,16),
|
||||
new ColumnDfn(10,"Gender",2,-6,false,3),
|
||||
new ColumnDfn(10,"DateOfBirthDay",2,-6,false,3),
|
||||
new ColumnDfn(10,"DateOfBirthMonth",2,-6,false,3),
|
||||
new ColumnDfn(10,"DateOfBirthYear",3,5,false,5),
|
||||
new ColumnDfn(10,"RegionIdCountry",4,4,false,10),
|
||||
new ColumnDfn(10,"RegionIdProvince",4,4,false,10),
|
||||
new ColumnDfn(10,"PasswordToken",0,12,false,32),
|
||||
|
||||
@@ -88,6 +88,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
// System codes.
|
||||
private readonly Dictionary<Sax.CodeType, List<TypeCodeDesc>> codeTypes = new Dictionary<Sax.CodeType, List<TypeCodeDesc>>();
|
||||
public List<TypeCodeDesc> DataItemTypeCodes { get { return GetCodesOfType(Sax.CodeType.DataItemType); } }
|
||||
public List<TypeCodeDesc> GenderCodes { get { return GetCodesOfType(Sax.CodeType.Gender); } }
|
||||
public List<TypeCodeDesc> SportParticipationCodes { get { return GetCodesOfType(Sax.CodeType.SportParticipation); } }
|
||||
public List<TypeCodeDesc> SportOfficiatingCodes { get { return GetCodesOfType(Sax.CodeType.SportOfficiating); } }
|
||||
public List<TypeCodeDesc> RegionTypeCodes { get { return GetCodesOfType(Sax.CodeType.RegionType); } }
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
// Code types.
|
||||
private static readonly List<TypeCodeDesc> yesNoCodes = new List<TypeCodeDesc>();
|
||||
private static readonly List<TypeCodeDesc> dataItemTypeCodes = new List<TypeCodeDesc>();
|
||||
private static readonly List<TypeCodeDesc> genderCodes = new List<TypeCodeDesc>();
|
||||
private static readonly List<TypeCodeDesc> sportParticipationCodes = new List<TypeCodeDesc>();
|
||||
private static readonly List<TypeCodeDesc> sportOfficiatingCodes = new List<TypeCodeDesc>();
|
||||
private static readonly List<TypeCodeDesc> regionTypeCodes = new List<TypeCodeDesc>();
|
||||
@@ -59,6 +60,15 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
dataItemTypeCodes.Add(Sax.DataItemType.ItemSport, "ItemSport", "Item Sport");
|
||||
dataItemTypeCodes.Add(Sax.DataItemType.ItemImage, "ItemImage", "Item Image");
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Gender.
|
||||
genderCodes.Add(Sax.Gender.Female, "Female", "Female");
|
||||
genderCodes.Add(Sax.Gender.Male, "Male", "Male");
|
||||
genderCodes.Add(Sax.Gender.TransFemale, "TransFemale", "TransFemale");
|
||||
genderCodes.Add(Sax.Gender.TransMale, "TransMale", "TransMale");
|
||||
genderCodes.Add(Sax.Gender.Nonconforming, "Nonconforming", "Nonconforming");
|
||||
genderCodes.Add(Sax.Gender.PreferNotToSay, "PreferNotToSay", "Prefer not to say");
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Sport participation.
|
||||
sportParticipationCodes.Add(Sax.SportParticipation.Professional, "PRO", "Professional");
|
||||
|
||||
@@ -40,6 +40,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
return new List<TypeCodeDesc>(yesNoCodes);
|
||||
case Sax.CodeType.DataItemType:
|
||||
return new List<TypeCodeDesc>(dataItemTypeCodes);
|
||||
case Sax.CodeType.Gender:
|
||||
return new List<TypeCodeDesc>(genderCodes);
|
||||
case Sax.CodeType.SportParticipation:
|
||||
return new List<TypeCodeDesc>(sportParticipationCodes);
|
||||
case Sax.CodeType.SportOfficiating:
|
||||
|
||||
@@ -24,6 +24,9 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
LastName,
|
||||
PhoneMain,
|
||||
PhoneMobile,
|
||||
DateOfBirthDay,
|
||||
DateOfBirthMonth,
|
||||
DateOfBirthYear,
|
||||
DateOfBirth,
|
||||
// Regions.
|
||||
RegionIdCountry,
|
||||
@@ -64,7 +67,10 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public String LastName { get; set; } = String.Empty;
|
||||
public String PhoneMain { get; set; } = String.Empty;
|
||||
public String PhoneMobile { get; set; } = String.Empty;
|
||||
public DateTime DateOfBirth { get; set; }
|
||||
public Sax.Gender Gender { get; set; }
|
||||
public byte DateOfBirthDay { get; set; }
|
||||
public byte DateOfBirthMonth { get; set; }
|
||||
public short DateOfBirthYear { get; set; }
|
||||
public SysId RegionIdCountry { get; set; }
|
||||
public SysId RegionIdProvince{ get; set; }
|
||||
// Security.
|
||||
@@ -125,10 +131,25 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
get { return data.PhoneMobile; }
|
||||
set { CheckChanged(data.PhoneMobile, value); data.PhoneMobile = value; }
|
||||
}
|
||||
public DateTime DateOfBirth
|
||||
public Sax.Gender Gender
|
||||
{
|
||||
get { return data.DateOfBirth; }
|
||||
set { CheckChanged(data.DateOfBirth, value); data.DateOfBirth = value; }
|
||||
get { return data.Gender; }
|
||||
set { CheckChanged((int)data.Gender, (int)value); data.Gender = value; }
|
||||
}
|
||||
public byte DateOfBirthDay
|
||||
{
|
||||
get { return data.DateOfBirthDay; }
|
||||
set { CheckChanged(data.DateOfBirthDay, value); data.DateOfBirthDay = value; }
|
||||
}
|
||||
public byte DateOfBirthMonth
|
||||
{
|
||||
get { return data.DateOfBirthMonth; }
|
||||
set { CheckChanged(data.DateOfBirthMonth, value); data.DateOfBirthMonth = value; }
|
||||
}
|
||||
public short DateOfBirthYear
|
||||
{
|
||||
get { return data.DateOfBirthYear; }
|
||||
set { CheckChanged(data.DateOfBirthYear, value); data.DateOfBirthYear = value; }
|
||||
}
|
||||
public SysId RegionIdCountry
|
||||
{
|
||||
@@ -192,7 +213,10 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
LastName = data.LastName;
|
||||
PhoneMain = data.PhoneMain;
|
||||
PhoneMobile = data.PhoneMobile;
|
||||
DateOfBirth = data.DateOfBirth;
|
||||
Gender = data.Gender;
|
||||
DateOfBirthDay = data.DateOfBirthDay;
|
||||
DateOfBirthMonth = data.DateOfBirthMonth;
|
||||
DateOfBirthYear = data.DateOfBirthYear;
|
||||
RegionIdCountry = data.RegionIdCountry;
|
||||
RegionIdProvince = data.RegionIdProvince;
|
||||
// Security.
|
||||
@@ -226,7 +250,10 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public ValidValue LastName { get; set; } = ValidValue.Valid;
|
||||
public ValidValue PhoneMain { get; set; } = ValidValue.Valid;
|
||||
public ValidValue PhoneMobile { get; set; } = ValidValue.Valid;
|
||||
public ValidValue DateOfBirth { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Gender { get; set; } = ValidValue.Valid;
|
||||
public ValidValue DateOfBirthDay { get; set; } = ValidValue.Valid;
|
||||
public ValidValue DateOfBirthMonth { get; set; } = ValidValue.Valid;
|
||||
public ValidValue DateOfBirthYear { get; set; } = ValidValue.Valid;
|
||||
public ValidValue RegionIdCountry { get; set; } = ValidValue.Valid;
|
||||
public ValidValue RegionIdProvince { get; set; } = ValidValue.Valid;
|
||||
// Security.
|
||||
@@ -339,10 +366,25 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
get { return data.PhoneMobile; }
|
||||
set { data.PhoneMobile = value; }
|
||||
}
|
||||
public DateTime DateOfBirth
|
||||
public Sax.Gender Gender
|
||||
{
|
||||
get { return data.DateOfBirth; }
|
||||
set { data.DateOfBirth = value; }
|
||||
get { return data.Gender; }
|
||||
set { data.Gender = value; }
|
||||
}
|
||||
public byte DateOfBirthDay
|
||||
{
|
||||
get { return data.DateOfBirthDay; }
|
||||
set { data.DateOfBirthDay = value; }
|
||||
}
|
||||
public byte DateOfBirthMonth
|
||||
{
|
||||
get { return data.DateOfBirthMonth; }
|
||||
set { data.DateOfBirthMonth = value; }
|
||||
}
|
||||
public short DateOfBirthYear
|
||||
{
|
||||
get { return data.DateOfBirthYear; }
|
||||
set { data.DateOfBirthYear = value; }
|
||||
}
|
||||
public SysId RegionIdCountry
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@ using Saxonite.Base.App;
|
||||
using Saxonite.Net.Standard.Base.Bus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
@@ -130,11 +131,11 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
errField.PhoneMobile = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
// Date of birth.
|
||||
if (errField.DateOfBirth != SacsHierarchyItem.ValidValue.Ignore && DateUtil.IsValid(data.DateOfBirth) && data.DateOfBirth.CompareTo(DateTime.Today) > 0)
|
||||
// Date of birth year.
|
||||
if (errField.DateOfBirthYear != SacsHierarchyItem.ValidValue.Ignore && data.DateOfBirthYear > DateTime.Today.Year)
|
||||
{
|
||||
errField.PhoneMobile = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState("Date of birth must not be in the future");
|
||||
return SetErrorState("Date of birth year must not be in the future");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
@@ -244,11 +245,34 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
/// Extract and format result set data value where specific handling is required.
|
||||
/// <para>Where response is an invalid data value, format value using column.FormatValue(values).</para>
|
||||
/// </summary>
|
||||
public virtual DataValue GetUserAccountDataValue(ColumnDfn column, NamedValue.Map values)
|
||||
public virtual DataValue GetUserAccountDataValue(ColumnDfn column, NamedValue.Map values, CultureInfo cultureInfo = null)
|
||||
{
|
||||
DataValue value = new DataValue();
|
||||
switch ((SaxUserAccount.Column)column.Id)
|
||||
{
|
||||
//-----------------------------------------------------------
|
||||
case SaxUserAccount.Column.DateOfBirth:
|
||||
{
|
||||
byte dobDay = (byte)values.GetValue(GetUserAccountColumnDfn(SaxUserAccount.Column.DateOfBirthDay).DataName).AsLong();
|
||||
byte dobMonth = (byte)values.GetValue(GetUserAccountColumnDfn(SaxUserAccount.Column.DateOfBirthMonth).DataName).AsLong();
|
||||
short dobYear = (short)values.GetValue(GetUserAccountColumnDfn(SaxUserAccount.Column.DateOfBirthYear).DataName).AsLong();
|
||||
List<String> dobParts = new List<string>();
|
||||
if (dobYear > 0)
|
||||
{
|
||||
if (dobMonth > 0)
|
||||
{
|
||||
if (dobDay > 0)
|
||||
dobParts.Add(dobDay.ToString());
|
||||
// Format date with month to extract name.
|
||||
DateTime monthDate = new DateTime(DateTime.Today.Year, dobMonth, 1);
|
||||
dobParts.Add(DateUtil.Format(monthDate, "MMM", cultureInfo));
|
||||
}
|
||||
dobParts.Add(dobYear.ToString());
|
||||
}
|
||||
value = new DataValue(dobParts.Concat("-"));
|
||||
}
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Notes.
|
||||
case SaxUserAccount.Column.Notes:
|
||||
|
||||
Reference in New Issue
Block a user