This commit is contained in:
2022-05-23 17:28:34 +01:00
parent 56f6b0bb7e
commit 25386026af
86 changed files with 2395 additions and 664 deletions
+12
View File
@@ -261,6 +261,18 @@ namespace Saxonite.Net.Core.Web.Base.App
return GetCodeTypeCaption(Sax.CodeType.OrganisationRole, organisationRole);
}
// Address types.
public String GetAddressTypeCaption(Sax.AddressType addressType)
{
return GetCodeTypeCaption(Sax.CodeType.AddressType, addressType);
}
// Contact Method.
public String GetContactMethodCaption(Sax.ContactMethod contactMethod)
{
return GetCodeTypeCaption(Sax.CodeType.ContactMethod, contactMethod);
}
// Event type.
public String GetEventTypeCaption(Sax.EventType eventType)
{
@@ -122,6 +122,7 @@ namespace Saxonite.Net.Core.Web.Base.Controllers
public List<TypeCodeDesc> OrganisationCategoryCodes { get { return Internals.OrganisationCategoryCodes; } }
public List<TypeCodeDesc> OrganisationRoleCodes { get { return Internals.OrganisationRoleCodes; } }
public List<TypeCodeDesc> AddressTypeCodes { get { return Internals.AddressTypeCodes; } }
public List<TypeCodeDesc> ContactMethodCodes { get { return Internals.ContactMethodCodes; } }
public List<TypeCodeDesc> EventTypeCodes { get { return Internals.EventTypeCodes; } }
public List<TypeCodeDesc> OpportunityTypeCodes { get { return Internals.OpportunityTypeCodes; } }
public List<TypeCodeDesc> ActivityReactionCodes { get { return Internals.ActivityReactionCodes; } }
@@ -486,6 +487,25 @@ namespace Saxonite.Net.Core.Web.Base.Controllers
/// <summary>Updated on date - formatted per locale</summary>
public String UpdatedOnFmt { get; set; }
}
/// <summary>Contact Method properties.</summary>
public class ContactMethodData
{
public String Method { get; set; }
public String MethodCaption { get; set; }
public String Value { get; set; }
}
/// <summary>Address properties.</summary>
public class AddressData : ItemData_Base
{
public String Line1 { get; set; }
public String Line2 { get; set; }
public String Line3 { get; set; }
public String Town { get; set; }
public String Province { get; set; }
public String RegionIdProvince { get; set; }
public String Country { get; set; }
public String PostalCode { get; set; }
}
/// <summary>
/// Item data with label and value.
/// </summary>
@@ -1,6 +1,7 @@
using Microsoft.AspNetCore.Html;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;
using Microsoft.AspNetCore.Mvc.Rendering;
using Sarand.Net.Standard.Base.App;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Dbas;
@@ -58,6 +59,20 @@ namespace Saxonite.Net.Core.Web.Base.Models
public String PageCaption { get; set; }
public String InstanceVersion { get { return !StringUtil.IsEmpty(App.AppConfig.Instance) ? App.AppConfig.Instance + " v" + Sax.Version.GetFullVersion() : "v" + Sax.Version.GetAppVersion(); } }
public bool IncludeGoogleAnalytics { get; set; } = false;
// Views can be registered to avoid multiple inclusions in a page.
private HashSet<String> registeredViews = new HashSet<String>(StringComparer.OrdinalIgnoreCase);
/// <summary>
/// Views can be registered to avoid multiple inclusions in a page.
/// <para>Only generate view content if this method returns true.</para>
/// </summary>
public bool RegisterView (String viewName)
{
#if DEBUG
if (registeredViews.Contains(viewName))
SaLogger.Warn(this.GetType().Name + ".RegisterView View already registered: " + viewName);
#endif
return registeredViews.Add(viewName);
}
//-------------------------------------------------------------------
// Business components.
@@ -83,6 +98,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
public List<TypeCodeDesc> OrganisationCategoryCodes { get { return Internals.OrganisationCategoryCodes; } }
public List<TypeCodeDesc> OrganisationRoleCodes { get { return Internals.OrganisationRoleCodes; } }
public List<TypeCodeDesc> AddressTypeCodes { get { return Internals.AddressTypeCodes; } }
public List<TypeCodeDesc> ContactMethodCodes { get { return Internals.ContactMethodCodes; } }
public List<TypeCodeDesc> EventTypeCodes { get { return Internals.EventTypeCodes; } }
public List<TypeCodeDesc> OpportunityTypeCodes { get { return Internals.OpportunityTypeCodes; } }
public List<TypeCodeDesc> ActivityReactionCodes { get { return Internals.ActivityReactionCodes; } }