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);
}
//-------------------------------------------------------------------
@@ -7,7 +7,7 @@ using System.Text;
namespace Saxonite.Net.Core.Web.Base.App
{
//=======================================================================
public class SaxSessionData_Web : SaxSessionData
public abstract class SaxSessionData_Web : SaxSessionData
{
//-------------------------------------------------------------------
// Protected construction.
@@ -57,7 +57,7 @@ namespace Saxonite.Net.Core.Web.Base.Consoles
public static int CompareActivityIndices(ActivityData_Web item1, ActivityData_Web item2)
{
int effectiveCompare = item1.EffectiveOn.CompareTo(item2.EffectiveOn);
if (effectiveCompare != null) return effectiveCompare * -1;
if (effectiveCompare != 0) return effectiveCompare * -1;
return 1;
}
}
@@ -90,13 +90,15 @@ namespace Saxonite.Net.Core.Web.Base.Controllers
public SaxActivityMgr ActivityMgr { get { return Internals.ActivityMgr; } }
public SaxItemDataMgr ItemDataMgr { get { return Internals.ItemDataMgr; } }
// System codes.
public List<TypeCodeDesc> RegionTypes { get { return Internals.RegionTypes; } }
public List<TypeCodeDesc> UserRoles { get { return Internals.UserRoles; } }
public List<TypeCodeDesc> OrganisationTypes { get { return Internals.OrganisationTypes; } }
public List<TypeCodeDesc> OrganisationCategories { get { return Internals.OrganisationCategories; } }
public List<TypeCodeDesc> OrganisationRoles { get { return Internals.OrganisationRoles; } }
public List<TypeCodeDesc> OpportunityTypes { get { return Internals.OpportunityTypes; } }
public List<TypeCodeDesc> DataItemTypes { get { return Internals.DataItemTypes; } }
public List<TypeCodeDesc> SportParticipationCodes { get { return Internals.SportParticipationCodes; } }
public List<TypeCodeDesc> SportOfficiatingCodes { get { return Internals.SportOfficiatingCodes; } }
public List<TypeCodeDesc> RegionTypeCodes { get { return Internals.RegionTypeCodes; } }
public List<TypeCodeDesc> UserRoleCodes { get { return Internals.UserRoleCodes; } }
public List<TypeCodeDesc> OrganisationTypeCodes { get { return Internals.OrganisationTypeCodes; } }
public List<TypeCodeDesc> OrganisationCategoryCodes { get { return Internals.OrganisationCategoryCodes; } }
public List<TypeCodeDesc> OrganisationRoleCodes { get { return Internals.OrganisationRoleCodes; } }
public List<TypeCodeDesc> OpportunityTypeCodes { get { return Internals.OpportunityTypeCodes; } }
public List<TypeCodeDesc> DataItemTypeCodes { get { return Internals.DataItemTypeCodes; } }
// Email.
public SaEmailConfig EmailConfig { get { return App.EmailConfig; } }
public SaxEmailConsole EmailConsole { get { return Internals.EmailConsole; } }
+29 -15
View File
@@ -55,13 +55,15 @@ namespace Saxonite.Net.Core.Web.Base.Models
protected SaxActivityMgr ActivityMgr { get { return Internals.ActivityMgr; } }
protected SaxItemDataMgr ItemDataMgr { get { return Internals.ItemDataMgr; } }
// System codes.
public List<TypeCodeDesc> RegionTypes { get { return Internals.RegionTypes; } }
public List<TypeCodeDesc> UserRoles { get { return Internals.UserRoles; } }
public List<TypeCodeDesc> OrganisationTypes { get { return Internals.OrganisationTypes; } }
public List<TypeCodeDesc> OrganisationCategories { get { return Internals.OrganisationCategories; } }
public List<TypeCodeDesc> OrganisationRoles { get { return Internals.OrganisationRoles; } }
public List<TypeCodeDesc> OpportunityTypes { get { return Internals.OpportunityTypes; } }
public List<TypeCodeDesc> DataItemTypes { get { return Internals.DataItemTypes; } }
public List<TypeCodeDesc> SportParticipationCodes { get { return Internals.SportParticipationCodes; } }
public List<TypeCodeDesc> SportOfficiatingCodes { get { return Internals.SportOfficiatingCodes; } }
public List<TypeCodeDesc> RegionTypeCodes { get { return Internals.RegionTypeCodes; } }
public List<TypeCodeDesc> UserRoleCodes { get { return Internals.UserRoleCodes; } }
public List<TypeCodeDesc> OrganisationTypeCodes { get { return Internals.OrganisationTypeCodes; } }
public List<TypeCodeDesc> OrganisationCategoryCodes { get { return Internals.OrganisationCategoryCodes; } }
public List<TypeCodeDesc> OrganisationRoleCodes { get { return Internals.OrganisationRoleCodes; } }
public List<TypeCodeDesc> OpportunityTypeCodes { get { return Internals.OpportunityTypeCodes; } }
public List<TypeCodeDesc> DataItemTypeCodes { get { return Internals.DataItemTypeCodes; } }
//-------------------------------------------------------------------
// Page configuration.
@@ -153,28 +155,40 @@ namespace Saxonite.Net.Core.Web.Base.Models
get { return new SelectList(SaxSystem.GetCodesOfType(Sax.CodeType.YesNo), "Code", "Desc"); }
}
/// <summary>List of Sport Participation options for dropdown.</summary>
public IEnumerable<SelectListItem> SportParticipationCodesForSelect
{
get { return new SelectList(SportParticipationCodes, "Code", "Desc"); }
}
/// <summary>List of Sport Officiating options for dropdown.</summary>
public IEnumerable<SelectListItem> SportOfficiatingCodesForSelect
{
get { return new SelectList(SportOfficiatingCodes, "Code", "Desc"); }
}
/// <summary>List of Region Types for dropdown.</summary>
public IEnumerable<SelectListItem> RegionTypesForSelect
{
get { return new SelectList(RegionTypeCodes, "Code", "Desc"); }
}
/// <summary>List of titles for dropdown.</summary>
public IEnumerable<SelectListItem> TitlesForSelect
{
get { return new SelectList(SaxSystem.GetCodesOfType(Sax.CodeType.Title), "Code", "Desc"); }
}
/// <summary>List of Region Types for dropdown.</summary>
public IEnumerable<SelectListItem> RegionTypesForSelect
{
get { return new SelectList(RegionTypes, "Code", "Desc"); }
}
/// <summary>List of Organisation Types for dropdown.</summary>
public IEnumerable<SelectListItem> OrganisationTypesForSelect
{
get { return new SelectList(OrganisationTypes, "Code", "Desc"); }
get { return new SelectList(OrganisationTypeCodes, "Code", "Desc"); }
}
/// <summary>List of Organisation Categories for dropdown.</summary>
public IEnumerable<SelectListItem> OrganisationCategoriesForSelect
{
get { return new SelectList(OrganisationCategories, "Code", "Desc"); }
get { return new SelectList(OrganisationCategoryCodes, "Code", "Desc"); }
}
//-------------------------------------------------------------------