This commit is contained in:
2021-08-12 18:58:03 +01:00
parent 5e5ef7190b
commit 6a682ff9ea
51 changed files with 657 additions and 192 deletions
+11
View File
@@ -137,6 +137,7 @@ namespace Saxonite.Net.Core.Web.Base.App
//-------------------------------------------------------------------
private class CodeCache
{
public List<TypeCodeDesc> genderCodes;
public List<TypeCodeDesc> sportParticipationCodes;
public List<TypeCodeDesc> sportOfficiatingCodes;
public List<TypeCodeDesc> regionTypeCodes;
@@ -155,6 +156,16 @@ namespace Saxonite.Net.Core.Web.Base.App
return SacsSystem.GetStatusDesc(status);
}
// Gender.
public String GetGenderCaption(Sax.Gender gender)
{
if ((int)gender < 1) return "";
if (codes.genderCodes == null)
codes.genderCodes = SaxSystem.GetCodesOfType(Sax.CodeType.Gender);
// ToDo Opportunity Type localisation.
return codes.genderCodes.GetDescForType(gender);
}
// Sport Participation.
public String GetSportParticipationTypeCaption(Sax.SportParticipation participation)
{
+5
View File
@@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Mvc.Razor;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Microsoft.Net.Http.Headers;
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Core;
@@ -160,6 +161,10 @@ namespace Saxonite.Net.Core.Web.Base.App
//config.app.UseAuthorization();
config.app.UseAntiforgeryTokens();
// Localisation.
IOptions<RequestLocalizationOptions> localizationOptions = config.app.ApplicationServices.GetService<IOptions<RequestLocalizationOptions>>();
config.app.UseRequestLocalization(localizationOptions.Value);
config.app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(