diff --git a/z01_WinAPP/Service/procCompare.cs b/z01_WinAPP/Service/procCompare.cs index 3d5045e..d61efd2 100644 --- a/z01_WinAPP/Service/procCompare.cs +++ b/z01_WinAPP/Service/procCompare.cs @@ -30,7 +30,7 @@ namespace tpDomeWinAPP.Service { bool result = false; //tag - InsertNiagaraTagList(dt, building); + insertNiagaraTagList(dt, building); insertItemFromNiagara(dt, building); deviceComparison(); deviceItemComparison(); @@ -39,7 +39,7 @@ namespace tpDomeWinAPP.Service return result; } - protected void InsertNiagaraTagList(List dt, string building) + protected void insertNiagaraTagList(List dt, string building) { var ds2 = dt.GroupBy(x => new { @@ -209,6 +209,7 @@ namespace tpDomeWinAPP.Service conn.Open(); StringBuilder sb = new StringBuilder(); + StringBuilder sb2 = new StringBuilder(); sb.Append($@" SELECT m.* FROM import_niagara_tag m LEFT JOIN device d @@ -237,11 +238,19 @@ namespace tpDomeWinAPP.Service data.device_serial_tag + "', '" + data.niagara_tags + "', '" + data.device_system_tag + "', now(), now() );"); + + sb2.Append($@"INSERT device_kind (device_kind_guid, device_building_tag, device_system_tag, device_name_tag, + device_normal_flashing, device_close_flashing, device_error_flashing, device_error_independent, + created_by, created_at) + VALUES (uuid(), '" + data.device_building_tag + "', '" + data.device_system_tag + "', '" + data.device_name_tag + + "', 0, 0, 1, 0, 'B43E3CA7-96DD-4FC7-B6E6-974ACC3B0878', now());"); } if(sb.Length > 0) { conn.Execute(sb.ToString()); + conn.Execute(sb2.ToString()); sb.Clear(); + sb2.Clear(); } }