diff --git a/Backend/Controllers/BuildInfoController.cs b/Backend/Controllers/BuildInfoController.cs index 94bde0a..9fc3a02 100644 --- a/Backend/Controllers/BuildInfoController.cs +++ b/Backend/Controllers/BuildInfoController.cs @@ -123,7 +123,16 @@ namespace Backend.Controllers { "@urn_3D", post.urn_3D}, { "@created_by", myUserInfo.Userinfo_guid} }; - await backendRepository.AddOneByCustomTable(building, "building"); + + sWhere = $@"deleted = 1 AND building_tag = @Building_tag"; + buildInfos = await backendRepository.GetAllAsync("building", sWhere, new { building_tag = post.building_tag }); + if (buildInfos.Count == 0) + await backendRepository.AddOneByCustomTable(building, "building"); + else + { + building.Add("@deleted", 0); + await backendRepository.UpdateOneByCustomTable(building, "building", "building_tag='" + post.building_tag + "'"); + } } else { @@ -141,7 +150,16 @@ namespace Backend.Controllers { "@extName_3D", post.extName_3D}, { "@created_by", myUserInfo.Userinfo_guid} }; - await backendRepository.AddOneByCustomTable(building, "building"); + + sWhere = $@"deleted = 1 AND building_tag = @Building_tag"; + buildInfos = await backendRepository.GetAllAsync("building", sWhere, new { building_tag = post.building_tag }); + if (buildInfos.Count == 0) + await backendRepository.AddOneByCustomTable(building, "building"); + else + { + building.Add("@deleted", 0); + await backendRepository.UpdateOneByCustomTable(building, "building", "building_tag='" + post.building_tag + "'"); + } } if (post.orgName_3D != null && post.extName_3D != null) diff --git a/Backend/wwwroot/upload/build_map/24574086-ea17-4ccc-8f8c-54760999ef73.nwc b/Backend/wwwroot/upload/build_map/24574086-ea17-4ccc-8f8c-54760999ef73.nwc new file mode 100644 index 0000000..5763191 Binary files /dev/null and b/Backend/wwwroot/upload/build_map/24574086-ea17-4ccc-8f8c-54760999ef73.nwc differ diff --git a/Backend/wwwroot/upload/build_map/685405b1-89b7-46a8-a8f2-cb0a2343b392.nwc b/Backend/wwwroot/upload/build_map/685405b1-89b7-46a8-a8f2-cb0a2343b392.nwc new file mode 100644 index 0000000..5763191 Binary files /dev/null and b/Backend/wwwroot/upload/build_map/685405b1-89b7-46a8-a8f2-cb0a2343b392.nwc differ diff --git a/Backend/wwwroot/upload/build_map/72eecd08-02de-4925-84ef-89854ae75aac.nwc b/Backend/wwwroot/upload/build_map/72eecd08-02de-4925-84ef-89854ae75aac.nwc new file mode 100644 index 0000000..5763191 Binary files /dev/null and b/Backend/wwwroot/upload/build_map/72eecd08-02de-4925-84ef-89854ae75aac.nwc differ diff --git a/Backend/wwwroot/upload/build_map/9740ccde-66d1-4809-8976-8f1a89f4d692.nwc b/Backend/wwwroot/upload/build_map/9740ccde-66d1-4809-8976-8f1a89f4d692.nwc new file mode 100644 index 0000000..5763191 Binary files /dev/null and b/Backend/wwwroot/upload/build_map/9740ccde-66d1-4809-8976-8f1a89f4d692.nwc differ diff --git a/Backend/wwwroot/upload/build_map/f171145a-5ef4-4ab0-b5cf-632857480ca0.nwc b/Backend/wwwroot/upload/build_map/f171145a-5ef4-4ab0-b5cf-632857480ca0.nwc new file mode 100644 index 0000000..5763191 Binary files /dev/null and b/Backend/wwwroot/upload/build_map/f171145a-5ef4-4ab0-b5cf-632857480ca0.nwc differ diff --git a/Frontend/_historyData.html b/Frontend/_historyData.html index 5630030..a2543c1 100644 --- a/Frontend/_historyData.html +++ b/Frontend/_historyData.html @@ -86,6 +86,31 @@ loadTable(null); $(`[onclick="setDateType('day', this)"]`).click(); $(`[onclick="setDateType('today', this)"]`).click(); + + onEvent('change', '#startdate', function () { + let today = displayDate(new Date(Date.now()), 'date').replaceAll('/', '-'); + let ytd = displayDate(new Date(new Date().setDate(new Date(Date.now()).getDate() - 1)), 'date').replaceAll('/', '-'); + console.log(today); + console.log(ytd); + if ($(this).val() == today) { + $(`[onclick="setDateType('today', this)"]`).removeClass('btn-secondary'); + $(`[onclick="setDateType('today', this)"]`).addClass('btn-dark'); + $(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary'); + $(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-dark'); + } + else if ($(this).val() == ytd) { + $(`[onclick="setDateType('today', this)"]`).addClass('btn-secondary'); + $(`[onclick="setDateType('today', this)"]`).removeClass('btn-dark'); + $(`[onclick="setDateType('ytd', this)"]`).removeClass('btn-secondary'); + $(`[onclick="setDateType('ytd', this)"]`).addClass('btn-dark'); + } + else { + $(`[onclick="setDateType('today', this)"]`).addClass('btn-secondary'); + $(`[onclick="setDateType('today', this)"]`).removeClass('btn-dark'); + $(`[onclick="setDateType('ytd', this)"]`).addClass('btn-secondary'); + $(`[onclick="setDateType('ytd', this)"]`).removClass('btn-dark'); + } + }); }); function initList() {