1.2.11.8
This commit is contained in:
@@ -72,7 +72,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
|
||||
// 2a. Population of active priority Country with no Provinces.
|
||||
{
|
||||
bool populatePriorityCountryNoProvinces = SacsRandomHelper.GetInt32(1, 3) == 1;
|
||||
bool populatePriorityCountryNoProvinces = SacsRandomHelper.GetInt32(1, 5) == 1;
|
||||
if (populatePriorityCountryNoProvinces)
|
||||
{
|
||||
SaxGolfUsgaCountry.Params prmCountry = new SaxGolfUsgaCountry.Params();
|
||||
@@ -93,7 +93,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
|
||||
// 2b. Refresh active priority Country with Provinces.
|
||||
{
|
||||
bool refreshPriorityCountryWithProvinces = SacsRandomHelper.GetInt32(1, 3) == 1;
|
||||
bool refreshPriorityCountryWithProvinces = SacsRandomHelper.GetInt32(1, 25) == 1;
|
||||
if (refreshPriorityCountryWithProvinces)
|
||||
{
|
||||
SaxGolfUsgaCountry.Params prmCountry = new SaxGolfUsgaCountry.Params();
|
||||
@@ -117,7 +117,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
|
||||
// 3a. Populate active priority Province with no Facilities (Courses).
|
||||
{
|
||||
bool populatePriorityProvinceNoFacilities = SacsRandomHelper.GetInt32(1, 3) == 1;
|
||||
bool populatePriorityProvinceNoFacilities = SacsRandomHelper.GetInt32(1, 4) == 1;
|
||||
if (populatePriorityProvinceNoFacilities)
|
||||
{
|
||||
// Active priority Provinces with no Facilities.
|
||||
@@ -125,7 +125,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
prmProvince.PriorityFlagState = SacsHierarchyItem.Params.FlagState.True;
|
||||
prmProvince.HasFacilities = SacsHierarchyItem.Params.BoolState.False;
|
||||
prmProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.ActiveOnly;
|
||||
List<SaxGolfUsgaProvince> provincesNoFacilities = internals.ReferenceGolfMgr.GetUsgaProvinceList(prmProvince);
|
||||
List<SaxGolfUsgaProvince> provincesNoFacilities = internals.ReferenceGolfMgr.GetUsgaProvinceList(prmProvince).Randomise();
|
||||
disposableItems.AddRange(provincesNoFacilities);
|
||||
if (provincesNoFacilities.Any())
|
||||
{
|
||||
@@ -139,14 +139,14 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
|
||||
// 3b. Refresh active priority Province with Facilities (courses).
|
||||
{
|
||||
bool refreshProvinceWithFacilities = SacsRandomHelper.GetInt32(1, 3) == 1;
|
||||
bool refreshProvinceWithFacilities = SacsRandomHelper.GetInt32(1, 21) == 1;
|
||||
if (refreshProvinceWithFacilities)
|
||||
{
|
||||
SaxGolfUsgaProvince.Params prmProvince = new SaxGolfUsgaProvince.Params();
|
||||
prmProvince.PriorityFlagState = SacsHierarchyItem.Params.FlagState.True;
|
||||
prmProvince.HasFacilities = SacsHierarchyItem.Params.BoolState.True;
|
||||
prmProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.ActiveOnly;
|
||||
List<SaxGolfUsgaProvince> provincesWithFacilities = internals.ReferenceGolfMgr.GetUsgaProvinceList(prmProvince);
|
||||
List<SaxGolfUsgaProvince> provincesWithFacilities = internals.ReferenceGolfMgr.GetUsgaProvinceList(prmProvince).Randomise();
|
||||
disposableItems.AddRange(provincesWithFacilities);
|
||||
if (provincesWithFacilities.Any())
|
||||
{
|
||||
@@ -169,7 +169,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
prmCourse.PriorityFlagState = SacsHierarchyItem.Params.FlagState.True;
|
||||
prmCourse.HasMarkers = SacsHierarchyItem.Params.BoolState.False;
|
||||
prmCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.ActiveOnly;
|
||||
List<SaxGolfUsgaCourse> coursesNoMarkers = internals.ReferenceGolfMgr.GetUsgaCourseList(prmCourse);
|
||||
List<SaxGolfUsgaCourse> coursesNoMarkers = internals.ReferenceGolfMgr.GetUsgaCourseList(prmCourse).Randomise();
|
||||
disposableItems.AddRange(coursesNoMarkers);
|
||||
if (coursesNoMarkers.Any())
|
||||
{
|
||||
@@ -182,7 +182,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
|
||||
// 4b. Refresh active priority Course with Markers.
|
||||
{
|
||||
bool refreshPriorityCourseWithMarkers = SacsRandomHelper.GetInt32(1, 3) == 1;
|
||||
bool refreshPriorityCourseWithMarkers = SacsRandomHelper.GetInt32(1, 17) == 1;
|
||||
if (refreshPriorityCourseWithMarkers)
|
||||
{
|
||||
// Active priority Course with no Markers.
|
||||
@@ -190,7 +190,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
prmCourse.PriorityFlagState = SacsHierarchyItem.Params.FlagState.True;
|
||||
prmCourse.HasMarkers = SacsHierarchyItem.Params.BoolState.True;
|
||||
prmCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.ActiveOnly;
|
||||
List<SaxGolfUsgaCourse> coursesWithMarkers = internals.ReferenceGolfMgr.GetUsgaCourseList(prmCourse);
|
||||
List<SaxGolfUsgaCourse> coursesWithMarkers = internals.ReferenceGolfMgr.GetUsgaCourseList(prmCourse).Randomise();
|
||||
disposableItems.AddRange(coursesWithMarkers);
|
||||
if (coursesWithMarkers.Any())
|
||||
{
|
||||
@@ -207,7 +207,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
|
||||
// 5a. Active Country with no Provinces.
|
||||
{
|
||||
bool populateCountryNoProvinces = SacsRandomHelper.GetInt32(1, 2) == 1;
|
||||
bool populateCountryNoProvinces = SacsRandomHelper.GetInt32(1, 3) == 1;
|
||||
if (populateCountryNoProvinces)
|
||||
{
|
||||
SaxGolfUsgaCountry.Params prmCountry = new SaxGolfUsgaCountry.Params();
|
||||
@@ -227,14 +227,14 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
|
||||
// 5b. Active Province with no Facilities (courses).
|
||||
{
|
||||
bool populateProvinceNoFacilities = SacsRandomHelper.GetInt32(1, 3) == 1;
|
||||
bool populateProvinceNoFacilities = SacsRandomHelper.GetInt32(1, 4) == 1;
|
||||
if (populateProvinceNoFacilities)
|
||||
{
|
||||
// Active Provinces with no Facilities.
|
||||
SaxGolfUsgaProvince.Params prmProvince = new SaxGolfUsgaProvince.Params();
|
||||
prmProvince.HasFacilities = SacsHierarchyItem.Params.BoolState.False;
|
||||
prmProvince.StatusCat = SaxGolfUsgaProvince.StatusCat.ActiveOnly;
|
||||
List<SaxGolfUsgaProvince> provincesNoFacilities = internals.ReferenceGolfMgr.GetUsgaProvinceList(prmProvince);
|
||||
List<SaxGolfUsgaProvince> provincesNoFacilities = internals.ReferenceGolfMgr.GetUsgaProvinceList(prmProvince).Randomise();
|
||||
disposableItems.AddRange(provincesNoFacilities);
|
||||
if (provincesNoFacilities.Any())
|
||||
{
|
||||
@@ -254,7 +254,7 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
SaxGolfUsgaCourse.Params prmCourse = new SaxGolfUsgaCourse.Params();
|
||||
prmCourse.HasMarkers = SacsHierarchyItem.Params.BoolState.False;
|
||||
prmCourse.StatusCat = SaxGolfUsgaCourse.StatusCat.ActiveOnly;
|
||||
List<SaxGolfUsgaCourse> coursesNoMarkers = internals.ReferenceGolfMgr.GetUsgaCourseList(prmCourse);
|
||||
List<SaxGolfUsgaCourse> coursesNoMarkers = internals.ReferenceGolfMgr.GetUsgaCourseList(prmCourse).Randomise();
|
||||
disposableItems.AddRange(coursesNoMarkers);
|
||||
if (coursesNoMarkers.Any())
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
public static class Version
|
||||
{
|
||||
private static String version { get; } = "1.2.11.7";
|
||||
private static String version { get; } = "1.2.11.8";
|
||||
// Retrieve version.
|
||||
public static String GetFullVersion () { return version; }
|
||||
public static String GetAppVersion ()
|
||||
|
||||
@@ -28,6 +28,8 @@ namespace Saxonite.Net.Standard.Base.App
|
||||
//-------------------------------------------------------------------
|
||||
public static Sax.Environment GetEnvironment()
|
||||
{
|
||||
if (ComputerName.EqualsCI("Sarand602"))
|
||||
return Sax.Environment.Production;
|
||||
if (ComputerName.ContainsCI("Sarand"))
|
||||
return Sax.Environment.Development;
|
||||
return Sax.Environment.Production;
|
||||
|
||||
@@ -48,10 +48,20 @@ namespace Saxonite.Web.Api.Consoles
|
||||
await processData.Process.StopProcessAsync();
|
||||
processData.Process.Dispose();
|
||||
}
|
||||
processes.Clear();
|
||||
// Internals.
|
||||
if (internals != null)
|
||||
{
|
||||
internals.Dispose();
|
||||
internals = null;
|
||||
}
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Priority.
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Processes.
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Saxonite.Web.Api.Controllers
|
||||
public class RequestData_UsgaCountries
|
||||
{
|
||||
public String? Search { get; set; }
|
||||
public SaxGolfUsgaCountry.StatusCat? Status { get; set; }
|
||||
public SaxGolfUsgaCountry.StatusCat? Status { get; set; } = SaxGolfUsgaCountry.StatusCat.ActiveOnly;
|
||||
}
|
||||
public class ResponseData_UsgaCountries : ApiResponse_Data
|
||||
{
|
||||
@@ -69,17 +69,17 @@ namespace Saxonite.Web.Api.Controllers
|
||||
{
|
||||
public String? CountryId { get; set; }
|
||||
public String? Search { get; set; }
|
||||
public SaxGolfUsgaProvince.StatusCat? Status { get; set; }
|
||||
public SaxGolfUsgaProvince.StatusCat? Status { get; set; } = SaxGolfUsgaProvince.StatusCat.ActiveOnly;
|
||||
}
|
||||
public class ResponseData_UsgaProvinces : ApiResponse_Data
|
||||
{
|
||||
public class UsgaProvincesData
|
||||
public class UsgaProvinceData
|
||||
{
|
||||
public long? Id { get; set; }
|
||||
public String? Id { get; set; }
|
||||
public String? Code { get; set; }
|
||||
public String? Name { get; set; }
|
||||
}
|
||||
public List<UsgaProvincesData> UsgaProvinces { get; } = new List<UsgaProvincesData>();
|
||||
public List<UsgaProvinceData> UsgaProvinces { get; } = new List<UsgaProvinceData>();
|
||||
}
|
||||
[HttpPost]
|
||||
[Route("[controller]/UsgaProvinces")]
|
||||
@@ -96,8 +96,8 @@ namespace Saxonite.Web.Api.Controllers
|
||||
prmProvinces.StatusCat = requestData.Status ?? SaxGolfUsgaProvince.StatusCat.NotDeleted;
|
||||
foreach (SaxGolfUsgaProvince usgaProvince in ReferenceGolfMgr.GetUsgaProvinceList(prmProvinces))
|
||||
{
|
||||
ResponseData_UsgaProvinces.UsgaProvincesData provinceData = new ResponseData_UsgaProvinces.UsgaProvincesData();
|
||||
provinceData.Id = SysId.ToLong(usgaProvince.Id);
|
||||
ResponseData_UsgaProvinces.UsgaProvinceData provinceData = new ResponseData_UsgaProvinces.UsgaProvinceData();
|
||||
provinceData.Id = SysId.ToString(usgaProvince.Id);
|
||||
if (!StringUtil.IsBlank(usgaProvince.ProvinceCode))
|
||||
provinceData.Code = usgaProvince.ProvinceCode;
|
||||
if (!StringUtil.IsBlank(usgaProvince.ProvinceName))
|
||||
@@ -109,6 +109,138 @@ namespace Saxonite.Web.Api.Controllers
|
||||
return responseData;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// USGA Courses.
|
||||
|
||||
public class RequestData_UsgaCourses
|
||||
{
|
||||
public String? ProvinceId { get; set; }
|
||||
public String? Search { get; set; }
|
||||
public SaxGolfUsgaCourse.StatusCat? Status { get; set; } = SaxGolfUsgaCourse.StatusCat.ActiveOnly;
|
||||
}
|
||||
public class ResponseData_UsgaCourses : ApiResponse_Data
|
||||
{
|
||||
public class UsgaCourseData
|
||||
{
|
||||
public String? Id { get; set; }
|
||||
public String? Caption { get; set; }
|
||||
public String? CourseName { get; set; }
|
||||
public String? FullName { get; set; }
|
||||
public String? Address1 { get; set; }
|
||||
public String? Address2 { get; set; }
|
||||
public String? City { get; set; }
|
||||
}
|
||||
public List<UsgaCourseData> UsgaCourses { get; } = new List<UsgaCourseData>();
|
||||
}
|
||||
[HttpPost]
|
||||
[Route("[controller]/UsgaCourses")]
|
||||
public ResponseData_UsgaCourses GetUsgaCourses_Post(RequestData_UsgaCourses requestData)
|
||||
{
|
||||
ResponseData_UsgaCourses responseData = new ResponseData_UsgaCourses();
|
||||
|
||||
SysId provinceId = StringUtil.ToSysId(requestData.ProvinceId);
|
||||
if (SysId.IsValid(provinceId))
|
||||
{
|
||||
SaxGolfUsgaCourse.Params prmCourses = new SaxGolfUsgaCourse.Params();
|
||||
prmCourses.ProvinceIdsIncluded.Add(provinceId);
|
||||
prmCourses.CourseFilter = requestData.Search;
|
||||
prmCourses.StatusCat = requestData.Status ?? SaxGolfUsgaCourse.StatusCat.NotDeleted;
|
||||
foreach (SaxGolfUsgaCourse usgaCourse in ReferenceGolfMgr.GetUsgaCourseList(prmCourses))
|
||||
{
|
||||
ResponseData_UsgaCourses.UsgaCourseData provinceData = new ResponseData_UsgaCourses.UsgaCourseData();
|
||||
provinceData.Id = SysId.ToString(usgaCourse.Id);
|
||||
if (!StringUtil.IsBlank(usgaCourse.Caption))
|
||||
provinceData.Caption = usgaCourse.Caption;
|
||||
if (!StringUtil.IsBlank(usgaCourse.CourseName))
|
||||
provinceData.CourseName = usgaCourse.CourseName;
|
||||
if (!StringUtil.IsBlank(usgaCourse.FullName))
|
||||
provinceData.FullName = usgaCourse.FullName;
|
||||
if (!StringUtil.IsBlank(usgaCourse.Address1))
|
||||
provinceData.Address1 = usgaCourse.Address1;
|
||||
if (!StringUtil.IsBlank(usgaCourse.Address2))
|
||||
provinceData.Address2 = usgaCourse.Address2;
|
||||
if (!StringUtil.IsBlank(usgaCourse.City))
|
||||
provinceData.City = usgaCourse.City;
|
||||
responseData.UsgaCourses.Add(provinceData);
|
||||
}
|
||||
}
|
||||
|
||||
return responseData;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// USGA Markers.
|
||||
|
||||
public class RequestData_UsgaMarkers
|
||||
{
|
||||
public String? CourseId { get; set; }
|
||||
public String? Search { get; set; }
|
||||
public SaxGolfUsgaMarker.StatusCat? Status { get; set; } = SaxGolfUsgaMarker.StatusCat.ActiveOnly;
|
||||
}
|
||||
public class ResponseData_UsgaMarkers : ApiResponse_Data
|
||||
{
|
||||
public class UsgaMarkerData
|
||||
{
|
||||
public String? CourseId { get; set; }
|
||||
public String? MarkerId { 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; }
|
||||
}
|
||||
public List<UsgaMarkerData> UsgaMarkers { get; } = new List<UsgaMarkerData>();
|
||||
}
|
||||
[HttpPost]
|
||||
[Route("[controller]/UsgaMarkers")]
|
||||
public ResponseData_UsgaMarkers GetUsgaMarkers_Post(RequestData_UsgaMarkers requestData)
|
||||
{
|
||||
ResponseData_UsgaMarkers responseData = new ResponseData_UsgaMarkers();
|
||||
|
||||
SysId courseId = StringUtil.ToSysId(requestData.CourseId);
|
||||
if (SysId.IsValid(courseId))
|
||||
{
|
||||
SaxGolfUsgaMarker.Params prmMarkers = new SaxGolfUsgaMarker.Params();
|
||||
prmMarkers.CourseIdsIncluded.Add(courseId);
|
||||
prmMarkers.MarkerFilter = requestData.Search;
|
||||
prmMarkers.StatusCat = requestData.Status ?? SaxGolfUsgaMarker.StatusCat.NotDeleted;
|
||||
foreach (SaxGolfUsgaMarker usgaMarker in ReferenceGolfMgr.GetUsgaMarkerList(prmMarkers))
|
||||
{
|
||||
ResponseData_UsgaMarkers.UsgaMarkerData provinceData = new ResponseData_UsgaMarkers.UsgaMarkerData();
|
||||
provinceData.CourseId = SysId.ToString(usgaMarker.CourseId);
|
||||
provinceData.MarkerId = SysId.ToString(usgaMarker.Id);
|
||||
if (!StringUtil.IsBlank(usgaMarker.Caption))
|
||||
provinceData.Caption = usgaMarker.Caption;
|
||||
if (usgaMarker.Holes > 0)
|
||||
provinceData.Holes = usgaMarker.Holes;
|
||||
if (!StringUtil.IsBlank(usgaMarker.HolesCaption))
|
||||
provinceData.HolesCaption = usgaMarker.HolesCaption;
|
||||
if (!StringUtil.IsBlank(usgaMarker.Tee))
|
||||
provinceData.Tee = usgaMarker.Tee;
|
||||
if (!StringUtil.IsBlank(usgaMarker.Gender))
|
||||
provinceData.Gender = usgaMarker.Gender;
|
||||
if (usgaMarker.SlopeRating > 0)
|
||||
provinceData.SlopeRating = usgaMarker.SlopeRating;
|
||||
if (usgaMarker.Par > 0)
|
||||
provinceData.Par = usgaMarker.Par;
|
||||
if (usgaMarker.CourseRating > 0)
|
||||
provinceData.CourseRating = usgaMarker.CourseRating;
|
||||
if (usgaMarker.BogeyRating > 0)
|
||||
provinceData.BogeyRating = usgaMarker.BogeyRating;
|
||||
if (usgaMarker.Length > 0)
|
||||
provinceData.Length = usgaMarker.Length;
|
||||
responseData.UsgaMarkers.Add(provinceData);
|
||||
}
|
||||
}
|
||||
|
||||
return responseData;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
}
|
||||
//=======================================================================
|
||||
|
||||
Reference in New Issue
Block a user