1.2.11.12 Online Events

This commit is contained in:
2024-08-20 17:51:32 +01:00
parent 780e6778e5
commit 41db4e63d4
158 changed files with 6945 additions and 666 deletions
@@ -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);
}
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -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
{
//-------------------------------------------------------------------
//-------------------------------------------------------------------
}
//=======================================================================
}
@@ -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.