v1.1.6.0
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.5.1";
|
||||
private static String version { get; } = "1.1.6.0";
|
||||
// Retrieve version.
|
||||
public static String GetFullVersion () { return version; }
|
||||
public static String GetAppVersion ()
|
||||
@@ -40,6 +40,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
// Version history.
|
||||
//-------------------------------------------------------------------
|
||||
// 1.1.6 ?-Aug-2021 ?
|
||||
// - ?
|
||||
// 1.1.5 19-Aug-2021 Profile Sport Experience.
|
||||
// - Online Profile Sport Experience.
|
||||
// 1.1.4 9-Aug-2021 Organisation Articles.
|
||||
|
||||
@@ -90,6 +90,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
YesNo,
|
||||
DataItemType,
|
||||
Gender,
|
||||
SportSpecialityLabel,
|
||||
SportParticipation,
|
||||
SportOfficiating,
|
||||
RegionType,
|
||||
@@ -199,6 +200,17 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
SystemAdmin,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Sport Speciality Label</summary>
|
||||
public enum SportSpecialityLabel
|
||||
{
|
||||
Default = 0,
|
||||
/* Do not change the values/codes - tied to database. */
|
||||
Positon = 10,
|
||||
Discipline = 20,
|
||||
NotRelevant = 90,
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>Sport Participation</summary>
|
||||
public enum SportParticipation
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// Code generated by Sarand Database Utilities Thu 19-Aug-2021 17:19:49
|
||||
// Code generated by Sarand Database Utilities Thu 26-Aug-2021 12:36:27
|
||||
//---------------------------------------------------------------------------
|
||||
namespace Saxonite.Base.App
|
||||
{
|
||||
@@ -195,6 +195,7 @@ namespace Saxonite.Base.App
|
||||
Region_UpdateHost,
|
||||
Sport_Id,
|
||||
Sport_Name,
|
||||
Sport_SpecialityLabel,
|
||||
Sport_Notes,
|
||||
Sport_Flags,
|
||||
Sport_Status,
|
||||
@@ -210,6 +211,7 @@ namespace Saxonite.Base.App
|
||||
UserAccount_FirstName,
|
||||
UserAccount_Initials,
|
||||
UserAccount_LastName,
|
||||
UserAccount_About,
|
||||
UserAccount_PhoneMain,
|
||||
UserAccount_PhoneMobile,
|
||||
UserAccount_PhoneAlt,
|
||||
@@ -293,6 +295,7 @@ namespace Saxonite.Base.App
|
||||
UserSport_Id,
|
||||
UserSport_UserAccountId,
|
||||
UserSport_SportId,
|
||||
UserSport_About,
|
||||
UserSport_Participation,
|
||||
UserSport_Officiating,
|
||||
UserSport_UserSportData,
|
||||
@@ -333,7 +336,7 @@ namespace Saxonite.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private static readonly int tableCount = 16;
|
||||
private static readonly int columnCount = 288;
|
||||
private static readonly int columnCount = 291;
|
||||
private static ulong maxTextLen = 0;
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -676,6 +679,7 @@ namespace Saxonite.Base.App
|
||||
new ColumnDfn(8,"UpdateHost",0,12,false,100),
|
||||
new ColumnDfn(9,"Id",4,4,true,10),
|
||||
new ColumnDfn(9,"Name",0,-9,false,100),
|
||||
new ColumnDfn(9,"SpecialityLabel",3,5,false,5),
|
||||
new ColumnDfn(9,"Notes",0,-9,false,2000),
|
||||
new ColumnDfn(9,"Flags",3,5,false,5),
|
||||
new ColumnDfn(9,"Status",0,12,false,3),
|
||||
@@ -691,6 +695,7 @@ namespace Saxonite.Base.App
|
||||
new ColumnDfn(10,"FirstName",0,-9,false,100),
|
||||
new ColumnDfn(10,"Initials",0,-9,false,10),
|
||||
new ColumnDfn(10,"LastName",0,-9,false,100),
|
||||
new ColumnDfn(10,"About",0,-9,false,2000),
|
||||
new ColumnDfn(10,"PhoneMain",0,-9,false,50),
|
||||
new ColumnDfn(10,"PhoneMobile",0,-9,false,50),
|
||||
new ColumnDfn(10,"PhoneAlt",0,-9,false,50),
|
||||
@@ -774,6 +779,7 @@ namespace Saxonite.Base.App
|
||||
new ColumnDfn(15,"Id",5,-5,true,19),
|
||||
new ColumnDfn(15,"UserAccountId",4,4,false,10),
|
||||
new ColumnDfn(15,"SportId",4,4,false,10),
|
||||
new ColumnDfn(15,"About",0,-9,false,2000),
|
||||
new ColumnDfn(15,"Participation",3,5,false,5),
|
||||
new ColumnDfn(15,"Officiating",3,5,false,5),
|
||||
new ColumnDfn(15,"UserSportData",0,-9,false,0),
|
||||
|
||||
@@ -89,6 +89,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
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> SportSpecialityLabelCodes { get { return GetCodesOfType(Sax.CodeType.SportSpecialityLabel); } }
|
||||
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); } }
|
||||
@@ -201,31 +202,24 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
SaLogger.Debug(GetType().Name + ".QueryRegionsToCache(regionIds) Regions queried: " + regionsQueried + ". Regions in cache: " + regionCache.Count + ". Elapsed: " + DateUtil.FormatNumberOfSeconds((DateTime.Now - startedAt).TotalSeconds));
|
||||
}
|
||||
}
|
||||
public SaxRegion GetRegion(SysId regionId)
|
||||
public SaxRegion.Data GetRegion(SysId regionId)
|
||||
{
|
||||
QueryRegionsToCache(new List<SysId>() { regionId });
|
||||
return GetRegion(regionCache.GetValue(regionId, null));
|
||||
return regionCache.GetValue(regionId, null);
|
||||
}
|
||||
public List<SaxRegion> GetRegions(List<SysId> regionIds)
|
||||
public List<SaxRegion.Data> GetRegions(List<SysId> regionIds)
|
||||
{
|
||||
List<SaxRegion> regions = new List<SaxRegion>();
|
||||
List<SaxRegion.Data> regions = new List<SaxRegion.Data>();
|
||||
QueryRegionsToCache(regionIds);
|
||||
foreach (SysId regionId in regionIds)
|
||||
{
|
||||
if (!SysId.IsValid(regionId)) continue;
|
||||
SaxRegion region = GetRegion(regionCache.GetValue(regionId, null));
|
||||
SaxRegion.Data region = regionCache.GetValue(regionId, null);
|
||||
if (region != null)
|
||||
regions.Add(region);
|
||||
}
|
||||
return regions;
|
||||
}
|
||||
private SaxRegion GetRegion(SaxRegion.Data regionData)
|
||||
{
|
||||
if (regionData == null) return null;
|
||||
SaxRegion region = ReferenceMgr.CreateRegion();
|
||||
region.SetData(regionData);
|
||||
return region;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Sports.
|
||||
@@ -276,31 +270,24 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
SaLogger.Debug(GetType().Name + ".QuerySportsToCache(sportIds) Sports queried: " + sportsQueried + ". Sports in cache: " + sportCache.Count + ". Elapsed: " + DateUtil.FormatNumberOfSeconds((DateTime.Now - startedAt).TotalSeconds));
|
||||
}
|
||||
}
|
||||
public SaxSport GetSport(SysId sportId)
|
||||
public SaxSport.Data GetSport(SysId sportId)
|
||||
{
|
||||
QuerySportsToCache(new List<SysId>() { sportId });
|
||||
return GetSport(sportCache.GetValue(sportId, null));
|
||||
return sportCache.GetValue(sportId, null);
|
||||
}
|
||||
public List<SaxSport> GetSports(List<SysId> sportIds)
|
||||
public List<SaxSport.Data> GetSports(List<SysId> sportIds)
|
||||
{
|
||||
List<SaxSport> sports = new List<SaxSport>();
|
||||
List<SaxSport.Data> sports = new List<SaxSport.Data>();
|
||||
QuerySportsToCache(sportIds);
|
||||
foreach (SysId sportId in sportIds)
|
||||
{
|
||||
if (!SysId.IsValid(sportId)) continue;
|
||||
SaxSport sport = GetSport(sportCache.GetValue(sportId, null));
|
||||
SaxSport.Data sport = sportCache.GetValue(sportId, null);
|
||||
if (sport != null)
|
||||
sports.Add(sport);
|
||||
}
|
||||
return sports;
|
||||
}
|
||||
private SaxSport GetSport(SaxSport.Data sportData)
|
||||
{
|
||||
if (sportData == null) return null;
|
||||
SaxSport sport = ReferenceMgr.CreateSport();
|
||||
sport.SetData(sportData);
|
||||
return sport;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Common Data Components
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
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> sportSpecialityLabelCodes = 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>();
|
||||
@@ -69,6 +70,12 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
genderCodes.Add(Sax.Gender.Nonconforming, "Nonconforming", "Nonconforming");
|
||||
genderCodes.Add(Sax.Gender.PreferNotToSay, "PreferNotToSay", "Prefer not to say");
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Sport speciality label.
|
||||
sportSpecialityLabelCodes.Add(Sax.SportSpecialityLabel.Positon, "POS", "Positon");
|
||||
sportSpecialityLabelCodes.Add(Sax.SportSpecialityLabel.Discipline, "DIS", "Discipline");
|
||||
sportSpecialityLabelCodes.Add(Sax.SportSpecialityLabel.NotRelevant, "NRE", "Not relevant");
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Sport participation.
|
||||
sportParticipationCodes.Add(Sax.SportParticipation.Professional, "PRO", "Professional");
|
||||
|
||||
@@ -42,6 +42,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
return new List<TypeCodeDesc>(dataItemTypeCodes);
|
||||
case Sax.CodeType.Gender:
|
||||
return new List<TypeCodeDesc>(genderCodes);
|
||||
case Sax.CodeType.SportSpecialityLabel:
|
||||
return new List<TypeCodeDesc>(sportSpecialityLabelCodes);
|
||||
case Sax.CodeType.SportParticipation:
|
||||
return new List<TypeCodeDesc>(sportParticipationCodes);
|
||||
case Sax.CodeType.SportOfficiating:
|
||||
|
||||
@@ -19,6 +19,8 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
Pos,
|
||||
Id,
|
||||
Name,
|
||||
SpecialityLabel,
|
||||
SpecialityLabel_Desc,
|
||||
// Associated data.
|
||||
// Common.
|
||||
Notes,
|
||||
@@ -35,6 +37,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public class DataProperties
|
||||
{
|
||||
public String Name { get; set; } = String.Empty;
|
||||
public Sax.SportSpecialityLabel SpecialityLabel { get; set; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -54,10 +57,16 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
get { return data.Name; }
|
||||
set { CheckChanged(data.Name, value); data.Name = value; }
|
||||
}
|
||||
public Sax.SportSpecialityLabel SpecialityLabel
|
||||
{
|
||||
get { return data.SpecialityLabel; }
|
||||
set { CheckChanged((short)data.SpecialityLabel, (short)value); data.SpecialityLabel = value; }
|
||||
}
|
||||
// Population.
|
||||
internal void PopulateFrom (Data data)
|
||||
{
|
||||
Name = data.Name;
|
||||
SpecialityLabel = data.SpecialityLabel;
|
||||
base.PopulateFrom(data);
|
||||
}
|
||||
public Data Clone ()
|
||||
@@ -74,6 +83,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
{
|
||||
// Identifies the field that has invalid data.
|
||||
public ValidValue Name { get; set; } = ValidValue.Valid;
|
||||
public ValidValue SpecialityLabel { get; set; } = ValidValue.Valid;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -129,6 +139,11 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
get { return data.Name; }
|
||||
set { data.Name = value; }
|
||||
}
|
||||
public Sax.SportSpecialityLabel SpecialityLabel
|
||||
{
|
||||
get { return data.SpecialityLabel; }
|
||||
set { data.SpecialityLabel = value; }
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Flags - positions 1-16 available.
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
FirstName,
|
||||
Initials,
|
||||
LastName,
|
||||
About,
|
||||
PhoneMain,
|
||||
PhoneMobile,
|
||||
DateOfBirthDay,
|
||||
@@ -65,6 +66,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public String FirstName { get; set; } = String.Empty;
|
||||
public String Initials { get; set; } = String.Empty;
|
||||
public String LastName { get; set; } = String.Empty;
|
||||
public String About { get; set; } = String.Empty;
|
||||
public String PhoneMain { get; set; } = String.Empty;
|
||||
public String PhoneMobile { get; set; } = String.Empty;
|
||||
public Sax.Gender Gender { get; set; }
|
||||
@@ -121,6 +123,11 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
get { return data.LastName; }
|
||||
set { CheckChanged(data.LastName, value); data.LastName = value; }
|
||||
}
|
||||
public String About
|
||||
{
|
||||
get { return data.About; }
|
||||
set { CheckChanged(data.About, value); data.About = value; }
|
||||
}
|
||||
public String PhoneMain
|
||||
{
|
||||
get { return data.PhoneMain; }
|
||||
@@ -211,6 +218,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
FirstName = data.FirstName;
|
||||
Initials = data.Initials;
|
||||
LastName = data.LastName;
|
||||
About = data.About;
|
||||
PhoneMain = data.PhoneMain;
|
||||
PhoneMobile = data.PhoneMobile;
|
||||
Gender = data.Gender;
|
||||
@@ -248,6 +256,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
public ValidValue FirstName { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Initials { get; set; } = ValidValue.Valid;
|
||||
public ValidValue LastName { get; set; } = ValidValue.Valid;
|
||||
public ValidValue About { get; set; } = ValidValue.Valid;
|
||||
public ValidValue PhoneMain { get; set; } = ValidValue.Valid;
|
||||
public ValidValue PhoneMobile { get; set; } = ValidValue.Valid;
|
||||
public ValidValue Gender { get; set; } = ValidValue.Valid;
|
||||
@@ -356,6 +365,11 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
get { return data.LastName; }
|
||||
set { data.LastName = value; }
|
||||
}
|
||||
public String About
|
||||
{
|
||||
get { return data.About; }
|
||||
set { data.About = value; }
|
||||
}
|
||||
public String PhoneMain
|
||||
{
|
||||
get { return data.PhoneMain; }
|
||||
|
||||
@@ -22,6 +22,8 @@ namespace Saxonite.Net.Standard.Base.Bus
|
||||
Pos,
|
||||
Id,
|
||||
UserSportId,
|
||||
// Sport.
|
||||
Sport_Id,
|
||||
// Period.
|
||||
PeriodFrom,
|
||||
PeriodTo,
|
||||
|
||||
@@ -29,16 +29,24 @@ namespace Saxonite.Net.Standard.Base.Consoles
|
||||
//-------------------------------------------------------------------
|
||||
// Regions.
|
||||
/// <summary>
|
||||
/// Get the cached list of regions. NB These should be disposed after use.
|
||||
/// Get the cached list of regions.
|
||||
/// </summary>
|
||||
public abstract List<SaxRegion> GetActiveRegions();
|
||||
public abstract List<SaxRegion.Data> GetAllRegions();
|
||||
/// <summary>
|
||||
/// Get the cached list of active regions.
|
||||
/// </summary>
|
||||
public abstract List<SaxRegion.Data> GetActiveRegions();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Sports.
|
||||
/// <summary>
|
||||
/// Get the cached list of sports. NB These should be disposed after use.
|
||||
/// Get the cached list of sports.
|
||||
/// </summary>
|
||||
public abstract List<SaxSport> GetActiveSports();
|
||||
public abstract List<SaxSport.Data> GetAllSports();
|
||||
/// <summary>
|
||||
/// Get the cached list of active sports.
|
||||
/// </summary>
|
||||
public abstract List<SaxSport.Data> GetActiveSports();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
|
||||
@@ -119,6 +119,12 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
errField.LastName = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
// About.
|
||||
if (errField.About != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.About, "about", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.UserAccount_About)))
|
||||
{
|
||||
errField.About = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
// Phone - main.
|
||||
if (errField.PhoneMain != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.PhoneMain, "phone", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.UserAccount_PhoneMain)))
|
||||
{
|
||||
@@ -196,13 +202,12 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
// Associated data - ignore for deleted items.
|
||||
if (!data.IsStatusDeleted)
|
||||
{
|
||||
|
||||
// Regions.
|
||||
if (errField.RegionIdCountry != SacsHierarchyItem.ValidValue.Ignore || errField.RegionIdProvince != SacsHierarchyItem.ValidValue.Ignore)
|
||||
{
|
||||
List<SaxRegion> regions = Internals.GetRegions(new List<SysId>() { data.RegionIdCountry, data.RegionIdProvince });
|
||||
SaxRegion regionCountry = regions.GetRegionById(data.RegionIdCountry);
|
||||
SaxRegion regionProvince = regions.GetRegionById(data.RegionIdProvince);
|
||||
List<SaxRegion.Data> regions = Internals.GetRegions(new List<SysId>() { data.RegionIdCountry, data.RegionIdProvince });
|
||||
SaxRegion.Data regionCountry = regions.Find(item => item.Id.Equals(data.RegionIdCountry));
|
||||
SaxRegion.Data regionProvince = regions.Find(item => item.Id.Equals(data.RegionIdProvince));
|
||||
if (errField.RegionIdCountry != SacsHierarchyItem.ValidValue.Ignore)
|
||||
{
|
||||
if (SysId.IsValid(data.RegionIdCountry) && regionCountry == null)
|
||||
@@ -214,7 +219,6 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
return SetErrorState("Invalid country specified");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
public SaxItemDataMgr ItemDataMgr { get { return Internals.ItemDataMgr; } }
|
||||
// Application codes.
|
||||
public List<TypeCodeDesc> DataItemTypeCodes { get { return Internals.DataItemTypeCodes; } }
|
||||
public List<TypeCodeDesc> SportSpecialityLabelCodes { get { return Internals.SportSpecialityLabelCodes; } }
|
||||
public List<TypeCodeDesc> SportParticipationCodes { get { return Internals.SportParticipationCodes; } }
|
||||
public List<TypeCodeDesc> SportOfficiatingCodes { get { return Internals.SportOfficiatingCodes; } }
|
||||
public List<TypeCodeDesc> RegionTypeCodes { get { return Internals.RegionTypeCodes; } }
|
||||
|
||||
@@ -21,11 +21,11 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Create item.
|
||||
public abstract SaxSport CreateSport ();
|
||||
public abstract SaxSport CreateSport();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Item exists.
|
||||
public bool SportExistsById (SysId id)
|
||||
public bool SportExistsById(SysId id)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return false;
|
||||
@@ -34,7 +34,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
prmSport.StatusCat = SaxSport.StatusCat.Any;
|
||||
return GetSportCount(prmSport) == 1;
|
||||
}
|
||||
public bool SportExistsByName (String name)
|
||||
public bool SportExistsByName(String name)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (StringUtil.IsEmpty(name)) return false;
|
||||
@@ -46,8 +46,8 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Retrieve individual items.
|
||||
public abstract SaxSport GetSport (SaxSport.Params prmSport);
|
||||
public SaxSport GetSportById (SysId id)
|
||||
public abstract SaxSport GetSport(SaxSport.Params prmSport);
|
||||
public SaxSport GetSportById(SysId id)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (!SysId.IsValid(id)) return null;
|
||||
@@ -56,7 +56,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
prmSport.StatusCat = SaxSport.StatusCat.Any;
|
||||
return GetSport(prmSport);
|
||||
}
|
||||
public SaxSport GetSportByName (String name)
|
||||
public SaxSport GetSportByName(String name)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (StringUtil.IsEmpty(name)) return null;
|
||||
@@ -68,13 +68,13 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validate item data.
|
||||
public bool IsValidSport (SaxSport sport)
|
||||
public bool IsValidSport(SaxSport sport)
|
||||
{
|
||||
ClearErrorState();
|
||||
if (sport == null) return SetErrorState(ErrorMessage.ItemNotSpecified);
|
||||
return IsValidSportData(sport.GetData(), new SaxSport.ErrField());
|
||||
}
|
||||
public virtual bool IsValidSportData (SaxSport.Data data, SaxSport.ErrField errField)
|
||||
public virtual bool IsValidSportData(SaxSport.Data data, SaxSport.ErrField errField)
|
||||
{
|
||||
ClearErrorState();
|
||||
|
||||
@@ -109,33 +109,39 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Sport database interface.
|
||||
public abstract bool InsertSport (SaxSport sport, DbUpdateInfo dbUpdateInfo);
|
||||
public abstract bool UpdateSport (SaxSport sport, DbUpdateInfo dbUpdateInfo);
|
||||
public virtual bool SportCanBeDeleted (SaxSport sport)
|
||||
public abstract bool InsertSport(SaxSport sport, DbUpdateInfo dbUpdateInfo);
|
||||
public abstract bool UpdateSport(SaxSport sport, DbUpdateInfo dbUpdateInfo);
|
||||
public virtual bool SportCanBeDeleted(SaxSport sport)
|
||||
{
|
||||
ClearErrorState();
|
||||
return true;
|
||||
}
|
||||
public abstract bool DeleteSport (SaxSport sport, DbUpdateInfo dbUpdateInfo);
|
||||
public abstract bool DeleteSport(SaxSport sport, DbUpdateInfo dbUpdateInfo);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Sport list:
|
||||
public abstract ColumnDfn GetSportColumnDfn (SaxSport.Column columnId, String caption = "", int width = 0);
|
||||
public abstract List<String> GetSportQueryFilter (SaxSport.Params prmSport);
|
||||
public abstract long GetSportCount (SaxSport.Params prmSport);
|
||||
public abstract List<SaxSport> GetSportList (SaxSport.Params prmSport);
|
||||
public abstract DbResultSet ExecuteSportQuery (List<ColumnDfn> columns, SaxSport.Params prmSport);
|
||||
public abstract ColumnDfn GetSportColumnDfn(SaxSport.Column columnId, String caption = "", int width = 0);
|
||||
public abstract List<String> GetSportQueryFilter(SaxSport.Params prmSport);
|
||||
public abstract long GetSportCount(SaxSport.Params prmSport);
|
||||
public abstract List<SaxSport> GetSportList(SaxSport.Params prmSport);
|
||||
public abstract DbResultSet ExecuteSportQuery(List<ColumnDfn> columns, SaxSport.Params prmSport);
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
/// <summary>
|
||||
/// 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 GetSportDataValue (ColumnDfn column, NamedValue.Map values)
|
||||
public virtual DataValue GetSportDataValue(ColumnDfn column, NamedValue.Map values)
|
||||
{
|
||||
DataValue value = new DataValue();
|
||||
switch ((SaxSport.Column)column.Id)
|
||||
{
|
||||
//-----------------------------------------------------------
|
||||
// Speciality label.
|
||||
case SaxSport.Column.SpecialityLabel_Desc:
|
||||
value = new DataValue(Internals.SportSpecialityLabelCodes.GetDescForType(values.GetValue(column.DataName).AsLong()));
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// Notes - limit to 200 chars.
|
||||
case SaxSport.Column.Notes:
|
||||
@@ -146,17 +152,17 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
// Status.
|
||||
case SaxSport.Column.Status_Desc:
|
||||
case SaxSport.Column.Status_Ind:
|
||||
{
|
||||
String statusCode = values.GetValue(column.DataName).ToString();
|
||||
SaStatus status = SacsSystem.GetStatusForCode(statusCode);
|
||||
if (column.Id == (int)SaxSport.Column.Status_Desc)
|
||||
value = new DataValue(SacsSystem.GetStatusDesc(status));
|
||||
else if (column.Id == (int)SaxSport.Column.Status_Ind)
|
||||
value = new DataValue(SaxSport.GetStatusTriState(status));
|
||||
}
|
||||
break;
|
||||
{
|
||||
String statusCode = values.GetValue(column.DataName).ToString();
|
||||
SaStatus status = SacsSystem.GetStatusForCode(statusCode);
|
||||
if (column.Id == (int)SaxSport.Column.Status_Desc)
|
||||
value = new DataValue(SacsSystem.GetStatusDesc(status));
|
||||
else if (column.Id == (int)SaxSport.Column.Status_Ind)
|
||||
value = new DataValue(SaxSport.GetStatusTriState(status));
|
||||
}
|
||||
break;
|
||||
|
||||
//-----------------------------------------------------------
|
||||
//-----------------------------------------------------------
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user