This commit is contained in:
2021-05-20 19:22:52 +01:00
parent edd6e39c35
commit 047e8b235a
94 changed files with 5417 additions and 286 deletions
+50 -12
View File
@@ -122,6 +122,17 @@ namespace Saxonite.Net.Core.Web.Base.App
//-------------------------------------------------------------------
// Specific phrase translation.
//-------------------------------------------------------------------
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;
}
private CodeCache codes = new CodeCache();
// Status.
public String GetStatusCaption(SaStatus status)
{
@@ -130,36 +141,63 @@ namespace Saxonite.Net.Core.Web.Base.App
}
// Region type.
private List<TypeCodeDesc> regionTypes;
public String GetRegionTypeCaption(Sax.RegionType regionType)
{
if ((int)regionType < 1) return "";
if (regionTypes == null)
regionTypes = SaxSystem.GetCodesOfType(Sax.CodeType.RegionType);
if (codes.regionTypes == null)
codes.regionTypes = SaxSystem.GetCodesOfType(Sax.CodeType.RegionType);
// ToDo Region type localisation.
return regionTypes.GetDescForType(regionType);
return codes.regionTypes.GetDescForType(regionType);
}
// User role.
private List<TypeCodeDesc> userRoles;
public String GetUserRoleCaption(Sax.UserRole userRole)
{
if ((int)userRole < 1) return "";
if (userRoles == null)
userRoles = SaxSystem.GetCodesOfType(Sax.CodeType.UserRole);
if (codes.userRoles == null)
codes.userRoles = SaxSystem.GetCodesOfType(Sax.CodeType.UserRole);
// ToDo User Role localisation.
return userRoles.GetDescForType(userRole);
return codes.userRoles.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);
// ToDo Organisation Type localisation.
return codes.organisationTypes.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);
// ToDo Organisation Category localisation.
return codes.organisationCategories.GetDescForType(organisationCategory);
}
// Organisation role.
private List<TypeCodeDesc> organisationRoles;
public String GetOrganisationRoleCaption(Sax.OrganisationRole organisationRole)
{
if ((int)organisationRole < 1) return "";
if (organisationRoles == null)
organisationRoles = SaxSystem.GetCodesOfType(Sax.CodeType.OrganisationRole);
if (codes.organisationRoles == null)
codes.organisationRoles = SaxSystem.GetCodesOfType(Sax.CodeType.OrganisationRole);
// ToDo Organisation Role localisation.
return organisationRoles.GetDescForType(organisationRole);
return codes.organisationRoles.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);
// ToDo Opportunity Type localisation.
return codes.opportunityTypes.GetDescForType(opportunityType);
}
//-------------------------------------------------------------------
@@ -94,6 +94,7 @@ namespace Saxonite.Net.Core.Web.Base.Controllers
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; } }
// Email.
public SaEmailConfig EmailConfig { get { return App.EmailConfig; } }
public SaxEmailConsole EmailConsole { get { return Internals.EmailConsole; } }
@@ -59,6 +59,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
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; } }
//-------------------------------------------------------------------
// Page configuration.