v1.3.0 Restructure Saxonite workspace and upgrade to .NET 10 (#1)
Move Saxonite’s projects into a dedicated `Workspace` folder and align the solution with .NET 10 and the current Common workspace. Update encryption integration, test project structure and coverage, and repository guidance and upgrade notes. - Relocate application and library projects while retaining Git rename history. - Split tests into Admin, Online, and Shared projects; add representative behavioral and serialization tests. - Update Common integration, application version, and repository documentation. Application version: 1.3.0 Reviewed-on: #1 Co-authored-by: andy <andy@sarand.com>
This commit was merged in pull request #1.
This commit is contained in:
+46
@@ -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;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+33
@@ -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
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Core.Web.Admin.Models;
|
||||
using Saxonite.Net.Core.Web.Base.Models;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using Saxonite.Net.Standard.Base.Helpers;
|
||||
using System;
|
||||
|
||||
namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
||||
{
|
||||
//=======================================================================
|
||||
// Admin Reference Controller - Contact Method Ajax actions only.
|
||||
//=======================================================================
|
||||
partial class ReferenceController
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Validate Contact Method.
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_ValidateContactMethod : AjaxResponse_Data
|
||||
{
|
||||
public AjaxResponse_ValidateContactMethod(SaxModel_Base model) : base(model) { }
|
||||
}
|
||||
[HttpPost]
|
||||
[Route("Reference/Ajax/ValidateContactMethod")]
|
||||
public IActionResult Ajax_ValidateContactMethod(Model_ContactMethod model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_ValidateContactMethod";
|
||||
String messageTitle = Localiser["caption.contact.method"];
|
||||
AjaxResponse_ValidateContactMethod responseData = new AjaxResponse_ValidateContactMethod(model);
|
||||
|
||||
// Validate session and referrer.
|
||||
if (!ValidReferer) return Forbid();
|
||||
if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData);
|
||||
|
||||
// Validate method.
|
||||
Sax.ContactMethod method = EnumUtil.ParseEnum(model.ContactMethod, Sax.ContactMethod.Unknown);
|
||||
if (model.ContactMethod.IsEmpty() || (int)method < 1)
|
||||
responseData.SetControlError(nameof(model.ContactMethod), Localiser["msg.validation.mandatory.value"]);
|
||||
|
||||
// Validate method.
|
||||
if (model.ContactValue.IsEmpty())
|
||||
responseData.SetControlError(nameof(model.ContactValue), Localiser["msg.validation.mandatory.value"]);
|
||||
|
||||
// Method specific value validation.
|
||||
if (!model.ContactValue.IsEmpty() && !SaxContactMethodHelper.IsValidContactMethodValue(method, model.ContactValue))
|
||||
{
|
||||
// Log invalid values so that the validation can be adjusted if needed.
|
||||
SaLogger.Warn(fn + " Invalid contact method value. Mathod: " + method.ToString() + ". Value: " + model.ContactValue);
|
||||
responseData.SetControlError(nameof(model.ContactValue), Localiser["msg.validation.invalid.value"]);
|
||||
}
|
||||
|
||||
if (responseData.HasControlErrors())
|
||||
return Json(responseData);
|
||||
|
||||
// Complete response.
|
||||
responseData.Success = true;
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Saxonite.Net.Core.Web.Base.App;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using Saxonite.Net.Standard.Base.Bus;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Saxonite.Net.Core.Web.Admin.Controllers.Reference
|
||||
{
|
||||
//=======================================================================
|
||||
// Admin Reference Controller - Ajax actions only.
|
||||
//=======================================================================
|
||||
public partial class ReferenceController : SaxController_Admin
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public ReferenceController(SaxLocaliser localiser, ILogger<HomeController> logger) :
|
||||
base(localiser, logger)
|
||||
{}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+300
@@ -0,0 +1,300 @@
|
||||
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 Golf Controller - Ajax requests - Stats.
|
||||
//=======================================================================
|
||||
partial class ReferenceGolfController
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Get Stats ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_ReferenceGolfStats : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_ReferenceGolfStats(SaxModel_Admin model) : base(model) { }
|
||||
// Statistics.
|
||||
public List<StatsGroupData> Groups { get; } = new List<StatsGroupData>();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Reference/Golf/Ajax/GetUsgaStats")]
|
||||
[Route("Reference/Golf/Ajax/GetStats")]
|
||||
[Route("Reference/Golf/Ajax/Stats")]
|
||||
public IActionResult Ajax_GetUsgaStats(Model_ReferenceGolf model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_GetUsgaStats";
|
||||
String messageTitle = Localiser["caption.reference.golf"];
|
||||
AjaxResponse_ReferenceGolfStats responseData = new AjaxResponse_ReferenceGolfStats(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
return GetAjaxResult_InvalidSession(responseData);
|
||||
|
||||
// Statistics.
|
||||
responseData.Groups.Add(PopulateCountryStatsData());
|
||||
responseData.Groups.Add(PopulateProvinceStatsData());
|
||||
responseData.Groups.Add(PopulateFacilityStatsData());
|
||||
responseData.Groups.Add(PopulateCourseStatsData());
|
||||
responseData.Groups.Add(PopulateMarkerStatsData());
|
||||
|
||||
// Complete response.
|
||||
responseData.Success = true;
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private AjaxResponse_Data.StatsGroupData PopulateCountryStatsData()
|
||||
{
|
||||
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_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_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_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_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_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_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_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_Data.StatData() { Caption = "Non-priority with provinces", Value = ReferenceGolfMgr.GetUsgaCountryCount(prmCountry).ToString() });
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private AjaxResponse_Data.StatsGroupData PopulateProvinceStatsData()
|
||||
{
|
||||
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_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_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_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_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_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_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_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_Data.StatData() { Caption = "Non-priority with facilities", Value = ReferenceGolfMgr.GetUsgaProvinceCount(prmProvince).ToString() });
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private AjaxResponse_Data.StatsGroupData PopulateFacilityStatsData()
|
||||
{
|
||||
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_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_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_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_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_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_Data.StatData() { Caption = "With courses", Value = ReferenceGolfMgr.GetUsgaFacilityCount(prmFacility).ToString() });
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private AjaxResponse_Data.StatsGroupData PopulateCourseStatsData()
|
||||
{
|
||||
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_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_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_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_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_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_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_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_Data.StatData() { Caption = "Non-priority with markers", Value = ReferenceGolfMgr.GetUsgaCourseCount(prmCourse).ToString() });
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
private AjaxResponse_Data.StatsGroupData PopulateMarkerStatsData()
|
||||
{
|
||||
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_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_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_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_Data.StatData() { Caption = "Deleted", Value = ReferenceGolfMgr.GetUsgaMarkerCount(prmMarker).ToString() });
|
||||
|
||||
return group;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
+590
@@ -0,0 +1,590 @@
|
||||
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 Golf Controller - Ajax requests.
|
||||
//=======================================================================
|
||||
partial class ReferenceGolfController
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// USGA Country data.
|
||||
private class UsgaCountryListData : AjaxResponse_Data.ItemData_Base
|
||||
{
|
||||
public String Code { get; set; }
|
||||
public String Name { get; set; }
|
||||
public bool? PriorityPopulate { get; set; }
|
||||
public long? ProvinceCount { get; set; }
|
||||
public long? ProvinceCountActive { get; set; }
|
||||
public long? FacilityCount { get; set; }
|
||||
public long? FacilityCountActive { get; set; }
|
||||
public decimal? CoursesPercent { get; set; }
|
||||
public String CoursesPercentFmt { get { return (CoursesPercent ?? 0.0m) > 0 ? $"{((decimal)CoursesPercent).ToString("N0")}%" : null; } }
|
||||
}
|
||||
private class UsgaCountryItemData : UsgaCountryListData
|
||||
{
|
||||
}
|
||||
private void PopulateUsgaCountryResponseListData(SaxGolfUsgaCountry country, UsgaCountryListData data)
|
||||
{
|
||||
data.Id = SysId.ToString(country.Id);
|
||||
data.Code = country.CountryCode;
|
||||
data.Name = country.CountryName;
|
||||
data.StatusCode = country.StatusCode;
|
||||
data.StatusDesc = country.StatusDesc;
|
||||
}
|
||||
private void PopulateUsgaCountryResponseItemData(SaxGolfUsgaCountry country, UsgaCountryItemData data)
|
||||
{
|
||||
PopulateUsgaCountryResponseListData(country, data);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// USGA Province data.
|
||||
private class UsgaProvinceListData : AjaxResponse_Data.ItemData_Base
|
||||
{
|
||||
public String Code { get; set; }
|
||||
public String Name { get; set; }
|
||||
public bool? PriorityPopulate { get; set; }
|
||||
public long? FacilityCount { get; set; }
|
||||
public long? FacilityCountActive { get; set; }
|
||||
public long? CourseCount { get; set; }
|
||||
public long? CourseCountActive { get; set; }
|
||||
public decimal? MarkersPercent { get; set; }
|
||||
public String MarkersPercentFmt { get { return (MarkersPercent ?? 0.0m) > 0 ? $"{((decimal)MarkersPercent).ToString("N0")}%" : null; } }
|
||||
}
|
||||
private class UsgaProvinceItemData : UsgaProvinceListData
|
||||
{
|
||||
}
|
||||
private void PopulateUsgaProvinceResponseListData(SaxGolfUsgaProvince province, UsgaProvinceListData data)
|
||||
{
|
||||
data.Id = SysId.ToString(province.Id);
|
||||
data.Code = province.ProvinceCode;
|
||||
data.Name = province.ProvinceName;
|
||||
data.StatusCode = province.StatusCode;
|
||||
data.StatusDesc = province.StatusDesc;
|
||||
}
|
||||
private void PopulateUsgaProvinceResponseItemData(SaxGolfUsgaProvince province, UsgaProvinceItemData data)
|
||||
{
|
||||
PopulateUsgaProvinceResponseListData(province, data);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// USGA Course data.
|
||||
private class UsgaCourseListData : AjaxResponse_Data.ItemData_Base
|
||||
{
|
||||
public long? UsgaCourseId { get; set; }
|
||||
public String Caption { get; set; }
|
||||
public String Name { get; set; }
|
||||
public String FullName { get; set; }
|
||||
public String Address1 { get; set; }
|
||||
public String Address2 { get; set; }
|
||||
public String City { get; set; }
|
||||
public bool? PriorityPopulate { get; set; }
|
||||
public long? MarkerCount { get; set; }
|
||||
public long? MarkerCountActive { get; set; }
|
||||
}
|
||||
private class UsgaCourseItemData : UsgaCourseListData
|
||||
{
|
||||
}
|
||||
private void PopulateUsgaCourseResponseListData(SaxGolfUsgaCourse course, UsgaCourseListData data)
|
||||
{
|
||||
data.Id = SysId.ToString(course.Id);
|
||||
data.Caption = course.Caption;
|
||||
data.Name = course.CourseName;
|
||||
data.FullName = course.FullName;
|
||||
data.Address1 = course.Address1;
|
||||
data.Address2 = course.Address2;
|
||||
data.City = course.City;
|
||||
data.StatusCode = course.StatusCode;
|
||||
data.StatusDesc = course.StatusDesc;
|
||||
}
|
||||
private void PopulateUsgaCourseResponseItemData(SaxGolfUsgaCourse course, UsgaCourseItemData data)
|
||||
{
|
||||
PopulateUsgaCourseResponseListData(course, data);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// USGA Marker data.
|
||||
private class UsgaMarkerListData : AjaxResponse_Data.ItemData_Base
|
||||
{
|
||||
public long? UsgaMarkerId { get; set; }
|
||||
public String Caption { get; set; }
|
||||
public short? Holes { get; set; }
|
||||
public String HolesCaption { get; set; }
|
||||
public String Tee { get; set; }
|
||||
public String Gender { get; set; }
|
||||
public short? SlopeRating { get; set; }
|
||||
public short? Par { get; set; }
|
||||
public decimal? CourseRating { get; set; }
|
||||
public decimal? BogeyRating { get; set; }
|
||||
public short? Length { get; set; }
|
||||
}
|
||||
private class UsgaMarkerItemData : UsgaMarkerListData
|
||||
{
|
||||
}
|
||||
private void PopulateUsgaMarkerResponseListData(SaxGolfUsgaMarker marker, UsgaMarkerListData data)
|
||||
{
|
||||
data.Id = SysId.ToString(marker.Id);
|
||||
data.Caption = marker.Caption;
|
||||
data.Holes = marker.Holes;
|
||||
data.HolesCaption = marker.HolesCaption;
|
||||
data.Tee = marker.Tee;
|
||||
data.Gender = marker.Gender;
|
||||
data.SlopeRating = marker.SlopeRating;
|
||||
data.Par = marker.Par;
|
||||
data.Gender = marker.Gender;
|
||||
data.BogeyRating = marker.BogeyRating;
|
||||
data.Length = marker.Length;
|
||||
data.StatusCode = marker.StatusCode;
|
||||
data.StatusDesc = marker.StatusDesc;
|
||||
}
|
||||
private void PopulateUsgaMarkerResponseItemData(SaxGolfUsgaMarker course, UsgaMarkerItemData data)
|
||||
{
|
||||
PopulateUsgaMarkerResponseListData(course, data);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get Country List ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_ReferenceGolf_CountryList : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_ReferenceGolf_CountryList(SaxModel_Admin model) : base(model) { }
|
||||
// Country list.
|
||||
public List<UsgaCountryListData> Countries { get; } = new List<UsgaCountryListData>();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Reference/Golf/Ajax/GetUsgaCountryList")]
|
||||
[Route("Reference/Golf/Ajax/GetUsgaCountries")]
|
||||
[Route("Reference/Golf/Ajax/GetCountryList")]
|
||||
[Route("Reference/Golf/Ajax/GetCountries")]
|
||||
public IActionResult Ajax_GetCountryList(Model_ReferenceGolf model)
|
||||
{
|
||||
String messageTitle = Localiser["caption.reference.golf"];
|
||||
AjaxResponse_ReferenceGolf_CountryList responseData = new AjaxResponse_ReferenceGolf_CountryList(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
return GetAjaxResult_InvalidSession(responseData);
|
||||
|
||||
// Item columns.
|
||||
ColumnDfn colId = ReferenceGolfMgr.GetUsgaCountryColumnDfn(SaxGolfUsgaCountry.Column.Id);
|
||||
ColumnDfn colCode = ReferenceGolfMgr.GetUsgaCountryColumnDfn(SaxGolfUsgaCountry.Column.CountryCode);
|
||||
ColumnDfn colName = ReferenceGolfMgr.GetUsgaCountryColumnDfn(SaxGolfUsgaCountry.Column.CountryName);
|
||||
ColumnDfn colProvinceCount_All = ReferenceGolfMgr.GetUsgaCountryColumnDfn(SaxGolfUsgaCountry.Column.ProvinceCount_All);
|
||||
ColumnDfn colProvinceCount_Active = ReferenceGolfMgr.GetUsgaCountryColumnDfn(SaxGolfUsgaCountry.Column.ProvinceCount_Active);
|
||||
ColumnDfn colFacilityCount_All = ReferenceGolfMgr.GetUsgaCountryColumnDfn(SaxGolfUsgaCountry.Column.FacilityCount_All);
|
||||
ColumnDfn colFacilityCount_Active = ReferenceGolfMgr.GetUsgaCountryColumnDfn(SaxGolfUsgaCountry.Column.FacilityCount_Active);
|
||||
ColumnDfn colCoursesPercent = ReferenceGolfMgr.GetUsgaCountryColumnDfn(SaxGolfUsgaCountry.Column.FacilityPercent);
|
||||
ColumnDfn colFlags = ReferenceGolfMgr.GetUsgaCountryColumnDfn(SaxGolfUsgaCountry.Column.Flags);
|
||||
ColumnDfn colStatus = ReferenceGolfMgr.GetUsgaCountryColumnDfn(SaxGolfUsgaCountry.Column.Status);
|
||||
List<ColumnDfn> columns = new List<ColumnDfn>()
|
||||
{
|
||||
colId, colCode, colName, colProvinceCount_All, colProvinceCount_Active, colFacilityCount_All, colFacilityCount_Active, colCoursesPercent, colFlags, colStatus
|
||||
};
|
||||
|
||||
// Item filter.
|
||||
SaxGolfUsgaCountry.Params prmUsgaCountry = new SaxGolfUsgaCountry.Params();
|
||||
prmUsgaCountry.CountryFilter = model.Filter.CountrySearch;
|
||||
prmUsgaCountry.StatusCat = SaxGolfUsgaCountry.StatusCat.Any;
|
||||
model.Paging.ItemTotal = (ulong)ReferenceGolfMgr.GetUsgaCountryCount(prmUsgaCountry);
|
||||
model.PopulatePagingTo(prmUsgaCountry.ResultsPaging);
|
||||
|
||||
// Sort order.
|
||||
prmUsgaCountry.SortColumns.Add(colName);
|
||||
|
||||
// Query items.
|
||||
using (DbResultSet resultSet = ReferenceGolfMgr.ExecuteUsgaCountryQuery(columns, prmUsgaCountry))
|
||||
{
|
||||
while (resultSet != null && resultSet.HasRows && resultSet.NextRecord())
|
||||
{
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
ushort flags = (ushort)values.GetLong(colFlags.DataName);
|
||||
UsgaCountryListData provinceData = new UsgaCountryListData()
|
||||
{
|
||||
Id = values.GetString(colId.DataName),
|
||||
Code = values.GetString(colCode.DataName),
|
||||
Name = values.GetString(colName.DataName),
|
||||
PriorityPopulate = SacsHierarchyItem.GetFlag(flags, SaxGolfUsgaCountry.Flag_Priority),
|
||||
ProvinceCount = values.GetLong(colProvinceCount_All.DataName),
|
||||
ProvinceCountActive = values.GetLong(colProvinceCount_Active.DataName),
|
||||
FacilityCount = values.GetLong(colFacilityCount_All.DataName),
|
||||
FacilityCountActive = values.GetLong(colFacilityCount_Active.DataName),
|
||||
CoursesPercent = values.GetDecimal(colCoursesPercent.DataName),
|
||||
StatusCode = values.GetString(colStatus.DataName),
|
||||
StatusDesc = SacsSystem.GetStatusDescForCode(values.GetString(colStatus.DataName))
|
||||
};
|
||||
responseData.Countries.Add(provinceData);
|
||||
}
|
||||
}
|
||||
if (model.Paging.IsPaged)
|
||||
model.Paging.ItemCount = (ushort)responseData.Countries.Count;
|
||||
|
||||
// Complete response.
|
||||
responseData.SetPaging(model);
|
||||
responseData.Success = true;
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get Province List ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_ReferenceGolf_ProvinceList : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_ReferenceGolf_ProvinceList(SaxModel_Admin model) : base(model) { }
|
||||
// Province list.
|
||||
public List<UsgaProvinceListData> Provinces { get; } = new List<UsgaProvinceListData>();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Reference/Golf/Ajax/GetUsgaProvinceList")]
|
||||
[Route("Reference/Golf/Ajax/GetUsgaProvinces")]
|
||||
[Route("Reference/Golf/Ajax/GetProvinceList")]
|
||||
[Route("Reference/Golf/Ajax/GetProvinces")]
|
||||
public IActionResult Ajax_GetProvinceList(Model_ReferenceGolf model)
|
||||
{
|
||||
String messageTitle = Localiser["caption.reference.golf"];
|
||||
AjaxResponse_ReferenceGolf_ProvinceList responseData = new AjaxResponse_ReferenceGolf_ProvinceList(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
return GetAjaxResult_InvalidSession(responseData);
|
||||
|
||||
// Item columns.
|
||||
ColumnDfn colId = ReferenceGolfMgr.GetUsgaProvinceColumnDfn(SaxGolfUsgaProvince.Column.Id);
|
||||
ColumnDfn colCode = ReferenceGolfMgr.GetUsgaProvinceColumnDfn(SaxGolfUsgaProvince.Column.ProvinceCode);
|
||||
ColumnDfn colName = ReferenceGolfMgr.GetUsgaProvinceColumnDfn(SaxGolfUsgaProvince.Column.ProvinceName);
|
||||
ColumnDfn colFacilityCount_All = ReferenceGolfMgr.GetUsgaProvinceColumnDfn(SaxGolfUsgaProvince.Column.FacilityCount_All);
|
||||
ColumnDfn colFacilityCount_Active = ReferenceGolfMgr.GetUsgaProvinceColumnDfn(SaxGolfUsgaProvince.Column.FacilityCount_Active);
|
||||
ColumnDfn colCourseCount_All = ReferenceGolfMgr.GetUsgaProvinceColumnDfn(SaxGolfUsgaProvince.Column.CourseCount_All);
|
||||
ColumnDfn colCourseCount_Active = ReferenceGolfMgr.GetUsgaProvinceColumnDfn(SaxGolfUsgaProvince.Column.CourseCount_Active);
|
||||
ColumnDfn colMarkersPercent = ReferenceGolfMgr.GetUsgaProvinceColumnDfn(SaxGolfUsgaProvince.Column.MarkerPercent);
|
||||
ColumnDfn colFlags = ReferenceGolfMgr.GetUsgaProvinceColumnDfn(SaxGolfUsgaProvince.Column.Flags);
|
||||
ColumnDfn colStatus = ReferenceGolfMgr.GetUsgaProvinceColumnDfn(SaxGolfUsgaProvince.Column.Status);
|
||||
List<ColumnDfn> columns = new List<ColumnDfn>()
|
||||
{
|
||||
colId, colCode, colName, colFacilityCount_All, colFacilityCount_Active, colCourseCount_All, colCourseCount_Active, colMarkersPercent, colFlags, colStatus
|
||||
};
|
||||
|
||||
// Item filter.
|
||||
SaxGolfUsgaProvince.Params prmUsgaProvince = new SaxGolfUsgaProvince.Params();
|
||||
if (StringUtil.ToLong(model.Filter.CountryId) > 0)
|
||||
prmUsgaProvince.CountryIdsIncluded.Add(SysId.ToSysId(model.Filter.CountryId));
|
||||
prmUsgaProvince.ProvinceFilter = model.Filter.ProvinceSearch;
|
||||
prmUsgaProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.Any;
|
||||
model.Paging.ItemTotal = (ulong)ReferenceGolfMgr.GetUsgaProvinceCount(prmUsgaProvince);
|
||||
model.PopulatePagingTo(prmUsgaProvince.ResultsPaging);
|
||||
|
||||
// Sort order.
|
||||
prmUsgaProvince.SortColumns.Add(colCode);
|
||||
|
||||
// Query items.
|
||||
using (DbResultSet resultSet = ReferenceGolfMgr.ExecuteUsgaProvinceQuery(columns, prmUsgaProvince))
|
||||
{
|
||||
while (resultSet != null && resultSet.HasRows && resultSet.NextRecord())
|
||||
{
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
ushort flags = (ushort)values.GetLong(colFlags.DataName);
|
||||
UsgaProvinceListData provinceData = new UsgaProvinceListData()
|
||||
{
|
||||
Id = values.GetString(colId.DataName),
|
||||
Code = values.GetString(colCode.DataName),
|
||||
Name = values.GetString(colName.DataName),
|
||||
PriorityPopulate = SacsHierarchyItem.GetFlag(flags, SaxGolfUsgaProvince.Flag_Priority),
|
||||
FacilityCount = values.GetLong(colFacilityCount_All.DataName),
|
||||
FacilityCountActive = values.GetLong(colFacilityCount_Active.DataName),
|
||||
CourseCount = values.GetLong(colCourseCount_All.DataName),
|
||||
CourseCountActive = values.GetLong(colCourseCount_Active.DataName),
|
||||
MarkersPercent = values.GetDecimal(colMarkersPercent.DataName),
|
||||
StatusCode = values.GetString(colStatus.DataName),
|
||||
StatusDesc = SacsSystem.GetStatusDescForCode(values.GetString(colStatus.DataName))
|
||||
};
|
||||
responseData.Provinces.Add(provinceData);
|
||||
}
|
||||
}
|
||||
if (model.Paging.IsPaged)
|
||||
model.Paging.ItemCount = (ushort)responseData.Provinces.Count;
|
||||
|
||||
// Complete response.
|
||||
responseData.SetPaging(model);
|
||||
responseData.Success = true;
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get Course List ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_ReferenceGolf_CourseList : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_ReferenceGolf_CourseList(SaxModel_Admin model) : base(model) { }
|
||||
// Course list.
|
||||
public List<UsgaCourseListData> Courses { get; } = new List<UsgaCourseListData>();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Reference/Golf/Ajax/GetUsgaCourseList")]
|
||||
[Route("Reference/Golf/Ajax/GetUsgaCourses")]
|
||||
[Route("Reference/Golf/Ajax/GetCourseList")]
|
||||
[Route("Reference/Golf/Ajax/GetCourses")]
|
||||
public IActionResult Ajax_GetCourseList(Model_ReferenceGolf model)
|
||||
{
|
||||
String messageTitle = Localiser["caption.reference.golf"];
|
||||
AjaxResponse_ReferenceGolf_CourseList responseData = new AjaxResponse_ReferenceGolf_CourseList(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
return GetAjaxResult_InvalidSession(responseData);
|
||||
|
||||
// Item columns.
|
||||
ColumnDfn colId = ReferenceGolfMgr.GetUsgaCourseColumnDfn(SaxGolfUsgaCourse.Column.Id);
|
||||
ColumnDfn colUsgaCourseId = ReferenceGolfMgr.GetUsgaCourseColumnDfn(SaxGolfUsgaCourse.Column.UsgaCourseId);
|
||||
ColumnDfn colCaption = ReferenceGolfMgr.GetUsgaCourseColumnDfn(SaxGolfUsgaCourse.Column.Caption);
|
||||
ColumnDfn colCourseName = ReferenceGolfMgr.GetUsgaCourseColumnDfn(SaxGolfUsgaCourse.Column.CourseName);
|
||||
ColumnDfn colFullName = ReferenceGolfMgr.GetUsgaCourseColumnDfn(SaxGolfUsgaCourse.Column.FullName);
|
||||
ColumnDfn colAddress1 = ReferenceGolfMgr.GetUsgaCourseColumnDfn(SaxGolfUsgaCourse.Column.Address1);
|
||||
ColumnDfn colAddress2 = ReferenceGolfMgr.GetUsgaCourseColumnDfn(SaxGolfUsgaCourse.Column.Address2);
|
||||
ColumnDfn colCity = ReferenceGolfMgr.GetUsgaCourseColumnDfn(SaxGolfUsgaCourse.Column.City);
|
||||
ColumnDfn colMarkerCount_All = ReferenceGolfMgr.GetUsgaCourseColumnDfn(SaxGolfUsgaCourse.Column.MarkerCount_All);
|
||||
ColumnDfn colMarkerCount_Active = ReferenceGolfMgr.GetUsgaCourseColumnDfn(SaxGolfUsgaCourse.Column.MarkerCount_Active);
|
||||
ColumnDfn colFlags = ReferenceGolfMgr.GetUsgaCourseColumnDfn(SaxGolfUsgaCourse.Column.Flags);
|
||||
ColumnDfn colStatus = ReferenceGolfMgr.GetUsgaCourseColumnDfn(SaxGolfUsgaCourse.Column.Status);
|
||||
List<ColumnDfn> columns = new List<ColumnDfn>()
|
||||
{
|
||||
colId, colUsgaCourseId, colCaption, colCourseName, colFullName, colAddress1, colAddress2, colCity, colMarkerCount_All, colMarkerCount_Active, colFlags, colStatus
|
||||
};
|
||||
|
||||
// Item filter.
|
||||
SaxGolfUsgaCourse.Params prmUsgaCourse = new SaxGolfUsgaCourse.Params();
|
||||
if (StringUtil.ToLong(model.Filter.ProvinceId) > 0)
|
||||
prmUsgaCourse.ProvinceIdsIncluded.Add(SysId.ToSysId(model.Filter.ProvinceId));
|
||||
prmUsgaCourse.CourseFilter = model.Filter.CourseSearch;
|
||||
prmUsgaCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.Any;
|
||||
model.Paging.ItemTotal = (ulong)ReferenceGolfMgr.GetUsgaCourseCount(prmUsgaCourse);
|
||||
model.PopulatePagingTo(prmUsgaCourse.ResultsPaging);
|
||||
// Restrict results is not paged.
|
||||
if (!prmUsgaCourse.ResultsPaging.Paged)
|
||||
{
|
||||
prmUsgaCourse.ResultsPaging.PageNo = 1;
|
||||
prmUsgaCourse.ResultsPaging.PageLength = 200;
|
||||
}
|
||||
|
||||
// Sort order.
|
||||
prmUsgaCourse.SortColumns.Add(colCaption);
|
||||
|
||||
// Query items.
|
||||
using (DbResultSet resultSet = ReferenceGolfMgr.ExecuteUsgaCourseQuery(columns, prmUsgaCourse))
|
||||
{
|
||||
while (resultSet != null && resultSet.HasRows && resultSet.NextRecord())
|
||||
{
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
ushort flags = (ushort)values.GetLong(colFlags.DataName);
|
||||
UsgaCourseListData courseData = new UsgaCourseListData()
|
||||
{
|
||||
Id = values.GetString(colId.DataName),
|
||||
UsgaCourseId = values.GetLong(colUsgaCourseId.DataName),
|
||||
Caption = values.GetString(colCaption.DataName),
|
||||
Name = values.GetString(colCourseName.DataName),
|
||||
FullName = values.GetString(colFullName.DataName),
|
||||
Address1 = values.GetString(colAddress1.DataName),
|
||||
Address2 = values.GetString(colAddress2.DataName),
|
||||
City = values.GetString(colCity.DataName),
|
||||
PriorityPopulate = SacsHierarchyItem.GetFlag(flags, SaxGolfUsgaCourse.Flag_Priority),
|
||||
MarkerCount = values.GetLong(colMarkerCount_All.DataName),
|
||||
MarkerCountActive = values.GetLong(colMarkerCount_Active.DataName),
|
||||
StatusCode = values.GetString(colStatus.DataName),
|
||||
StatusDesc = SacsSystem.GetStatusDescForCode(values.GetString(colStatus.DataName))
|
||||
};
|
||||
responseData.Courses.Add(courseData);
|
||||
}
|
||||
}
|
||||
if (model.Paging.IsPaged)
|
||||
model.Paging.ItemCount = (ushort)responseData.Courses.Count;
|
||||
|
||||
// Complete response.
|
||||
responseData.SetPaging(model);
|
||||
responseData.Success = true;
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get Marker List ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_ReferenceGolf_CleanseUsgaCourseCaptions : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_ReferenceGolf_CleanseUsgaCourseCaptions(SaxModel_Admin model) : base(model) { }
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Reference/Golf/Ajax/CleanseUsgaCourseCaptions")]
|
||||
public IActionResult Ajax_CleanseUsgaCourseCaptions(Model_ReferenceGolf model)
|
||||
{
|
||||
String messageTitle = Localiser["caption.reference.golf"];
|
||||
AjaxResponse_ReferenceGolf_CleanseUsgaCourseCaptions responseData = new AjaxResponse_ReferenceGolf_CleanseUsgaCourseCaptions(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
return GetAjaxResult_InvalidSession(responseData);
|
||||
|
||||
// Record disposable items as they are created so all can be disposed when needed.
|
||||
using (DisposableCollection<IDisposable> disposableItems = new DisposableCollection<IDisposable>())
|
||||
{
|
||||
|
||||
// Process console.
|
||||
SaxProcessConsole_Admin processConsole = GetProcessConsole_Admin(SessionContext);
|
||||
if (processConsole == null)
|
||||
return Json(responseData.SetPopupMessage(messageTitle, Localiser["msg.error.system"]));
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
// Check whether process is in progress.
|
||||
if (processConsole.IsProcessing(SaxProcessConsole_Admin.ProcessType.GolfUsgaDataLookup))
|
||||
return Json(responseData.SetPopupMessage(messageTitle, Localiser["msg.process.in.progress"]));
|
||||
|
||||
// Configure the process.
|
||||
SaxGolfUsgaDataLookup.Config processConfig = new SaxGolfUsgaDataLookup.Config(SessionContext, DbUpdateInfo);
|
||||
processConfig.Tasks.Add(SaxGolfUsgaDataLookup.Task.CleanseCourses);
|
||||
SaxGolfUsgaDataLookup process = new SaxGolfUsgaDataLookup(processConfig);
|
||||
|
||||
// Store the process and run.
|
||||
processConsole.SetProcess(process);
|
||||
process.RunAsync();
|
||||
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
SaLogger.Warn($"{SysUtil.Fn} {exc.GetType().Name} initialising organisation uploader.");
|
||||
return Json(responseData.SetPopupMessage(messageTitle, exc.GetType().Name + " initialising USGA Golf Data Loader."));
|
||||
}
|
||||
}
|
||||
|
||||
// Complete response.
|
||||
Json(responseData.SetPopupMessage(messageTitle, "Course caption cleansing is underway."));
|
||||
responseData.Success = true;
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get Marker List ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_ReferenceGolf_MarkerList : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_ReferenceGolf_MarkerList(SaxModel_Admin model) : base(model) { }
|
||||
// Marker list.
|
||||
public List<UsgaMarkerListData> Markers { get; } = new List<UsgaMarkerListData>();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Reference/Golf/Ajax/GetUsgaMarkerList")]
|
||||
[Route("Reference/Golf/Ajax/GetUsgaMarkers")]
|
||||
[Route("Reference/Golf/Ajax/GetMarkerList")]
|
||||
[Route("Reference/Golf/Ajax/GetMarkers")]
|
||||
public IActionResult Ajax_GetMarkerList(Model_ReferenceGolf model)
|
||||
{
|
||||
String messageTitle = Localiser["caption.reference.golf"];
|
||||
AjaxResponse_ReferenceGolf_MarkerList responseData = new AjaxResponse_ReferenceGolf_MarkerList(model);
|
||||
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
return GetAjaxResult_InvalidSession(responseData);
|
||||
|
||||
// Item columns.
|
||||
ColumnDfn colId = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.Id);
|
||||
ColumnDfn colUsgaMarkerId = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.UsgaMarkerId);
|
||||
ColumnDfn colCaption = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.Caption);
|
||||
ColumnDfn colHoles = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.Holes);
|
||||
ColumnDfn colHolesCaption = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.HolesCaption);
|
||||
ColumnDfn colTee = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.Tee);
|
||||
ColumnDfn colGender = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.Gender);
|
||||
ColumnDfn colSlopeRating = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.SlopeRating);
|
||||
ColumnDfn colPar = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.Par);
|
||||
ColumnDfn colCourseRating = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.CourseRating);
|
||||
ColumnDfn colBogeyRating = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.BogeyRating);
|
||||
ColumnDfn colLength = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.Length);
|
||||
ColumnDfn colFlags = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.Flags);
|
||||
ColumnDfn colStatus = ReferenceGolfMgr.GetUsgaMarkerColumnDfn(SaxGolfUsgaMarker.Column.Status);
|
||||
List<ColumnDfn> columns = new List<ColumnDfn>()
|
||||
{
|
||||
colId, colUsgaMarkerId, colCaption, colHoles, colHolesCaption, colTee, colGender, colSlopeRating, colPar, colCourseRating, colBogeyRating, colLength, colFlags, colStatus
|
||||
};
|
||||
|
||||
// Item filter.
|
||||
SaxGolfUsgaMarker.Params prmUsgaMarker = new SaxGolfUsgaMarker.Params();
|
||||
if (StringUtil.ToLong(model.Filter.CourseId) > 0)
|
||||
prmUsgaMarker.CourseIdsIncluded.Add(SysId.ToSysId(model.Filter.CourseId));
|
||||
prmUsgaMarker.MarkerFilter = model.Filter.MarkerSearch;
|
||||
prmUsgaMarker.StatusCat = SaxGolfUsgaMarker.StatusCat.Any;
|
||||
model.Paging.ItemTotal = (ulong)ReferenceGolfMgr.GetUsgaMarkerCount(prmUsgaMarker);
|
||||
model.PopulatePagingTo(prmUsgaMarker.ResultsPaging);
|
||||
// Restrict results is not paged.
|
||||
if (!prmUsgaMarker.ResultsPaging.Paged)
|
||||
{
|
||||
prmUsgaMarker.ResultsPaging.PageNo = 1;
|
||||
prmUsgaMarker.ResultsPaging.PageLength = 200;
|
||||
}
|
||||
|
||||
// Sort order.
|
||||
prmUsgaMarker.SortColumns.Add(colCaption);
|
||||
|
||||
// Query items.
|
||||
using (DbResultSet resultSet = ReferenceGolfMgr.ExecuteUsgaMarkerQuery(columns, prmUsgaMarker))
|
||||
{
|
||||
while (resultSet != null && resultSet.HasRows && resultSet.NextRecord())
|
||||
{
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
ushort flags = (ushort)values.GetLong(colFlags.DataName);
|
||||
UsgaMarkerListData markerData = new UsgaMarkerListData()
|
||||
{
|
||||
Id = values.GetString(colId.DataName),
|
||||
UsgaMarkerId = values.GetLong(colUsgaMarkerId.DataName),
|
||||
Caption = values.GetString(colCaption.DataName),
|
||||
Holes = (short)values.GetLong(colHoles.DataName),
|
||||
HolesCaption = values.GetString(colHolesCaption.DataName),
|
||||
Tee = values.GetString(colTee.DataName),
|
||||
Gender = values.GetString(colGender.DataName),
|
||||
SlopeRating = (short)values.GetLong(colSlopeRating.DataName),
|
||||
Par = (short)values.GetLong(colPar.DataName),
|
||||
CourseRating = values.GetDecimal(colCourseRating.DataName),
|
||||
BogeyRating = values.GetDecimal(colBogeyRating.DataName),
|
||||
Length = (short)values.GetLong(colLength.DataName),
|
||||
StatusCode = values.GetString(colStatus.DataName),
|
||||
StatusDesc = SacsSystem.GetStatusDescForCode(values.GetString(colStatus.DataName))
|
||||
};
|
||||
responseData.Markers.Add(markerData);
|
||||
}
|
||||
}
|
||||
if (model.Paging.IsPaged)
|
||||
model.Paging.ItemCount = (ushort)responseData.Markers.Count;
|
||||
|
||||
// Complete response.
|
||||
responseData.SetPaging(model);
|
||||
responseData.Success = true;
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
@@ -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 ReferenceGolfController : SaxController_Admin
|
||||
{
|
||||
//-------------------------------------------------------------------
|
||||
// Construction.
|
||||
public ReferenceGolfController(SaxLocaliser localiser, ILogger<HomeController> logger) :
|
||||
base(localiser, logger)
|
||||
{
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
[HttpGet]
|
||||
[Route("Reference/Golf")]
|
||||
public IActionResult Index()
|
||||
{
|
||||
// Validate session.
|
||||
if (!ValidUserSession)
|
||||
AutoLoginUser();
|
||||
if (!ValidUserSession)
|
||||
return RedirectToAction("", "");
|
||||
|
||||
// Paging.
|
||||
Model_ReferenceGolf model = new Model_ReferenceGolf(Localiser);
|
||||
//model.Paging.PageNo = 1;
|
||||
//model.Paging.PageLength = 12;
|
||||
|
||||
return View("/Views/Reference/Golf/Index.cshtml",model);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
}
|
||||
Reference in New Issue
Block a user