Refresh Online Session with profile region and sports.
This commit is contained in:
2021-06-02 16:52:57 +01:00
parent 7b0a710b13
commit 7e5940a542
62 changed files with 601 additions and 214 deletions
+46 -24
View File
@@ -137,12 +137,14 @@ namespace Saxonite.Net.Core.Web.Base.App
//-------------------------------------------------------------------
private class CodeCache
{
public List<TypeCodeDesc> regionTypes;
public List<TypeCodeDesc> userRoles;
public List<TypeCodeDesc> organisationTypes;
public List<TypeCodeDesc> organisationCategories;
public List<TypeCodeDesc> organisationRoles;
public List<TypeCodeDesc> opportunityTypes;
public List<TypeCodeDesc> sportParticipationCodes;
public List<TypeCodeDesc> sportOfficiatingCodes;
public List<TypeCodeDesc> regionTypeCodes;
public List<TypeCodeDesc> userRoleCodes;
public List<TypeCodeDesc> organisationTypeCodes;
public List<TypeCodeDesc> organisationCategoryCodes;
public List<TypeCodeDesc> organisationRoleCodes;
public List<TypeCodeDesc> opportunityTypeCodes;
}
private CodeCache codes = new CodeCache();
@@ -153,64 +155,84 @@ namespace Saxonite.Net.Core.Web.Base.App
return SacsSystem.GetStatusDesc(status);
}
// Sport Participation.
public String GetSportParticipationTypeCaption(Sax.SportParticipation participation)
{
if ((int)participation < 1) return "";
if (codes.sportParticipationCodes == null)
codes.sportParticipationCodes = SaxSystem.GetCodesOfType(Sax.CodeType.SportParticipation);
// ToDo Sport Participation localisation.
return codes.sportParticipationCodes.GetDescForType(participation);
}
// Sport Officiating.
public String GetSportOfficiatingTypeCaption(Sax.SportOfficiating participation)
{
if ((int)participation < 1) return "";
if (codes.sportOfficiatingCodes == null)
codes.sportOfficiatingCodes = SaxSystem.GetCodesOfType(Sax.CodeType.SportOfficiating);
// ToDo Sport Officiating localisation.
return codes.sportOfficiatingCodes.GetDescForType(participation);
}
// Region type.
public String GetRegionTypeCaption(Sax.RegionType regionType)
{
if ((int)regionType < 1) return "";
if (codes.regionTypes == null)
codes.regionTypes = SaxSystem.GetCodesOfType(Sax.CodeType.RegionType);
if (codes.regionTypeCodes == null)
codes.regionTypeCodes = SaxSystem.GetCodesOfType(Sax.CodeType.RegionType);
// ToDo Region type localisation.
return codes.regionTypes.GetDescForType(regionType);
return codes.regionTypeCodes.GetDescForType(regionType);
}
// User role.
public String GetUserRoleCaption(Sax.UserRole userRole)
{
if ((int)userRole < 1) return "";
if (codes.userRoles == null)
codes.userRoles = SaxSystem.GetCodesOfType(Sax.CodeType.UserRole);
if (codes.userRoleCodes == null)
codes.userRoleCodes = SaxSystem.GetCodesOfType(Sax.CodeType.UserRole);
// ToDo User Role localisation.
return codes.userRoles.GetDescForType(userRole);
return codes.userRoleCodes.GetDescForType(userRole);
}
// Organisation type.
public String GetOrganisationTypeCaption(Sax.OrganisationType organisationType)
{
if ((int)organisationType < 1) return "";
if (codes.organisationTypes == null)
codes.organisationTypes = SaxSystem.GetCodesOfType(Sax.CodeType.OrganisationType);
if (codes.organisationTypeCodes == null)
codes.organisationTypeCodes = SaxSystem.GetCodesOfType(Sax.CodeType.OrganisationType);
// ToDo Organisation Type localisation.
return codes.organisationTypes.GetDescForType(organisationType);
return codes.organisationTypeCodes.GetDescForType(organisationType);
}
// Organisation category.
public String GetOrganisationCategoryCaption(Sax.OrganisationCategory organisationCategory)
{
if ((int)organisationCategory < 1) return "";
if (codes.organisationCategories == null)
codes.organisationCategories = SaxSystem.GetCodesOfType(Sax.CodeType.OrganisationCategory);
if (codes.organisationCategoryCodes == null)
codes.organisationCategoryCodes = SaxSystem.GetCodesOfType(Sax.CodeType.OrganisationCategory);
// ToDo Organisation Category localisation.
return codes.organisationCategories.GetDescForType(organisationCategory);
return codes.organisationCategoryCodes.GetDescForType(organisationCategory);
}
// Organisation role.
public String GetOrganisationRoleCaption(Sax.OrganisationRole organisationRole)
{
if ((int)organisationRole < 1) return "";
if (codes.organisationRoles == null)
codes.organisationRoles = SaxSystem.GetCodesOfType(Sax.CodeType.OrganisationRole);
if (codes.organisationRoleCodes == null)
codes.organisationRoleCodes = SaxSystem.GetCodesOfType(Sax.CodeType.OrganisationRole);
// ToDo Organisation Role localisation.
return codes.organisationRoles.GetDescForType(organisationRole);
return codes.organisationRoleCodes.GetDescForType(organisationRole);
}
// Opportunity type.
public String GetOpportunityTypeCaption(Sax.OpportunityType opportunityType)
{
if ((int)opportunityType < 1) return "";
if (codes.opportunityTypes == null)
codes.opportunityTypes = SaxSystem.GetCodesOfType(Sax.CodeType.OpportunityType);
if (codes.opportunityTypeCodes == null)
codes.opportunityTypeCodes = SaxSystem.GetCodesOfType(Sax.CodeType.OpportunityType);
// ToDo Opportunity Type localisation.
return codes.opportunityTypes.GetDescForType(opportunityType);
return codes.opportunityTypeCodes.GetDescForType(opportunityType);
}
//-------------------------------------------------------------------