1.2.11.12 Online Events
This commit is contained in:
@@ -31,7 +31,7 @@ namespace Saxonite.Net.Core.Web.Admin.App
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Data members.
|
||||
private bool generateDatabaseDefinitions = false;
|
||||
private bool generateDatabaseDefinitions = true;
|
||||
private bool populateRegions = false;
|
||||
private Dictionary<String, SaxAppConfig> appConfigs = new Dictionary<string, SaxAppConfig>();
|
||||
private Dictionary<String, SaxEmailConfig> emailConfigs = new Dictionary<string, SaxEmailConfig>();
|
||||
|
||||
+17
-7
@@ -19,7 +19,7 @@ using System.Threading.Tasks;
|
||||
namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
{
|
||||
//=======================================================================
|
||||
// Controller: Organisation Images - Ajax
|
||||
// Controller: Organisation - Ajax - Images
|
||||
//=======================================================================
|
||||
partial class OrganisationController
|
||||
{
|
||||
@@ -156,18 +156,28 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
imageData = fileStream.ToArray();
|
||||
}
|
||||
|
||||
// Validate content type.
|
||||
if (StringUtil.IsEmpty(file.ContentType) || !SaxItemImage.GetValidContentTypes(Sax.DataItemType.Organisation).ContainsCI(file.ContentType))
|
||||
return Json(responseData.SetControlError("OrganisationLogoImage", Localiser["msg.upload.image.invalid.content.type"]));
|
||||
Sarand.Net.Standard.Base.Core.Sacs.MimeType mimeTypeExpected = SacsContentTypeHelper.GetMimeTypeFromContentType(file.ContentType);
|
||||
|
||||
// Validate the image.
|
||||
ImageUtils.ImageConfig imageConfig = ImageUtils.VerifyImageData(imageData);
|
||||
ImageUtils.ImageConfig imageConfig = null;
|
||||
if (mimeTypeExpected == Sarand.Net.Standard.Base.Core.Sacs.MimeType.Svg)
|
||||
imageConfig = ImageUtils.VerifySvgImageData(imageData);
|
||||
else
|
||||
imageConfig = ImageUtils.VerifyImageData(imageData);
|
||||
if (!imageConfig.ValidImage)
|
||||
return Json(responseData.SetControlError("OrganisationLogoImage", Localiser["msg.upload.image.invalid"]));
|
||||
|
||||
// Validate mime type.
|
||||
if (!SaxItemImage.GetValidMimeTypes(Sax.DataItemType.UserAccount).Contains(imageConfig.MimeType))
|
||||
if (!SaxItemImage.GetValidMimeTypes(Sax.DataItemType.Organisation).Contains(imageConfig.MimeType))
|
||||
return Json(responseData.SetControlError("OrganisationLogoImage", Localiser["msg.upload.image.invalid.mime"]));
|
||||
|
||||
// Validate content type.
|
||||
if (StringUtil.IsEmpty(file.ContentType) || !SaxItemImage.GetValidContentTypes(Sax.DataItemType.UserAccount).ContainsCI(file.ContentType))
|
||||
return Json(responseData.SetControlError("OrganisationLogoImage", Localiser["msg.upload.image.invalid.content.type"]));
|
||||
if (imageConfig.MimeType != mimeTypeExpected)
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} Image upload - inconsistent Mime. Filename: {file.FileName}. Mime: {imageConfig.MimeType}. Expected Mime: {mimeTypeExpected}.");
|
||||
return Json(responseData.SetControlError("OrganisationLogoImage", Localiser["msg.upload.image.invalid"]));
|
||||
}
|
||||
|
||||
// Resize the image if required.
|
||||
if (!ImageUtils.ConstrainImage(imageConfig, Sax.Config.Organisation.Logo.WidthMax, Sax.Config.Organisation.Logo.HeightMax))
|
||||
@@ -0,0 +1,46 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Saxonite.Net.Core.Web.Admin.Models.Reference;
|
||||
using Saxonite.Net.Core.Web.Base.App;
|
||||
using Saxonite.Net.Core.Web.Base.Controllers;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
||||
{
|
||||
//=======================================================================
|
||||
public partial class ReferenceBaseballController : SaxController_Admin
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public ReferenceBaseballController(SaxLocaliser localiser, ILogger<HomeController> logger) :
|
||||
base(localiser, logger)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
[HttpGet]
|
||||
[Route("Reference/Baseball")]
|
||||
public IActionResult Index()
|
||||
{
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
AutoLoginUser();
|
||||
if (!ValidUserSession)
|
||||
return RedirectToAction("", "");
|
||||
|
||||
// Paging.
|
||||
Model_ReferenceBaseball model = new Model_ReferenceBaseball(Localiser);
|
||||
//model.Paging.PageNo = 1;
|
||||
//model.Paging.PageLength = 12;
|
||||
|
||||
return View("/Views/Reference/Baseball/Index.cshtml",model);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
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 Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Core.Web.Admin.Models;
|
||||
using Saxonite.Net.Core.Web.Admin.Models.Reference;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using Saxonite.Net.Standard.Base.Bus;
|
||||
using Saxonite.Net.Standard.Base.Bus.Reference;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
||||
{
|
||||
//=======================================================================
|
||||
// Reference Baseball Controller - Ajax requests - Stats.
|
||||
//=======================================================================
|
||||
partial class ReferenceBaseballController
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Get Stats ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_ReferenceBaseballStats : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_ReferenceBaseballStats(SaxModel_Admin model) : base(model) { }
|
||||
// Statistics.
|
||||
public List<StatsGroupData> Groups { get; } = new List<StatsGroupData>();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Reference/Baseball/Ajax/GetStats")]
|
||||
[Route("Reference/Baseball/Ajax/Stats")]
|
||||
public IActionResult Ajax_GetUsgaStats(Model_ReferenceBaseball model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetUsgaStats";
|
||||
String messageTitle = Localiser["caption.reference.baseball"];
|
||||
AjaxResponse_ReferenceBaseballStats responseData = new AjaxResponse_ReferenceBaseballStats(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
return GetAjaxResult_InvalidSession(responseData);
|
||||
|
||||
// Statistics.
|
||||
responseData.Groups.Add(PopulateCoreStatsData(model));
|
||||
|
||||
// Complete response.
|
||||
responseData.Success = true;
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private AjaxResponse_Data.StatsGroupData PopulateCoreStatsData(Model_ReferenceBaseball model)
|
||||
{
|
||||
AjaxResponse_Data.StatsGroupData group = new AjaxResponse_Data.StatsGroupData() { Caption = "Core" };
|
||||
|
||||
// Sports.
|
||||
List<SaxSport.Data> sports = GetSportsByName("Baseball", true);
|
||||
|
||||
// Organisations.
|
||||
SaxOrganisation.Params prmOrganisation = new SaxOrganisation.Params();
|
||||
prmOrganisation.SportIdsIncluded.AddIds(sports.Select(item => item.Id));
|
||||
prmOrganisation.StatusCat = SaxOrganisation.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Active Organisations", Value = AccountMgr.GetOrganisationCount(prmOrganisation).ToString() });
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
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 Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Core.Web.Admin.Consoles;
|
||||
using Saxonite.Net.Core.Web.Admin.Models;
|
||||
using Saxonite.Net.Core.Web.Admin.Models.Reference;
|
||||
using Saxonite.Net.Core.Web.Admin.Procs;
|
||||
using Saxonite.Net.Core.Web.Base.Procs;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using Saxonite.Net.Standard.Base.Bus;
|
||||
using Saxonite.Net.Standard.Base.Bus.Reference;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
||||
{
|
||||
//=======================================================================
|
||||
// Reference Baseball Controller - Ajax requests.
|
||||
//=======================================================================
|
||||
partial class ReferenceBaseballController
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+49
-59
@@ -16,10 +16,10 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
||||
{
|
||||
//=======================================================================
|
||||
// Reference Golf Controller - Ajax requests.
|
||||
//=======================================================================
|
||||
partial class ReferenceGolfController
|
||||
//=======================================================================
|
||||
// Reference Golf Controller - Ajax requests - Stats.
|
||||
//=======================================================================
|
||||
partial class ReferenceGolfController
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Get Stats ajax request.
|
||||
@@ -29,17 +29,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
||||
// Construction.
|
||||
public AjaxResponse_ReferenceGolfStats(SaxModel_Admin model) : base(model) { }
|
||||
// Statistics.
|
||||
public class StatData : AjaxResponse_Base
|
||||
{
|
||||
public String Caption { get; set; }
|
||||
public String Value { get; set; }
|
||||
}
|
||||
public class StatGroupData : AjaxResponse_Base
|
||||
{
|
||||
public String Caption { get; set; }
|
||||
public List<StatData> Stats { get; } = new List<StatData>();
|
||||
}
|
||||
public List<StatGroupData> Groups { get; } = new List<StatGroupData>();
|
||||
public List<StatsGroupData> Groups { get; } = new List<StatsGroupData>();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
@@ -69,237 +59,237 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private AjaxResponse_ReferenceGolfStats.StatGroupData PopulateCountryStatsData()
|
||||
private AjaxResponse_Data.StatsGroupData PopulateCountryStatsData()
|
||||
{
|
||||
AjaxResponse_ReferenceGolfStats.StatGroupData group = new AjaxResponse_ReferenceGolfStats.StatGroupData() { Caption = "Countries" };
|
||||
AjaxResponse_Data.StatsGroupData group = new AjaxResponse_Data.StatsGroupData() { Caption = "Countries" };
|
||||
|
||||
// All countries.
|
||||
SaxGolfUsgaCountry.Params prmCountry = new SaxGolfUsgaCountry.Params();
|
||||
prmCountry.StatusCat = SaxGolfUsgaCountry.StatusCat.Any;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Total", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Total", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
|
||||
// Active countries.
|
||||
prmCountry = new SaxGolfUsgaCountry.Params();
|
||||
prmCountry.StatusCat = SaxGolfUsgaCountry.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Active", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Active", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
|
||||
// Inctive countries.
|
||||
prmCountry = new SaxGolfUsgaCountry.Params();
|
||||
prmCountry.StatusCat = SaxGolfUsgaCountry.StatusCat.InactiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Inactive", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Inactive", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
|
||||
// Deleted countries.
|
||||
prmCountry = new SaxGolfUsgaCountry.Params();
|
||||
prmCountry.StatusCat = SaxGolfUsgaCountry.StatusCat.DeletedOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Deleted", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Deleted", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
|
||||
// Priority countries without provinces.
|
||||
prmCountry = new SaxGolfUsgaCountry.Params();
|
||||
prmCountry.PriorityFlagState = SacsHierarchyItem.Params.FlagState.True;
|
||||
prmCountry.HasProvinces = SacsHierarchyItem.Params.BoolState.False;
|
||||
prmCountry.StatusCat = SaxGolfUsgaCountry.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Priority no provinces", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Priority no provinces", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
|
||||
// Non-Priority countries without provinces.
|
||||
prmCountry = new SaxGolfUsgaCountry.Params();
|
||||
prmCountry.PriorityFlagState = SacsHierarchyItem.Params.FlagState.False;
|
||||
prmCountry.HasProvinces = SacsHierarchyItem.Params.BoolState.False;
|
||||
prmCountry.StatusCat = SaxGolfUsgaCountry.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Non-priority no provinces", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Non-priority no provinces", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
|
||||
// Priority countries with provinces.
|
||||
prmCountry = new SaxGolfUsgaCountry.Params();
|
||||
prmCountry.PriorityFlagState = SacsHierarchyItem.Params.FlagState.True;
|
||||
prmCountry.HasProvinces = SacsHierarchyItem.Params.BoolState.True;
|
||||
prmCountry.StatusCat = SaxGolfUsgaCountry.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Priority with provinces", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Priority with provinces", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
|
||||
// Non-Priority countries with provinces.
|
||||
prmCountry = new SaxGolfUsgaCountry.Params();
|
||||
prmCountry.PriorityFlagState = SacsHierarchyItem.Params.FlagState.False;
|
||||
prmCountry.HasProvinces = SacsHierarchyItem.Params.BoolState.True;
|
||||
prmCountry.StatusCat = SaxGolfUsgaCountry.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Non-priority with provinces", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Non-priority with provinces", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private AjaxResponse_ReferenceGolfStats.StatGroupData PopulateProvinceStatsData()
|
||||
private AjaxResponse_Data.StatsGroupData PopulateProvinceStatsData()
|
||||
{
|
||||
AjaxResponse_ReferenceGolfStats.StatGroupData group = new AjaxResponse_ReferenceGolfStats.StatGroupData() { Caption = "Provinces" };
|
||||
AjaxResponse_Data.StatsGroupData group = new AjaxResponse_Data.StatsGroupData() { Caption = "Provinces" };
|
||||
|
||||
// All provinces.
|
||||
SaxGolfUsgaProvince.Params prmProvince = new SaxGolfUsgaProvince.Params();
|
||||
prmProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.Any;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Total", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Total", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
|
||||
// Active provinces.
|
||||
prmProvince = new SaxGolfUsgaProvince.Params();
|
||||
prmProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Active", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Active", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
|
||||
// Inctive provinces.
|
||||
prmProvince = new SaxGolfUsgaProvince.Params();
|
||||
prmProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.InactiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Inactive", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Inactive", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
|
||||
// Deleted provinces.
|
||||
prmProvince = new SaxGolfUsgaProvince.Params();
|
||||
prmProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.DeletedOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Deleted", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Deleted", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
|
||||
// Priority provinces without facilities.
|
||||
prmProvince = new SaxGolfUsgaProvince.Params();
|
||||
prmProvince.PriorityFlagState = SacsHierarchyItem.Params.FlagState.True;
|
||||
prmProvince.HasFacilities = SacsHierarchyItem.Params.BoolState.False;
|
||||
prmProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Priority no facilities", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Priority no facilities", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
|
||||
// Non-Priority provinces without facilities.
|
||||
prmProvince = new SaxGolfUsgaProvince.Params();
|
||||
prmProvince.PriorityFlagState = SacsHierarchyItem.Params.FlagState.False;
|
||||
prmProvince.HasFacilities = SacsHierarchyItem.Params.BoolState.False;
|
||||
prmProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Non-priority no facilities", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Non-priority no facilities", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
|
||||
// Priority provinces with facilities.
|
||||
prmProvince = new SaxGolfUsgaProvince.Params();
|
||||
prmProvince.PriorityFlagState = SacsHierarchyItem.Params.FlagState.True;
|
||||
prmProvince.HasFacilities = SacsHierarchyItem.Params.BoolState.True;
|
||||
prmProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Priority with facilities", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Priority with facilities", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
|
||||
// Non-Priority provinces with facilities.
|
||||
prmProvince = new SaxGolfUsgaProvince.Params();
|
||||
prmProvince.PriorityFlagState = SacsHierarchyItem.Params.FlagState.False;
|
||||
prmProvince.HasFacilities = SacsHierarchyItem.Params.BoolState.True;
|
||||
prmProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Non-priority with facilities", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Non-priority with facilities", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private AjaxResponse_ReferenceGolfStats.StatGroupData PopulateFacilityStatsData()
|
||||
private AjaxResponse_Data.StatsGroupData PopulateFacilityStatsData()
|
||||
{
|
||||
AjaxResponse_ReferenceGolfStats.StatGroupData group = new AjaxResponse_ReferenceGolfStats.StatGroupData() { Caption = "Facilities" };
|
||||
AjaxResponse_Data.StatsGroupData group = new AjaxResponse_Data.StatsGroupData() { Caption = "Facilities" };
|
||||
|
||||
// All facilities.
|
||||
SaxGolfUsgaFacility.Params prmFacility = new SaxGolfUsgaFacility.Params();
|
||||
prmFacility.StatusCat = SaxGolfUsgaFacility.StatusCat.Any;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Total", Value = ReferenceGolfMgr.GetUsgaFacilityCount(prmFacility).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Total", Value = ReferenceGolfMgr.GetUsgaFacilityCount(prmFacility).ToString() });
|
||||
|
||||
// Active facilities.
|
||||
prmFacility = new SaxGolfUsgaFacility.Params();
|
||||
prmFacility.StatusCat = SaxGolfUsgaFacility.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Active", Value = ReferenceGolfMgr.GetUsgaFacilityCount(prmFacility).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Active", Value = ReferenceGolfMgr.GetUsgaFacilityCount(prmFacility).ToString() });
|
||||
|
||||
// Inctive facilities.
|
||||
prmFacility = new SaxGolfUsgaFacility.Params();
|
||||
prmFacility.StatusCat = SaxGolfUsgaFacility.StatusCat.InactiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Inactive", Value = ReferenceGolfMgr.GetUsgaFacilityCount(prmFacility).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Inactive", Value = ReferenceGolfMgr.GetUsgaFacilityCount(prmFacility).ToString() });
|
||||
|
||||
// Deleted facilities.
|
||||
prmFacility = new SaxGolfUsgaFacility.Params();
|
||||
prmFacility.StatusCat = SaxGolfUsgaFacility.StatusCat.DeletedOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Deleted", Value = ReferenceGolfMgr.GetUsgaFacilityCount(prmFacility).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Deleted", Value = ReferenceGolfMgr.GetUsgaFacilityCount(prmFacility).ToString() });
|
||||
|
||||
// Facilities without courses.
|
||||
prmFacility = new SaxGolfUsgaFacility.Params();
|
||||
prmFacility.HasCourses = SacsHierarchyItem.Params.BoolState.False;
|
||||
prmFacility.StatusCat = SaxGolfUsgaFacility.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "No courses", Value = ReferenceGolfMgr.GetUsgaFacilityCount(prmFacility).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "No courses", Value = ReferenceGolfMgr.GetUsgaFacilityCount(prmFacility).ToString() });
|
||||
|
||||
// Priority facilities with courses.
|
||||
prmFacility = new SaxGolfUsgaFacility.Params();
|
||||
prmFacility.HasCourses = SacsHierarchyItem.Params.BoolState.True;
|
||||
prmFacility.StatusCat = SaxGolfUsgaFacility.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "With courses", Value = ReferenceGolfMgr.GetUsgaFacilityCount(prmFacility).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "With courses", Value = ReferenceGolfMgr.GetUsgaFacilityCount(prmFacility).ToString() });
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private AjaxResponse_ReferenceGolfStats.StatGroupData PopulateCourseStatsData()
|
||||
private AjaxResponse_Data.StatsGroupData PopulateCourseStatsData()
|
||||
{
|
||||
AjaxResponse_ReferenceGolfStats.StatGroupData group = new AjaxResponse_ReferenceGolfStats.StatGroupData() { Caption = "Courses" };
|
||||
AjaxResponse_Data.StatsGroupData group = new AjaxResponse_Data.StatsGroupData() { Caption = "Courses" };
|
||||
|
||||
// All courses.
|
||||
SaxGolfUsgaCourse.Params prmCourse = new SaxGolfUsgaCourse.Params();
|
||||
prmCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.Any;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Total", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Total", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
|
||||
// Active courses.
|
||||
prmCourse = new SaxGolfUsgaCourse.Params();
|
||||
prmCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Active", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Active", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
|
||||
// Inctive courses.
|
||||
prmCourse = new SaxGolfUsgaCourse.Params();
|
||||
prmCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.InactiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Inactive", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Inactive", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
|
||||
// Deleted courses.
|
||||
prmCourse = new SaxGolfUsgaCourse.Params();
|
||||
prmCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.DeletedOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Deleted", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Deleted", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
|
||||
// Priority courses without markers.
|
||||
prmCourse = new SaxGolfUsgaCourse.Params();
|
||||
prmCourse.PriorityFlagState = SacsHierarchyItem.Params.FlagState.True;
|
||||
prmCourse.HasMarkers = SacsHierarchyItem.Params.BoolState.False;
|
||||
prmCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Priority no markers", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Priority no markers", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
|
||||
// Non-Priority courses without markers.
|
||||
prmCourse = new SaxGolfUsgaCourse.Params();
|
||||
prmCourse.PriorityFlagState = SacsHierarchyItem.Params.FlagState.False;
|
||||
prmCourse.HasMarkers = SacsHierarchyItem.Params.BoolState.False;
|
||||
prmCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Non-priority no markers", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Non-priority no markers", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
|
||||
// Priority courses with markers.
|
||||
prmCourse = new SaxGolfUsgaCourse.Params();
|
||||
prmCourse.PriorityFlagState = SacsHierarchyItem.Params.FlagState.True;
|
||||
prmCourse.HasMarkers = SacsHierarchyItem.Params.BoolState.True;
|
||||
prmCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Priority with markers", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Priority with markers", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
|
||||
// Non-Priority courses with markers.
|
||||
prmCourse = new SaxGolfUsgaCourse.Params();
|
||||
prmCourse.PriorityFlagState = SacsHierarchyItem.Params.FlagState.False;
|
||||
prmCourse.HasMarkers = SacsHierarchyItem.Params.BoolState.True;
|
||||
prmCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Non-priority with markers", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Non-priority with markers", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private AjaxResponse_ReferenceGolfStats.StatGroupData PopulateMarkerStatsData()
|
||||
private AjaxResponse_Data.StatsGroupData PopulateMarkerStatsData()
|
||||
{
|
||||
AjaxResponse_ReferenceGolfStats.StatGroupData group = new AjaxResponse_ReferenceGolfStats.StatGroupData() { Caption = "Markers" };
|
||||
AjaxResponse_Data.StatsGroupData group = new AjaxResponse_Data.StatsGroupData() { Caption = "Markers" };
|
||||
|
||||
// All markers.
|
||||
SaxGolfUsgaMarker.Params prmMarker = new SaxGolfUsgaMarker.Params();
|
||||
prmMarker.StatusCat = SaxGolfUsgaMarker.StatusCat.Any;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Total", Value = ReferenceGolfMgr.GetUsgaMarkerCount(prmMarker).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Total", Value = ReferenceGolfMgr.GetUsgaMarkerCount(prmMarker).ToString() });
|
||||
|
||||
// Active markers.
|
||||
prmMarker = new SaxGolfUsgaMarker.Params();
|
||||
prmMarker.StatusCat = SaxGolfUsgaMarker.StatusCat.ActiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Active", Value = ReferenceGolfMgr.GetUsgaMarkerCount(prmMarker).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Active", Value = ReferenceGolfMgr.GetUsgaMarkerCount(prmMarker).ToString() });
|
||||
|
||||
// Inctive markers.
|
||||
prmMarker = new SaxGolfUsgaMarker.Params();
|
||||
prmMarker.StatusCat = SaxGolfUsgaMarker.StatusCat.InactiveOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Inactive", Value = ReferenceGolfMgr.GetUsgaMarkerCount(prmMarker).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Inactive", Value = ReferenceGolfMgr.GetUsgaMarkerCount(prmMarker).ToString() });
|
||||
|
||||
// Deleted markers.
|
||||
prmMarker = new SaxGolfUsgaMarker.Params();
|
||||
prmMarker.StatusCat = SaxGolfUsgaMarker.StatusCat.DeletedOnly;
|
||||
group.Stats.Add(new AjaxResponse_ReferenceGolfStats.StatData() { Caption = "Deleted", Value = ReferenceGolfMgr.GetUsgaMarkerCount(prmMarker).ToString() });
|
||||
group.Stats.Add(new AjaxResponse_Data.StatData() { Caption = "Deleted", Value = ReferenceGolfMgr.GetUsgaMarkerCount(prmMarker).ToString() });
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
@@ -464,7 +464,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
||||
|
||||
// Configure the process.
|
||||
SaxGolfUsgaDataLookup.Config processConfig = new SaxGolfUsgaDataLookup.Config(SessionContext, DbUpdateInfo);
|
||||
processConfig.Tasks.Add(SaxGolfUsgaDataLookup.Task.CleanseCourseCaptions);
|
||||
processConfig.Tasks.Add(SaxGolfUsgaDataLookup.Task.CleanseCourses);
|
||||
SaxGolfUsgaDataLookup process = new SaxGolfUsgaDataLookup(processConfig);
|
||||
|
||||
// Store the process and run.
|
||||
|
||||
@@ -24,6 +24,8 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
private class SportListData : AjaxResponse_Data.ItemData_Base
|
||||
{
|
||||
public String Name { get; set; }
|
||||
public String GroupingCode { get; set; }
|
||||
public String GroupingDesc { get; set; }
|
||||
public String SportIdParent { get; set; }
|
||||
public String SportNameParent { get; set; }
|
||||
public String SpecialityLabelCode { get; set; }
|
||||
@@ -35,6 +37,8 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
private void PopulateSportResponseListData(SaxSport sport, SaxSport parentSport, SportListData data)
|
||||
{
|
||||
data.Id = SysId.ToString(sport.Id);
|
||||
data.GroupingCode = SportGroupingCodes.GetCodeForType(sport.Grouping);
|
||||
data.GroupingDesc = SportGroupingCodes.GetDescForType(sport.Grouping);
|
||||
data.SportNameParent = parentSport?.Name ?? null;
|
||||
data.SportIdParent = parentSport?.Id.ToString() ?? null;
|
||||
data.Name = sport.Name;
|
||||
@@ -88,6 +92,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
|
||||
// Item columns.
|
||||
ColumnDfn colId = ReferenceMgr.GetSportColumnDfn(SaxSport.Column.Id);
|
||||
ColumnDfn colGrouping = ReferenceMgr.GetSportColumnDfn(SaxSport.Column.Grouping);
|
||||
ColumnDfn colParentId = ReferenceMgr.GetSportColumnDfn(SaxSport.Column.SportIdParent);
|
||||
ColumnDfn colParentName = ReferenceMgr.GetSportColumnDfn(SaxSport.Column.ParentSport_Name);
|
||||
ColumnDfn colName = ReferenceMgr.GetSportColumnDfn(SaxSport.Column.Name);
|
||||
@@ -95,7 +100,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
ColumnDfn colStatus = ReferenceMgr.GetSportColumnDfn(SaxSport.Column.Status);
|
||||
List<ColumnDfn> columns = new List<ColumnDfn>()
|
||||
{
|
||||
colId, colParentId, colParentName,
|
||||
colId, colGrouping, colParentId, colParentName,
|
||||
colName, colSpecialityLabel, colStatus
|
||||
};
|
||||
|
||||
@@ -108,10 +113,13 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
while (resultSet != null && resultSet.HasRows && resultSet.NextRecord())
|
||||
{
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
Sax.SportGrouping grouping = (Sax.SportGrouping)values.GetLong(colGrouping.DataName);
|
||||
Sax.SportSpecialityLabel specialityLabel = (Sax.SportSpecialityLabel)values.GetLong(colSpecialityLabel.DataName);
|
||||
SportListData sportData = new SportListData()
|
||||
{
|
||||
Id = values.GetString(colId.DataName),
|
||||
GroupingCode = SportGroupingCodes.GetCodeForType(grouping),
|
||||
GroupingDesc = SportGroupingCodes.GetDescForType(grouping),
|
||||
SportIdParent = values.GetString(colParentId.DataName),
|
||||
SportNameParent = values.GetString(colParentName.DataName),
|
||||
Name = values.GetString(colName.DataName),
|
||||
@@ -229,6 +237,8 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
||||
}
|
||||
|
||||
// Populate item properties.
|
||||
if (model.SportGroupingCode != null)
|
||||
sport.Grouping = model.SportGrouping;
|
||||
if (model.SportIdParent != null)
|
||||
sport.SportIdParent = model.SportIdParent.ToSysId();
|
||||
if (model.SportName != null)
|
||||
|
||||
@@ -37,8 +37,12 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
//-------------------------------------------------------------------
|
||||
// Sport properties.
|
||||
public String SportId { get; set; }
|
||||
public String SportIdParent { get; set; }
|
||||
public String SportName { get; set; }
|
||||
public String SportGroupingCode { get; set; }
|
||||
public Sax.SportGrouping SportGrouping { get { return (Sax.SportGrouping)SportGroupingCodes.GetTypeForCode(SportGroupingCode); } }
|
||||
public String SportIdParent { get; set; }
|
||||
public String SportIdsParents { get; set; }
|
||||
public String SportIdsChildren { get; set; }
|
||||
public String SportSpecialityLabelCode { get; set; }
|
||||
public Sax.SportSpecialityLabel SportSpecialityLabel { get { return (Sax.SportSpecialityLabel)SportSpecialityLabelCodes.GetTypeForCode(SportSpecialityLabelCode); } }
|
||||
public String SportStatusCode { get; set; }
|
||||
@@ -54,6 +58,16 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
||||
{
|
||||
|
||||
// Sport Grouping.
|
||||
if (SportGroupingCode != null)
|
||||
{
|
||||
String controlName = nameof(SportGrouping);
|
||||
if (StringUtil.IsEmpty(SportGroupingCode))
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||
else if (SportGrouping <= 0)
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
// Parent sport.
|
||||
SysId sportIdParent = SportIdParent.ToSysId();
|
||||
if (SportIdParent != null && SysId.IsValid(sportIdParent))
|
||||
@@ -70,11 +84,12 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
// Sport name.
|
||||
if (SportName != null)
|
||||
{
|
||||
responseData.SetControlValue(nameof(SportName), SportName);
|
||||
String controlName = nameof(SportName);
|
||||
responseData.SetControlValue(controlName, SportName);
|
||||
if (StringUtil.IsEmpty(SportName))
|
||||
responseData.SetControlError(nameof(SportName), Localiser["msg.validation.mandatory.value"]);
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||
else if (StringUtil.GetLength(SportName) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Sport_Name))
|
||||
responseData.SetControlError(nameof(SportName), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Sport_Name)]);
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Sport_Name)]);
|
||||
else
|
||||
{
|
||||
// Check for duplicate name.
|
||||
@@ -85,27 +100,29 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
||||
prmSport.NameFull = SportName;
|
||||
prmSport.StatusCat = SaxSport.StatusCat.Any;
|
||||
if (ReferenceMgr.GetSportCount(prmSport) > 0)
|
||||
responseData.SetControlError(nameof(SportName), Localiser["msg.validation.duplicate.value"]);
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.duplicate.value"]);
|
||||
}
|
||||
}
|
||||
|
||||
// Sport Speciality Label.
|
||||
if (SportSpecialityLabelCode != null)
|
||||
{
|
||||
String controlName = nameof(SportSpecialityLabel);
|
||||
if (!StringUtil.IsEmpty(SportSpecialityLabelCode))
|
||||
{
|
||||
if (SportSpecialityLabel <= 0)
|
||||
responseData.SetControlError(nameof(SportSpecialityLabel), Localiser["msg.validation.invalid.value"]);
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
}
|
||||
|
||||
// Sport status.
|
||||
if (SportStatusCode != null)
|
||||
{
|
||||
String controlName = nameof(SportStatus);
|
||||
if (StringUtil.IsEmpty(SportStatusCode))
|
||||
responseData.SetControlError(nameof(SportStatus), Localiser["msg.validation.mandatory.value"]);
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.mandatory.value"]);
|
||||
else if (!SaxSport.ValidStatuses.Contains(SportStatus))
|
||||
responseData.SetControlError(nameof(SportStatus), Localiser["msg.validation.invalid.value"]);
|
||||
responseData.SetControlError(controlName, Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
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.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 System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Saxonite.Net.Core.Web.Admin.Models.Reference
|
||||
{
|
||||
//=======================================================================
|
||||
public class Model_ReferenceBaseball : SaxModel_Admin
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public Model_ReferenceBaseball(SaxLocaliser localiser) :
|
||||
base(localiser)
|
||||
{
|
||||
AdditionalFiles_JS.Add("js/ref/sax-ref-baseball.js");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Reference Baseball list parameters.
|
||||
public class FilterData
|
||||
{
|
||||
}
|
||||
public FilterData Filter { get; } = new FilterData();
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Reference Baseball properties.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validation.
|
||||
//-------------------------------------------------------------------
|
||||
// Reference Baseball.
|
||||
public bool ValidateReferenceBaseballData(Sacs.Web.Components.SaController.AjaxResponse_Data responseData)
|
||||
{
|
||||
// Record disposable items as they are created so all can be disposed when needed.
|
||||
using (DisposableCollection<SacsHierarchyItem> disposables = new DisposableCollection<SacsHierarchyItem>())
|
||||
{
|
||||
|
||||
}
|
||||
return !responseData.HasControlErrors();
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -23,7 +23,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models.Reference
|
||||
public Model_ReferenceGolf(SaxLocaliser localiser) :
|
||||
base(localiser)
|
||||
{
|
||||
AdditionalFiles_JS.Add("js/sax-ref-golf.js");
|
||||
AdditionalFiles_JS.Add("js/ref/sax-ref-golf.js");
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -52,7 +52,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models.Reference
|
||||
public bool ValidateReferenceGolfData(Sacs.Web.Components.SaController.AjaxResponse_Data responseData)
|
||||
{
|
||||
// Record disposable items as they are created so all can be disposed when needed.
|
||||
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
||||
using (DisposableCollection<SacsHierarchyItem> disposables = new DisposableCollection<SacsHierarchyItem>())
|
||||
{
|
||||
}
|
||||
return !responseData.HasControlErrors();
|
||||
|
||||
Reference in New Issue
Block a user