From 25386026af238e0c694edc14c6cd3cf294edb85a Mon Sep 17 00:00:00 2001 From: Andy Howard Date: Mon, 23 May 2022 17:28:34 +0100 Subject: [PATCH] v1.2.6.2 --- SaxoniteCoreWeb/Base/App/SaxLocaliser.cs | 12 + .../Base/Controllers/SaxController_Base.cs | 20 ++ SaxoniteCoreWeb/Base/Models/SaxModel_Base.cs | 16 + .../OrganisationController-Activation-Ajax.cs | 16 +- .../OrganisationController-Ajax.cs | 281 +++++++++++++----- ...ReferenceController-Ajax-ContactMethods.cs | 64 ++++ .../Controllers/ReferenceController-Ajax.cs | 31 ++ .../Admin/Models/ModelData_Address.cs | 141 +++++++++ .../Admin/Models/ModelData_Online.cs | 38 +++ .../Admin/Models/Model_ContactMethod.cs | 28 ++ .../Admin/Models/Model_Organisation.cs | 39 ++- .../Localisation/SaxAdminProperties.resx | 12 + .../Views/Common/ContactMethods.cshtml | 50 ++++ .../Common/Controls-ItemContactMethods.cshtml | 75 +++++ .../Views/Common/SelectCode.cshtml | 2 + .../Views/Common/SelectItem.cshtml | 2 + .../Views/Common/SelectOrganisation.cshtml | 2 + .../Panel-OrganisationDialog.cshtml | 3 + SaxoniteCoreWebAdmin/wwwroot/css/sax-form.css | 8 +- .../wwwroot/img/action/edit16.png | Bin 0 -> 586 bytes .../wwwroot/js/sax-cnt-mth.js | 69 +++++ .../wwwroot/js/sax-org-mbr.js | 9 +- SaxoniteCoreWebAdmin/wwwroot/js/sax-org.js | 95 +++++- .../Localisation/SaxOnlineProperties.resx | 48 ++- .../AccountController-Ajax-Organisations.cs | 70 +++-- ...ReferenceController-Ajax-ContactMethods.cs | 64 ++++ .../SearchController-Ajax-Organisations.cs | 49 +-- .../Helpers/SaxContactMethodHelper_Online.cs | 63 ++++ .../Online/Models/ModelData_Address.cs | 46 ++- .../Online/Models/ModelData_Organisation.cs | 38 ++- .../Online/Models/Model_ContactMethod.cs | 28 ++ .../SaxoniteCoreWebOnline.csproj | 1 - .../Account/Profile-Organisations.cshtml | 46 ++- .../Views/Common/CodeSelect.cshtml | 66 ++-- .../Views/Common/ContactMethods.cshtml | 50 ++++ .../OrganisationControls-Address.cshtml | 99 ++++++ .../OrganisationControls-Contact.cshtml | 75 +++++ .../Common/OrganisationControls-Core.cshtml | 94 ++++++ .../Views/Common/OrganisationControls.cshtml | 208 ------------- .../Views/Common/OrganisationRequest.cshtml | 18 +- .../Views/Common/OrganisationSelect.cshtml | 2 + .../Views/Common/RegionSelect.cshtml | 2 + .../Views/Common/SportSelect.cshtml | 2 + .../Search/Panel-OrganisationDialog.cshtml | 26 +- .../wwwroot/css/sax-data.css | 4 +- .../wwwroot/css/sax-form.css | 8 +- .../wwwroot/img/action/edit16.png | Bin 0 -> 586 bytes .../wwwroot/img/icon/contact/facebook-16.png | Bin 0 -> 727 bytes .../wwwroot/img/icon/contact/facebook-24.png | Bin 0 -> 1025 bytes .../wwwroot/img/icon/contact/facebook-32.png | Bin 0 -> 1308 bytes .../wwwroot/img/icon/contact/instagram-16.png | Bin 0 -> 998 bytes .../wwwroot/img/icon/contact/instagram-24.png | Bin 0 -> 1631 bytes .../wwwroot/img/icon/contact/instagram-32.png | Bin 0 -> 2413 bytes .../wwwroot/img/icon/contact/linkedin-16.png | Bin 0 -> 767 bytes .../wwwroot/img/icon/contact/linkedin-24.png | Bin 0 -> 1132 bytes .../wwwroot/img/icon/contact/linkedin-32.png | Bin 0 -> 1412 bytes .../wwwroot/img/icon/contact/mobile-16.png | Bin 0 -> 412 bytes .../wwwroot/img/icon/contact/mobile-24.png | Bin 0 -> 502 bytes .../wwwroot/img/icon/contact/mobile-32.png | Bin 0 -> 559 bytes .../wwwroot/img/icon/contact/phone-16.png | Bin 0 -> 764 bytes .../wwwroot/img/icon/contact/phone-24.png | Bin 0 -> 1095 bytes .../wwwroot/img/icon/contact/phone-32.png | Bin 0 -> 1471 bytes .../wwwroot/img/icon/contact/twitter-16.png | Bin 0 -> 748 bytes .../wwwroot/img/icon/contact/twitter-24.png | Bin 0 -> 1084 bytes .../wwwroot/img/icon/contact/twitter-32.png | Bin 0 -> 1402 bytes .../wwwroot/img/icon/contact/wikipedia-16.png | Bin 0 -> 640 bytes .../wwwroot/img/icon/contact/wikipedia-24.png | Bin 0 -> 938 bytes .../wwwroot/img/icon/contact/wikipedia-32.png | Bin 0 -> 1342 bytes .../wwwroot/img/icon/contact/www-16.png | Bin 0 -> 975 bytes .../wwwroot/img/icon/contact/www-24.png | Bin 0 -> 1718 bytes .../wwwroot/img/icon/contact/www-32.png | Bin 0 -> 2560 bytes .../wwwroot/js/sax-cnt-mth.js | 69 +++++ .../wwwroot/js/sax-src-org.js | 20 +- .../wwwroot/js/sax-src-usr.js | 2 +- .../wwwroot/js/sax-usr-org.js | 86 +++++- SaxoniteStandardBase/Base/App/Sax-Config.cs | 13 + SaxoniteStandardBase/Base/App/Sax-Version.cs | 3 +- SaxoniteStandardBase/Base/App/Sax.cs | 30 ++ SaxoniteStandardBase/Base/App/SaxInternals.cs | 1 + .../Base/App/SaxSystem-CodeTypes.cs | 239 ++++++++++++++- .../Base/App/SaxSystem-Statics.cs | 164 +--------- SaxoniteStandardBase/Base/App/SaxSystem.cs | 48 --- .../Base/Bus/SaxContactData.cs | 151 ++++++++++ .../Base/Bus/SaxOrganisation.cs | 18 +- .../Base/Helpers/SaxContactMethodHelper.cs | 94 ++++++ SaxoniteStandardBase/Base/Mgr/SaxItemMgr.cs | 1 + 86 files changed, 2395 insertions(+), 664 deletions(-) create mode 100644 SaxoniteCoreWebAdmin/Admin/Controllers/ReferenceController-Ajax-ContactMethods.cs create mode 100644 SaxoniteCoreWebAdmin/Admin/Controllers/ReferenceController-Ajax.cs create mode 100644 SaxoniteCoreWebAdmin/Admin/Models/ModelData_Address.cs create mode 100644 SaxoniteCoreWebAdmin/Admin/Models/ModelData_Online.cs create mode 100644 SaxoniteCoreWebAdmin/Admin/Models/Model_ContactMethod.cs create mode 100644 SaxoniteCoreWebAdmin/Views/Common/ContactMethods.cshtml create mode 100644 SaxoniteCoreWebAdmin/Views/Common/Controls-ItemContactMethods.cshtml create mode 100644 SaxoniteCoreWebAdmin/wwwroot/img/action/edit16.png create mode 100644 SaxoniteCoreWebAdmin/wwwroot/js/sax-cnt-mth.js create mode 100644 SaxoniteCoreWebOnline/Online/Controllers/ReferenceController-Ajax-ContactMethods.cs create mode 100644 SaxoniteCoreWebOnline/Online/Helpers/SaxContactMethodHelper_Online.cs create mode 100644 SaxoniteCoreWebOnline/Online/Models/Model_ContactMethod.cs create mode 100644 SaxoniteCoreWebOnline/Views/Common/ContactMethods.cshtml create mode 100644 SaxoniteCoreWebOnline/Views/Common/OrganisationControls-Address.cshtml create mode 100644 SaxoniteCoreWebOnline/Views/Common/OrganisationControls-Contact.cshtml create mode 100644 SaxoniteCoreWebOnline/Views/Common/OrganisationControls-Core.cshtml delete mode 100644 SaxoniteCoreWebOnline/Views/Common/OrganisationControls.cshtml create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/action/edit16.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/facebook-16.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/facebook-24.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/facebook-32.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/instagram-16.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/instagram-24.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/instagram-32.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/linkedin-16.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/linkedin-24.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/linkedin-32.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/mobile-16.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/mobile-24.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/mobile-32.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/phone-16.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/phone-24.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/phone-32.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/twitter-16.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/twitter-24.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/twitter-32.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/wikipedia-16.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/wikipedia-24.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/wikipedia-32.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/www-16.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/www-24.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/img/icon/contact/www-32.png create mode 100644 SaxoniteCoreWebOnline/wwwroot/js/sax-cnt-mth.js create mode 100644 SaxoniteStandardBase/Base/Bus/SaxContactData.cs create mode 100644 SaxoniteStandardBase/Base/Helpers/SaxContactMethodHelper.cs diff --git a/SaxoniteCoreWeb/Base/App/SaxLocaliser.cs b/SaxoniteCoreWeb/Base/App/SaxLocaliser.cs index 56a4bee..901aac5 100644 --- a/SaxoniteCoreWeb/Base/App/SaxLocaliser.cs +++ b/SaxoniteCoreWeb/Base/App/SaxLocaliser.cs @@ -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) { diff --git a/SaxoniteCoreWeb/Base/Controllers/SaxController_Base.cs b/SaxoniteCoreWeb/Base/Controllers/SaxController_Base.cs index 639baf8..d543dd7 100644 --- a/SaxoniteCoreWeb/Base/Controllers/SaxController_Base.cs +++ b/SaxoniteCoreWeb/Base/Controllers/SaxController_Base.cs @@ -122,6 +122,7 @@ namespace Saxonite.Net.Core.Web.Base.Controllers public List OrganisationCategoryCodes { get { return Internals.OrganisationCategoryCodes; } } public List OrganisationRoleCodes { get { return Internals.OrganisationRoleCodes; } } public List AddressTypeCodes { get { return Internals.AddressTypeCodes; } } + public List ContactMethodCodes { get { return Internals.ContactMethodCodes; } } public List EventTypeCodes { get { return Internals.EventTypeCodes; } } public List OpportunityTypeCodes { get { return Internals.OpportunityTypeCodes; } } public List ActivityReactionCodes { get { return Internals.ActivityReactionCodes; } } @@ -486,6 +487,25 @@ namespace Saxonite.Net.Core.Web.Base.Controllers /// Updated on date - formatted per locale public String UpdatedOnFmt { get; set; } } + /// Contact Method properties. + public class ContactMethodData + { + public String Method { get; set; } + public String MethodCaption { get; set; } + public String Value { get; set; } + } + /// Address properties. + 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; } + } /// /// Item data with label and value. /// diff --git a/SaxoniteCoreWeb/Base/Models/SaxModel_Base.cs b/SaxoniteCoreWeb/Base/Models/SaxModel_Base.cs index 96c0f8f..68fa520 100644 --- a/SaxoniteCoreWeb/Base/Models/SaxModel_Base.cs +++ b/SaxoniteCoreWeb/Base/Models/SaxModel_Base.cs @@ -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 registeredViews = new HashSet(StringComparer.OrdinalIgnoreCase); + /// + /// Views can be registered to avoid multiple inclusions in a page. + /// Only generate view content if this method returns true. + /// + 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 OrganisationCategoryCodes { get { return Internals.OrganisationCategoryCodes; } } public List OrganisationRoleCodes { get { return Internals.OrganisationRoleCodes; } } public List AddressTypeCodes { get { return Internals.AddressTypeCodes; } } + public List ContactMethodCodes { get { return Internals.ContactMethodCodes; } } public List EventTypeCodes { get { return Internals.EventTypeCodes; } } public List OpportunityTypeCodes { get { return Internals.OpportunityTypeCodes; } } public List ActivityReactionCodes { get { return Internals.ActivityReactionCodes; } } diff --git a/SaxoniteCoreWebAdmin/Admin/Controllers/OrganisationController-Activation-Ajax.cs b/SaxoniteCoreWebAdmin/Admin/Controllers/OrganisationController-Activation-Ajax.cs index 56a4ac2..5e6d998 100644 --- a/SaxoniteCoreWebAdmin/Admin/Controllers/OrganisationController-Activation-Ajax.cs +++ b/SaxoniteCoreWebAdmin/Admin/Controllers/OrganisationController-Activation-Ajax.cs @@ -28,7 +28,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers // Construction. public AjaxResponse_OrganisationActivationInfo(SaxModel_Admin model) : base(model) { } // Organisation details. - public OrganisationData_Full organisation { get; } = new OrganisationData_Full(); + public OrganisationItemData organisation { get; } = new OrganisationItemData(); // Member awaiting activation. public List Members { get; } = new List(); } @@ -69,8 +69,12 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"])); } + // Organisation address. + SaxItemAddress address = ItemDataMgr.GetFirstItemAddressByItemAndType(organisation.GetItemId()); + disposableItems.Add(address); + // Construct response. - PopulateOrganisationResponseData(organisation, responseData.organisation); + PopulateOrganisationResponseItemData(organisation, address, responseData.organisation); GetOrganisationMembers(model, organisationId, responseData.Members); } @@ -119,12 +123,16 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers SysId organisationId = model.OrganisationId.ToSysId(); SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId); disposableItems.Add(organisation); - if (organisation == null && SysId.IsValid(organisationId)) + if (organisation == null) { SaLogger.Warn(fn + " Failed to retrieve organisation for. : '" + model.OrganisationId + "'"); return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"])); } + // Organisation address. + SaxItemAddress address = ItemDataMgr.GetFirstItemAddressByItemAndType(organisation.GetItemId()); + disposableItems.Add(address); + // Retrieve users. List organisationMembersToActivate = new List(); foreach (String userOrganisationId in model.OrganisationMemberIds) @@ -206,7 +214,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers } // Construct response. - PopulateOrganisationResponseData(organisation, responseData.organisation); + PopulateOrganisationResponseItemData(organisation, address, responseData.organisation); } // Complete response. diff --git a/SaxoniteCoreWebAdmin/Admin/Controllers/OrganisationController-Ajax.cs b/SaxoniteCoreWebAdmin/Admin/Controllers/OrganisationController-Ajax.cs index a8be7f4..5c0cd4f 100644 --- a/SaxoniteCoreWebAdmin/Admin/Controllers/OrganisationController-Ajax.cs +++ b/SaxoniteCoreWebAdmin/Admin/Controllers/OrganisationController-Ajax.cs @@ -21,7 +21,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers { //------------------------------------------------------------------- // Organisation data. - private class OrganisationData_List : AjaxResponse_Data.ItemData_Base + private class OrganisationListData : AjaxResponse_Data.ItemData_Base { public String Name { get; set; } public String TypeCode { get; set; } @@ -38,12 +38,14 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers // Address. public String AddressSummary { get; set; } } - private class OrganisationData_Full : OrganisationData_List + private class OrganisationItemData : OrganisationListData { public String About { get; set; } public String Facilities { get; set; } + public List ContactMethods { get; set; } + public AjaxResponse_Data.AddressData Address { get; set; } } - private void PopulateOrganisationResponseData(SaxOrganisation organisation, OrganisationData_List data) + private void PopulateOrganisationResponseListData(SaxOrganisation organisation, OrganisationListData data) { data.Id = SysId.ToString(organisation.Id); data.Name = organisation.Name; @@ -64,11 +66,32 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers data.StatusCode = organisation.StatusCode; data.StatusDesc = organisation.StatusDesc; } - private void PopulateOrganisationResponseData(SaxOrganisation organisation, OrganisationData_Full data) + private void PopulateOrganisationResponseItemData(SaxOrganisation organisation, SaxItemAddress address, OrganisationItemData data) { - PopulateOrganisationResponseData(organisation, data as OrganisationData_List); + PopulateOrganisationResponseListData(organisation, data as OrganisationListData); data.About = organisation.About; data.Facilities = organisation.Facilities; + // Contact methods. + SaxContactData contactData = new SaxContactData(organisation.ContactData); + foreach (Sax.ContactMethod method in contactData.Methods) + { + if (data.ContactMethods == null) data.ContactMethods = new List(); + data.ContactMethods.Add(new AjaxResponse_Data.ContactMethodData() { Method = method.ToString(), MethodCaption = Localiser.GetContactMethodCaption(method), Value = contactData.GetContactMethodValue(method) }); + } + // Address. + if (address != null) + { + data.Address = new AjaxResponse_Data.AddressData(); + data.Address.Id = address.Id.ToString(); + data.Address.Line1 = address.Line1; + data.Address.Line2 = address.Line2; + data.Address.Line3 = address.Line3; + data.Address.Town = address.Town; + data.Address.Province = address.Province; + data.Address.Country = address.Country; + data.Address.PostalCode = address.PostalCode; + } + // Common properties. data.Notes = organisation.Notes; } @@ -80,8 +103,9 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers // Construction. public AjaxResponse_OrganisationList(SaxModel_Admin model) : base(model) { } // Organisation list. - public List Organisations { get; } = new List(); + public List Organisations { get; } = new List(); // Reference data. + public List ContactMethods { get; } = new List(); public List Statuses { get; } = new List(); public String DefaultStatusCode { get; set; } } @@ -98,6 +122,15 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData); + // Reference data - contact methods. + List validContactMethods = SaxOrganisation.ValidContactMethods; + foreach (TypeCodeDesc contactMethod in ContactMethodCodes) + { + // Skip methods that aren't associated with Organisations. + if (!validContactMethods.Contains((Sax.ContactMethod)contactMethod.Type)) continue; + responseData.ContactMethods.Add(new AjaxResponse_Data.ItemCodeDesc() { Code = contactMethod.Code, Desc = Localiser.GetContactMethodCaption((Sax.ContactMethod)contactMethod.Type) }); + } + // Reference data - statuses. foreach (SaStatus status in SaxOrganisation.ValidStatuses.FindAll(item => item != SaStatus.Deleted)) responseData.Statuses.Add(SacsSystem.GetStatusCode(status), Localiser.GetStatusCaption(status)); @@ -149,7 +182,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers while (resultSet != null && resultSet.HasRows && resultSet.NextRecord()) { NamedValue.Map values = resultSet.GetRecordValues(); - OrganisationData_List organisationData = new OrganisationData_List() + OrganisationListData organisationData = new OrganisationListData() { Id = values.GetLong(colId.DataName).ToString(), Name = values.GetString(colName.DataName), @@ -185,7 +218,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers // Construction. public AjaxResponse_Organisation(SaxModel_Admin model) : base(model) { } // Organisation details. - public OrganisationData_Full organisation { get; } = new OrganisationData_Full(); + public OrganisationItemData organisation { get; } = new OrganisationItemData(); } //------------------------------------------------------------------- [HttpPost] @@ -200,25 +233,34 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData); - // Identify item. - SysId organisationId = model.OrganisationId.ToSysId(); - if (!SysId.IsValid(organisationId)) - return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"])); - - // Retrieve item. - SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId); - if (organisation == null) + // Record disposable items as they are created so all can be disposed when needed. + using (DisposableCollection disposableItems = new DisposableCollection()) { - SaLogger.Warn(fn + " Failed to retrieve organisation for Id: '" + model.OrganisationId + "'"); - return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"])); + + // Identify item. + SysId organisationId = model.OrganisationId.ToSysId(); + if (!SysId.IsValid(organisationId)) + return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.specified"])); + + // Retrieve item. + SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId); + disposableItems.Add(organisation); + if (organisation == null) + { + SaLogger.Warn(fn + " Failed to retrieve organisation for Id: '" + model.OrganisationId + "'"); + return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"])); + } + + // Organisation address. + SaxItemAddress address = ItemDataMgr.GetFirstItemAddressByItemAndType(organisation.GetItemId()); + disposableItems.Add(address); + + // Construct response. + PopulateOrganisationResponseItemData(organisation, address, responseData.organisation); + + // Complete response. + responseData.Success = true; } - - // Construct response. - PopulateOrganisationResponseData(organisation, responseData.organisation); - - // Complete response. - responseData.Success = true; - return Json(responseData); } @@ -237,69 +279,148 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData); - // Validate item properties. - model.ValidateOrganisationData(responseData); - if (responseData.HasControlErrors()) - return Json(responseData); - - // Retrieve existing item. - SysId organisationId = model.OrganisationId.ToSysId(); - SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId); - if (organisation == null && SysId.IsValid(organisationId)) + // Record disposable items as they are created so all can be disposed when needed. + using (DisposableCollection disposableItems = new DisposableCollection()) { - SaLogger.Warn(fn + " Failed to retrieve organisation for Id: '" + model.OrganisationId + "'"); - return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"])); - } - // Create new item if required. - if (organisation == null) - organisation = AccountMgr.CreateOrganisation(); + // Validate item properties. + model.ValidateOrganisationData(responseData); + if (responseData.HasControlErrors()) + return Json(responseData); - // Populate item properties. - if (model.OrganisationName != null) - organisation.Name = model.OrganisationName; - if (model.OrganisationTypeValue != null) - organisation.OrganisationType = model.OrganisationType; - if (model.OrganisationCategoryValue != null) - organisation.OrganisationCategory = model.OrganisationCategory; - if (model.OrganisationSportId != null) - organisation.SportIdPrimary = model.OrganisationSportId.ToSysId(); - if (model.OrganisationRegionIdCountry != null) - organisation.RegionIdPrimary = model.OrganisationRegionIdCountry.ToSysId(); - if (model.OrganisationAbout != null) - organisation.About = model.OrganisationAbout; - if (model.OrganisationFacilities != null) - organisation.Facilities = model.OrganisationFacilities; - // Common properties. - if (model.OrganisationStatusCode != null) - organisation.Status = model.OrganisationStatus; - if (model.OrganisationNotes != null) - organisation.Notes = model.OrganisationNotes; - - // Store item. - if (!SysId.IsValid(organisation.Id)) - { - if (!AccountMgr.InsertOrganisation(organisation, DbUpdateInfo)) + // Retrieve existing item. + SysId organisationId = model.OrganisationId.ToSysId(); + SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationId); + disposableItems.Add(organisation); + if (organisation == null && SysId.IsValid(organisationId)) { - SaLogger.Warn(fn + " Failed to insert organisation: " + AccountMgr.ErrorStateMessage); - return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"] + "\n\n" + AccountMgr.ErrorStateMessage)); + SaLogger.Warn(fn + " Failed to retrieve organisation for Id: '" + model.OrganisationId + "'"); + return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.id.not.found"])); } - } - else - { - if (!AccountMgr.UpdateOrganisation(organisation, DbUpdateInfo)) + + // Create new item if required. + if (organisation == null) { - SaLogger.Warn(fn + " Failed to update organisation [Id:" + SysId.ToString(organisation.Id) + "]: " + AccountMgr.ErrorStateMessage); - return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + AccountMgr.ErrorStateMessage)); + organisation = AccountMgr.CreateOrganisation(); + disposableItems.Add(organisation); } + + // Organisation address. + SaxItemAddress organisationAddress = ItemDataMgr.GetFirstItemAddressByItemAndType(organisation.GetItemId()); + disposableItems.Add(organisationAddress); + + // Populate item properties. + if (model.OrganisationName != null) + organisation.Name = model.OrganisationName; + if (model.OrganisationTypeValue != null) + organisation.OrganisationType = model.OrganisationType; + if (model.OrganisationCategoryValue != null) + organisation.OrganisationCategory = model.OrganisationCategory; + if (model.OrganisationSportId != null) + organisation.SportIdPrimary = model.OrganisationSportId.ToSysId(); + if (model.OrganisationRegionIdCountry != null) + organisation.RegionIdPrimary = model.OrganisationRegionIdCountry.ToSysId(); + if (model.OrganisationAbout != null) + organisation.About = model.OrganisationAbout; + if (model.OrganisationFacilities != null) + organisation.Facilities = model.OrganisationFacilities; + if (model.ContactData != null) + organisation.ContactData = model.ContactData.GetContactData(); + // Common properties. + if (model.OrganisationStatusCode != null) + organisation.Status = model.OrganisationStatus; + if (model.OrganisationNotes != null) + organisation.Notes = model.OrganisationNotes; + + // Store item. + if (!SysId.IsValid(organisation.Id)) + { + if (!AccountMgr.InsertOrganisation(organisation, DbUpdateInfo)) + { + SaLogger.Warn(fn + " Failed to insert organisation: " + AccountMgr.ErrorStateMessage); + return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.insert.failed"] + "\n\n" + AccountMgr.ErrorStateMessage)); + } + } + else + { + if (!AccountMgr.UpdateOrganisation(organisation, DbUpdateInfo)) + { + SaLogger.Warn(fn + " Failed to update organisation [Id:" + SysId.ToString(organisation.Id) + "]: " + AccountMgr.ErrorStateMessage); + return Json(responseData.SetMessage(messageTitle, Localiser["msg.error.item.update.failed"] + "\n\n" + AccountMgr.ErrorStateMessage)); + } + } + + if (model.Address.IsSpecified()) + { + // Organisation regions. + SaxRegion.Data regionCountry = Internals.GetRegion(organisation.RegionIdPrimary); + if (regionCountry != null && regionCountry.RegionType != Sax.RegionType.Country) + regionCountry = null; + SaxRegion.Data regionProvince = null; + + // Create Organisation address if required. + if (organisationAddress == null) + { + organisationAddress = ItemDataMgr.CreateItemAddress(organisation.GetItemId(), SaxItemAddress.DefaultOrganisationAddressType); + disposableItems.Add(organisationAddress); + } + + // Store address. + if (model.Address.Line1 != null) + organisationAddress.Line1 = model.Address.Line1; + if (model.Address.Line2 != null) + organisationAddress.Line2 = model.Address.Line2; + if (model.Address.Line3 != null) + organisationAddress.Line3 = model.Address.Line3; + if (model.Address.Town != null) + organisationAddress.Town = model.Address.Town; + if (regionProvince != null) + { + organisationAddress.Province = regionProvince.Name; + organisationAddress.RegionIdProvince = regionProvince.Id; + } + else + { + if (model.Address.Province != null) + organisationAddress.Province = model.Address.Province; + } + if (regionCountry != null) + { + organisationAddress.Country = regionCountry.Name; + organisationAddress.RegionIdCountry = regionCountry.Id; + } + else + { + if (model.Address.Country != null) + organisationAddress.Country = model.Address.Country; + } + organisationAddress.PostalCode = model.Address.PostalCode; + if (!SysId.IsValid(organisationAddress.Id)) + { + // Create new address. + if (!ItemDataMgr.InsertItemAddress(organisationAddress, DbUpdateInfo)) + { + SaLogger.Warn(fn + " Failed to insert organisation address - " + ItemDataMgr.ErrorStateMessage); + return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"])); + } + } + else + { + // Update existing address. + if (!ItemDataMgr.UpdateItemAddress(organisationAddress, DbUpdateInfo)) + { + SaLogger.Warn(fn + " Failed to update organisation address - " + ItemDataMgr.ErrorStateMessage); + return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"])); + } + } + } + + // Construct response. + PopulateOrganisationResponseItemData(organisation, organisationAddress, responseData.organisation); + + // Complete response. + responseData.Success = true; } - - // Construct response. - PopulateOrganisationResponseData(organisation, responseData.organisation); - - // Complete response. - responseData.Success = true; - return Json(responseData); } diff --git a/SaxoniteCoreWebAdmin/Admin/Controllers/ReferenceController-Ajax-ContactMethods.cs b/SaxoniteCoreWebAdmin/Admin/Controllers/ReferenceController-Ajax-ContactMethods.cs new file mode 100644 index 0000000..df7562b --- /dev/null +++ b/SaxoniteCoreWebAdmin/Admin/Controllers/ReferenceController-Ajax-ContactMethods.cs @@ -0,0 +1,64 @@ +using Microsoft.AspNetCore.Mvc; +using Sarand.Net.Standard.Base.App; +using Sarand.Net.Standard.Base.Utils; +using Saxonite.Net.Core.Web.Admin.Models; +using Saxonite.Net.Core.Web.Base.Models; +using Saxonite.Net.Standard.Base.App; +using Saxonite.Net.Standard.Base.Helpers; +using System; + +namespace Saxonite.Net.Core.Web.Admin.Controllers +{ + //======================================================================= + // Admin Reference Controller - Contact Method Ajax actions only. + //======================================================================= + partial class ReferenceController + { + //------------------------------------------------------------------- + // Validate Contact Method. + //------------------------------------------------------------------- + private class AjaxResponse_ValidateContactMethod : AjaxResponse_Data + { + public AjaxResponse_ValidateContactMethod(SaxModel_Base model) : base(model) { } + } + [HttpPost] + [Route("Reference/Ajax/ValidateContactMethod")] + public IActionResult Ajax_ValidateContactMethod(Model_ContactMethod model) + { + String fn = GetType().Name + ".Ajax_ValidateContactMethod"; + String messageTitle = Localiser["caption.contact.method"]; + AjaxResponse_ValidateContactMethod responseData = new AjaxResponse_ValidateContactMethod(model); + + // Validate session and referrer. + if (!ValidReferer) return Forbid(); + if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData); + + // Validate method. + Sax.ContactMethod method = EnumUtil.ParseEnum(model.ContactMethod, Sax.ContactMethod.Unknown); + if (model.ContactMethod.IsEmpty() || (int)method < 1) + responseData.SetControlError(nameof(model.ContactMethod), Localiser["msg.validation.mandatory.value"]); + + // Validate method. + if (model.ContactValue.IsEmpty()) + responseData.SetControlError(nameof(model.ContactValue), Localiser["msg.validation.mandatory.value"]); + + // Method specific value validation. + if (!SaxContactMethodHelper.IsValidContactMethodValue(method, model.ContactValue)) + { + // Log invalid values so that the validation can be adjusted if needed. + SaLogger.Warn(fn + " Invalid contact method value. Mathod: " + method.ToString() + ". Value: " + model.ContactValue); + responseData.SetControlError(nameof(model.ContactValue), Localiser["msg.validation.invalid.value"]); + } + + if (responseData.HasControlErrors()) + return Json(responseData); + + // Complete response. + responseData.Success = true; + return Json(responseData); + } + + //------------------------------------------------------------------- + } + //======================================================================= +} diff --git a/SaxoniteCoreWebAdmin/Admin/Controllers/ReferenceController-Ajax.cs b/SaxoniteCoreWebAdmin/Admin/Controllers/ReferenceController-Ajax.cs new file mode 100644 index 0000000..b4d6647 --- /dev/null +++ b/SaxoniteCoreWebAdmin/Admin/Controllers/ReferenceController-Ajax.cs @@ -0,0 +1,31 @@ +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; +using Sarand.Net.Standard.Base.App; +using Sarand.Net.Standard.Base.Bus; +using Sarand.Net.Standard.Base.Core; +using Sarand.Net.Standard.Base.Dbas; +using Saxonite.Net.Core.Web.Base.App; +using Saxonite.Net.Standard.Base.App; +using Saxonite.Net.Standard.Base.Bus; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Saxonite.Net.Core.Web.Admin.Controllers +{ + //======================================================================= + // Admin Reference Controller - Ajax actions only. + //======================================================================= + public partial class ReferenceController : SaxController_Admin + { + //------------------------------------------------------------------- + // Construction. + public ReferenceController(SaxLocaliser localiser, ILogger logger) : + base(localiser, logger) + {} + + //------------------------------------------------------------------- + } + //======================================================================= +} diff --git a/SaxoniteCoreWebAdmin/Admin/Models/ModelData_Address.cs b/SaxoniteCoreWebAdmin/Admin/Models/ModelData_Address.cs new file mode 100644 index 0000000..6c46bcc --- /dev/null +++ b/SaxoniteCoreWebAdmin/Admin/Models/ModelData_Address.cs @@ -0,0 +1,141 @@ +using Sarand.Net.Standard.Base.App; +using Sarand.Net.Standard.Base.Bus; +using Sarand.Net.Standard.Base.Core; +using Sarand.Net.Standard.Base.Helpers; +using Sarand.Net.Standard.Base.Utils; +using Saxonite.Base.App; +using Saxonite.Net.Core.Web.Base.App; +using Saxonite.Net.Core.Web.Base.Controllers; +using Saxonite.Net.Standard.Base.App; +using Saxonite.Net.Standard.Base.Bus; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Saxonite.Net.Core.Web.Admin.Models +{ + //======================================================================= + /// + /// Address model data properties. + /// + public class ModelData_Address : ModelData_Admin + { + //------------------------------------------------------------------- + // Construction. + public ModelData_Address(SaxModel_Admin model, String controlNameSuffix) : base(model) + { + this.ControlNameSuffix = StringUtil.EmptyOnNull(controlNameSuffix) + "Address"; + } + + //------------------------------------------------------------------- + // Properties. + private String ControlNameSuffix { get; } + // Address properties. + public String Id { get; set; } + 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; } + + //------------------------------------------------------------------- + // Utilities. + /// Have any address values been supplied by the form. + public bool IsSpecified() + { + if (Id != null || Line1 != null || Town != null || Province != null || Country != null || PostalCode != null) + return true; + return false; + } + + //------------------------------------------------------------------- + // Validation. + //------------------------------------------------------------------- + // Address. + public bool ValidateAddressData(SaxController_Base.AjaxResponse_Data responseData) + { + + // Address Line 1 - optional. + if (Line1 != null) + { + responseData.SetControlValue(ControlNameSuffix + "Line1", Line1); + if (StringUtil.GetLength(Line1) > Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line1)) + responseData.SetControlError(ControlNameSuffix + "Line1", Model.Localiser["msg.validation.maximum.length", Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line1)]); + } + + // Address Line 2 - optional. + if (Line2 != null) + { + responseData.SetControlValue(ControlNameSuffix + "Line2", Line2); + if (!StringUtil.IsEmpty(Line2)) + { + if (StringUtil.GetLength(Line2) > Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line2)) + responseData.SetControlError(ControlNameSuffix + "Line2", Model.Localiser["msg.validation.maximum.length", Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line2)]); + } + } + + // Address Line 3 - optional. + if (Line3 != null) + { + responseData.SetControlValue(ControlNameSuffix + "Line3", Line3); + if (!StringUtil.IsEmpty(Line3)) + { + if (StringUtil.GetLength(Line3) > Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line3)) + responseData.SetControlError(ControlNameSuffix + "Line3", Model.Localiser["msg.validation.maximum.length", Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line3)]); + } + } + + // Address Town - mandatory. + if (Town != null) + { + responseData.SetControlValue(ControlNameSuffix + "Town", Town); + if (StringUtil.IsEmpty(Town)) + responseData.SetControlError(ControlNameSuffix + "Town", Model.Localiser["msg.validation.mandatory.value"]); + else if (StringUtil.GetLength(Town) > Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town)) + responseData.SetControlError(ControlNameSuffix + "Town", Model.Localiser["msg.validation.maximum.length", Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town)]); + } + + // Address Province - optional. + if (Province != null) + { + responseData.SetControlValue(ControlNameSuffix + "Province", Province); + if (!StringUtil.IsEmpty(Province)) + { + if (StringUtil.GetLength(Province) > Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Province)) + responseData.SetControlError(ControlNameSuffix + "Province", Model.Localiser["msg.validation.maximum.length", Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Province)]); + } + } + + // Address Country - optional. + if (Country != null) + { + responseData.SetControlValue(ControlNameSuffix + "Country", Country); + if (!StringUtil.IsEmpty(Country)) + { + if (StringUtil.GetLength(Country) > Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Country)) + responseData.SetControlError(ControlNameSuffix + "Country", Model.Localiser["msg.validation.maximum.length", Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Country)]); + } + } + + // Address PostalCode - optional. + if (PostalCode != null) + { + responseData.SetControlValue(ControlNameSuffix + "PostalCode", PostalCode); + if (!StringUtil.IsEmpty(PostalCode)) + { + if (StringUtil.GetLength(PostalCode) > Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_PostalCode)) + responseData.SetControlError(ControlNameSuffix + "PostalCode", Model.Localiser["msg.validation.maximum.length", Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_PostalCode)]); + } + } + + return !responseData.HasControlErrors(); + } + + //------------------------------------------------------------------- + } + //======================================================================= +} diff --git a/SaxoniteCoreWebAdmin/Admin/Models/ModelData_Online.cs b/SaxoniteCoreWebAdmin/Admin/Models/ModelData_Online.cs new file mode 100644 index 0000000..733c682 --- /dev/null +++ b/SaxoniteCoreWebAdmin/Admin/Models/ModelData_Online.cs @@ -0,0 +1,38 @@ +using Sarand.Net.Standard.Base.App; +using Sarand.Net.Standard.Base.Bus; +using Sarand.Net.Standard.Base.Core; +using Sarand.Net.Standard.Base.Helpers; +using Sarand.Net.Standard.Base.Utils; +using Saxonite.Base.App; +using Saxonite.Net.Core.Web.Base.App; +using Saxonite.Net.Core.Web.Base.Controllers; +using Saxonite.Net.Standard.Base.App; +using Saxonite.Net.Standard.Base.Bus; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Saxonite.Net.Core.Web.Admin.Models +{ + //======================================================================= + /// + /// Online model data. + /// + public class ModelData_Admin + { + //------------------------------------------------------------------- + // Construction. + public ModelData_Admin(SaxModel_Admin model) + { + this.Model = model; + } + + //------------------------------------------------------------------- + // Properties. + public SaxModel_Admin Model { get; } + + //------------------------------------------------------------------- + } + //======================================================================= +} diff --git a/SaxoniteCoreWebAdmin/Admin/Models/Model_ContactMethod.cs b/SaxoniteCoreWebAdmin/Admin/Models/Model_ContactMethod.cs new file mode 100644 index 0000000..9adfeb9 --- /dev/null +++ b/SaxoniteCoreWebAdmin/Admin/Models/Model_ContactMethod.cs @@ -0,0 +1,28 @@ +using Saxonite.Net.Core.Web.Base.App; +using Saxonite.Net.Core.Web.Base.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace Saxonite.Net.Core.Web.Admin.Models +{ + //======================================================================= + public class Model_ContactMethod : SaxModel_Admin + { + //------------------------------------------------------------------- + // Construction. + public Model_ContactMethod(SaxLocaliser localiser) : + base(localiser) + { + } + + //------------------------------------------------------------------- + // Form properties. + public String ContactMethod { get; set; } + public String ContactValue { get; set; } + + //------------------------------------------------------------------- + } + //======================================================================= +} diff --git a/SaxoniteCoreWebAdmin/Admin/Models/Model_Organisation.cs b/SaxoniteCoreWebAdmin/Admin/Models/Model_Organisation.cs index d56d30b..446bbf5 100644 --- a/SaxoniteCoreWebAdmin/Admin/Models/Model_Organisation.cs +++ b/SaxoniteCoreWebAdmin/Admin/Models/Model_Organisation.cs @@ -6,13 +6,11 @@ using Sarand.Net.Standard.Base.Utils; using Saxonite.Base.App; using Saxonite.Net.Core.Web.Base.App; using Saxonite.Net.Core.Web.Base.Controllers; -using Saxonite.Net.Core.Web.Base.Models; using Saxonite.Net.Standard.Base.App; using Saxonite.Net.Standard.Base.Bus; +using Saxonite.Net.Standard.Base.Helpers; using System; using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace Saxonite.Net.Core.Web.Admin.Models { @@ -25,6 +23,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models base(localiser) { AdditionalFiles_JS.Add("js/sax-org.js"); + Address = new ModelData_Address(this, "Address"); } //------------------------------------------------------------------- @@ -83,6 +82,15 @@ namespace Saxonite.Net.Core.Web.Admin.Models public String OrganisationNotes { get; set; } public String OrganisationStatusCode { get; set; } public SaStatus OrganisationStatus { get { return SacsSystem.GetStatusForCode(OrganisationStatusCode); } } + // Contact Methods. + /// Placeholder field value to indicate the number of Contact Methods in form (even if none are populated). + public String ContactMethods { get; set; } + public String[] ContactMethod { get; set; } + public String[] ContactValue { get; set; } + /// Contact methods to be populated during validation. + public SaxContactData ContactData { get; set; } + // Address. + public ModelData_Address Address { get; } // Utilities. public bool IsSportMandatory() @@ -96,6 +104,8 @@ namespace Saxonite.Net.Core.Web.Admin.Models // Organisation validation. public bool ValidateOrganisationData(SaxController_Base.AjaxResponse_Data responseData) { + String fn = this.GetType().Name + ".ValidateOrganisationData"; + // Organisation name. if (OrganisationName != null) { @@ -174,6 +184,29 @@ namespace Saxonite.Net.Core.Web.Admin.Models responseData.SetControlError(nameof(OrganisationFacilities), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_Facilities)]); } + // Contact Methods. + if (ContactMethods != null) + { + ContactData = new SaxContactData(""); + ContactMethod = ContactMethod ?? new String[0]; + ContactValue = ContactValue ?? new String[0]; + for (int idx = 0; idx < ContactMethod.Length && idx < ContactValue.Length; idx++) + { + String methodValue = ContactMethod[idx]; + String value = ContactValue[idx]; + if (methodValue == null & value == null) continue; + Sax.ContactMethod method = EnumUtil.ParseEnum(methodValue, Sax.ContactMethod.Unknown); + if (method > 0 && !value.IsEmpty() && SaxContactMethodHelper.IsValidContactMethodValue(method, value)) + ContactData.SetContactMethodValue(method, value); + else SaLogger.Warn(fn + " Invalid Contact Method data. Method: " + methodValue + ". Value: " + value); + } + if (ContactData.Methods.Count != ContactMethods.ToInt()) + { + SaLogger.Warn(fn + " Inconsistent Contact Methods received. Expected: " + ContactMethods + ". Received: " + ContactData.Methods.Count); + responseData.SetMessage("caption.contact.method", "System error"); + } + } + // Organisation notes. if (OrganisationNotes != null) { diff --git a/SaxoniteCoreWebAdmin/Localisation/SaxAdminProperties.resx b/SaxoniteCoreWebAdmin/Localisation/SaxAdminProperties.resx index 69d92cd..720ff5b 100644 --- a/SaxoniteCoreWebAdmin/Localisation/SaxAdminProperties.resx +++ b/SaxoniteCoreWebAdmin/Localisation/SaxAdminProperties.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Contact Method + Sportierre @@ -201,6 +204,9 @@ Columns + + Contact + Country @@ -285,6 +291,9 @@ Members awaiting activation + + Method + Name @@ -423,6 +432,9 @@ Users online + + Value + Yes diff --git a/SaxoniteCoreWebAdmin/Views/Common/ContactMethods.cshtml b/SaxoniteCoreWebAdmin/Views/Common/ContactMethods.cshtml new file mode 100644 index 0000000..57e0227 --- /dev/null +++ b/SaxoniteCoreWebAdmin/Views/Common/ContactMethods.cshtml @@ -0,0 +1,50 @@ +@model SaxModel_Admin +@inject SaxLocaliser Localiser + +@if (!Model.RegisterView("Views/Common/ContactMethods")) return; + + + + +
+
+ + @* Method *@ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ + @* Value *@ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+ diff --git a/SaxoniteCoreWebAdmin/Views/Common/Controls-ItemContactMethods.cshtml b/SaxoniteCoreWebAdmin/Views/Common/Controls-ItemContactMethods.cshtml new file mode 100644 index 0000000..06e39d0 --- /dev/null +++ b/SaxoniteCoreWebAdmin/Views/Common/Controls-ItemContactMethods.cshtml @@ -0,0 +1,75 @@ +@* Contact Methods controls *@ +@model SaxModel_Admin +@inject SaxLocaliser Localiser + +@if (!Model.RegisterView("Views/Common/Controls-ItemContactMethods")) return; + + +@* Contact Methods *@ +
+ +
+
+
+
+ +
+
+
+ @* Action to add new contact method. *@ +
+
@(Localiser[
+
+
+
+
+
+
+ @* List of existing contact methods with actions to edit/remove. *@ +
+
+
+ + + + + + +
+ + +
+
@(Localiser[
+
@(Localiser[
+
+
+
+
+
+
+
+
+ + diff --git a/SaxoniteCoreWebAdmin/Views/Common/SelectCode.cshtml b/SaxoniteCoreWebAdmin/Views/Common/SelectCode.cshtml index bb17642..c201668 100644 --- a/SaxoniteCoreWebAdmin/Views/Common/SelectCode.cshtml +++ b/SaxoniteCoreWebAdmin/Views/Common/SelectCode.cshtml @@ -1,6 +1,8 @@ @model SaxModel_Admin @inject SaxLocaliser Localiser +@if (!Model.RegisterView("Views/Common/SelectCode")) return; + - +@if (!Model.RegisterView("Views/Common/CodeSelect")) return; -
+ + + - @* Filter *@ -
+
-
+ @* Filter *@ +
- @* Available codes *@ -
+
-
+ @* Available codes *@ +
-
+
- @* Code selection *@ -
+
-
+ @* Code selection *@ +
-
- -
- -
- -
+
+
+
-
- - @* Selected codes *@ -
- -
- +
+
+
-
-
-
+ @* Selected codes *@ +
+ +
+
+ +
+
+
+
+
+ +
diff --git a/SaxoniteCoreWebOnline/Views/Common/ContactMethods.cshtml b/SaxoniteCoreWebOnline/Views/Common/ContactMethods.cshtml new file mode 100644 index 0000000..08f5659 --- /dev/null +++ b/SaxoniteCoreWebOnline/Views/Common/ContactMethods.cshtml @@ -0,0 +1,50 @@ +@model SaxModel_Online +@inject SaxLocaliser Localiser + +@if (!Model.RegisterView("Views/Common/ContactMethods")) return; + + + + +
+
+ + @* Method *@ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ + @* Value *@ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+ diff --git a/SaxoniteCoreWebOnline/Views/Common/OrganisationControls-Address.cshtml b/SaxoniteCoreWebOnline/Views/Common/OrganisationControls-Address.cshtml new file mode 100644 index 0000000..b9fd5d9 --- /dev/null +++ b/SaxoniteCoreWebOnline/Views/Common/OrganisationControls-Address.cshtml @@ -0,0 +1,99 @@ +@* Organisation controls - Address *@ +@model SaxModel_Online +@inject SaxLocaliser Localiser + +@if (!Model.RegisterView("Views/Common/OrganisationControls-Address")) return; + +@* Organisation address - Line 1 *@ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+ +@* Organisation address - Line 2 *@ +
+
+
+
+
+
+
+
+
+
+
+ +@* Organisation address - Line 3 *@ +
+
+
+
+
+
+
+
+
+
+
+ +@* Organisation address - Town *@ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+ +@* Organisation address - Province *@ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+ +@* Organisation address - PostalCode *@ +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
diff --git a/SaxoniteCoreWebOnline/Views/Common/OrganisationControls-Contact.cshtml b/SaxoniteCoreWebOnline/Views/Common/OrganisationControls-Contact.cshtml new file mode 100644 index 0000000..56994f4 --- /dev/null +++ b/SaxoniteCoreWebOnline/Views/Common/OrganisationControls-Contact.cshtml @@ -0,0 +1,75 @@ +@* Organisation controls - Contact *@ +@model SaxModel_Online +@inject SaxLocaliser Localiser + +@if (!Model.RegisterView("Views/Common/OrganisationControls-Contact")) return; + + +@* Organisation Contact Methods *@ +
+ +
+
+
+
+ +
+
+
+ @* Action to add new contact method. *@ +
+
@(Localiser[
+
+
+
+
+
+
+ @* List of existing contact methods with actions to edit/remove. *@ +
+
+
+ + + + + + +
+ + +
+
@(Localiser[
+
@(Localiser[
+
+
+
+
+
+
+
+
+ + diff --git a/SaxoniteCoreWebOnline/Views/Common/OrganisationControls-Core.cshtml b/SaxoniteCoreWebOnline/Views/Common/OrganisationControls-Core.cshtml new file mode 100644 index 0000000..f236a68 --- /dev/null +++ b/SaxoniteCoreWebOnline/Views/Common/OrganisationControls-Core.cshtml @@ -0,0 +1,94 @@ +@* Organisation controls - Core *@ +@model SaxModel_Online +@inject SaxLocaliser Localiser + +@if (!Model.RegisterView("Views/Common/OrganisationControls-Core")) return; + +@* Organisation name *@ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ +
+
+
+ + @* Organisation category *@ +
+
+
+ +
+
+ @Html.DropDownList("", Model.OrganisationCategoriesForSelect, Localiser["label.select"] + ":", new { @id = "", @name = "Organisation.Category", @class = "OrganisationCategory sax-select" }) +
+
+
+
+ + @* Organisation type *@ +
+
+
+ +
+
+ @Html.DropDownList("", Model.OrganisationTypesForSelect, Localiser["label.select"] + ":", new { @id = "", @name = "Organisation.Type", @class = "OrganisationType sax-select" }) +
+
+
+
+ +
+
+ +@* Organisation sport *@ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+ +@* Organisation primary region *@ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+ diff --git a/SaxoniteCoreWebOnline/Views/Common/OrganisationControls.cshtml b/SaxoniteCoreWebOnline/Views/Common/OrganisationControls.cshtml deleted file mode 100644 index 59d00a7..0000000 --- a/SaxoniteCoreWebOnline/Views/Common/OrganisationControls.cshtml +++ /dev/null @@ -1,208 +0,0 @@ -@model SaxModel_Online -@inject SaxLocaliser Localiser - -
-
- -
-
- -@* Organisation name *@ -
-
-
-
- -
-
-
-
- -
-
-
-
-
- -
-
-
- - @* Organisation category *@ -
-
-
- -
-
- @Html.DropDownList("", Model.OrganisationCategoriesForSelect, Localiser["label.select"] + ":", new { @id = "", @name = "Organisation.Category", @class = "OrganisationCategory sax-select" }) -
-
-
-
- - @* Organisation type *@ -
-
-
- -
-
- @Html.DropDownList("", Model.OrganisationTypesForSelect, Localiser["label.select"] + ":", new { @id = "", @name = "Organisation.Type", @class = "OrganisationType sax-select" }) -
-
-
-
- -
-
- -@* Organisation sport *@ -
-
-
-
- -
-
-
-
- -
-
-
-
-
-
-
- -@* Organisation country *@ -
-
-
-
- -
-
-
-
- -
-
-
-
-
-
-
- -@* Organisation PhoneMain *@ -
-
-
-
- -
-
-
-
-
-
-
-
-
-
- -@* Organisation address - Line 1 *@ -
-
-
-
- -
-
-
-
-
-
-
-
-
-
- -@* Organisation address - Line 2 *@ -
-
-
-
-
-
-
-
-
-
-
- -@* Organisation address - Line 3 *@ -
-
-
-
-
-
-
-
-
-
-
- -@* Organisation address - Town *@ -
-
-
-
- -
-
-
-
-
-
-
-
-
-
- -@* Organisation address - Province *@ -
-
-
-
- -
-
-
-
-
-
-
-
-
-
- -@* Organisation address - PostalCode *@ -
-
-
-
- -
-
-
-
-
-
-
-
-
-
- diff --git a/SaxoniteCoreWebOnline/Views/Common/OrganisationRequest.cshtml b/SaxoniteCoreWebOnline/Views/Common/OrganisationRequest.cshtml index 8ad5be8..081ddcd 100644 --- a/SaxoniteCoreWebOnline/Views/Common/OrganisationRequest.cshtml +++ b/SaxoniteCoreWebOnline/Views/Common/OrganisationRequest.cshtml @@ -1,5 +1,8 @@ @model SaxModel_Online @inject SaxLocaliser Localiser + +@if (!Model.RegisterView("Views/Common/OrganisationRequest")) return; + @{ Microsoft.AspNetCore.Html.HtmlString regionIdCountry = new Microsoft.AspNetCore.Html.HtmlString(Model.ValidUserSession ? Model.GetEncryptedRegionId(Model.SessionData.User.RegionIdCountry) : ""); String regionNameCountry = Model.ValidUserSession ? Localiser.EscapeJavascriptText(Model.GetRegionCaption(Model.SessionData.User.RegionIdCountry)) : ""; @@ -29,7 +32,7 @@ @* Contact Email Address *@
-
+
@@ -44,7 +47,7 @@
-
@* No label. *@
+
@* No label. *@
@* Contact First Name *@ @@ -78,7 +81,16 @@ } - + @* Organisation core details - name, category, sport, region etc *@ +
+
+ +
+
+ + + @* Organisation Address *@ + } diff --git a/SaxoniteCoreWebOnline/Views/Common/OrganisationSelect.cshtml b/SaxoniteCoreWebOnline/Views/Common/OrganisationSelect.cshtml index 8ac8f19..c6cf994 100644 --- a/SaxoniteCoreWebOnline/Views/Common/OrganisationSelect.cshtml +++ b/SaxoniteCoreWebOnline/Views/Common/OrganisationSelect.cshtml @@ -1,6 +1,8 @@ @model SaxModel_Online @inject SaxLocaliser Localiser +@if (!Model.RegisterView("Views/Common/OrganisationSelect")) return; + diff --git a/SaxoniteCoreWebOnline/Views/Common/SportSelect.cshtml b/SaxoniteCoreWebOnline/Views/Common/SportSelect.cshtml index cb55b73..c908da5 100644 --- a/SaxoniteCoreWebOnline/Views/Common/SportSelect.cshtml +++ b/SaxoniteCoreWebOnline/Views/Common/SportSelect.cshtml @@ -1,6 +1,8 @@ @model SaxModel_Online @inject SaxLocaliser Localiser +@if (!Model.RegisterView("Views/Common/SportSelect")) return; + diff --git a/SaxoniteCoreWebOnline/Views/Search/Panel-OrganisationDialog.cshtml b/SaxoniteCoreWebOnline/Views/Search/Panel-OrganisationDialog.cshtml index 92fe9ea..9e014bc 100644 --- a/SaxoniteCoreWebOnline/Views/Search/Panel-OrganisationDialog.cshtml +++ b/SaxoniteCoreWebOnline/Views/Search/Panel-OrganisationDialog.cshtml @@ -4,6 +4,22 @@ /* Organisation dialog panel */ } + @@ -13,7 +29,7 @@ }
-
+
"
@Localiser["label.type"]
@@ -29,11 +45,15 @@
@Localiser["label.about"]
-
+
@Localiser["label.facilities"]
-
+
+
+
+
@Localiser["label.contact"]
+
@Localiser["label.address"]
diff --git a/SaxoniteCoreWebOnline/wwwroot/css/sax-data.css b/SaxoniteCoreWebOnline/wwwroot/css/sax-data.css index 95e8f6e..cc69775 100644 --- a/SaxoniteCoreWebOnline/wwwroot/css/sax-data.css +++ b/SaxoniteCoreWebOnline/wwwroot/css/sax-data.css @@ -238,8 +238,8 @@ .sax-panel-item > .sax-content { - margin: 4px 8px; - padding: 4px 4px; + margin: 4px 8px 2px 8px; + padding: 2px 2px; } .sax-panel-item .sax-note diff --git a/SaxoniteCoreWebOnline/wwwroot/css/sax-form.css b/SaxoniteCoreWebOnline/wwwroot/css/sax-form.css index 61ea338..a1de06b 100644 --- a/SaxoniteCoreWebOnline/wwwroot/css/sax-form.css +++ b/SaxoniteCoreWebOnline/wwwroot/css/sax-form.css @@ -182,7 +182,7 @@ .sax-form .sax-input.sax-calendar { - width:80%; + width: 80%; max-width: 180px; } @@ -193,8 +193,10 @@ overflow-y: scroll; } -.sax-form .sax-input:read-only, .sax-form .sax-textarea:read-only +.sax-form .sax-input:read-only, .sax-form .sax-textarea:read-only, .sax-form .sax-select:disabled { + color: #202020; + opacity: 1; background-color: #f8f8f8; } @@ -220,7 +222,7 @@ .sax-form .sax-form-control.sax-error .sax-message { - min-height:16px; + min-height: 16px; display: block; color: #e3120b; background-image: url("../img/icon/error-16.png"); diff --git a/SaxoniteCoreWebOnline/wwwroot/img/action/edit16.png b/SaxoniteCoreWebOnline/wwwroot/img/action/edit16.png new file mode 100644 index 0000000000000000000000000000000000000000..1b4afbe4dd5a61ce2e48b3bf51940945151fc498 GIT binary patch literal 586 zcmV-Q0=4~#P)hL3OmGW__? z#QWjVBYlDf{5ofp&&VmA%)$JWLE>{N1D{_k!yo4ohHt+(uBhctS`Jgkh)whF3uaD# z8UJl(;?-pP_wFbI6R#NqBZmmX{SRhuKE2_wFmVpLi_?Jb*Zmcke%w9DBxou2_st## zCN4b&MlNXv1`e^`3@kD}tRgA9a0cT4=Zm-*zg=C=Bw#M~@7-abttt!*EF3_IZw!n~ zJQe7gF%0GS&_vh2BToGBg0vpAEo#&re{AFSW`q_kmNwkuIi9_KTyO>K5qqN^Q zTn4}cabj*R`?Vk6o@%PA2#5PSJ>e9Uoyo)`Ig^i%@io4*0yBV3RzgBgT|;dtJ16Io z1BZ^R|N8aoFQ7OJEPR3ZFBJaas76L43;v@S@(XInKL$zx Y0B>cU&o6KpG5`Po07*qoM6N<$g2J%;)&Kwi literal 0 HcmV?d00001 diff --git a/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/facebook-16.png b/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/facebook-16.png new file mode 100644 index 0000000000000000000000000000000000000000..1657af8b7ac9719cd2af2d2f7b396c8d795642a6 GIT binary patch literal 727 zcmV;|0x127P)WdKcYZXhx$QfsZn)Rb;E&EL*An`pAx2Fbh3&YSn%H{Z8| zz;k)DBHxHL*p% z$21ZhwoR=I2u0*8Ul!;k1_;A{!RRh8zWU&t<8m$FRAlwo=LHrsn(bB|e8dc$TM3j@ zfQPS(@Mc!!CPo836r2h>pWxUBW}Z*O&1RLyPKppZYJsjj0vzrX!0)L_H0@G`MKrJQ zJR$cg1=waZdtC_j?}?5Vf705yQb6rb0~~GzOFz+aVC%R#~l+Tigg9U$8d_$4}cT z>zTVbNX^y77*H8IMf43?0A&p3(v5BK7C+&RHsPh7TwGz$do2s$iCm34e?JF(V+yP& ztRbMyPF~;tV%xoE}aQQWHbg1m@RZyM1KPOrY3GD;i8( zyL~em)V!6KaeF|T3HV4qpK`thbKdVE{rApFGu1)WdKcYZXhx$eQJOO|$i?VL*Ai>k(~1rHcUtjiriJnbSJBsDQavyt z<_jXiYCaSqVvHHTinE~Vs|QW3Aqmvobw;)K(T#nB;uetv%g+Zav82VL){G=!cTH); z(2N2Nk3E_9JGs{HPBK3<>dA;TBS%q=uITVaea|$3E03H}_d2N;gQFxX7?EBFU@;)@ za0J|A0K5=bi!`El>z4}!$BTWL(BlhF-_Z4gqoO8xaukANoAi*MPJxd0?Tz&ku%CCs zH>a)VTQhB}%sh`LQ1IeW2 zK-Q}+aH>SFbj?(x#Zk~)X;N(IR|1>QxmDu@z#eRkr@7D)R)<5Q0vu0zF{6XF*$8Nr zI4+XvLN7iO=Ik|B|0qi$raHu15HNFmcCDQOYl5%Y90LNJY+@DLDV+o7@9E^mFyuT? zY)Zlf^AMY0fo8QGd>8*#t~KdlR^MVG408yV zokZ8lwjxkb!Z@r6xaxliq{dKHHFn0~7m#5uGuCA#;g;EwTjO!dp2fzx@v&dPh7ey^ zV61yGAfs#<;;tPs?aEHZd(8}tgi0Q+hmn<;)X`f< zOuJ-`iEFBtdE+6|_3f)6eNhUomM-*O`EsA?gQYp?itJq|`RvGr^b7lp7iY>WC>kIA vo@-mG%Zm>8jem{;Jb2A@mKPiPg2ny;@)t4VeBfbw00000NkvXXu0mjf+&Ihm literal 0 HcmV?d00001 diff --git a/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/facebook-32.png b/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/facebook-32.png new file mode 100644 index 0000000000000000000000000000000000000000..797ed1b828fcc4662bd72b975ab609f46abacb4d GIT binary patch literal 1308 zcmV+%1>^dOP)WdKcYZXhxLxKE{B+U>kJN5i)@U5*JJcx-BwYm@X_DjWHVI zjL`uZe=H=*jEPZ<$$}2k@CPcJ)9EIXO&1j=B1|ews0=KlEtGz@@A_UBVEyDhV85iV z@7{OrIp>~x&hK0VA}}^am}^t+yy4qyiOa(l%$iyMye1BVM1n{1x8Q;Dbm?EYxyU6{ zClVsm{*^OlXv+Jdd5JxA#|j#^H@uvL0!UE7Y@7n?@*kkzfBk?=zaa;De2q6~pa{Ix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+9&;$h+HUa4+hUK6PuGYlbZ+JqixuoX0_Rw>dFQoYOcl1}E?LeOuR46F#V|~CP(>4;|W?{R{9uoBL(_UO)f<002ovPDHLkV1hs`;hX>f literal 0 HcmV?d00001 diff --git a/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/instagram-32.png b/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/instagram-32.png new file mode 100644 index 0000000000000000000000000000000000000000..949bee54ad28edaa15c454eff79d009502e73164 GIT binary patch literal 2413 zcmV-z36l1SP)WdKcYZXhxsxDmYwdjnKH?cVIFvf@uAe(`u{iy*IAc=5sO*gI`u{Bb$>x9@ z>4j_OV8xd@$Al1SrX4Z!#qQnbR-GIweYH>uH^Im3&{eQPzzzlLx5F-U&C_1zPXUl?(JDtv+DM;NzjUf;&BHo{|d z>)04JAR-;0RuSwZoc*BdoI10EQ@Im>xLAMQ?@`;t3z56Y63;E zbA*5-gOcWnfFz6{N&9&Z!K6>$rVSe)dK{rTTv&PZ?c+Pi^p6<8@Ah8W=#KhLnP}QO zI}YQDwQX4Q@EpwT%|en@F(YwAEGQLotEOmeW!%TrgEw&g*H_@(aM`dFH82rM=f^kK z0jP>vpLHW+G%`6%Cj>U{T!g;0?YwEV6rg<5M-)Ved<8|`YC{^5lmx^gZAsR4%0fe1 z0*fD;i=K@gIQq;m9F@T106$vlS5lLHj8Y>>|LQoCyryYZsyfldff14(iL@bmJavDOv6M`es($@he zXXEs@2Vp(88XfDqap&h2;Qd`Ern47m)J0PT>A(ZRkp9s|LM*_nX>wTA&@{4(V| zBqJdkYM+-fjqS`e;#&d)AGCt`+Kl=xq+x9CUnL_0Q%DHk7xjsZo3W+BB_5hlwiAxz803w8=3tw+c z??ZbcHXfpJ-7<7;AK-6Oe>{w-ciux-^pIRUA8n6sL}p1h?s(=A41Hq{!f|p+QX{4` zsVL$#7VRr&AEm7S29UKTVKV@q76ovu8h|`RLIVid<5^EUqzfPU-Fq?h=3&}M@@A!x zQB+P`z})AbM5ccpng@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edin-16.png b/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/linkedin-16.png new file mode 100644 index 0000000000000000000000000000000000000000..3835c922b5703d5c9ad6d492fae686f3e1bb97ba GIT binary patch literal 767 zcmVWdKcYZXhx`nLPW_fE5^Hb0 zYJc+aXY_~fzgdyxgt=LN$nbH_PB&4k&$5+&k6}Rks@yH>CPZToMlJbd>p0L1z7>o3FOk3Se5y#K*K z2;6`FHF5T_M?%cs%pxKly#M9{68!g{f#JoMpA2W8e*^{&BZHfY2m>R~H@+HT3|4Xi zV8cO{fWXhc|5;d>8P2o({rguJW~vA`8^eMiU51rcUNCIF`HEp7kp21B9|j&a7I0`s z>q{|M&pN^IAFBTDyDth%KpWWbIrY$k_Y9ho4l`VP{e?kSoR>j}3lY0N|NLWM`u6+Z zC42@PfBb>r3DD`c-hKnSf}MpKE~hHO^M=V;N$4muBkpMX{~xkzq0_7w;VsmK{qwgoEgCeS7728q4)p)f5yxWmuyZv xeDCz&-8ViaU}9Gkn002ovPDHLkV1l~HWG(;z literal 0 HcmV?d00001 diff --git a/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/linkedin-24.png b/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/linkedin-24.png new file mode 100644 index 0000000000000000000000000000000000000000..052bbe3fbe77d72b13ee2f2144e0286e755a1bb4 GIT binary patch literal 1132 zcmV-y1e5!TP)WdKcYZXhxm3}tHFbJKU@jh7+c ze*N=({^v{CUXgF7bdV$q>i66<+j8~!^o!3w8~yqB zAFm5JSeO_LrTF(Gno4D-nJeESXhHnSvl*MOznb{&+ix~vf&d02c-TIM>PyB?_SfHt z(}J`$7m633f70{)_din1h67;G{f;-137-_8w;m?O1Y=b1yymv%%JVLm;R3*LmgeIi z$%2nR{;;mP^n794?z?Iz7F@aVpKa~s7gK=20_H0VaWP!ZwPCml#L)&)Bw6y}%TL}7 z*PqTrv0(DeODQ*AeNlx88cXvt2y(D8urM()I4TO098?#de{!hbebohS!KugZFHsk*LUnIg8A9?!f%P)9*fMTALl^M+b z1yl@5s+_D4X%HKfay3M_8Q6eH^wyiN3}1i!#jr$0nCs2HNHsZ@4VUjJzWItU90at) zc^M8Rn}OMl2ktV=IQfX-PLTrx2QwqX_B(GF6!G7CeW2kmEyA3v4BhS;U_Hp- z`=5UddvCqwV*362FEc6O3(^?2@&be9tP>13fx!a;s={2Lq60-8u&819`0Y0X)9bH4 z&XHol$tNEfw%>ZqaOLG^hONNF0E;sLpihti8_>5la{LTT4)VhHc-V;d#22Ip{q+}j zIVH}^{!3R*?iLfXvD^bW0nP`c_<|U~$HsC%Q$6=&*~UwGaR%1Dntd}m16a0RUR;)~C~ z%=M2UW7Ab|l6~^&2i%|y*IqK*0j4BSOgx8*bFni2^HLWnFp!i4Coy>HUG@Jz^Q_s& zm+raqCY)TC1G5T4khWy^>NwLfm>5d-xc>S-Z`$gkGmkxdANlwHf07Ib)ok7x;uF@! znHD08W7KHC48k0}>`cj?yYK2=efh~njN!8U9B+L!CCa7->dt3mWc-iU0vK3x^_l#f z;}44Ny!{^j=)-q$P@#tmfMLx5Ox}-FM0n=r+RDywSCM>$%^aK-Ao+-W+Od0jdv3i^ yIQ#S?12ZsB+9(P!*ei)$Pd1gk33TyqeEI>{Saa{+{c{Nb0000- literal 0 HcmV?d00001 diff --git a/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/linkedin-32.png b/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/linkedin-32.png new file mode 100644 index 0000000000000000000000000000000000000000..955b48a0a2a5b14bf44ec60d64bb6d268f31ff65 GIT binary patch literal 1412 zcmV-~1$+95P)WdKcYZXhx)$9&8$}SreOCbbj7ILcYg3hd`sL%jdNa@F+`L|HR0QOTxKp_)yifK#B0XJ% zAg+)AP!vUKe%6#W4^4kOXt40nEe>r21;IdgnwR9FnFa zHK>u?P(n7{{k%N6=F^hw_kse@Xi$1}M^9_Bdb-H7)oyPf28{xTWQnKhkL-Be{~yIS zfekyYw!gpmZZ?j~?({&TYUZ`d7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2yoj*KjvhUKF>~TwWC)Md*17gsqz-7=J>2XX$ z5+~}1r({XrKP^jC22*#?w_{(mjah^j`?WOP;+l))q%h!#Y_Uy|%3a!OU4H}p^xa(N Sx@HFe0000;Hm701PXB$ zctjR6FmMZjFyp1Wb$@_@Ea{HEjtmSN`?>!lvI6;^JzX3_DsCmG9AN5`wO0G`{JeZx z$;bWm|M!)bl>9l|z&~T=%&QwWZ~mW}ocvo~U;lr+r{_z1dHMVG0`XB%zkdDy|37lV zRpW)y1^@rm`Yw3u<8WI-LQ?YJkNf-U6>dw$?X6l``0I}r1<*pPBEh)w5Y!^2ls zSM&V)$Ko?(!h{IECI6Z?tXp^Q|E*iM{u|gCDE{4F`FWX1oVbL9g#NyQhifDZ><#wR z{q0J;yQ`E(Nl7WeGBx$-?N_f}`D=bP1BU+Qhe1asMU~A3dY{45)z4*}Q$iB}{KBMx literal 0 HcmV?d00001 diff --git a/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/mobile-24.png b/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/mobile-24.png new file mode 100644 index 0000000000000000000000000000000000000000..330fbdc5ea7099cdf992a154aed64151d6e6ac26 GIT binary patch literal 502 zcmVWdKcYZXhx4pDtW@&W+6+CR`R=y?ROH|Ns98g-lEg?Ck7d z%*MusqW0y>m%RV~zf-_w4hwFtGcb62douuCj8)##(-Y2KxpF1WkicmH2t-CkF+@j4 z5e&|wM~~r@Vwy0( zEG%%$&CUH^M@I)m41|I8!~gT=uWFMNL_9oPpz4s}&!0bV91;@BaNxiJaOHz6&dkir zz|YV5ha?}=*Vh}#$jE*G)?oi(n2(SDzpk$Ce`GOEPR{@C?jA>RnZtWdKcYZXhx4-c#(tGiT1QMnpud7Zeow#mme4 zpI9s@DfulTA|jh&2Xu9Hxv;UZ{Rc8pu&%D|e{*wlIF^@}$55l7pz#06lPALX%x5Cx zfb-|i^Zfet3qu^}C;|WyMhQ{P}Z+SFhfy<1?RykOThy1tt_mMzDp*;L4RN z7;4$s+2QQ}|Nn#a5ds7q00O|o#IR$>4x$W%f!D8JGgw>OP{#o*EG!ISVqy$TOax;L zEd&UwBi=+Bfl&vHI$+cRqYfB#z^DU89Wd$uqFO|^Z{KF{^710dU{FK$_wV17yD%&) zGJpZCxeddHhKB#APoMrD*j&RZ4{W6VKX>l36+ZI`MuCisB+kZYXlN)ydU`s8si`Se zc~DE5kB{#sMIo?o;X+{p1H<>&e8|JY``_N){y(tMiZulM{rztdGM}h+_V(?2)t4-p x7xMV=Q=%QNrKR;FBO`6Gfq}s*ib7!60|3LmlCQxE3`YO}002ovPDHLkV1j*Y@ErgE literal 0 HcmV?d00001 diff --git a/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/phone-16.png b/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/phone-16.png new file mode 100644 index 0000000000000000000000000000000000000000..dfadfb1532a5348b1c6568f9e888e4f75d092793 GIT binary patch literal 764 zcmVWdKcYZXhxQ(!B=%qra z7s&|1CsC+;h+bTZUWCE|3kgfeT(M1Ub=7TjR(D2c?%bK~3>w>?`oS3v_nz-NXTEzR zte|JQE5aRjJ2n8ukUn00Zr;l!@AEwK=vt(->P~=cqU*9fotTzeW zOt5>w0LYbwNp2|^hdvP)@%N-BQ4_RPr|={1Ll1$RIQ z0E_k4@$^#8$K7u<4uj#c17 zz!1p-hdyng>%&8E$HuX3=Mkg3!F2A2Rj>uYhLN*Sn6ms@k7Juc016;05=e=J2|b0U zsWwna!Ik<}RFOJZi#C|(v@diRv9eu|3H(}F1jN=*MJUjKys}b2_gFhB%Az<_brQ`7 zI?S{_%2jXuYf9r;hk$Crk2 zf22vgN*FuK>oITT@J;_BOmiW6bJH|G`G0=>-HDbNKGEn%{4bGzfk1IWQuNln{oT#d u>S5c!&6-?cGQ1Ii+VX^YW>4dom;VH?s{mbajJ%`(0000WdKcYZXhxstor(7V000SaNLh0L01FZT01FZU(%pXi00004XF*Lt006O%3;baP000A? zNkl}D@XHYCy5Y_v^cyDCYDVxWd%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.png b/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/phone-32.png new file mode 100644 index 0000000000000000000000000000000000000000..df4830d6832e7967cd5ebac74a187f8670b2a6dd GIT binary patch literal 1471 zcmV;w1wi_VP)WdKcYZXhxI%M_q~l000SaNLh0L01FZT01FZU(%pXi00004XF*Lt006O%3;baP000FR zNklI}pAsC~^r~x0u5Ol)8WNw4;++b`lwsq@cZSU^Wb57U0UfbawCH|T( zy}do>`+nc^9N>Qj_wN@S{+7JvNaHdyOeN_u!o!4+6gstN`kE6S&LfOUVBf{98>d)H zYI3aw&J5m~%x;3v$Y)3q5S03S0cqgnbtTX4Ng}ZO!aEyh=PcajFgw#0-c<05z37Qv zetP}QFYM6?{M~o7_(HU~)n#=%Zm9KP^a`DUxjAJs%W`k;H`5nwk>+Y}oFgdp8y04o z9dO${pi$|HwxdVrN(%vwGdUZ253MDSUorxH;#J;e%7(y2^+kD>LR7h`VIj3Zag)V` z1L5-+QiTZ_O@sy&*;dyooq$3-P$H9yf~JfRP*sW5 zKpg#IcgjtYDq{bo57C!~Zje<&1VE~L#G_Mz22@Xd!muGChp_$JCNu}?CvBWXfJB{w zPxWVO@C2Dy#zOnP>$9{OPXr^NMij_HD#=T%utbvM2H&rSg||AF>P0#!&xs9LP#{IL z5duO;Lgbo=aJLA-FF_Gi9Pas6&r^&*1s3OdCvKEDC=8HVyDB2mBSDHP#uQNJRY`*w zR2Y%gb0<;X`LnKsBQxU38LuFR^ejS;Z|b? z6Ld4Hd?Eodfq4^`Bm?3#>}slos;N4OMTJ$^u;4A26f=t$73!6y#5^NY95#!c?B`SJ zjEf-x^aS9@%T#jY$`3fuzRwWy)zk0CYs0uGiNfA?|Z+&`uWcz z%jQVZ8*eDH9ttx?Z8MFGs_iXruv2nb(OvADq9Ah`UM;UfWA7hm^3~&!TQ zGP3dL><#diJcu1FZ==O`OxGBPIUWa=7jE=Emm%S!lbhH{cz5w*`pHSZ7Z^=W3J~^`mQ8_&3IY7}BY18#^G!4VfCZvG7 zUH}XUInw(b8P~`0_{^73p1&F<&V1b+VL3=HGC##~Z_L050al&kn6y6mDz=?{9UjMg zc#9swlDsu=WF+6HFNM$G^R`;Ho--vIU<6$DsVcn=a{Tyb{l!QtcDL7Hf5!(Xb5>$* zPC1+zdF=Y#=>Hw3gMUHMWP@%xEdzq@Po03dh7nc5RsTexMO3frD}&o%93b^ z(l3BR$&<=#D>rXmzVp4f-K3;{eRgN@m0(BpK(vP+n@eLuah69dEvP(LS>o-y@nIeZ Z{sDNQT4IUz7IXjr002ovPDHLkV1ke#pUwaP literal 0 HcmV?d00001 diff --git a/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/twitter-16.png b/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/twitter-16.png new file mode 100644 index 0000000000000000000000000000000000000000..b2468dabae342c30e9f64994dbdbd5ad17edf369 GIT binary patch literal 748 zcmVWdKcYZXhxiY<`n5P@e-&ANIoS zk&tJ(A;9QN_V`koOyxCbga5#xpzHy+G<5Hr>y5CDERT7~i@(X_PGW(g#@ve;ed6I< zW`8}vr(`8u)WK^I$SQE#5S$Ij5NO5VQmc<89Xy{?FlMyyYKiT8zL5UDO+XUFji3!) zFKh5~iyFa3Pus!oK%i3wD>;DhY?=RynJ{v(OFAgOi|5bO!~z<3ynjN4*(8N{jv33 z(BOT-S{C;qy&W`SxZRq{K1meF6(cGiXHUBX9=^T|FPq;7RGPH3w-ry04S0rRVI12d z-;MmB7kDsJT)1`<16qEms*pidqi2|41%A(w0*jL@t?cLqO&GZnNW;L7#f(`ccPfjYrM0y!gsG=Tn7&^{t9u*gmJ6?AxV8 eE+468HRBIH^W`U#*5fe%0000WdKcYZXhxHej000SaNLh0L01FZT01FZU(%pXi00004XF*Lt006O%3;baP000A% zNklIOmW7{oJ_PN(<~}7LMVEC_YqMa6-XZ?(G!A#&@Z8) zpCIT(2GLhh^wo=~D2vjDL5k2YreV}6b9C-JypMA`=f>nXbH^FmaN(ZU+H0?U_Spyu zu%W2#?)@J3POD@I8{0T8*t*mLo!;a;m*wELPulTx zSbmh$fd4=EnMm5amYpfN3>nVpI`)OtD}{nn5Gb=D;7vr7HNgI`a`|l_U}Iwg(A}Td z^JVJq6-?R6at;P3G@!YdWzB95_OB4YB_Q~j)ZuwR13UeHFev}qGbWL$SHaRf^!J9r zAuyq|XUe|S%fsb}tuUDgCc-aNx)QB9z&E%08~lruZwNH4KgDZayk|YNw`S)=URMNe7t# z*m(roy&P<#A2GRIY)?2wvgTt7Sii=SjX0@l4Q2=3G(}=s5*csKq%42ZNR@1SV35Ix zT9&hz9(_|_V4Q%SrzZNs+MMfH6tSN(ag(68C!ClYU81_b2&krOEZC|NejK~_aKI&^ zq}ir>Uln*A(hO&r#;X1HXBDEdISGdVNv}BV!>!fT36~YWNnd1IFR&u0q}PuYA7nJa#vGQ(M0O_=;O&xA&E3)Ze+#9ib$cX6I62o`K_v$3m#iOSzk@nF@i@3 zk#&{g5jziAG1IpNBJ@d!6$ozOK&1tGfPu5|KXvyu*Tdy1;B>Qnplxorl&r zpQYxqO6TIcXoqi9xkw*5aX#Qy9!PUJf9B-I;_mc$)0WxekGJ{9~C-dyC^q=336C&w7OCgS2ZXLiWWKvYF;VOm#XYMX?3R#TMLK|{7d?R{MXi~2I7)l6i++1l>ye{$Es)Z<)@9ZDmvuQ+(9jHnG0000hhfc literal 0 HcmV?d00001 diff --git a/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/twitter-32.png b/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/twitter-32.png new file mode 100644 index 0000000000000000000000000000000000000000..25728573ede3c814ac6a76a537b9eb524ba190ec GIT binary patch literal 1402 zcmV-=1%>*FP)WdKcYZXhx^hXbc!1rh8C=%xLD4#cYHDlOeD{8tg28TClXVxBqVM{k&gE8D+g~ zsg1vv+xy*fzu)hi^PO`~5fq74jCr>wVj;h)jiOL%Hg6WQ4=U7feiPSSbqT$JhTj<`z6^o8Z~<#hS)E$@i0T@dWuwN-0~I_9i~~)fH<>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bd*D@frVq#)X zE?v4bi3McA|NsB50~NJDe*9Pt#OLGV`^d=1=;z|%^6c*2yPRjwp3V97>lfHX+S=Ni zq@<)8e*XOV^y9~mZU6rL69gJIMMXvB5l{{9_wV1UK7anqB_JRWkKz@et0IAh{s-B| z%gg(}qoYFxCa0#Rwhtr@!g6wQTR~#=_4PnA1U}o_+b1BK1GMa>xw&~QMpywgut-Zw zKY$rzW@c6glM4t4aARU(0*iBTas6#-YElOoqM)E~>&%%mtT1(oFhLZEi;F)51vOp^a&vPHfyoSP2ry;+&&$ixfyn_= z&^(w0Kp$KOraoqv954va0+V(l12F*T^8GM_fQC+oiO0mmc)-L#kq(RlcaV5SMus6U zMg6R-tP~~60#8rRV3ZFal*;Z&;JZ04s^ut%*;$dvMeYpEYt@k*+0Or{?pjlXpStW ztE=1104bYRl4Upyn3$N%v9Pe{MHdG~x}vD4=r%t;KNpHD7zH#30JFIpIhfjI*#H0l M07*qoM6N<$f~uRExc~qF literal 0 HcmV?d00001 diff --git a/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/wikipedia-32.png b/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/wikipedia-32.png new file mode 100644 index 0000000000000000000000000000000000000000..e9c046485dc5535d1fc995f1eb46fe4dd1a255e9 GIT binary patch literal 1342 zcmV-E1;P4>P)WdKcYZXhxLL{tnaf<+AyEEqMkw!1il5xZ8pem!U4i`OsPrd;Ze2j=p<=b7`K z_dU;f&T!nNUE2R_5_;o#UaHgSBFD$a_tVqUx$y9CZf|do+uq*h=H}+2wzjr*@F`a+ zm6Dp88qVF_-ST4r)6vnP4h{~!e{^&de;+n9H1sXSP^na$mzURZR8-VSPfw4G*3@b> zx3;#%jg5^RwY0PxTLPI(CMAMCwzs$EU0q#yPft%C&%C3fBk$wm^U!QID*^)p4`nhL zkAS?NpP%LB;o-r{<#OKJ+nev}>l>o)QmK@8aB#51LBf1lS=pVYrY5bOogMG&>}**l ze|vj-?U}0>7#Jvp^Jlsc;pOk|e{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U}G4L7bQTWj0x3PF^2BwaQu|I(_+WJKlNS zj|(_r9+m!Ev!>u&WgE8qavOb`VeDQNhR>G=+0GF ztKj?>deO2N_e~e8ANR7^#rQc>?~%ft9Lmmuyqhg-&qpyGo@6KH$ZqM<7)!I^*#LS$Q(v8_Tu|QBTd+AXNWj9xW_7;mF_Eg`9Lw_Y&Dk0Rdf35>TE*Ui zIx-(aQk7GCn2gNaJM2u@ustR8hyNTn`)DQ_GJCfrE>06W0canA5uGGlmFCCe=e>M7EsO~tZ(HrM343RN2seGf!j9&5x z+eX+P#7;JL7_lvyh_8*E>X5!ZegY$N{5n=tKktU3YxSVckT7g8IZ(f1Sj+3EgVG<} zc2=U|P`Pc6zeq(xKYrpv|KCS9doB#j- literal 0 HcmV?d00001 diff --git a/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/www-32.png b/SaxoniteCoreWebOnline/wwwroot/img/icon/contact/www-32.png new file mode 100644 index 0000000000000000000000000000000000000000..b918344e157d895d1b7e19de2ca40b6570923482 GIT binary patch literal 2560 zcmV+b3jg(qP)WdKcYZXhxe_oySgS#OXAdSiN;LjTn}ds{`6PxYWKI7wfaLVDxQx=~qos{nMcgD8EQxT3ufhiP z9X(JtYthj?$RY!ol{o>D!b>hiqoxEb*HeURV(7ivA%3%tQkI zeduZ_t`#&O+E_n$yMSh=c++`QG_ciDr`HJjW>^E@(n*-6NO1c&2@A9 zkbI*I+TKAPks-Z-N1#R5kG*L{^jrmP-=OrwgOaV|0OVA*za8b{2su@BNxcRK)=$T# zdHzH(Gt=hY&QiqFCVxBmkU;ixCTu(U0Jn;pkofvkPRERrW)oyvYcbad2IfXl6W0nx z<+7%(^|=iV5)**y#r1(@O}gMkQ`~Vrrw$*Se1vyWvJl{Ei{wo+u`JRZ))r>?f%M`;W))rzcSA!*k8O5g z=Ti1RJ07x2+ZWJtQK*LlzWkwtzfeG`#)@!ukOJ{>D!d-!i@t#&qGQ!K-C%W4)~LhV zDfcNQ)>uTFyth0I&bF2y5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R|P(R5*ou^C51#(M;y;au?f9C{Wf#1)&n2a9mYIgB* z(MD>!x0E+^dq_wlf~Zqs`DWfhY&2cXil|d+(e}f8f>c9=d2nfjN21U3T+PO$MQ|an zCMLJ6Z83GbQ*^z0w?Tu!-b^I4q$Z=mL29m%n2XXwyd2YGy{w=4a{63@Kv_NS_544K W5;D>B+&3Zs0000').prop('value', mth.code).text(mth.desc)); + } + cm.$mth.val(cfg.method).attr('disabled', cfg.method && cm.$mth.val() == cfg.method ? true : null); + cm.$val.val(cfg.value); + sax.openDialog($dlg.conMth, 600, 240); + } + + //-------------------------------------------------------------- + cm.fn.applyChanges = function () + { + cm.ajax.applyChanges = cm.ajax.applyChanges || { url: sax.url.base + 'Reference/Ajax/ValidateContactMethod', callbackFn: cm.fn.onApplyChanges }; + cm.ajax.applyChanges.formData = new FormData(); + cm.ajax.applyChanges.formData.append("__RequestVerificationToken", $('#frmNavigate input[name="__RequestVerificationToken"]').val()); + cm.ajax.applyChanges.formData.append("ContactMethod", $('select[name="ContactMethod"]', $dlg.conMth).val()); + cm.ajax.applyChanges.formData.append("ContactValue", $('input[name="ContactValue"]', $dlg.conMth).val()); + sax.doAjaxRequest(cm.ajax.applyChanges, 50); + } + cm.fn.onApplyChanges = function (response) + { + if (!response) return; + sax.refreshControlValues(response.controlValues, $dlg.conMth); + if (!response.success) return; + $dlg.conMth.dialog('close'); + if (cm.data.cfg.fnCallback) cm.data.cfg.fnCallback(cm.$mth.val(), $('option:selected', cm.$mth).text(), cm.$val.val()); + } + + //-------------------------------------------------------------- + cm.fn.init = function () + { + if ($dlg.conMth) return; + var opt = sax.dlgOpts(); + opt.buttons[sax.dlg.btn.ok] = function () { cm.fn.applyChanges(); }; + opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); }; + $dlg.conMth = $('#dlgContactMethod').dialog(opt); + cm.$mth = $('.sax-select.ContactMethod', $dlg.conMth); + cm.$val = $('.sax-input.ContactValue', $dlg.conMth); + } + + //-------------------------------------------------------------- +}(window, window.document)); + +/* The End */ \ No newline at end of file diff --git a/SaxoniteCoreWebOnline/wwwroot/js/sax-src-org.js b/SaxoniteCoreWebOnline/wwwroot/js/sax-src-org.js index e109291..f085c61 100644 --- a/SaxoniteCoreWebOnline/wwwroot/js/sax-src-org.js +++ b/SaxoniteCoreWebOnline/wwwroot/js/sax-src-org.js @@ -50,7 +50,7 @@ $('.OrganisationName', $item).text(item.name); $('.OrganisationCategory', $item).text(item.categoryDesc); $('.OrganisationSport', $item).text(item.sportName); - $('.OrganisationLocation', $item).text(item.location); + $('.OrganisationLocation', $item).text(item.regionName); let $bgr = $('.sax-burger', $item); let $mnu = $('ul.sax-dropdown-menu', $bgr).empty(); { @@ -134,16 +134,20 @@ } so.onViewItem = function (response) { - sax.debug('onViewItem',response); + //sax.debug('onViewItem', response); if (!response.success) return; let dlg = $dlg.org; let item = so.data.organisation = response.organisation; $('.OrganisationName', dlg).val(item.name); - $('.OrganisationCategory', dlg).toggle(!!item.category).find('.sax-value').text(item.category); - $('.OrganisationSport', dlg).toggle(!!item.sport).find('.sax-value').text(item.sport); - $('.OrganisationLocation', dlg).toggle(!!item.location).find('.sax-value').text(item.location); - $('.OrganisationAbout', dlg).toggle(!!item.about).find('.sax-value').html(item.about.replace('\n','
')); - $('.OrganisationFacilities', dlg).toggle(!!item.facilities).find('.sax-value').html(item.facilities.replace('\n', '
')); + $('.OrganisationCategory', dlg).toggle(!!item.categoryDesc).find('.sax-value').text(item.categoryDesc); + $('.OrganisationSport', dlg).toggle(!!item.sportName).find('.sax-value').text(item.sportName); + $('.OrganisationLocation', dlg).toggle(!!item.regionName).find('.sax-value').text(item.regionName); + $('.OrganisationAbout', dlg).toggle(!!item.about).find('.sax-value').html((item.about || '').replace('\n', '
')); + $('.OrganisationFacilities', dlg).toggle(!!item.facilities).find('.sax-value').html((item.facilities || '').replace('\n', '
')); + let contact = []; + for (let cnt of item.contacts || []) + contact.push(cnt.value); + $('.OrganisationContact', dlg).toggle(!!contact.length).find('.sax-value').html(contact.join('
')); $('.OrganisationAddress', dlg).toggle(!!item.address).find('.sax-value').html(item.address ? item.address.replace('\n', '
') : ''); $('.OrganisationPostalCode', dlg).toggle(!!item.postalCode).find('.sax-value').text(item.postalCode); sax.clearControlErrors(); @@ -166,7 +170,7 @@ $('.FilterCategory', $frm.filter).on('change', function () { so.refreshResults(); }); var opt = sax.dlgOpts(); - opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); }; + opt.buttons[sax.dlg.btn.close] = function () { $(this).dialog('close'); }; $dlg.org = $('#dlgOrganisation').dialog(opt); $frm.orgId = $('#frmOrganisationId'); diff --git a/SaxoniteCoreWebOnline/wwwroot/js/sax-src-usr.js b/SaxoniteCoreWebOnline/wwwroot/js/sax-src-usr.js index 12c6397..2b0d089 100644 --- a/SaxoniteCoreWebOnline/wwwroot/js/sax-src-usr.js +++ b/SaxoniteCoreWebOnline/wwwroot/js/sax-src-usr.js @@ -157,7 +157,7 @@ $('.FilterCategory', $frm.filter).on('change', function () { su.refreshResults(); }); var opt = sax.dlgOpts(); - opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); }; + opt.buttons[sax.dlg.btn.close] = function () { $(this).dialog('close'); }; $dlg.usr = $('#dlgUser').dialog(opt); $frm.usrId = $('#frmUserId'); diff --git a/SaxoniteCoreWebOnline/wwwroot/js/sax-usr-org.js b/SaxoniteCoreWebOnline/wwwroot/js/sax-usr-org.js index 2f71079..fa2288a 100644 --- a/SaxoniteCoreWebOnline/wwwroot/js/sax-usr-org.js +++ b/SaxoniteCoreWebOnline/wwwroot/js/sax-usr-org.js @@ -5,8 +5,8 @@ (function (win, doc, undef) { "use strict"; - let po = sax.mdl.profileOrganisations = sax.mdl.profileOrganisations || { $pnl: {}, $dlg: {}, $frm: {} }; - let $pnl = po.$pnl, $dlg = po.$dlg, $frm = po.$frm; + let po = sax.mdl.profileOrganisations = sax.mdl.profileOrganisations || { data: {}, ajax: {} }; + let $pnl = po.$pnl = {}, $dlg = po.$dlg = {}, $frm = po.$frm = {}; //-------------------------------------------------------------- sax.refreshProfileOrganisationsInfo = function (delay) @@ -20,16 +20,16 @@ { //sax.debug('refreshProfileOrganisations'); delete sax.page.profileOrganisationsChanged; - sax.ajax.profileOrganisations = sax.ajax.profileOrganisations || { url: sax.url.base + 'Account/Ajax/GetProfileOrganisations', formId: 'frmNavigate', noWaitIcon: true }; - sax.ajax.profileOrganisations.callbackFn = callbackFn; - sax.doAjaxRequest(sax.ajax.profileOrganisations, 50); + po.ajax.profileOrganisations = po.ajax.profileOrganisations || { url: sax.url.base + 'Account/Ajax/GetProfileOrganisations', formId: 'frmNavigate', noWaitIcon: true }; + po.ajax.profileOrganisations.callbackFn = callbackFn; + sax.doAjaxRequest(po.ajax.profileOrganisations, 50); } po.onRefreshProfileOrganisationsInfo = function (response) { //sax.debug('onRefreshProfileOrganisationsInfo', response); if (!response || !response.success) return; $('.sax-message', $pnl.section).stop(true, false).fadeOut(200).empty(); - + po.data.contactMethods = response.contactMethods; let items = response.organisations; if (!items) return; let $items = $('.sax-panel-results.Organisations', $pnl.section).empty(); @@ -95,12 +95,12 @@ //sax.debug('po.updateOrganisation', $item, item); $('.OrganisationId', $frm.orgId).val(item.id); - sax.ajax.profileOrganisation = sax.ajax.profileOrganisation || { url: sax.url.base + 'Account/Ajax/GetProfileOrganisation', formId: 'frmProfileOrganisationId', callbackFn: po.doUpdateOrganisation }; - sax.doAjaxRequest(sax.ajax.profileOrganisation, 50); + po.ajax.profileOrganisation = po.ajax.profileOrganisation || { url: sax.url.base + 'Account/Ajax/GetProfileOrganisation', formId: 'frmProfileOrganisationId', callbackFn: po.doUpdateOrganisation }; + sax.doAjaxRequest(po.ajax.profileOrganisation, 50); } po.doUpdateOrganisation = function (response) { - sax.debug('doUpdateOrganisation', response); + //sax.debug('doUpdateOrganisation', response); if (!response || !response.success) return; let item = response.organisation; if (!item) return; @@ -114,6 +114,16 @@ $('.OrganisationSportCaption', $frm.org).val(item.sportName); $('.OrganisationRegionIdCountry', $frm.org).val(item.regionIdCountry); $('.OrganisationRegionCaptionCountry', $frm.org).val(item.regionNameCountry); + $('.OrganisationAbout', $frm.org).val(item.about); + $('.OrganisationFacilities', $frm.org).val(item.facilities); + $pnl.tblconMths.empty(); + let conMths = item.contactMethods || []; + for (let idx = 0; idx < conMths.length; idx++) + { + let conMth = conMths[idx]; + $pnl.tblconMths.append(po.getConMthEl(conMth.method, conMth.methodCaption, conMth.value)); + } + po.sortConMths(); let address = item.address || {}; $('input.OrganisationAddressId', $frm.org).val(address.id); $('input.OrganisationAddressLine1', $frm.org).val(address.line1); @@ -123,7 +133,7 @@ $('input.OrganisationAddressProvince', $frm.org).val(address.province); $('input.OrganisationAddressCountry', $frm.org).val(address.country); $('input.OrganisationAddressPostalCode', $frm.org).val(address.postalCode); - sax.openDialog($dlg.org, 600, 600); + sax.openDialog($dlg.org, 640, 800); } po.storeOrganisation = function () { @@ -165,6 +175,59 @@ $('.OrganisationRegionCaptionCountry', $frm.org).val(region ? region.name : ''); } + //-------------------------------------------------------------- + po.getConMthCfg = function (usedMths, mth, val) + { + let cfg = { fnCallback: po.applyConMth, methods: po.data.contactMethods, methodsUsed: usedMths, method: mth, value: val }; + return cfg; + } + po.getUsedMths = function () + { + return $('input[name="Organisation.ContactMethod"]', $frm.org).map(function () { return $(this).val(); }).get(); + } + po.addConMth = function () + { + sax.editContactMethod(po.getConMthCfg(po.getUsedMths())); + } + po.editConMth = function (mth, val) + { + sax.editContactMethod(po.getConMthCfg(po.getUsedMths(), mth, val)); + } + po.getConMthId = function (mth) + { + return 'ConMth_' + mth; + } + po.applyConMth = function (mth, mthDsc, val) + { + //sax.debug('applyConMth(\'' + mth + '\',\'' + mthDsc + '\',\'' + val + '\')'); + $('#' + po.getConMthId(mth), $pnl.conMths).remove(); + $pnl.tblconMths.append(po.getConMthEl(mth, mthDsc, val)); + po.sortConMths(); + } + po.sortConMths = function () + { + let $rows = $pnl.tblconMths.find('tr').detach().sort(function (a, b) + { + return $('.sax-label', a).text().localeCompare($('.sax-label', b).text()); + }).appendTo($pnl.tblconMths); + $('input[name="Organisation.ContactMethods"]', $pnl.conMths).val($rows.length); + } + po.getConMthEl = function (mth, mthDsc, val) + { + let $conMth = $('.sax-panel-item-template .ContactMethod', $pnl.conMths).clone().prop('id', po.getConMthId(mth)); + $('.sax-label', $conMth).text(mthDsc); + $('.sax-value', $conMth).text(val); + $('input[name="Organisation.ContactMethod"]', $conMth).val(mth); + $('input[name="Organisation.ContactValue"]', $conMth).val(val); + $conMth.on('click', '.sax-action.sax-edit', function () { po.editConMth(mth, val); }); + $conMth.on('click', '.sax-action.sax-remove', function () { po.clearConMth(mth); }); + return $conMth; + } + po.clearConMth = function (mth) + { + $('#' + po.getConMthId(mth), $pnl.conMths).remove(); + } + //-------------------------------------------------------------- $(function () { @@ -178,6 +241,9 @@ $frm.org = $('#frmProfileOrganisation', $dlg.org); $frm.org.on('dblclick', 'input.OrganisationSportCaption', po.selectOrgSport).on('click', 'button.SelectSport', po.selectOrgSport); $frm.org.on('dblclick', 'input.OrganisationRegionCaptionCountry', po.selectOrgRegionCountry).on('click', 'button.SelectRegionCountry', po.selectOrgRegionCountry); + $frm.org.on('click', '.OrganisationContactMethods .sax-action.sax-add', po.addConMth); + $pnl.conMths = $('.OrganisationContactMethods', $frm.org); + $pnl.tblconMths = $('table.sax-data', $pnl.conMths); }); //-------------------------------------------------------------- diff --git a/SaxoniteStandardBase/Base/App/Sax-Config.cs b/SaxoniteStandardBase/Base/App/Sax-Config.cs index d2ab573..d067fe6 100644 --- a/SaxoniteStandardBase/Base/App/Sax-Config.cs +++ b/SaxoniteStandardBase/Base/App/Sax-Config.cs @@ -84,6 +84,19 @@ namespace Saxonite.Net.Standard.Base.App } } } + public static class Links + { + public static class Targets + { + public static String Website { get; } = "sax-lnk-web"; + public static String Wikipedia { get; } = "sax-lnk-wikip"; + public static String Facebook { get; } = "sax-lnk-fbook"; + public static String Twitter { get; } = "sax-lnk-twit"; + public static String Instagram { get; } = "sax-lnk-insta"; + public static String LinkedIn { get; } = "sax-lnk-lnkin"; + public static String Article { get; } = "sax-art-lnk"; + } + } public static class Articles { public static class Segments diff --git a/SaxoniteStandardBase/Base/App/Sax-Version.cs b/SaxoniteStandardBase/Base/App/Sax-Version.cs index 9fc28e4..0764e0f 100644 --- a/SaxoniteStandardBase/Base/App/Sax-Version.cs +++ b/SaxoniteStandardBase/Base/App/Sax-Version.cs @@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App //------------------------------------------------------------------- public static class Version { - private static String version { get; } = "1.2.6.1"; + private static String version { get; } = "1.2.6.2"; // Retrieve version. public static String GetFullVersion () { return version; } public static String GetAppVersion () @@ -43,6 +43,7 @@ namespace Saxonite.Net.Standard.Base.App // 1.2.6 16-May-2022 Image resizing // - Profile and article images resized to maximum width/height. // - Organisation About and Facilities properties. + // - Online profile organisation contact methods. // 1.2.5 20-Apr-2022 Article feedback // - Online Activity/Article feedback 5 stars, summary on Article list/popup. // - Online Activity filter. diff --git a/SaxoniteStandardBase/Base/App/Sax.cs b/SaxoniteStandardBase/Base/App/Sax.cs index 1aa7ff3..d33a21f 100644 --- a/SaxoniteStandardBase/Base/App/Sax.cs +++ b/SaxoniteStandardBase/Base/App/Sax.cs @@ -30,6 +30,7 @@ namespace Saxonite.Net.Standard.Base.App OrganisationCategory, OrganisationRole, AddressType, + ContactMethod, EventType, OpportunityType, ActivityReaction, @@ -253,6 +254,35 @@ namespace Saxonite.Net.Standard.Base.App Delivery = 60, } + //------------------------------------------------------------------- + public enum ContactMethodType + { + Unknown, + Phone, + Email, + WebUrl, + } + + //------------------------------------------------------------------- + public enum ContactMethod + { + Unknown = 0, + /* Do not change the numeric values or names - tied to database. */ + PhoneMain = 10, + PhoneMobile = 20, + PhoneHome = 30, + PhoneOffice = 40, + // Online. + Email = 100, + Website = 200, + Wikipedia = 210, + // Social media. + LinkedIn = 300, + Twitter = 310, + Facebook = 320, + Instagram = 330, + } + //------------------------------------------------------------------- /// Event Type public enum EventType diff --git a/SaxoniteStandardBase/Base/App/SaxInternals.cs b/SaxoniteStandardBase/Base/App/SaxInternals.cs index 9de1ef6..2215e20 100644 --- a/SaxoniteStandardBase/Base/App/SaxInternals.cs +++ b/SaxoniteStandardBase/Base/App/SaxInternals.cs @@ -100,6 +100,7 @@ namespace Saxonite.Net.Standard.Base.App public List OrganisationCategoryCodes { get { return GetCodesOfType(Sax.CodeType.OrganisationCategory); } } public List OrganisationRoleCodes { get { return GetCodesOfType(Sax.CodeType.OrganisationRole); } } public List AddressTypeCodes { get { return GetCodesOfType(Sax.CodeType.AddressType); } } + public List ContactMethodCodes { get { return GetCodesOfType(Sax.CodeType.ContactMethod); } } public List EventTypeCodes { get { return GetCodesOfType(Sax.CodeType.EventType); } } public List OpportunityTypeCodes { get { return GetCodesOfType(Sax.CodeType.OpportunityType); } } public List ActivityReactionCodes { get { return GetCodesOfType(Sax.CodeType.ActivityReaction); } } diff --git a/SaxoniteStandardBase/Base/App/SaxSystem-CodeTypes.cs b/SaxoniteStandardBase/Base/App/SaxSystem-CodeTypes.cs index 0a49e37..f4c184f 100644 --- a/SaxoniteStandardBase/Base/App/SaxSystem-CodeTypes.cs +++ b/SaxoniteStandardBase/Base/App/SaxSystem-CodeTypes.cs @@ -1,4 +1,5 @@ -using System; +using Sarand.Net.Standard.Base.Core; +using System; using System.Collections.Generic; using System.Text; @@ -11,8 +12,244 @@ namespace Saxonite.Net.Standard.Base.App { //------------------------------------------------------------------- // Data members. + // Code types. + private static readonly List yesNoCodes = new List(); + private static readonly List dataItemTypeCodes = new List(); + private static readonly List genderCodes = new List(); + private static readonly List sportSpecialityLabelCodes = new List(); + private static readonly List sportParticipationCodes = new List(); + private static readonly List sportOfficiatingCodes = new List(); + private static readonly List regionTypeCodes = new List(); + private static readonly List userRoleCodes = new List(); + private static readonly List titleCodes = new List(); + private static readonly List imageTypeCodes = new List(); + private static readonly List organisationTypeCodes = new List(); + private static readonly List organisationCategoryCodes = new List(); + private static readonly List organisationRoleCodes = new List(); + private static readonly List addressTypeCodes = new List(); + private static readonly List contactMethodCodes = new List(); + private static readonly List eventTypeCodes = new List(); + private static readonly List opportunityTypeCodes = new List(); + private static readonly List activityReactionCodes = new List(); //------------------------------------------------------------------- + // C o d e T y p e s + //------------------------------------------------------------------- + public static List GetCodesOfType(Sax.CodeType codeType) + { + // Lists are cloned to avoid modifications to the internal static lists. + switch (codeType) + { + case Sax.CodeType.YesNo: + return new List(yesNoCodes); + case Sax.CodeType.DataItemType: + return new List(dataItemTypeCodes); + case Sax.CodeType.Gender: + return new List(genderCodes); + case Sax.CodeType.SportSpecialityLabel: + return new List(sportSpecialityLabelCodes); + case Sax.CodeType.SportParticipation: + return new List(sportParticipationCodes); + case Sax.CodeType.SportOfficiating: + return new List(sportOfficiatingCodes); + case Sax.CodeType.RegionType: + return new List(regionTypeCodes); + case Sax.CodeType.UserRole: + return new List(userRoleCodes); + case Sax.CodeType.Title: + return new List(titleCodes); + case Sax.CodeType.ImageType: + return new List(imageTypeCodes); + case Sax.CodeType.OrganisationType: + return new List(organisationTypeCodes); + case Sax.CodeType.OrganisationCategory: + return new List(organisationCategoryCodes); + case Sax.CodeType.OrganisationRole: + return new List(organisationRoleCodes); + case Sax.CodeType.AddressType: + return new List(addressTypeCodes); + case Sax.CodeType.ContactMethod: + return new List(contactMethodCodes); + case Sax.CodeType.EventType: + return new List(eventTypeCodes); + case Sax.CodeType.OpportunityType: + return new List(opportunityTypeCodes); + case Sax.CodeType.ActivityReaction: + return new List(activityReactionCodes); + + default: + throw new NotSupportedException(nameof(SaxSystem) + ".GetCodesOfType Unexpected code type: " + codeType.ToString()); + } + } + + //------------------------------------------------------------------- + /// Static code type initialisation. + private static void InitCodeTypes() + { + //--------------------------------------------------------------- + // Yes No options. + yesNoCodes.Add(Sax.YesNo.Yes, "YES", "Yes"); + yesNoCodes.Add(Sax.YesNo.No, "NO", "No"); + + //--------------------------------------------------------------- + // Data item types. + // Reference data. + dataItemTypeCodes.Add(Sax.DataItemType.Region, "Region", "Region"); + dataItemTypeCodes.Add(Sax.DataItemType.Sport, "Sport", "Sport"); + // Accounts. + dataItemTypeCodes.Add(Sax.DataItemType.UserAccount, "UserAccount", "User Account"); + dataItemTypeCodes.Add(Sax.DataItemType.UserRole, "UserRole", "User Role"); + dataItemTypeCodes.Add(Sax.DataItemType.UserOrganisation, "UserOrganisation", "User Organisation"); + dataItemTypeCodes.Add(Sax.DataItemType.UserSport, "UserSport", "User Sport"); + dataItemTypeCodes.Add(Sax.DataItemType.Organisation, "Organisation", "Organisation"); + // Activty data. + dataItemTypeCodes.Add(Sax.DataItemType.ActivityIndex, "ActivityIndex", "Activity Index"); + dataItemTypeCodes.Add(Sax.DataItemType.UserActivity, "UserActivity", "User Activity"); + dataItemTypeCodes.Add(Sax.DataItemType.Article, "Article", "Article"); + dataItemTypeCodes.Add(Sax.DataItemType.OrganisationOpportunity, "OrganisationOpportunity", "Organisation Opportunity"); + dataItemTypeCodes.Add(Sax.DataItemType.OrganisationEvent, "OrganisationEvent", "Organisation Event"); + // Item link components. + dataItemTypeCodes.Add(Sax.DataItemType.ItemSport, "ItemSport", "Item Sport"); + dataItemTypeCodes.Add(Sax.DataItemType.ItemImage, "ItemImage", "Item Image"); + + //--------------------------------------------------------------- + // Gender. + genderCodes.Add(Sax.Gender.Female, "Female", "Female"); + genderCodes.Add(Sax.Gender.Male, "Male", "Male"); + genderCodes.Add(Sax.Gender.TransFemale, "TransFemale", "TransFemale"); + genderCodes.Add(Sax.Gender.TransMale, "TransMale", "TransMale"); + genderCodes.Add(Sax.Gender.Nonconforming, "Nonconforming", "Nonconforming"); + genderCodes.Add(Sax.Gender.PreferNotToSay, "PreferNotToSay", "Prefer not to say"); + + //--------------------------------------------------------------- + // Sport speciality label. + sportSpecialityLabelCodes.Add(Sax.SportSpecialityLabel.Positon, "POS", "Positon"); + sportSpecialityLabelCodes.Add(Sax.SportSpecialityLabel.Discipline, "DIS", "Discipline"); + sportSpecialityLabelCodes.Add(Sax.SportSpecialityLabel.NotRelevant, "NRE", "Not relevant"); + + //--------------------------------------------------------------- + // Sport participation. + sportParticipationCodes.Add(Sax.SportParticipation.Professional, "PRO", "Professional"); + sportParticipationCodes.Add(Sax.SportParticipation.Regular, "REG", "Regular"); + sportParticipationCodes.Add(Sax.SportParticipation.Occasional, "OCC", "Occasional"); + sportParticipationCodes.Add(Sax.SportParticipation.Spectator, "SPC", "Spectator"); + sportParticipationCodes.Add(Sax.SportParticipation.Interested, "INT", "Interested"); + + //--------------------------------------------------------------- + // Sport officiating. + sportOfficiatingCodes.Add(Sax.SportParticipation.Professional, "PRO", "Professional"); + sportOfficiatingCodes.Add(Sax.SportParticipation.Regular, "REG", "Regular"); + sportOfficiatingCodes.Add(Sax.SportParticipation.Occasional, "OCC", "Occasional"); + + //--------------------------------------------------------------- + // Region types. + regionTypeCodes.Add(Sax.RegionType.Universe, "UNIV", "Universe"); + regionTypeCodes.Add(Sax.RegionType.Galaxy, "GALAX", "Galaxy"); + regionTypeCodes.Add(Sax.RegionType.World, "WORLD", "World"); + regionTypeCodes.Add(Sax.RegionType.Continent, "CONT", "Continent"); + regionTypeCodes.Add(Sax.RegionType.SubContinent, "SUBC", "Sub-Continent"); + regionTypeCodes.Add(Sax.RegionType.Country, "COUN", "Country"); + regionTypeCodes.Add(Sax.RegionType.State, "STAT", "State"); + regionTypeCodes.Add(Sax.RegionType.Province, "PROV", "Province"); + + //--------------------------------------------------------------- + // User roles. + userRoleCodes.Add(Sax.UserRole.Journalist, "JRNLST", "Journalist"); + userRoleCodes.Add(Sax.UserRole.SystemAdmin, "SYSADM", "System Admin"); + + //--------------------------------------------------------------- + // Titles. + titleCodes.Add(Sax.Title.Mr, "Mr", "Mr"); + titleCodes.Add(Sax.Title.Mrs, "Mrs", "Mrs"); + titleCodes.Add(Sax.Title.Miss, "Miss", "Miss"); + titleCodes.Add(Sax.Title.Mx, "Mx", "Mx"); + titleCodes.Add(Sax.Title.Dr, "Dr", "Dr"); + titleCodes.Add(Sax.Title.Sir, "Sir", "Sir"); + titleCodes.Add(Sax.Title.Lord, "Lord", "Lord"); + titleCodes.Add(Sax.Title.Lady, "Lady", "Lady"); + + //--------------------------------------------------------------- + // Image types. + imageTypeCodes.Add(Sax.ImageType.Avatar, "Avatar", "Avatar"); + imageTypeCodes.Add(Sax.ImageType.AvatarUpload, "AvatarUpload", "Avatar - upload"); + imageTypeCodes.Add(Sax.ImageType.Article, "Article", "Article"); + imageTypeCodes.Add(Sax.ImageType.ArticleUpload, "ArticleUpload", "Article - upload"); + + //--------------------------------------------------------------- + // Organisation types. + organisationTypeCodes.Add(Sax.OrganisationType.SocialEnterprise, "SEN", "Social Enterprise"); + organisationTypeCodes.Add(Sax.OrganisationType.CommunityGroup, "CGR", "Community Group"); + organisationTypeCodes.Add(Sax.OrganisationType.Charity, "CTY", "Charity"); + organisationTypeCodes.Add(Sax.OrganisationType.Commercial, "CMC", "Commercial"); + organisationTypeCodes.Add(Sax.OrganisationType.PublicSector, "PBS", "Public Sector"); + + //--------------------------------------------------------------- + // Organisation categories. + organisationCategoryCodes.Add(Sax.OrganisationCategory.Association, "ASC", "Association"); + organisationCategoryCodes.Add(Sax.OrganisationCategory.Club, "CLB", "Club"); + organisationCategoryCodes.Add(Sax.OrganisationCategory.Society, "SOC", "Society"); + organisationCategoryCodes.Add(Sax.OrganisationCategory.Education, "EDU", "Education"); + organisationCategoryCodes.Add(Sax.OrganisationCategory.SportDepartment, "SPD", "Sport Department"); + organisationCategoryCodes.Add(Sax.OrganisationCategory.Syndicate, "SYN", "Syndicate"); + organisationCategoryCodes.Add(Sax.OrganisationCategory.Partner, "PRT", "Partner"); + organisationCategoryCodes.Add(Sax.OrganisationCategory.Other, "OTH", "Other"); + + //--------------------------------------------------------------- + // Organisation roles. + organisationRoleCodes.Add(Sax.OrganisationRole.Member, "MBR", "Member"); + organisationRoleCodes.Add(Sax.OrganisationRole.Admin, "ADM", "Admin"); + organisationRoleCodes.Add(Sax.OrganisationRole.MemberAdmin, "MBA", "Members"); + organisationRoleCodes.Add(Sax.OrganisationRole.ScheduleAdmin, "SCA", "Schedule"); + organisationRoleCodes.Add(Sax.OrganisationRole.OpportunityAdmin, "OPA", "Opportunities"); + organisationRoleCodes.Add(Sax.OrganisationRole.ArticleAdmin, "ARA", "Articles"); + + //--------------------------------------------------------------- + // Address Types. + addressTypeCodes.Add(Sax.AddressType.Location, "Location", "Location"); + addressTypeCodes.Add(Sax.AddressType.Home, "Home", "Home"); + addressTypeCodes.Add(Sax.AddressType.Office, "Office", "Office"); + addressTypeCodes.Add(Sax.AddressType.Delivery, "Delivery", "Delivery"); + + //--------------------------------------------------------------- + // Contact methods. + contactMethodCodes.Add(Sax.ContactMethod.PhoneMain, Sax.ContactMethod.PhoneMain.ToString(), "Phone - main"); + contactMethodCodes.Add(Sax.ContactMethod.PhoneMobile, Sax.ContactMethod.PhoneMobile.ToString(), "Phone - mobile"); + contactMethodCodes.Add(Sax.ContactMethod.PhoneHome, Sax.ContactMethod.PhoneHome.ToString(), "Phone - home"); + contactMethodCodes.Add(Sax.ContactMethod.PhoneOffice, Sax.ContactMethod.PhoneOffice.ToString(), "Phone - office"); + // Online. + contactMethodCodes.Add(Sax.ContactMethod.Email, Sax.ContactMethod.Email.ToString(), "Email"); + contactMethodCodes.Add(Sax.ContactMethod.Website, Sax.ContactMethod.Website.ToString(), "Website"); + contactMethodCodes.Add(Sax.ContactMethod.Wikipedia, Sax.ContactMethod.Wikipedia.ToString(), "Wikipedia"); + // Social media. + contactMethodCodes.Add(Sax.ContactMethod.LinkedIn, Sax.ContactMethod.LinkedIn.ToString(), "LinkedIn"); + contactMethodCodes.Add(Sax.ContactMethod.Twitter, Sax.ContactMethod.Twitter.ToString(), "Twitter"); + contactMethodCodes.Add(Sax.ContactMethod.Facebook, Sax.ContactMethod.Facebook.ToString(), "Facebook"); + contactMethodCodes.Add(Sax.ContactMethod.Instagram, Sax.ContactMethod.Instagram.ToString(), "Instagram"); + + //--------------------------------------------------------------- + // Event types. + eventTypeCodes.Add(Sax.EventType.Playing, "PLG", "Playing"); + eventTypeCodes.Add(Sax.EventType.Training, "TRN", "Training"); + eventTypeCodes.Add(Sax.EventType.Organisation, "ORG", "Organisation"); + eventTypeCodes.Add(Sax.EventType.Social, "SCL", "Social"); + + //--------------------------------------------------------------- + // Opportunity types. + opportunityTypeCodes.Add(Sax.OpportunityType.Playing, "PLG", "Playing"); + opportunityTypeCodes.Add(Sax.OpportunityType.Official, "OFL", "Official"); + opportunityTypeCodes.Add(Sax.OpportunityType.Coaching, "CHG", "Coaching"); + opportunityTypeCodes.Add(Sax.OpportunityType.Volunteer, "VTR", "Volunteer"); + opportunityTypeCodes.Add(Sax.OpportunityType.Staff, "STF", "Staff"); + opportunityTypeCodes.Add(Sax.OpportunityType.Board, "BRD", "Board"); + + //--------------------------------------------------------------- + // Activity Reactions. + activityReactionCodes.Add(Sax.ActivityReaction.Good, "Good", "Good"); + activityReactionCodes.Add(Sax.ActivityReaction.VeryGood, "VeryGood", "Very Good"); + activityReactionCodes.Add(Sax.ActivityReaction.Exceptional, "Exceptional", "Exceptional"); + + //--------------------------------------------------------------- + } //------------------------------------------------------------------- } diff --git a/SaxoniteStandardBase/Base/App/SaxSystem-Statics.cs b/SaxoniteStandardBase/Base/App/SaxSystem-Statics.cs index d112bb6..fb17736 100644 --- a/SaxoniteStandardBase/Base/App/SaxSystem-Statics.cs +++ b/SaxoniteStandardBase/Base/App/SaxSystem-Statics.cs @@ -13,174 +13,14 @@ namespace Saxonite.Net.Standard.Base.App { //------------------------------------------------------------------- // Data members. - // Code types. - private static readonly List yesNoCodes = new List(); - private static readonly List dataItemTypeCodes = new List(); - private static readonly List genderCodes = new List(); - private static readonly List sportSpecialityLabelCodes = new List(); - private static readonly List sportParticipationCodes = new List(); - private static readonly List sportOfficiatingCodes = new List(); - private static readonly List regionTypeCodes = new List(); - private static readonly List userRoleCodes = new List(); - private static readonly List titleCodes = new List(); - private static readonly List imageTypeCodes = new List(); - private static readonly List organisationTypeCodes = new List(); - private static readonly List organisationCategoryCodes = new List(); - private static readonly List organisationRoleCodes = new List(); - private static readonly List addressTypeCodes = new List(); - private static readonly List eventTypeCodes = new List(); - private static readonly List opportunityTypeCodes = new List(); - private static readonly List activityReactionCodes = new List(); //------------------------------------------------------------------- /// Static initialisation. static SaxSystem() { //--------------------------------------------------------------- - // Yes No options. - yesNoCodes.Add(Sax.YesNo.Yes, "YES", "Yes"); - yesNoCodes.Add(Sax.YesNo.No, "NO", "No"); - - //--------------------------------------------------------------- - // Data item types. - // Reference data. - dataItemTypeCodes.Add(Sax.DataItemType.Region, "Region", "Region"); - dataItemTypeCodes.Add(Sax.DataItemType.Sport, "Sport", "Sport"); - // Accounts. - dataItemTypeCodes.Add(Sax.DataItemType.UserAccount, "UserAccount", "User Account"); - dataItemTypeCodes.Add(Sax.DataItemType.UserRole, "UserRole", "User Role"); - dataItemTypeCodes.Add(Sax.DataItemType.UserOrganisation, "UserOrganisation", "User Organisation"); - dataItemTypeCodes.Add(Sax.DataItemType.UserSport, "UserSport", "User Sport"); - dataItemTypeCodes.Add(Sax.DataItemType.Organisation, "Organisation", "Organisation"); - // Activty data. - dataItemTypeCodes.Add(Sax.DataItemType.ActivityIndex, "ActivityIndex", "Activity Index"); - dataItemTypeCodes.Add(Sax.DataItemType.UserActivity, "UserActivity", "User Activity"); - dataItemTypeCodes.Add(Sax.DataItemType.Article, "Article", "Article"); - dataItemTypeCodes.Add(Sax.DataItemType.OrganisationOpportunity, "OrganisationOpportunity", "Organisation Opportunity"); - dataItemTypeCodes.Add(Sax.DataItemType.OrganisationEvent, "OrganisationEvent", "Organisation Event"); - // Item link components. - dataItemTypeCodes.Add(Sax.DataItemType.ItemSport, "ItemSport", "Item Sport"); - dataItemTypeCodes.Add(Sax.DataItemType.ItemImage, "ItemImage", "Item Image"); - - //--------------------------------------------------------------- - // Gender. - genderCodes.Add(Sax.Gender.Female, "Female", "Female"); - genderCodes.Add(Sax.Gender.Male, "Male", "Male"); - genderCodes.Add(Sax.Gender.TransFemale, "TransFemale", "TransFemale"); - genderCodes.Add(Sax.Gender.TransMale, "TransMale", "TransMale"); - genderCodes.Add(Sax.Gender.Nonconforming, "Nonconforming", "Nonconforming"); - genderCodes.Add(Sax.Gender.PreferNotToSay, "PreferNotToSay", "Prefer not to say"); - - //--------------------------------------------------------------- - // Sport speciality label. - sportSpecialityLabelCodes.Add(Sax.SportSpecialityLabel.Positon, "POS", "Positon"); - sportSpecialityLabelCodes.Add(Sax.SportSpecialityLabel.Discipline, "DIS", "Discipline"); - sportSpecialityLabelCodes.Add(Sax.SportSpecialityLabel.NotRelevant, "NRE", "Not relevant"); - - //--------------------------------------------------------------- - // Sport participation. - sportParticipationCodes.Add(Sax.SportParticipation.Professional, "PRO", "Professional"); - sportParticipationCodes.Add(Sax.SportParticipation.Regular, "REG", "Regular"); - sportParticipationCodes.Add(Sax.SportParticipation.Occasional, "OCC", "Occasional"); - sportParticipationCodes.Add(Sax.SportParticipation.Spectator, "SPC", "Spectator"); - sportParticipationCodes.Add(Sax.SportParticipation.Interested, "INT", "Interested"); - - //--------------------------------------------------------------- - // Sport officiating. - sportOfficiatingCodes.Add(Sax.SportParticipation.Professional, "PRO", "Professional"); - sportOfficiatingCodes.Add(Sax.SportParticipation.Regular, "REG", "Regular"); - sportOfficiatingCodes.Add(Sax.SportParticipation.Occasional, "OCC", "Occasional"); - - //--------------------------------------------------------------- - // Region types. - regionTypeCodes.Add(Sax.RegionType.Universe, "UNIV", "Universe"); - regionTypeCodes.Add(Sax.RegionType.Galaxy, "GALAX", "Galaxy"); - regionTypeCodes.Add(Sax.RegionType.World, "WORLD", "World"); - regionTypeCodes.Add(Sax.RegionType.Continent, "CONT", "Continent"); - regionTypeCodes.Add(Sax.RegionType.SubContinent, "SUBC", "Sub-Continent"); - regionTypeCodes.Add(Sax.RegionType.Country, "COUN", "Country"); - regionTypeCodes.Add(Sax.RegionType.State, "STAT", "State"); - regionTypeCodes.Add(Sax.RegionType.Province, "PROV", "Province"); - - //--------------------------------------------------------------- - // User roles. - userRoleCodes.Add(Sax.UserRole.Journalist, "JRNLST", "Journalist"); - userRoleCodes.Add(Sax.UserRole.SystemAdmin, "SYSADM", "System Admin"); - - //--------------------------------------------------------------- - // Titles. - titleCodes.Add(Sax.Title.Mr, "Mr", "Mr"); - titleCodes.Add(Sax.Title.Mrs, "Mrs", "Mrs"); - titleCodes.Add(Sax.Title.Miss, "Miss", "Miss"); - titleCodes.Add(Sax.Title.Mx, "Mx", "Mx"); - titleCodes.Add(Sax.Title.Dr, "Dr", "Dr"); - titleCodes.Add(Sax.Title.Sir, "Sir", "Sir"); - titleCodes.Add(Sax.Title.Lord, "Lord", "Lord"); - titleCodes.Add(Sax.Title.Lady, "Lady", "Lady"); - - //--------------------------------------------------------------- - // Image types. - imageTypeCodes.Add(Sax.ImageType.Avatar, "Avatar", "Avatar"); - imageTypeCodes.Add(Sax.ImageType.AvatarUpload, "AvatarUpload", "Avatar - upload"); - imageTypeCodes.Add(Sax.ImageType.Article, "Article", "Article"); - imageTypeCodes.Add(Sax.ImageType.ArticleUpload, "ArticleUpload", "Article - upload"); - - //--------------------------------------------------------------- - // Organisation types. - organisationTypeCodes.Add(Sax.OrganisationType.SocialEnterprise, "SEN", "Social Enterprise"); - organisationTypeCodes.Add(Sax.OrganisationType.CommunityGroup, "CGR", "Community Group"); - organisationTypeCodes.Add(Sax.OrganisationType.Charity, "CTY", "Charity"); - organisationTypeCodes.Add(Sax.OrganisationType.Commercial, "CMC", "Commercial"); - organisationTypeCodes.Add(Sax.OrganisationType.PublicSector, "PBS", "Public Sector"); - - //--------------------------------------------------------------- - // Organisation categories. - organisationCategoryCodes.Add(Sax.OrganisationCategory.Association, "ASC", "Association"); - organisationCategoryCodes.Add(Sax.OrganisationCategory.Club, "CLB", "Club"); - organisationCategoryCodes.Add(Sax.OrganisationCategory.Society, "SOC", "Society"); - organisationCategoryCodes.Add(Sax.OrganisationCategory.Education, "EDU", "Education"); - organisationCategoryCodes.Add(Sax.OrganisationCategory.SportDepartment, "SPD", "Sport Department"); - organisationCategoryCodes.Add(Sax.OrganisationCategory.Syndicate, "SYN", "Syndicate"); - organisationCategoryCodes.Add(Sax.OrganisationCategory.Partner, "PRT", "Partner"); - organisationCategoryCodes.Add(Sax.OrganisationCategory.Other, "OTH", "Other"); - - //--------------------------------------------------------------- - // Organisation roles. - organisationRoleCodes.Add(Sax.OrganisationRole.Member, "MBR", "Member"); - organisationRoleCodes.Add(Sax.OrganisationRole.Admin, "ADM", "Admin"); - organisationRoleCodes.Add(Sax.OrganisationRole.MemberAdmin, "MBA", "Members"); - organisationRoleCodes.Add(Sax.OrganisationRole.ScheduleAdmin, "SCA", "Schedule"); - organisationRoleCodes.Add(Sax.OrganisationRole.OpportunityAdmin, "OPA", "Opportunities"); - organisationRoleCodes.Add(Sax.OrganisationRole.ArticleAdmin, "ARA", "Articles"); - - //--------------------------------------------------------------- - // Event types. - eventTypeCodes.Add(Sax.EventType.Playing, "PLG", "Playing"); - eventTypeCodes.Add(Sax.EventType.Training, "TRN", "Training"); - eventTypeCodes.Add(Sax.EventType.Organisation, "ORG", "Organisation"); - eventTypeCodes.Add(Sax.EventType.Social, "SCL", "Social"); - - //--------------------------------------------------------------- - // Opportunity types. - opportunityTypeCodes.Add(Sax.OpportunityType.Playing, "PLG", "Playing"); - opportunityTypeCodes.Add(Sax.OpportunityType.Official, "OFL", "Official"); - opportunityTypeCodes.Add(Sax.OpportunityType.Coaching, "CHG", "Coaching"); - opportunityTypeCodes.Add(Sax.OpportunityType.Volunteer, "VTR", "Volunteer"); - opportunityTypeCodes.Add(Sax.OpportunityType.Staff, "STF", "Staff"); - opportunityTypeCodes.Add(Sax.OpportunityType.Board, "BRD", "Board"); - - //--------------------------------------------------------------- - // Address Types. - addressTypeCodes.Add(Sax.AddressType.Location, "Location", "Location"); - addressTypeCodes.Add(Sax.AddressType.Home, "Home", "Home"); - addressTypeCodes.Add(Sax.AddressType.Office, "Office", "Office"); - addressTypeCodes.Add(Sax.AddressType.Delivery, "Delivery", "Delivery"); - - //--------------------------------------------------------------- - // Activity Reactions. - activityReactionCodes.Add(Sax.ActivityReaction.Good, "Good", "Good"); - activityReactionCodes.Add(Sax.ActivityReaction.VeryGood, "VeryGood", "Very Good"); - activityReactionCodes.Add(Sax.ActivityReaction.Exceptional, "Exceptional", "Exceptional"); + // Code types. + InitCodeTypes(); //--------------------------------------------------------------- } diff --git a/SaxoniteStandardBase/Base/App/SaxSystem.cs b/SaxoniteStandardBase/Base/App/SaxSystem.cs index 63fed77..b060e5a 100644 --- a/SaxoniteStandardBase/Base/App/SaxSystem.cs +++ b/SaxoniteStandardBase/Base/App/SaxSystem.cs @@ -28,54 +28,6 @@ namespace Saxonite.Net.Standard.Base.App public abstract SaxItemDataMgr CreateItemDataMgr(SaxSessionContext sessionContext, SaxInternals internals); public abstract SaxActivityMgr CreateActivityMgr(SaxSessionContext sessionContext, SaxInternals internals); - //------------------------------------------------------------------- - // S y s t e m C o d e s - //------------------------------------------------------------------- - public static List GetCodesOfType(Sax.CodeType systemCode) - { - // Lists are cloned to avoid modifications to the internal static lists. - switch (systemCode) - { - case Sax.CodeType.YesNo: - return new List(yesNoCodes); - case Sax.CodeType.DataItemType: - return new List(dataItemTypeCodes); - case Sax.CodeType.Gender: - return new List(genderCodes); - case Sax.CodeType.SportSpecialityLabel: - return new List(sportSpecialityLabelCodes); - case Sax.CodeType.SportParticipation: - return new List(sportParticipationCodes); - case Sax.CodeType.SportOfficiating: - return new List(sportOfficiatingCodes); - case Sax.CodeType.RegionType: - return new List(regionTypeCodes); - case Sax.CodeType.UserRole: - return new List(userRoleCodes); - case Sax.CodeType.Title: - return new List(titleCodes); - case Sax.CodeType.ImageType: - return new List(imageTypeCodes); - case Sax.CodeType.OrganisationType: - return new List(organisationTypeCodes); - case Sax.CodeType.OrganisationCategory: - return new List(organisationCategoryCodes); - case Sax.CodeType.OrganisationRole: - return new List(organisationRoleCodes); - case Sax.CodeType.AddressType: - return new List(addressTypeCodes); - case Sax.CodeType.EventType: - return new List(eventTypeCodes); - case Sax.CodeType.OpportunityType: - return new List(opportunityTypeCodes); - case Sax.CodeType.ActivityReaction: - return new List(activityReactionCodes); - - default: - throw new NotSupportedException(nameof(SaxSystem) + ".GetCodesOfType Unexpected code type: " + systemCode.ToString()); - } - } - //------------------------------------------------------------------- } //======================================================================= diff --git a/SaxoniteStandardBase/Base/Bus/SaxContactData.cs b/SaxoniteStandardBase/Base/Bus/SaxContactData.cs new file mode 100644 index 0000000..dd4b52a --- /dev/null +++ b/SaxoniteStandardBase/Base/Bus/SaxContactData.cs @@ -0,0 +1,151 @@ +using Sarand.Net.Standard.Base.App; +using Sarand.Net.Standard.Base.Bus; +using Sarand.Net.Standard.Base.Core; +using Sarand.Net.Standard.Base.Utils; +using Saxonite.Net.Standard.Base.App; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Xml.Linq; + +namespace Saxonite.Net.Standard.Base.Bus +{ + //======================================================================= + // Contact data - associated with Organisations, Users etc. + //======================================================================= + public class SaxContactData + { + //------------------------------------------------------------------- + // Definitions. + private static readonly String ElementName_ContactMethods = "contactMethods"; + private static readonly String ElementName_ContactMethod = "contactMethod"; + private static readonly String AttributeName_Method = "method"; + + //------------------------------------------------------------------- + // Data members. + private class ContactMethodData + { + public Sax.ContactMethod Method { get; set; } + public String Value { get; set; } + } + private Dictionary contactMethods { get; } = new Dictionary(); + + //------------------------------------------------------------------- + // Construction - from serialised data. + public SaxContactData(String contactData = "") + { + ExtractContactData(contactData); + } + + //------------------------------------------------------------------- + // Properties. + public List Methods { get { return contactMethods.Keys.ToList(); } } + + //------------------------------------------------------------------- + // Contact Methods. + //------------------------------------------------------------------- + /// Extract the value associated with the specified method. + public String GetContactMethodValue(Sax.ContactMethod method) + { + return contactMethods.GetValueOrDefault(method, new ContactMethodData()).Value; + } + + /// Set the value associated with the specified method. + public bool SetContactMethodValue(Sax.ContactMethod method, String value) + { + if ((int)method < 1 || value.IsEmpty()) return false; + ContactMethodData contactMethod = contactMethods.GetValueOrDefault(method, null); + if (contactMethod == null) + contactMethods.Add(method, contactMethod = new ContactMethodData() { Method = method }); + contactMethod.Value = value; + return true; + } + + /// Clear the value associated with the specified method. + public bool ClearContactMethod(Sax.ContactMethod method) + { + return contactMethods.Remove(method); + } + + /// Clear all contact methods. + public void ClearContactMethods(Sax.ContactMethod method) + { + contactMethods.Clear(); + } + + //------------------------------------------------------------------- + // Serialisation. + //------------------------------------------------------------------- + /// + /// Extract contact methods from serialised data. + /// + private void ExtractContactData(String contactData) + { + String fn = typeof(SaxContactData).FullName + ".ExtractContent"; + contactMethods.Clear(); + if (StringUtil.IsEmpty(contactData)) return; + + try + { + // Load XML data. + XDocument doc = XDocument.Parse(contactData); + XElement rootElement = doc.Root; + foreach (XElement rootChildElement in rootElement.GetChildElements()) + { + String rootChildElementName = rootChildElement.GetLocalName(); + if (rootChildElementName.EqualsCI(ElementName_ContactMethod)) + { + // Contact Method. + String methodValue = rootChildElement.GetAttributeValue(AttributeName_Method); + Sax.ContactMethod method = EnumUtil.ParseEnum(methodValue, Sax.ContactMethod.Unknown); + if (method != Sax.ContactMethod.Unknown) + { + ContactMethodData contactMethod = new ContactMethodData() + { + Method = method, + Value = rootChildElement.Value + }; + contactMethods.Add(method, contactMethod); + } + else SaLogger.Warn(fn + " Unrecognised contact method: " + methodValue); + } + else SaLogger.Warn(fn + " Unexpected 'Root' child element: " + rootChildElementName); + } + } + catch (Exception exc) + { + SaLogger.Warn(fn + " " + ExceptionUtil.GetLogMessage(exc)); + } + } + + //------------------------------------------------------------------- + /// + /// Convert to serialised data. + /// + public String GetContactData() + { + String fn = typeof(SaxContactData).FullName + ".GetContactData"; + try + { + XDocument doc = new XDocument(); + XElement contactMethodsElement = doc.AppendElement(ElementName_ContactMethods); + foreach (ContactMethodData contactMethod in contactMethods.Values) + { + if ((int)contactMethod.Method < 1 || contactMethod.Value.IsEmpty()) continue; + XElement contactMethodElement = contactMethodsElement.AppendElement(ElementName_ContactMethod, contactMethod.Value); + contactMethodElement.SetAttribute(AttributeName_Method, contactMethod.Method.ToString()); + } + return doc.GetXml(); + } + catch (Exception exc) + { + SaLogger.Warn(fn + " " + ExceptionUtil.GetLogMessage(exc)); + } + return ""; + } + + //------------------------------------------------------------------- + } + //======================================================================= +} diff --git a/SaxoniteStandardBase/Base/Bus/SaxOrganisation.cs b/SaxoniteStandardBase/Base/Bus/SaxOrganisation.cs index 12b70c8..e012d69 100644 --- a/SaxoniteStandardBase/Base/Bus/SaxOrganisation.cs +++ b/SaxoniteStandardBase/Base/Bus/SaxOrganisation.cs @@ -1,5 +1,6 @@ using Sarand.Net.Standard.Base.Bus; using Sarand.Net.Standard.Base.Core; +using Sarand.Net.Standard.Base.Utils; using Saxonite.Net.Standard.Base.App; using System; using System.Collections.Generic; @@ -212,6 +213,21 @@ namespace Saxonite.Net.Standard.Base.Bus if (organisationCategory == Sax.OrganisationCategory.SportDepartment) return true; return false; } + private static List validContactMethods = new List + { + Sax.ContactMethod.PhoneMain, + Sax.ContactMethod.PhoneOffice, + // Online. + Sax.ContactMethod.Email, + Sax.ContactMethod.Website, + Sax.ContactMethod.Wikipedia, + // Social media. + Sax.ContactMethod.LinkedIn, + Sax.ContactMethod.Twitter, + Sax.ContactMethod.Facebook, + Sax.ContactMethod.Instagram, + }; + public static List ValidContactMethods { get { return new List(validContactMethods); } } //------------------------------------------------------------------- // Properties. @@ -330,7 +346,7 @@ namespace Saxonite.Net.Standard.Base.Bus /// /// Extract the Organisation Ids. /// - public static ListGetIds(this List values) + public static List GetIds(this List values) { return values.Select(item => item.Id).ToList(); } diff --git a/SaxoniteStandardBase/Base/Helpers/SaxContactMethodHelper.cs b/SaxoniteStandardBase/Base/Helpers/SaxContactMethodHelper.cs new file mode 100644 index 0000000..31290d2 --- /dev/null +++ b/SaxoniteStandardBase/Base/Helpers/SaxContactMethodHelper.cs @@ -0,0 +1,94 @@ +using Sarand.Net.Standard.Base.Helpers; +using Saxonite.Net.Standard.Base.App; +using System; +using System.Collections.Generic; +using System.Text; + +namespace Saxonite.Net.Standard.Base.Helpers +{ + //======================================================================= + public static class SaxContactMethodHelper + { + //------------------------------------------------------------------- + // Utilities. + //------------------------------------------------------------------- + public static Sax.ContactMethodType GetContactMethodType(Sax.ContactMethod contactMethod) + { + switch (contactMethod) + { + case Sax.ContactMethod.PhoneMain: + case Sax.ContactMethod.PhoneMobile: + case Sax.ContactMethod.PhoneHome: + case Sax.ContactMethod.PhoneOffice: + return Sax.ContactMethodType.Phone; + case Sax.ContactMethod.Email: + return Sax.ContactMethodType.Email; + case Sax.ContactMethod.Website: + case Sax.ContactMethod.Wikipedia: + case Sax.ContactMethod.LinkedIn: + case Sax.ContactMethod.Twitter: + case Sax.ContactMethod.Facebook: + case Sax.ContactMethod.Instagram: + return Sax.ContactMethodType.WebUrl; + } + return Sax.ContactMethodType.Unknown; + } + + //------------------------------------------------------------------- + /// Validate Contact Method value. + public static bool IsValidContactMethodValue(Sax.ContactMethod method, String value) + { + Sax.ContactMethodType contactMethodType = GetContactMethodType(method); + + // Method specific value validation. + if (contactMethodType == Sax.ContactMethodType.Phone) + { + // Phone number. + return SacsDataValidationHelper.IsValidPhone(value); + } + else if (contactMethodType == Sax.ContactMethodType.Email) + { + // Email address. + return SacsDataValidationHelper.IsValidEmailAddress(value); + } + else if (contactMethodType == Sax.ContactMethodType.WebUrl) + { + if (method == Sax.ContactMethod.Wikipedia) + { + // Wikipedia. + return SacsDataValidationHelper.IsValidWikipediaUrl(value); + } + else if (method == Sax.ContactMethod.LinkedIn) + { + // LinkedIn. + return SacsDataValidationHelper.IsValidLinkedInUrl(value); + } + else if (method == Sax.ContactMethod.Twitter) + { + // Twitter. + return SacsDataValidationHelper.IsValidTwitterUrl(value); + } + else if (method == Sax.ContactMethod.Facebook) + { + // Facebook. + return SacsDataValidationHelper.IsValidFacebookUrl(value); + } + else if (method == Sax.ContactMethod.Instagram) + { + // Instagram. + return SacsDataValidationHelper.IsValidInstagramUrl(value); + } + else + { + // Generic URL. + return SacsDataValidationHelper.IsValidUrl(value); + } + } + return true; + } + + //------------------------------------------------------------------- + } + + //======================================================================= +} diff --git a/SaxoniteStandardBase/Base/Mgr/SaxItemMgr.cs b/SaxoniteStandardBase/Base/Mgr/SaxItemMgr.cs index 9c48e66..509dd6a 100644 --- a/SaxoniteStandardBase/Base/Mgr/SaxItemMgr.cs +++ b/SaxoniteStandardBase/Base/Mgr/SaxItemMgr.cs @@ -76,6 +76,7 @@ namespace Saxonite.Net.Standard.Base.Mgr public List OrganisationCategoryCodes { get { return Internals.OrganisationCategoryCodes; } } public List OrganisationRoleCodes { get { return Internals.OrganisationRoleCodes; } } public List AddressTypeCodes { get { return Internals.AddressTypeCodes; } } + public List ContactMethodCodes { get { return Internals.ContactMethodCodes; } } public List EventTypeCodes { get { return Internals.EventTypeCodes; } } public List OpportunityTypeCodes { get { return Internals.OpportunityTypeCodes; } } public List ActivityReactionCodes { get { return Internals.ActivityReactionCodes; } }