修改日期呈現, 新增區域基本資料

This commit is contained in:
dev02 2022-12-01 10:42:24 +08:00
parent b91fe03355
commit 22aeb02835
7 changed files with 45 additions and 2 deletions

View File

@ -123,7 +123,16 @@ namespace Backend.Controllers
{ "@urn_3D", post.urn_3D}, { "@urn_3D", post.urn_3D},
{ "@created_by", myUserInfo.Userinfo_guid} { "@created_by", myUserInfo.Userinfo_guid}
}; };
await backendRepository.AddOneByCustomTable(building, "building");
sWhere = $@"deleted = 1 AND building_tag = @Building_tag";
buildInfos = await backendRepository.GetAllAsync<BuildInfo>("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 else
{ {
@ -141,7 +150,16 @@ namespace Backend.Controllers
{ "@extName_3D", post.extName_3D}, { "@extName_3D", post.extName_3D},
{ "@created_by", myUserInfo.Userinfo_guid} { "@created_by", myUserInfo.Userinfo_guid}
}; };
await backendRepository.AddOneByCustomTable(building, "building");
sWhere = $@"deleted = 1 AND building_tag = @Building_tag";
buildInfos = await backendRepository.GetAllAsync<BuildInfo>("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) if (post.orgName_3D != null && post.extName_3D != null)

View File

@ -86,6 +86,31 @@
loadTable(null); loadTable(null);
$(`[onclick="setDateType('day', this)"]`).click(); $(`[onclick="setDateType('day', this)"]`).click();
$(`[onclick="setDateType('today', 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() { function initList() {