This commit is contained in:
2021-10-21 18:04:57 +01:00
parent 057b75462e
commit ea61d37840
32 changed files with 1486 additions and 523 deletions
+8 -4
View File
@@ -149,11 +149,15 @@ namespace Saxonite.Net.Core.Web.Base.App
private Dictionary<Sax.CodeType, List<TypeCodeDesc>> codeTypeCache { get; } = new Dictionary<Sax.CodeType, List<TypeCodeDesc>>();
public List<TypeCodeDesc> GetCodesOfType(Sax.CodeType codeType)
{
List<TypeCodeDesc> codes = codeTypeCache.GetValue(codeType, null);
if (codes == null)
List<TypeCodeDesc> codes = null;
lock (codeTypeCache)
{
codes = SaxSystem.GetCodesOfType(codeType);
codeTypeCache.Add(codeType, codes);
codes = codeTypeCache.GetValue(codeType, null);
if (codes == null)
{
codes = SaxSystem.GetCodesOfType(codeType);
codeTypeCache.Add(codeType, codes);
}
}
return codes;
}
+7 -7
View File
@@ -289,7 +289,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
{
List<SelectListItem> values = new List<SelectListItem>();
foreach (TypeCodeDesc yesNo in YesNoCodes)
values.Add(new SelectListItem(yesNo.Code, Localiser.GetYesNoCaption((Sax.YesNo)yesNo.Type)));
values.Add(new SelectListItem(Localiser.GetYesNoCaption((Sax.YesNo)yesNo.Type), yesNo.Code));
return values;
}
}
@@ -302,7 +302,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
List<SelectListItem> values = new List<SelectListItem>();
values.Add(new SelectListItem("Default", ""));
foreach (TypeCodeDesc sportSpecialityLabel in SportSpecialityLabelCodes)
values.Add(new SelectListItem(sportSpecialityLabel.Code, Localiser.GetSportSpecialityLabelCaption((Sax.SportSpecialityLabel)sportSpecialityLabel.Type)));
values.Add(new SelectListItem(Localiser.GetSportSpecialityLabelCaption((Sax.SportSpecialityLabel)sportSpecialityLabel.Type), sportSpecialityLabel.Code));
return values;
}
}
@@ -314,7 +314,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
{
List<SelectListItem> values = new List<SelectListItem>();
foreach (TypeCodeDesc sportParticipation in SportParticipationCodes)
values.Add(new SelectListItem(sportParticipation.Code, Localiser.GetSportParticipationCaption((Sax.SportParticipation)sportParticipation.Type)));
values.Add(new SelectListItem(Localiser.GetSportParticipationCaption((Sax.SportParticipation)sportParticipation.Type), sportParticipation.Code));
return values;
}
}
@@ -326,7 +326,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
{
List<SelectListItem> values = new List<SelectListItem>();
foreach (TypeCodeDesc sportOfficiating in SportOfficiatingCodes)
values.Add(new SelectListItem(sportOfficiating.Code, Localiser.GetSportOfficiatingCaption((Sax.SportOfficiating)sportOfficiating.Type)));
values.Add(new SelectListItem(Localiser.GetSportOfficiatingCaption((Sax.SportOfficiating)sportOfficiating.Type), sportOfficiating.Code));
return values;
}
}
@@ -338,7 +338,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
{
List<SelectListItem> values = new List<SelectListItem>();
foreach (TypeCodeDesc organisationType in RegionTypeCodes.FindAll(item => item.Type != (int)Sax.RegionType.Universe && item.Type != (int)Sax.RegionType.Galaxy))
values.Add(new SelectListItem(organisationType.Code, Localiser.GetRegionTypeCaption((Sax.RegionType)organisationType.Type)));
values.Add(new SelectListItem(Localiser.GetRegionTypeCaption((Sax.RegionType)organisationType.Type), organisationType.Code));
return values;
}
}
@@ -356,7 +356,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
{
List<SelectListItem> values = new List<SelectListItem>();
foreach (TypeCodeDesc organisationType in OrganisationTypeCodes)
values.Add(new SelectListItem(organisationType.Code, Localiser.GetOrganisationTypeCaption((Sax.OrganisationType)organisationType.Type)));
values.Add(new SelectListItem(Localiser.GetOrganisationTypeCaption((Sax.OrganisationType)organisationType.Type), organisationType.Code));
return values;
}
}
@@ -368,7 +368,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
{
List<SelectListItem> values = new List<SelectListItem>();
foreach (TypeCodeDesc organisationCategory in OrganisationCategoryCodes)
values.Add(new SelectListItem(organisationCategory.Code, Localiser.GetOrganisationCategoryCaption((Sax.OrganisationCategory)organisationCategory.Type)));
values.Add(new SelectListItem(Localiser.GetOrganisationCategoryCaption((Sax.OrganisationCategory)organisationCategory.Type), organisationCategory.Code));
return values;
}
}