This commit is contained in:
2022-05-19 13:41:22 +01:00
parent d17cce340e
commit 56f6b0bb7e
48 changed files with 850 additions and 319 deletions
@@ -77,6 +77,8 @@ namespace Saxonite.Net.Core.Web.Admin.Models
public Sax.OrganisationCategory OrganisationCategory { get { return (Sax.OrganisationCategory)OrganisationCategoryCodes.GetTypeForCode(OrganisationCategoryValue); } }
public String OrganisationSportId { get; set; }
public String OrganisationRegionIdCountry { get; set; }
public String OrganisationAbout { get; set; }
public String OrganisationFacilities { get; set; }
// Common properties.
public String OrganisationNotes { get; set; }
public String OrganisationStatusCode { get; set; }
@@ -131,15 +133,15 @@ namespace Saxonite.Net.Core.Web.Admin.Models
}
}
// Organisation country.
// Organisation region.
if (OrganisationRegionIdCountry != null)
{
using (SaxRegion region = ReferenceMgr.GetRegionById(OrganisationRegionIdCountry.ToSysId()))
{
if (region == null)
responseData.SetControlError(nameof(OrganisationRegionIdCountry), Localiser["msg.validation.invalid.value"]);
else if (region.RegionType != Sax.RegionType.Country)
responseData.SetControlError(nameof(OrganisationRegionIdCountry), "Organisation region must be a country");
else if (region.RegionType != Sax.RegionType.Country && region.RegionType != Sax.RegionType.Continent && region.RegionType != Sax.RegionType.World)
responseData.SetControlError(nameof(OrganisationRegionIdCountry), "Organisation region must be a country or international region");
}
if (!StringUtil.IsEmpty(OrganisationName))
@@ -156,6 +158,30 @@ namespace Saxonite.Net.Core.Web.Admin.Models
}
}
// Organisation about.
if (OrganisationAbout != null)
{
responseData.SetControlValue(nameof(OrganisationAbout), OrganisationAbout);
if (StringUtil.GetLength(OrganisationAbout) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_About))
responseData.SetControlError(nameof(OrganisationAbout), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_About)]);
}
// Organisation facilities.
if (OrganisationFacilities != null)
{
responseData.SetControlValue(nameof(OrganisationFacilities), OrganisationFacilities);
if (StringUtil.GetLength(OrganisationFacilities) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_Facilities))
responseData.SetControlError(nameof(OrganisationFacilities), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_Facilities)]);
}
// Organisation notes.
if (OrganisationNotes != null)
{
responseData.SetControlValue(nameof(OrganisationNotes), OrganisationNotes);
if (StringUtil.GetLength(OrganisationNotes) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_Notes))
responseData.SetControlError(nameof(OrganisationNotes), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_Notes)]);
}
// Organisation status.
if (OrganisationStatusCode != null)
{