개정판 b7a29053
dev issue #498 : OPC Attribute 처리
Change-Id: I275fe7dac7a400aed746dfa1d1a4d28d0ae8ff68
DTI_PID/SPPIDConverter/DB/Project_DB.cs | ||
---|---|---|
226 | 226 |
} |
227 | 227 |
if (dt.Select(string.Format("NAME = '{0}'", SPPID_OPC_INFO)).Length == 0) |
228 | 228 |
{ |
229 |
cmd.CommandText = string.Format("CREATE TABLE {0} (ID2_OPC_UID TEXT PRIMARY KEY, SPPID_OPC_MODELITEM_ID TEXT, ID2_DRAWING_UID, PAIRED BOOL)", SPPID_OPC_INFO); |
|
229 |
cmd.CommandText = string.Format("CREATE TABLE {0} (ID2_OPC_UID TEXT PRIMARY KEY, SPPID_OPC_MODELITEM_ID TEXT, ID2_DRAWING_UID TEXT, ATTRIBUTES TEXT, PAIRED BOOL)", SPPID_OPC_INFO);
|
|
230 | 230 |
cmd.ExecuteNonQuery(); |
231 | 231 |
} |
232 | 232 |
} |
... | ... | |
823 | 823 |
{ |
824 | 824 |
using (SQLiteCommand cmd = connection.CreateCommand()) |
825 | 825 |
{ |
826 |
cmd.CommandText = string.Format("INSERT OR REPLACE INTO {0} (ID2_OPC_UID, SPPID_OPC_MODELITEM_ID, ID2_DRAWING_UID, PAIRED) VALUES (@ID2_OPC_UID, @SPPID_OPC_MODELITEM_ID, @ID2_DRAWING_UID, @PAIRED)", SPPID_OPC_INFO);
|
|
826 |
cmd.CommandText = string.Format("INSERT OR REPLACE INTO {0} (ID2_OPC_UID, SPPID_OPC_MODELITEM_ID, ID2_DRAWING_UID, ATTRIBUTES, PAIRED) VALUES (@ID2_OPC_UID, @SPPID_OPC_MODELITEM_ID, @ID2_DRAWING_UID, @ATTRIBUTES, @PAIRED)", SPPID_OPC_INFO);
|
|
827 | 827 |
cmd.Parameters.AddWithValue("@ID2_OPC_UID", item.UID); |
828 | 828 |
cmd.Parameters.AddWithValue("@SPPID_OPC_MODELITEM_ID", item.SPPID.ModelItemID); |
829 | 829 |
cmd.Parameters.AddWithValue("@ID2_DRAWING_UID", document.UID); |
830 |
cmd.Parameters.AddWithValue("@ATTRIBUTES", JsonConvert.SerializeObject(item.SPPID.Attributes)); |
|
830 | 831 |
cmd.Parameters.AddWithValue("@PAIRED", false); |
831 | 832 |
cmd.ExecuteNonQuery(); |
832 | 833 |
} |
내보내기 Unified diff