v1.2.6.3
@@ -79,7 +79,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
data.ContactMethods.Add(new AjaxResponse_Data.ContactMethodData() { Method = method.ToString(), MethodCaption = Localiser.GetContactMethodCaption(method), Value = contactData.GetContactMethodValue(method) });
|
||||
}
|
||||
// Address.
|
||||
if (address != null)
|
||||
if (address != null && !address.IsStatusDeleted)
|
||||
{
|
||||
data.Address = new AjaxResponse_Data.AddressData();
|
||||
data.Address.Id = address.Id.ToString();
|
||||
@@ -352,64 +352,80 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
|
||||
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;
|
||||
// The form includes address fields.
|
||||
if (model.Address.IsPopulated())
|
||||
{
|
||||
// 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))
|
||||
// Create Organisation address if required.
|
||||
if (organisationAddress == null)
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to insert organisation address - " + ItemDataMgr.ErrorStateMessage);
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
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;
|
||||
organisationAddress.Status = SaxItemAddress.DefaultStatus;
|
||||
|
||||
// Store address.
|
||||
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"]));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Update existing address.
|
||||
if (!ItemDataMgr.UpdateItemAddress(organisationAddress, DbUpdateInfo))
|
||||
// Address not populated - delete it.
|
||||
if (!ItemDataMgr.DeleteItemAddress(organisationAddress, DbUpdateInfo))
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to update organisation address - " + ItemDataMgr.ErrorStateMessage);
|
||||
SaLogger.Warn(fn + " Failed to delete organisation address - " + ItemDataMgr.ErrorStateMessage);
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,22 +19,19 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Region data.
|
||||
private class RegionData_List
|
||||
private class RegionListData : AjaxResponse_Data.ItemData_Base
|
||||
{
|
||||
public String Id { get; set; }
|
||||
public String RegionTypeCode { get; set; }
|
||||
public String RegionTypeDesc { get; set; }
|
||||
public String CountryIso2Code { get; set; }
|
||||
public String Name { get; set; }
|
||||
public String ParentName { get; set; }
|
||||
public String StatusCode { get; set; }
|
||||
public String StatusDesc { get; set; }
|
||||
}
|
||||
private class RegionData_Full : RegionData_List
|
||||
private class RegionItemData : RegionListData
|
||||
{
|
||||
public int RegionIdParent { get; set; }
|
||||
public String RegionIdParent { get; set; }
|
||||
}
|
||||
private void PopulateRegionResponseData(SaxRegion region, RegionData_List data)
|
||||
private void PopulateRegionResponseListData(SaxRegion region, RegionListData data)
|
||||
{
|
||||
data.Id = SysId.ToString(region.Id);
|
||||
data.RegionTypeCode = RegionTypeCodes.GetCodeForType(region.RegionType);
|
||||
@@ -48,10 +45,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
data.StatusCode = region.StatusCode;
|
||||
data.StatusDesc = region.StatusDesc;
|
||||
}
|
||||
private void PopulateRegionResponseData(SaxRegion region, RegionData_Full data)
|
||||
private void PopulateRegionResponseItemData(SaxRegion region, RegionItemData data)
|
||||
{
|
||||
PopulateRegionResponseData(region, data as RegionData_List);
|
||||
data.RegionIdParent = SysId.ToInt(region.RegionIdParent);
|
||||
PopulateRegionResponseListData(region, data);
|
||||
data.RegionIdParent = SysId.ToString(region.RegionIdParent);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -62,7 +59,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
// Construction.
|
||||
public AjaxResponse_RegionList(SaxModel_Admin model) : base(model) { }
|
||||
// Region list.
|
||||
public List<RegionData_List> Regions { get; } = new List<RegionData_List>();
|
||||
public List<RegionListData> Regions { get; } = new List<RegionListData>();
|
||||
// Reference data.
|
||||
public List<CodeDesc> Statuses { get; } = new List<CodeDesc>();
|
||||
public String DefaultStatusCode { get; set; }
|
||||
@@ -121,7 +118,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
Sax.RegionType regionType = (Sax.RegionType)values.GetLong(colType.DataName);
|
||||
RegionData_List regionData = new RegionData_List()
|
||||
RegionListData regionData = new RegionListData()
|
||||
{
|
||||
Id = values.GetString(colId.DataName),
|
||||
RegionTypeCode = RegionTypeCodes.GetCodeForType(regionType),
|
||||
@@ -152,7 +149,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
// Construction.
|
||||
public AjaxResponse_Region(SaxModel_Admin model) : base(model) { }
|
||||
// Region details.
|
||||
public RegionData_Full region { get; } = new RegionData_Full();
|
||||
public RegionItemData region { get; } = new RegionItemData();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
@@ -186,7 +183,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
}
|
||||
|
||||
// Construct response.
|
||||
PopulateRegionResponseData(region, responseData.region);
|
||||
PopulateRegionResponseItemData(region, responseData.region);
|
||||
}
|
||||
|
||||
// Complete response.
|
||||
@@ -267,7 +264,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
}
|
||||
|
||||
// Construct response.
|
||||
PopulateRegionResponseData(region, responseData.region);
|
||||
PopulateRegionResponseItemData(region, responseData.region);
|
||||
}
|
||||
|
||||
// Complete response.
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Sport data.
|
||||
private class SportData_List : AjaxResponse_Data.ItemData_Base
|
||||
private class SportListData : AjaxResponse_Data.ItemData_Base
|
||||
{
|
||||
public String Name { get; set; }
|
||||
public String SportIdParent { get; set; }
|
||||
@@ -27,10 +27,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
public String SpecialityLabelCode { get; set; }
|
||||
public String SpecialityLabelDesc { get; set; }
|
||||
}
|
||||
private class SportData_Full : SportData_List
|
||||
private class SportItemData : SportListData
|
||||
{
|
||||
}
|
||||
private void PopulateSportResponseData(SaxSport sport, SaxSport parentSport, SportData_List data)
|
||||
private void PopulateSportResponseListData(SaxSport sport, SaxSport parentSport, SportListData data)
|
||||
{
|
||||
data.Id = SysId.ToString(sport.Id);
|
||||
data.SportNameParent = parentSport?.Name ?? null;
|
||||
@@ -41,9 +41,9 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
data.StatusCode = sport.StatusCode;
|
||||
data.StatusDesc = sport.StatusDesc;
|
||||
}
|
||||
private void PopulateSportResponseData(SaxSport sport, SaxSport parentSport, SportData_Full data)
|
||||
private void PopulateSportResponseItemData(SaxSport sport, SaxSport parentSport, SportItemData data)
|
||||
{
|
||||
PopulateSportResponseData(sport, parentSport, data as SportData_List);
|
||||
PopulateSportResponseListData(sport, parentSport, data);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -54,7 +54,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
// Construction.
|
||||
public AjaxResponse_SportList(SaxModel_Admin model) : base(model) { }
|
||||
// Sport list.
|
||||
public List<SportData_List> Sports { get; } = new List<SportData_List>();
|
||||
public List<SportListData> Sports { get; } = new List<SportListData>();
|
||||
// Reference data.
|
||||
public List<CodeDesc> Statuses { get; } = new List<CodeDesc>();
|
||||
public String DefaultStatusCode { get; set; }
|
||||
@@ -107,7 +107,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
Sax.SportSpecialityLabel specialityLabel = (Sax.SportSpecialityLabel)values.GetLong(colSpecialityLabel.DataName);
|
||||
SportData_List sportData = new SportData_List()
|
||||
SportListData sportData = new SportListData()
|
||||
{
|
||||
Id = values.GetString(colId.DataName),
|
||||
SportIdParent = values.GetString(colParentId.DataName),
|
||||
@@ -138,7 +138,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
// Construction.
|
||||
public AjaxResponse_Sport(SaxModel_Admin model) : base(model) { }
|
||||
// Sport details.
|
||||
public SportData_Full sport { get; } = new SportData_Full();
|
||||
public SportItemData sport { get; } = new SportItemData();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
@@ -176,7 +176,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
disposableItems.Add(parentSport);
|
||||
|
||||
// Construct response.
|
||||
PopulateSportResponseData(sport, parentSport, responseData.sport);
|
||||
PopulateSportResponseItemData(sport, parentSport, responseData.sport);
|
||||
}
|
||||
|
||||
// Complete response.
|
||||
@@ -259,7 +259,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
disposableItems.Add(parentSport);
|
||||
|
||||
// Construct response.
|
||||
PopulateSportResponseData(sport, parentSport, responseData.sport);
|
||||
PopulateSportResponseItemData(sport, parentSport, responseData.sport);
|
||||
}
|
||||
|
||||
// Complete response.
|
||||
|
||||
@@ -51,6 +51,13 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
/// <summary>Have any address values been populated on the form.</summary>
|
||||
public bool IsPopulated()
|
||||
{
|
||||
if (SysId.IsValid(Id.ToSysId()) || !StringUtil.IsEmpty(Line1) || !StringUtil.IsEmpty(Town) || !StringUtil.IsEmpty(Province) || !StringUtil.IsEmpty(Country) || !StringUtil.IsEmpty(PostalCode))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validation.
|
||||
@@ -58,6 +65,8 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
// Address.
|
||||
public bool ValidateAddressData(SaxController_Base.AjaxResponse_Data responseData)
|
||||
{
|
||||
// Are any properties populated.
|
||||
bool populated = IsPopulated();
|
||||
|
||||
// Address Line 1 - optional.
|
||||
if (Line1 != null)
|
||||
@@ -89,11 +98,11 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
}
|
||||
}
|
||||
|
||||
// Address Town - mandatory.
|
||||
// Address Town - mandatory if any value populated.
|
||||
if (Town != null)
|
||||
{
|
||||
responseData.SetControlValue(ControlNameSuffix + "Town", Town);
|
||||
if (StringUtil.IsEmpty(Town))
|
||||
if (StringUtil.IsEmpty(Town) && populated)
|
||||
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)]);
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
base(localiser)
|
||||
{
|
||||
AdditionalFiles_JS.Add("js/sax-org.js");
|
||||
Address = new ModelData_Address(this, "Address");
|
||||
Address = new ModelData_Address(this, "");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -224,6 +224,10 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
responseData.SetControlError(nameof(OrganisationStatus), Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Validate address fields.
|
||||
if (Address != null)
|
||||
Address.ValidateAddressData(responseData);
|
||||
|
||||
return !responseData.HasControlErrors();
|
||||
}
|
||||
|
||||
|
||||
@@ -120,6 +120,9 @@
|
||||
<data name="caption.contact.method" xml:space="preserve">
|
||||
<value>Contact Method</value>
|
||||
</data>
|
||||
<data name="caption.organisation.address" xml:space="preserve">
|
||||
<value>Organisation Address</value>
|
||||
</data>
|
||||
<data name="company.name" xml:space="preserve">
|
||||
<value>Sportierre</value>
|
||||
</data>
|
||||
@@ -255,6 +258,9 @@
|
||||
<data name="label.forgotten.password" xml:space="preserve">
|
||||
<value>Forgotten password?</value>
|
||||
</data>
|
||||
<data name="label.images" xml:space="preserve">
|
||||
<value>Images</value>
|
||||
</data>
|
||||
<data name="label.index" xml:space="preserve">
|
||||
<value>Index</value>
|
||||
</data>
|
||||
@@ -282,6 +288,9 @@
|
||||
<data name="label.last.name" xml:space="preserve">
|
||||
<value>Last name</value>
|
||||
</data>
|
||||
<data name="label.location" xml:space="preserve">
|
||||
<value>Location</value>
|
||||
</data>
|
||||
<data name="label.logs" xml:space="preserve">
|
||||
<value>Logs</value>
|
||||
</data>
|
||||
@@ -348,6 +357,9 @@
|
||||
<data name="label.password.current" xml:space="preserve">
|
||||
<value>Current password</value>
|
||||
</data>
|
||||
<data name="label.postal.code" xml:space="preserve">
|
||||
<value>Postcode</value>
|
||||
</data>
|
||||
<data name="label.previous" xml:space="preserve">
|
||||
<value>Previous</value>
|
||||
</data>
|
||||
@@ -420,6 +432,9 @@
|
||||
<data name="label.title" xml:space="preserve">
|
||||
<value>Title</value>
|
||||
</data>
|
||||
<data name="label.town" xml:space="preserve">
|
||||
<value>Town</value>
|
||||
</data>
|
||||
<data name="label.type" xml:space="preserve">
|
||||
<value>Type</value>
|
||||
</data>
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
@* Controls - Item Address *@
|
||||
@model SaxModel_Admin
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/Controls-ItemAddress")) return;
|
||||
|
||||
@* Item address - Line 1 *@
|
||||
<div class="sax-form-control AddressLine1">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="sax-caption">
|
||||
<label for=""><span>@Localiser["label.address"]</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sax-control row">
|
||||
<div class="col"><input type="text" name="Address.Line1" class="AddressLine1 sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line1)" /> </div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Item address - Line 2 *@
|
||||
<div class="sax-form-control AddressLine2">
|
||||
<div class="row">
|
||||
<div class="col-sm-3"></div>
|
||||
<div class="col-sm">
|
||||
<div class="sax-control row">
|
||||
<div class="col"><input type="text" name="Address.Line2" class="AddressLine2 sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line2)" /> </div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Item address - Line 3 *@
|
||||
<div class="sax-form-control AddressLine3">
|
||||
<div class="row">
|
||||
<div class="col-sm-3"></div>
|
||||
<div class="col-sm">
|
||||
<div class="sax-control row">
|
||||
<div class="col"><input type="text" name="Address.Line3" class="AddressLine3 sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line3)" /> </div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Item address - Town *@
|
||||
<div class="sax-form-control AddressTown">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="sax-label">
|
||||
<label for=""><span>@Localiser["label.town"]</span><span class="required"> (*)</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sax-control row">
|
||||
<div class="col"><input type="text" name="Address.Town" class="AddressTown sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town)" /> </div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Item address - Province *@
|
||||
<div class="sax-form-control AddressProvince">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="sax-label">
|
||||
<label for=""><span>@Localiser["label.province"]</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sax-control row">
|
||||
<div class="col"><input type="text" name="Address.Province" class="AddressProvince sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Province)" /> </div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Item address - PostalCode *@
|
||||
<div class="sax-form-control AddressPostalCode">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="sax-label">
|
||||
<label for=""><span>@Localiser["label.postal.code"]</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sax-control row">
|
||||
<div class="col"><input type="text" name="Address.PostalCode" class="AddressPostalCode sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_PostalCode)" /> </div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -11,6 +11,8 @@
|
||||
sax.lbl.refresh = '@(Localiser.GetJavascriptText("label.refresh"))';
|
||||
sax.lbl.create = '@(Localiser.GetJavascriptText("label.create"))';
|
||||
sax.lbl.edit = '@(Localiser.GetJavascriptText("label.edit"))';
|
||||
sax.lbl.location = '@(Localiser.GetJavascriptText("label.location"))';
|
||||
sax.lbl.images = '@(Localiser.GetJavascriptText("label.images"))';
|
||||
sax.lbl.activate = '@(Localiser.GetJavascriptText("label.activate"))';
|
||||
</script>
|
||||
|
||||
@@ -23,88 +25,88 @@
|
||||
@* Filter Panel *@
|
||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmOrganisationFilter", @class = "sax-form", @onSubmit = "return false;" }))
|
||||
{
|
||||
<div class="sax-panel-filter">
|
||||
@* Header - Page caption, paging controls, actions. *@
|
||||
<div class="sax-header">
|
||||
<div class="row">
|
||||
<div class="col"><div class="sax-caption">@Localiser["organisation.caption.organisations"]</div></div>
|
||||
<div class="fixed row">
|
||||
<div class="col">
|
||||
<partial name="~/Views/Common/ResultsPaging.cshtml" />
|
||||
</div>
|
||||
<div class="fixed">
|
||||
@* Burger menu *@
|
||||
<ul class="nav navbar-nav navbar-dark navbar-right sax-burger">
|
||||
<li class="dropdown-toggle caret-off">
|
||||
<a href="#" class="dropdown" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="navbar-toggler-icon"></span></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right sax-dropdown-menu">@* Menu items will be inserted here. *@</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sax-content">
|
||||
@* Organisation filter - name etc. *@
|
||||
<div class="row pb4">
|
||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.search"]</div>
|
||||
<div class="col-sm-7">
|
||||
@Html.TextBoxFor(model => model.Filter.Organisation, new { @id = "", @class = "FilterOrganisation", @maxlength = "32" })
|
||||
</div>
|
||||
</div>
|
||||
@* Organisation Category *@
|
||||
<div class="row pb4">
|
||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.category"]</div>
|
||||
<div class="col-sm-7">
|
||||
@Html.DropDownListFor(model => model.Filter.OrganisationCategoryCode, Model.AdminOrganisationCategoriesForSelect, Localiser["label.any"], new { @id = "", @class = "FilterOrganisationCategory sax-select" })
|
||||
</div>
|
||||
</div>
|
||||
@* Organisation sport *@
|
||||
<div class="row pb4">
|
||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.sport"]</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="row">
|
||||
@Html.HiddenFor(model => model.Filter.OrganisationSportId, new { @id = "", @class = "FilterOrganisationSportId" })
|
||||
<div class="col"><input type="text" class="FilterOrganisationSportCaption sax-input" readonly="readonly" /> </div>
|
||||
<div class="fixed row">
|
||||
<div class="sax-action FilterSportSelect"><img src="~/img/action/search24.png" alt="@(Localiser["label.search"])" title="@(Localiser["label.search"])" /></div>
|
||||
<div class="sax-action FilterSportClear"><img src="~/img/action/delete24.png" alt="@(Localiser["label.clear"])" title="@(Localiser["label.clear"])" /></div>
|
||||
<div class="sax-panel-filter">
|
||||
@* Header - Page caption, paging controls, actions. *@
|
||||
<div class="sax-header">
|
||||
<div class="row">
|
||||
<div class="col"><div class="sax-caption">@Localiser["organisation.caption.organisations"]</div></div>
|
||||
<div class="fixed row">
|
||||
<div class="col">
|
||||
<partial name="~/Views/Common/ResultsPaging.cshtml" />
|
||||
</div>
|
||||
<div class="fixed">
|
||||
@* Burger menu *@
|
||||
<ul class="nav navbar-nav navbar-dark navbar-right sax-burger">
|
||||
<li class="dropdown-toggle caret-off">
|
||||
<a href="#" class="dropdown" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="navbar-toggler-icon"></span></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right sax-dropdown-menu">@* Menu items will be inserted here. *@</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@* Organisation region *@
|
||||
<div class="row pb4">
|
||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.region"]</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="row">
|
||||
@Html.HiddenFor(model => model.Filter.OrganisationRegionId, new { @id = "", @class = "FilterOrganisationRegionId" })
|
||||
<div class="col"><input type="text" class="FilterOrganisationRegionCaption sax-input" readonly="readonly" /> </div>
|
||||
<div class="fixed row">
|
||||
<div class="sax-action FilterRegionSelect"><img src="~/img/action/search24.png" alt="@(Localiser["label.search"])" title="@(Localiser["label.search"])" /></div>
|
||||
<div class="sax-action FilterRegionClear"><img src="~/img/action/delete24.png" alt="@(Localiser["label.clear"])" title="@(Localiser["label.clear"])" /></div>
|
||||
<div class="sax-content">
|
||||
@* Organisation filter - name etc. *@
|
||||
<div class="row pb4">
|
||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.search"]</div>
|
||||
<div class="col-sm-7">
|
||||
@Html.TextBoxFor(model => model.Filter.Organisation, new { @id = "", @class = "FilterOrganisation", @maxlength = "32" })
|
||||
</div>
|
||||
</div>
|
||||
@* Organisation Category *@
|
||||
<div class="row pb4">
|
||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.category"]</div>
|
||||
<div class="col-sm-7">
|
||||
@Html.DropDownListFor(model => model.Filter.OrganisationCategoryCode, Model.AdminOrganisationCategoriesForSelect, Localiser["label.any"], new { @id = "", @class = "FilterOrganisationCategory sax-select" })
|
||||
</div>
|
||||
</div>
|
||||
@* Organisation sport *@
|
||||
<div class="row pb4">
|
||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.sport"]</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="row">
|
||||
@Html.HiddenFor(model => model.Filter.OrganisationSportId, new { @id = "", @class = "FilterOrganisationSportId" })
|
||||
<div class="col"><input type="text" class="FilterOrganisationSportCaption sax-input" readonly="readonly" /> </div>
|
||||
<div class="fixed row">
|
||||
<div class="sax-action FilterSportSelect"><img src="~/img/action/search24.png" alt="@(Localiser["label.search"])" title="@(Localiser["label.search"])" /></div>
|
||||
<div class="sax-action FilterSportClear"><img src="~/img/action/delete24.png" alt="@(Localiser["label.clear"])" title="@(Localiser["label.clear"])" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@* Organisation Status *@
|
||||
<div class="row pb4">
|
||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.status"]</div>
|
||||
<div class="col-sm-7">
|
||||
@Html.DropDownListFor(model => model.Filter.OrganisationStatusCategoryCode, Model.OrganisationFilterStatusCategoriesForSelect, new { @id = "", @class = "FilterOrganisationStatusCategory sax-select" })
|
||||
@* Organisation region *@
|
||||
<div class="row pb4">
|
||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.region"]</div>
|
||||
<div class="col-sm-7">
|
||||
<div class="row">
|
||||
@Html.HiddenFor(model => model.Filter.OrganisationRegionId, new { @id = "", @class = "FilterOrganisationRegionId" })
|
||||
<div class="col"><input type="text" class="FilterOrganisationRegionCaption sax-input" readonly="readonly" /> </div>
|
||||
<div class="fixed row">
|
||||
<div class="sax-action FilterRegionSelect"><img src="~/img/action/search24.png" alt="@(Localiser["label.search"])" title="@(Localiser["label.search"])" /></div>
|
||||
<div class="sax-action FilterRegionClear"><img src="~/img/action/delete24.png" alt="@(Localiser["label.clear"])" title="@(Localiser["label.clear"])" /></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@* Organisation Status *@
|
||||
<div class="row pb4">
|
||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.status"]</div>
|
||||
<div class="col-sm-7">
|
||||
@Html.DropDownListFor(model => model.Filter.OrganisationStatusCategoryCode, Model.OrganisationFilterStatusCategoriesForSelect, new { @id = "", @class = "FilterOrganisationStatusCategory sax-select" })
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Filter element templates *@
|
||||
<div class="sax-panel-item-template">
|
||||
@* Burger dropdown item template - ul is ignored *@
|
||||
<ul class="sax-dropdown-menu OrganisationFilter">
|
||||
<li class="sax-dropdown-item sax-action"><div class="sax-label">XXX</div></li>
|
||||
</ul>
|
||||
</div>
|
||||
@* Filter element templates *@
|
||||
<div class="sax-panel-item-template">
|
||||
@* Burger dropdown item template - ul is ignored *@
|
||||
<ul class="sax-dropdown-menu OrganisationFilter">
|
||||
<li class="sax-dropdown-item sax-action"><div class="sax-label">XXX</div></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
@@ -163,5 +165,6 @@
|
||||
</div>
|
||||
|
||||
<partial name="Panel-OrganisationDialog.cshtml" />
|
||||
<partial name="Panel-OrganisationAddressDialog.cshtml" />
|
||||
<partial name="~/Views/Common/SelectItem.cshtml" />
|
||||
<partial name="Panel-ActivationDialog.cshtml" />
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
@model Model_Organisation
|
||||
@inject SaxLocaliser Localiser
|
||||
@{
|
||||
/* Organisations - Organisation Address dialog panel */
|
||||
}
|
||||
|
||||
<div id="dlgOrganisationAddress" class="sax-dialog" title="@Localiser["caption.organisation.address"]">
|
||||
|
||||
<div class="spacer"></div>
|
||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmOrganisationAddress", @class = "sax-form", @onSubmit = "return false;" }))
|
||||
{
|
||||
@Html.HiddenFor(model => model.OrganisationId, new { @id = "", @class = "OrganisationId" })
|
||||
|
||||
@* Organisation name *@
|
||||
<div class="sax-form-control OrganisationName">
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="sax-label">
|
||||
<label for="ifOrganisationName"><span>@Localiser["label.name"]</span> <span class="required">*</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<div class="sax-control">
|
||||
@Html.TextBoxFor(model => model.OrganisationName, new { @id = "ifOrganisationName", @class = "OrganisationName sax-input", @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_Name), disabled = true })
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<partial name="~/Views/Common/Controls-ItemAddress.cshtml" />
|
||||
|
||||
}
|
||||
<div class="spacer"></div>
|
||||
</div>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
@Html.HiddenFor(model => model.RegionId, new { @id = "", @class = "RegionId" })
|
||||
|
||||
@* Region type *@
|
||||
<div class="sax-form-control RegionType">
|
||||
<div class="sax-form-control RegionTypeCode">
|
||||
<div class="sax-label">
|
||||
<label for="cbRegionType"><span><span class="required">*</span> @Localiser["label.type"]</span></label>
|
||||
</div>
|
||||
|
||||
@@ -161,6 +161,16 @@
|
||||
background-image: url('../img/action/mail24.png');
|
||||
}
|
||||
|
||||
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-location
|
||||
{
|
||||
background-image: url('../img/action/location-24.png');
|
||||
}
|
||||
|
||||
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-image
|
||||
{
|
||||
background-image: url('../img/action/image-24.png');
|
||||
}
|
||||
|
||||
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-process
|
||||
{
|
||||
background-image: url('../img/action/process24.png');
|
||||
|
||||
|
After Width: | Height: | Size: 542 B |
|
After Width: | Height: | Size: 794 B |
|
After Width: | Height: | Size: 1001 B |
|
After Width: | Height: | Size: 811 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -420,17 +420,14 @@
|
||||
{
|
||||
var $frmCtrls = $('.sax-form-control', $(context || doc.body)).removeClass('sax-error');
|
||||
sax.clearControlErrors(context);
|
||||
var values = (controlValues || []);
|
||||
var valuesLen = values.length;
|
||||
for (var valIdx = 0; valIdx < (controlValues || []).length; valIdx++)
|
||||
for (let ctrlValue of controlValues || [])
|
||||
{
|
||||
let ctrlValue = controlValues[valIdx];
|
||||
$frmCtrls.each(function (idx, frmCtrl)
|
||||
{
|
||||
var $frmCtrl = $(frmCtrl);
|
||||
var $ctrl = $('input,textarea,select', $frmCtrl);
|
||||
if ($ctrl.prop('name') != ctrlValue.controlName) return;
|
||||
if (ctrlValue.value)
|
||||
if (!$frmCtrl.hasClass(ctrlValue.controlName)) return;
|
||||
var $ctrl = $('sax-input,sax-textarea,sax-select', $frmCtrl);
|
||||
if ($ctrl.length && sax.isDef(ctrlValue.value))
|
||||
$ctrl.val(ctrlValue.value);
|
||||
if (ctrlValue.error)
|
||||
$frmCtrl.addClass('sax-error').find('.sax-message').text(ctrlValue.error);
|
||||
|
||||
@@ -25,16 +25,14 @@
|
||||
{
|
||||
//sax.debug('doRefreshResults', response);
|
||||
delete op.awaitingRefreshResponse;
|
||||
sax.refreshControlValues(response.controlValues);
|
||||
var $msgs = $('.sax-panel-messages', $pnl.results).hide().empty();
|
||||
var $items = $('.sax-panel-item-list', $pnl.results).hide().empty();
|
||||
sax.refreshPaging(response, '#frmOrganisationFilter', op.refreshResults);
|
||||
if (!response.success) return;
|
||||
sax.refreshPaging(response, '#frmOrganisationFilter', op.refreshResults);
|
||||
// Reference data.
|
||||
op.data.contactMethods = response.contactMethods;
|
||||
if (response.defaultStatusCode) op.data.defaultStatusCode = response.defaultStatusCode;
|
||||
if (response.statuses)
|
||||
sax.populateSelectCodeDesc('#cbOrganisationStatus', response.statuses);
|
||||
op.data.defaultStatusCode = response.defaultStatusCode;
|
||||
sax.populateSelectCodeDesc('#cbOrganisationStatus', response.statuses);
|
||||
// Menu.
|
||||
var $bgr = $('.sax-burger', $pnl.filter).hide();
|
||||
var $mnu = $('ul.sax-dropdown-menu', $bgr).empty();
|
||||
@@ -65,10 +63,12 @@
|
||||
if (!item.deleted)
|
||||
{
|
||||
let fnUpdItm = function () { op.updateItem(item, $item) };
|
||||
$item.on('click', '.sax-header .sax-action.sax-item-update', fnUpdItm).on('dblclick', fnUpdItm);
|
||||
$mnu.append(op.getItemMenuOption(sax.lbl.edit, fnUpdItm, 'sax-edit'));
|
||||
if (item.awaiting)
|
||||
$mnu.append(op.getItemMenuOption(sax.lbl.activate, function () { op.activateItem(item) }, 'sax-unlock'));
|
||||
$item.on('click', '.sax-header .sax-action.sax-item-update', fnUpdItm).on('dblclick', fnUpdItm);
|
||||
$mnu.append(op.getItemMenuOption(sax.lbl.images, function () { op.updateItemImages(item, $item) }, 'sax-image'));
|
||||
$mnu.append(op.getItemMenuOption(sax.lbl.location, function () { op.updateItemAddress(item, $item) }, 'sax-location'));
|
||||
}
|
||||
$('.sax-burger', $item).toggle(!!$('.sax-dropdown-item', $mnu).length);
|
||||
$('.sax-panel-messages', $pnl.results).hide().empty();
|
||||
@@ -101,6 +101,16 @@
|
||||
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
op.onClickMemberCount = function (id)
|
||||
{
|
||||
if (!(id * 1)) return;
|
||||
sax.doPleaseWait();
|
||||
let frm = $('#frmOrganisationId');
|
||||
$('.OrganisationId', frm).val(id);
|
||||
frm.prop('action', sax.url.base + 'Organisation/Members').submit();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
op.getFilterSport = function ()
|
||||
{
|
||||
@@ -242,6 +252,7 @@
|
||||
{
|
||||
let frm = $frm.org;
|
||||
$('.OrganisationId,.OrganisationSportId,.OrganisationRegionIdCountry,input[type="text"],textarea,select', frm).val('');
|
||||
$pnl.tblconMths.empty();
|
||||
$('.OrganisationStatus', frm).val(op.data.defaultStatusCode);
|
||||
sax.clearControlErrors();
|
||||
}
|
||||
@@ -289,17 +300,7 @@
|
||||
$pnl.tblconMths.append(op.getConMthEl(conMth.method, conMth.methodCaption, conMth.value));
|
||||
}
|
||||
op.sortConMths();
|
||||
// Address.
|
||||
let address = item.address || {};
|
||||
$('input.OrganisationAddressId', $frm.org).val(address.id);
|
||||
$('input.OrganisationAddressLine1', $frm.org).val(address.line1);
|
||||
$('input.OrganisationAddressLine2', $frm.org).val(address.line2);
|
||||
$('input.OrganisationAddressLine3', $frm.org).val(address.line3);
|
||||
$('input.OrganisationAddressTown', $frm.org).val(address.town);
|
||||
$('input.OrganisationAddressProvince', $frm.org).val(address.province);
|
||||
$('input.OrganisationAddressCountry', $frm.org).val(address.country);
|
||||
$('input.OrganisationAddressPostalCode', $frm.org).val(address.postalCode);
|
||||
sax.clearControlErrors();
|
||||
sax.clearControlErrors(frm);
|
||||
$dlg.organisation.dialog('option', 'title', sax.dlg.title.updateOrganisation);
|
||||
sax.openOrgDialog();
|
||||
}
|
||||
@@ -312,7 +313,7 @@
|
||||
}
|
||||
op.getUsedMths = function ()
|
||||
{
|
||||
return $('input[name="Organisation.ContactMethod"]', $frm.org).map(function () { return $(this).val(); }).get();
|
||||
return $('input[name="ContactMethod"]', $frm.org).map(function () { return $(this).val(); }).get();
|
||||
}
|
||||
op.addConMth = function ()
|
||||
{
|
||||
@@ -366,7 +367,7 @@
|
||||
op.onStoreItem = function (response)
|
||||
{
|
||||
//sax.debug('onStoreItem', response);
|
||||
sax.refreshControlValues(response.controlValues);
|
||||
sax.refreshControlValues(response.controlValues, $frm.org);
|
||||
if (!response.success) return;
|
||||
$dlg.organisation.dialog('close');
|
||||
op.refreshItem(response.organisation);
|
||||
@@ -437,13 +438,53 @@
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
op.onClickMemberCount = function (id)
|
||||
op.updateItemImages = function (item, $item)
|
||||
{
|
||||
if (!(id * 1)) return;
|
||||
sax.doPleaseWait();
|
||||
let frm = $('#frmOrganisationId');
|
||||
$('.OrganisationId', frm).val(id);
|
||||
frm.prop('action', sax.url.base + 'Organisation/Members').submit();
|
||||
sax.debug('updateItemImages');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
op.updateItemAddress = function (item, $item)
|
||||
{
|
||||
sax.debug('updateItemAddress');
|
||||
$('.OrganisationId', $frm.orgId).val(item.id);
|
||||
op.ajax.updateItemAddr = op.ajax.updateItemAddr || { url: sax.url.base + 'Organisation/Ajax/GetItem', formId: 'frmOrganisationId', callbackFn: op.onUpdateItemAddress };
|
||||
sax.doAjaxRequest(op.ajax.updateItemAddr, 50);
|
||||
}
|
||||
op.onUpdateItemAddress = function (response)
|
||||
{
|
||||
sax.debug('onUpdateItemAddress', response);
|
||||
if (!response.success) return;
|
||||
// Address.
|
||||
let item = response.organisation;
|
||||
let address = item.address || {};
|
||||
let frm = $frm.orgAddr;
|
||||
$('input.OrganisationId', frm).val(item.id);
|
||||
$('.OrganisationName', frm).val(item.name);
|
||||
$('input.AddressId', frm).val(address.id);
|
||||
$('input.AddressLine1', frm).val(address.line1);
|
||||
$('input.AddressLine2', frm).val(address.line2);
|
||||
$('input.AddressLine3', frm).val(address.line3);
|
||||
$('input.AddressTown', frm).val(address.town);
|
||||
$('input.AddressProvince', frm).val(address.province);
|
||||
$('input.AddressCountry', frm).val(address.country);
|
||||
$('input.AddressPostalCode', frm).val(address.postalCode);
|
||||
sax.clearControlErrors(frm);
|
||||
sax.openDialog($dlg.orgAddr, 640, 480);
|
||||
}
|
||||
op.storeItemAddress = function ()
|
||||
{
|
||||
sax.debug('storeItemAddress');
|
||||
op.ajax.storeItemAddr = op.ajax.storeItemAddr || { url: sax.url.base + 'Organisation/Ajax/StoreItem', formId: 'frmOrganisationAddress', callbackFn: op.onStoreItemAddress };
|
||||
sax.doAjaxRequest(op.ajax.storeItemAddr, 50);
|
||||
}
|
||||
op.onStoreItemAddress = function (response)
|
||||
{
|
||||
sax.debug('onStoreItemAddress', response);
|
||||
sax.refreshControlValues(response.controlValues, $frm.orgAddr);
|
||||
if (!response.success) return;
|
||||
$dlg.orgAddr.dialog('close');
|
||||
op.refreshItem(response.organisation);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
@@ -459,13 +500,15 @@
|
||||
$frm.filter.on('dblclick', '.FilterOrganisationSportCaption', op.selectFilterSport).on('click', '.FilterSportSelect', op.selectFilterSport).on('click', '.FilterSportClear', op.clearFilterSport);
|
||||
$frm.filter.on('dblclick', '.FilterOrganisationRegionCaption', op.selectFilterRegion).on('click', '.FilterRegionSelect', op.selectFilterRegion).on('click', '.FilterRegionClear', op.clearFilterRegion);
|
||||
|
||||
$frm.orgId = $('#frmOrganisationId');
|
||||
|
||||
// Organisation dialog and form.
|
||||
var opt = sax.dlgOpts();
|
||||
opt.open = sax.onOpenOrgDialog;
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { op.storeItem(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||
$dlg.organisation = $('#dlgOrganisation').dialog(opt);
|
||||
|
||||
$frm.orgId = $('#frmOrganisationId');
|
||||
$frm.org = $('#frmOrganisation');
|
||||
$frm.org.on('input', '.sax-input, .sax-textarea', function () { sax.clearControlError(this); }).on('change', '.sax-select', function () { sax.clearControlError(this); });
|
||||
$frm.org.on('dblclick', '.OrganisationSportCaption', op.selectOrgSport).on('click', '#pbSelectSport', op.selectOrgSport).on('click', '.OrganisationSportClear', op.clearOrgSport);
|
||||
@@ -474,11 +517,21 @@
|
||||
$pnl.conMths = $('.ItemContactMethods', $frm.org);
|
||||
$pnl.tblconMths = $('table.sax-data', $pnl.conMths);
|
||||
|
||||
// Activate Organisation dialog.
|
||||
var opt = sax.dlgOpts();
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { op.activateOrganisation(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||
$dlg.activate = $('#dlgOrganisationActivation').dialog(opt);
|
||||
|
||||
// Activate Organisation Address dialog and form.
|
||||
var opt = sax.dlgOpts();
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { op.storeItemAddress(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||
$dlg.orgAddr = $('#dlgOrganisationAddress').dialog(opt);
|
||||
|
||||
$frm.orgAddr = $('#frmOrganisationAddress');
|
||||
$frm.orgAddr.on('input', '.sax-input, .sax-textarea', function () { sax.clearControlError(this); }).on('change', '.sax-select', function () { sax.clearControlError(this); });
|
||||
|
||||
setTimeout(op.refreshResults, 250);
|
||||
});
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
{
|
||||
//sax.debug('doRefreshResults', response);
|
||||
delete sax.awaitingRefreshResponse;
|
||||
sax.refreshControlValues(response.controlValues);
|
||||
var $results = $('.sax-panel-results');
|
||||
var $msgs = $('.sax-panel-messages', $results).hide().empty();
|
||||
var $items = $('.sax-panel-item-list', $results).hide().empty();
|
||||
|
||||
@@ -486,7 +486,7 @@
|
||||
<data name="label.position" xml:space="preserve">
|
||||
<value>Position</value>
|
||||
</data>
|
||||
<data name="label.postalCode" xml:space="preserve">
|
||||
<data name="label.postal.code" xml:space="preserve">
|
||||
<value>Postal code</value>
|
||||
</data>
|
||||
<data name="label.previous" xml:space="preserve">
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
data.ContactMethods.Add(new AjaxResponse_Data.ContactMethodData() { Method = method.ToString(), MethodCaption = Localiser.GetContactMethodCaption(method), Value = contactData.GetContactMethodValue(method) });
|
||||
}
|
||||
// Address.
|
||||
if (address != null)
|
||||
if (address != null && !address.IsStatusDeleted)
|
||||
{
|
||||
data.Address = new AjaxResponse_Data.AddressData();
|
||||
data.Address.Id = model.EncryptId(address.Id);
|
||||
@@ -384,7 +384,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
organisationAddress = ItemDataMgr.CreateItemAddress(organisation.GetItemId(), SaxItemAddress.DefaultOrganisationAddressType);
|
||||
disposableItems.Add(organisationAddress);
|
||||
}
|
||||
else
|
||||
else if (!organisationAddress.IsStatusDeleted)
|
||||
{
|
||||
SaLogger.Warn(fn + " Organisation Address Id not supplied but no address found for Organisation. Id: " + organisationAddress.Id + ". " + GetLogSuffix());
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
@@ -450,51 +450,71 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
}
|
||||
|
||||
// Store address.
|
||||
if (model.Organisation.Address.Line1 != null)
|
||||
organisationAddress.Line1 = model.Organisation.Address.Line1;
|
||||
if (model.Organisation.Address.Line2 != null)
|
||||
organisationAddress.Line2 = model.Organisation.Address.Line2;
|
||||
if (model.Organisation.Address.Line3 != null)
|
||||
organisationAddress.Line3 = model.Organisation.Address.Line3;
|
||||
if (model.Organisation.Address.Town != null)
|
||||
organisationAddress.Town = model.Organisation.Address.Town;
|
||||
if (regionProvince != null)
|
||||
if (model.Organisation.Address.IsSpecified())
|
||||
{
|
||||
organisationAddress.Province = regionProvince.Name;
|
||||
organisationAddress.RegionIdProvince = regionProvince.Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (model.Organisation.Address.Province != null)
|
||||
organisationAddress.Province = model.Organisation.Address.Province;
|
||||
}
|
||||
if (regionCountry != null)
|
||||
{
|
||||
organisationAddress.Country = regionCountry.Name;
|
||||
organisationAddress.RegionIdCountry = regionCountry.Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (model.Organisation.Address.Country != null)
|
||||
organisationAddress.Country = model.Organisation.Address.Country;
|
||||
}
|
||||
organisationAddress.PostalCode = model.Organisation.Address.PostalCode;
|
||||
if (!SysId.IsValid(organisationAddress.Id))
|
||||
{
|
||||
// Create new address.
|
||||
if (!ItemDataMgr.InsertItemAddress(organisationAddress, DbUpdateInfo))
|
||||
// The form includes address fields.
|
||||
if (model.Organisation.Address.IsPopulated())
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to insert organisation address - " + ItemDataMgr.ErrorStateMessage);
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
// At least one address field has been populated.
|
||||
if (model.Organisation.Address.Line1 != null)
|
||||
organisationAddress.Line1 = model.Organisation.Address.Line1;
|
||||
if (model.Organisation.Address.Line2 != null)
|
||||
organisationAddress.Line2 = model.Organisation.Address.Line2;
|
||||
if (model.Organisation.Address.Line3 != null)
|
||||
organisationAddress.Line3 = model.Organisation.Address.Line3;
|
||||
if (model.Organisation.Address.Town != null)
|
||||
organisationAddress.Town = model.Organisation.Address.Town;
|
||||
if (regionProvince != null)
|
||||
{
|
||||
organisationAddress.Province = regionProvince.Name;
|
||||
organisationAddress.RegionIdProvince = regionProvince.Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (model.Organisation.Address.Province != null)
|
||||
organisationAddress.Province = model.Organisation.Address.Province;
|
||||
}
|
||||
if (regionCountry != null)
|
||||
{
|
||||
organisationAddress.Country = regionCountry.Name;
|
||||
organisationAddress.RegionIdCountry = regionCountry.Id;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (model.Organisation.Address.Country != null)
|
||||
organisationAddress.Country = model.Organisation.Address.Country;
|
||||
}
|
||||
organisationAddress.PostalCode = model.Organisation.Address.PostalCode;
|
||||
organisationAddress.Status = SaxItemAddress.DefaultStatus;
|
||||
|
||||
// Store address.
|
||||
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"]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Update existing address.
|
||||
if (!ItemDataMgr.UpdateItemAddress(organisationAddress, DbUpdateInfo))
|
||||
else
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to update organisation address - " + ItemDataMgr.ErrorStateMessage);
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
// Address not specified - delete it.
|
||||
if (!ItemDataMgr.DeleteItemAddress(organisationAddress, DbUpdateInfo))
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to delete organisation address - " + ItemDataMgr.ErrorStateMessage);
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,13 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
/// <summary>Have any address values been populated on the form.</summary>
|
||||
public bool IsPopulated()
|
||||
{
|
||||
if (SysId.IsValid(Id.ToSysId()) || !StringUtil.IsEmpty(Line1) || !StringUtil.IsEmpty(Town) || !StringUtil.IsEmpty(Province) || !StringUtil.IsEmpty(Country) || !StringUtil.IsEmpty(PostalCode))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validation.
|
||||
@@ -58,6 +65,8 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
// Address.
|
||||
public bool ValidateAddressData(SaxController_Base.AjaxResponse_Data responseData)
|
||||
{
|
||||
// Are any properties populated.
|
||||
bool populated = IsPopulated();
|
||||
|
||||
// Address Line 1 - optional.
|
||||
if (Line1 != null)
|
||||
@@ -89,11 +98,11 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
}
|
||||
}
|
||||
|
||||
// Address Town - mandatory.
|
||||
// Address Town - mandatory if any value populated.
|
||||
if (Town != null)
|
||||
{
|
||||
responseData.SetControlValue(ControlNameSuffix + "Town", Town);
|
||||
if (StringUtil.IsEmpty(Town))
|
||||
if (StringUtil.IsEmpty(Town) && populated)
|
||||
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)]);
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
@* Action buttons *@
|
||||
<div class="spacer2"></div>
|
||||
<div class="row">
|
||||
<div class="col-6 text-right"><button type="button" class="sax-button" value="" onclick="sax.closeProfileSportExperience();">@Localiser["label.close"]</button></div>
|
||||
<div class="col text-right pr12"><button type="button" class="sax-button" value="" onclick="sax.closeProfileSportExperience();">@Localiser["label.close"]</button></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
@* Organisation controls - Address *@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/OrganisationControls-Address")) return;
|
||||
@* NB Organisation address controls may be present more than once on a page, eg. Profile Organisation. *@
|
||||
|
||||
@* Organisation address - Line 1 *@
|
||||
<div class="sax-form-control OrganisationAddressLine1">
|
||||
@@ -52,7 +51,7 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="sax-label">
|
||||
<label for=""><span>@Localiser["label.town"]</span><span class="required"> *</span></label>
|
||||
<label for=""><span>@Localiser["label.town"]</span><span class="required"> (*)</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
@@ -86,7 +85,7 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="sax-label">
|
||||
<label for=""><span>@Localiser["label.postalCode"]</span></label>
|
||||
<label for=""><span>@Localiser["label.postal.code"]</span></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
@* Organisation controls - Contact *@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
@* NB Organisation contact controls may be present more than once on a page, eg. Profile Organisation. *@
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/OrganisationControls-Contact")) return;
|
||||
<style>
|
||||
.OrganisationContactMethods .ContactMethods
|
||||
{
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
@* Organisation controls - Core *@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@if (!Model.RegisterView("Views/Common/OrganisationControls-Core")) return;
|
||||
@* NB Core Organisation controls may be present more than once on a page, eg. Profile Organisation. *@
|
||||
|
||||
@* Organisation name *@
|
||||
<div class="sax-form-control OrganisationName">
|
||||
|
||||
@@ -154,6 +154,21 @@
|
||||
background-image: url('../img/action/users24.png');
|
||||
}
|
||||
|
||||
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-mail
|
||||
{
|
||||
background-image: url('../img/action/mail24.png');
|
||||
}
|
||||
|
||||
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-location
|
||||
{
|
||||
background-image: url('../img/action/location-24.png');
|
||||
}
|
||||
|
||||
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-image
|
||||
{
|
||||
background-image: url('../img/action/image-24.png');
|
||||
}
|
||||
|
||||
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-process
|
||||
{
|
||||
background-image: url('../img/action/process24.png');
|
||||
|
||||
|
After Width: | Height: | Size: 542 B |
|
After Width: | Height: | Size: 794 B |
|
After Width: | Height: | Size: 1001 B |
|
After Width: | Height: | Size: 811 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -420,17 +420,14 @@
|
||||
{
|
||||
var $frmCtrls = $('.sax-form-control', $(context || doc.body)).removeClass('sax-error');
|
||||
sax.clearControlErrors(context);
|
||||
var values = (controlValues || []);
|
||||
var valuesLen = values.length;
|
||||
for (var valIdx = 0; valIdx < valuesLen; valIdx++)
|
||||
for (let ctrlValue of controlValues || [])
|
||||
{
|
||||
let ctrlValue = values[valIdx];
|
||||
$frmCtrls.each(function (idx, frmCtrl)
|
||||
{
|
||||
var $frmCtrl = $(frmCtrl);
|
||||
if (!$frmCtrl.hasClass(ctrlValue.controlName)) return;
|
||||
var $ctrl = $('input,textarea,select', $frmCtrl);
|
||||
if ($ctrl.length && $ctrl.prop('name') == ctrlValue.controlName && ctrlValue.value)
|
||||
var $ctrl = $('sax-input,sax-textarea,sax-select', $frmCtrl);
|
||||
if ($ctrl.length && sax.isDef(ctrlValue.value))
|
||||
$ctrl.val(ctrlValue.value);
|
||||
if (ctrlValue.error)
|
||||
$frmCtrl.addClass('sax-error').find('.sax-message').text(ctrlValue.error);
|
||||
|
||||
@@ -133,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, 640, 800);
|
||||
sax.openDialog($dlg.org, 720, 840);
|
||||
}
|
||||
po.storeOrganisation = function ()
|
||||
{
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
{
|
||||
let frm = se.$frm.sportExp;
|
||||
$('.sax-input,.sax-textarea,.sax-select,.UserSportExperienceId,.UserSportExperienceExists', frm).val('').prop('autofocus', null);
|
||||
sax.clearControlErrors(frm);
|
||||
}
|
||||
se.fn.updateSportExperience = function (item, $item)
|
||||
{
|
||||
|
||||
@@ -57,11 +57,15 @@
|
||||
ps.addProfileSport = function ()
|
||||
{
|
||||
//sax.debug('addProfileSport');
|
||||
ps.clearProfileSport();
|
||||
sax.openDialog($dlg.proSpt.dialog('option', 'title', sax.dlg.title.addUserSport), 640, 480);
|
||||
}
|
||||
ps.clearProfileSport = function ()
|
||||
{
|
||||
let dlg = $dlg.proSpt;
|
||||
$('.UserSportId,.ProfileSportExists,#ifProfileSportId,input.sax-input,textarea.sax-textarea,select.sax-select', dlg).val('');
|
||||
$('.SelectSport', dlg).show();
|
||||
dlg.dialog('option', 'title', sax.dlg.title.addUserSport);
|
||||
sax.openDialog(dlg, 640, 480);
|
||||
sax.clearControlErrors(dlg);
|
||||
}
|
||||
ps.updateProfileSport = function (item)
|
||||
{
|
||||
@@ -73,6 +77,7 @@
|
||||
ps.doUpdateProfileSport = function (response)
|
||||
{
|
||||
//sax.debug('doUpdateProfileSport', response);
|
||||
ps.clearProfileSport();
|
||||
let dlg = $dlg.proSpt;
|
||||
let item = response.sport;
|
||||
$('.UserSportId', dlg).val(item.id);
|
||||
@@ -83,8 +88,7 @@
|
||||
$('#cbProfileSportParticipation', dlg).val(item.sportParticipationCode);
|
||||
$('#cbProfileSportOfficiating', dlg).val(item.sportOfficiatingCode);
|
||||
$('.SelectSport', dlg).hide();
|
||||
dlg.dialog('option', 'title', sax.dlg.title.updateUserSport);
|
||||
sax.openDialog(dlg, 640, 480);
|
||||
sax.openDialog(dlg.dialog('option', 'title', sax.dlg.title.updateUserSport), 640, 480);
|
||||
}
|
||||
sax.selectUserSport = function (sport)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
public static class Version
|
||||
{
|
||||
private static String version { get; } = "1.2.6.2";
|
||||
private static String version { get; } = "1.2.6.3";
|
||||
// Retrieve version.
|
||||
public static String GetFullVersion () { return version; }
|
||||
public static String GetAppVersion ()
|
||||
@@ -43,7 +43,8 @@ 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.
|
||||
// - Online profile and search organisation contact methods.
|
||||
// - Admin organisation address.
|
||||
// 1.2.5 20-Apr-2022 Article feedback
|
||||
// - Online Activity/Article feedback 5 stars, summary on Article list/popup.
|
||||
// - Online Activity filter.
|
||||
|
||||
@@ -72,6 +72,9 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
{
|
||||
ClearErrorState();
|
||||
|
||||
// Some mandatory properties become optional if the address is deleted.
|
||||
bool deleted = data.IsStatusDeleted;
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Item Id.
|
||||
if (errField.ItemId != SacsHierarchyItem.ValidValue.Ignore && !ItemId.IsValid(data.ItemId))
|
||||
@@ -100,7 +103,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
errField.Line3 = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
}
|
||||
if (errField.Town != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Town, "town", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town), true))
|
||||
if (errField.Town != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Town, "town", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town), !deleted))
|
||||
{
|
||||
errField.Town = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
@@ -119,7 +122,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
errField.RegionIdCountry = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return SetErrorState("Country region must be specified");
|
||||
}
|
||||
if (errField.Country != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Country, "country", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAddress_Country), true))
|
||||
if (errField.Country != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Country, "country", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAddress_Country), !deleted))
|
||||
{
|
||||
errField.Country = SacsHierarchyItem.ValidValue.Invalid;
|
||||
return false;
|
||||
@@ -176,7 +179,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Associated data.
|
||||
if (data.Status != SaStatus.Deleted)
|
||||
if (!data.IsStatusDeleted)
|
||||
{
|
||||
// Item must exists.
|
||||
if (errField.ItemId != SacsHierarchyItem.ValidValue.Ignore && ItemId.IsValid(data.ItemId))
|
||||
|
||||
@@ -226,6 +226,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
dbItemAddress._RegionIdProvince = SysId.ToInt(itemAddress.RegionIdProvince);
|
||||
dbItemAddress._Country = StringUtil.EmptyOnNull(itemAddress.Country);
|
||||
dbItemAddress._RegionIdCountry = SysId.ToInt(itemAddress.RegionIdCountry);
|
||||
dbItemAddress._PostalCode = StringUtil.EmptyOnNull(itemAddress.PostalCode);
|
||||
// Location.
|
||||
dbItemAddress._LocationSource = StringUtil.EmptyOnNull(itemAddress.LocationSource);
|
||||
dbItemAddress._LocationStoredAt = itemAddress.LocationStoredAt;
|
||||
@@ -263,6 +264,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
||||
itemAddress.RegionIdProvince = new SysId(dbItemAddress._RegionIdProvince);
|
||||
itemAddress.Country = dbItemAddress._Country;
|
||||
itemAddress.RegionIdCountry = new SysId(dbItemAddress._RegionIdCountry);
|
||||
itemAddress.PostalCode= dbItemAddress._PostalCode;
|
||||
// Location.
|
||||
itemAddress.LocationSource = dbItemAddress._LocationSource;
|
||||
itemAddress.LocationStoredAt = dbItemAddress._LocationStoredAt;
|
||||
|
||||