v1.0.4.0
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user