1.2.11.7 Golf stats
This commit is contained in:
@@ -321,6 +321,12 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
SaLogger.Warn($"{SysUtil.Fn} USGA Country not found for code '{countryCode}'.");
|
||||
return usgaProvinces;
|
||||
}
|
||||
if (usgaCountry.Priority)
|
||||
{
|
||||
// Clear country 'priority' flag.
|
||||
usgaCountry.Priority = false;
|
||||
ReferenceGolfMgr.UpdateUsgaCountry(usgaCountry, DbUpdateInfo);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@@ -390,9 +396,6 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
if (!ReferenceGolfMgr.HasErrorState())
|
||||
{
|
||||
// Provinces updates OK.
|
||||
// Clear country 'priority' flag.
|
||||
usgaCountry.Priority = false;
|
||||
ReferenceGolfMgr.UpdateUsgaCountry(usgaCountry, DbUpdateInfo);
|
||||
}
|
||||
else SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA provinces: {ReferenceGolfMgr.ErrorStateMessage}.");
|
||||
}
|
||||
@@ -433,6 +436,12 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
SaLogger.Warn($"{SysUtil.Fn} USGA Province not found for code '{provinceCode}'.");
|
||||
return usgaCourses;
|
||||
}
|
||||
if (usgaProvince.Priority)
|
||||
{
|
||||
// Clear province 'priority' flag.
|
||||
usgaProvince.Priority = false;
|
||||
ReferenceGolfMgr.UpdateUsgaProvince(usgaProvince, DbUpdateInfo);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@@ -604,9 +613,6 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
if (!ReferenceGolfMgr.HasErrorState())
|
||||
{
|
||||
// Courses updates OK.
|
||||
// Clear province 'priority' flag.
|
||||
usgaProvince.Priority = false;
|
||||
ReferenceGolfMgr.UpdateUsgaProvince(usgaProvince, DbUpdateInfo);
|
||||
}
|
||||
else SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA courses: {ReferenceGolfMgr.ErrorStateMessage}.");
|
||||
}
|
||||
@@ -723,6 +729,11 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
SaLogger.Warn($"{SysUtil.Fn} USGA Course not found for Id '{usgaCourseId}'.");
|
||||
return markersData.Markers;
|
||||
}
|
||||
if (usgaCourse.Priority)
|
||||
{
|
||||
usgaCourse.Priority = false;
|
||||
ReferenceGolfMgr.UpdateUsgaCourse(usgaCourse, DbUpdateInfo);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
@@ -913,16 +924,17 @@ namespace Saxonite.Net.Core.Web.Base.Procs
|
||||
ReferenceGolfMgr.BulkUpdateUsgaMarkers(markersUpdateData, DbUpdateInfo);
|
||||
if (!ReferenceGolfMgr.HasErrorState())
|
||||
{
|
||||
// Courses updates OK.
|
||||
// Store Marker data and clear Course 'priority' flag.
|
||||
if (markersData.Markers.Any())
|
||||
{
|
||||
usgaCourse.MarkersData = JsonConvert.SerializeObject(markersData);
|
||||
usgaCourse.Priority = false;
|
||||
ReferenceGolfMgr.UpdateUsgaCourse(usgaCourse, DbUpdateInfo);
|
||||
}
|
||||
// Markers updates OK.
|
||||
}
|
||||
else SaLogger.Warn($"{SysUtil.Fn} Error bulk updating USGA markers: {ReferenceGolfMgr.ErrorStateMessage}.");
|
||||
|
||||
// Store Marker data and clear Course 'priority' flag.
|
||||
if (markersData.Markers.Any())
|
||||
{
|
||||
usgaCourse.MarkersData = JsonConvert.SerializeObject(markersData);
|
||||
usgaCourse.Priority = false;
|
||||
ReferenceGolfMgr.UpdateUsgaCourse(usgaCourse, DbUpdateInfo);
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user