개정판 839708c6
issue #000: Insulation Purpose 추가, Pipeline Data 생성 로직추가
Change-Id: Ia2719fcda0974803ceace2343bc6c2dce7ba7734
DTI_PID/ID2PSN/DB.cs | ||
---|---|---|
26 | 26 |
const string PSN_TOPOLOGYSET = "SPPIDTopologySet"; |
27 | 27 |
//2021.11.17 추가 |
28 | 28 |
const string PSN_PIPELINE = "SPPIDPipeLine"; |
29 |
//2021.11.26 추가 |
|
30 |
const string PSN_INSULATIONPURPOSE = "SPPIDInsulationPurpose"; |
|
29 | 31 |
/// <summary> |
30 | 32 |
/// ID2 Project.db 데이터를 가져온다. |
31 | 33 |
/// DB 접속 정보 및 DBType (Sqlite, Mssql) 정보를 가져옴 |
... | ... | |
241 | 243 |
} |
242 | 244 |
} |
243 | 245 |
|
246 |
matched = names.FirstOrDefault(param => param == PSN_INSULATIONPURPOSE); |
|
247 |
if (matched == null) |
|
248 |
{ |
|
249 |
var query = $"CREATE TABLE {PSN_INSULATIONPURPOSE} (UID NVARCHAR(50), Code NVARCHAR(255), Description NVARCHAR(255), Remarks NVARCHAR(255))"; |
|
250 |
using (var cmd = connection.GetSqlStringCommand(query)) |
|
251 |
{ |
|
252 |
cmd.ExecuteNonQuery(); |
|
253 |
} |
|
254 |
} |
|
255 |
|
|
244 | 256 |
result = true; |
245 | 257 |
} |
246 | 258 |
catch (Exception ex) |
... | ... | |
405 | 417 |
return dt; |
406 | 418 |
} |
407 | 419 |
|
420 |
|
|
421 |
public static DataTable SelectInsulationPurpose() |
|
422 |
{ |
|
423 |
DataTable dt = null; |
|
424 |
ID2Info id2Info = ID2Info.GetInstance(); |
|
425 |
|
|
426 |
using (IAbstractDatabase connection = id2Info.CreateConnection()) |
|
427 |
{ |
|
428 |
try |
|
429 |
{ |
|
430 |
var query = "SELECT * FROM InsulationPurpose"; |
|
431 |
using (var ds = connection.ExecuteDataSet(connection.GetSqlStringCommand(query))) |
|
432 |
{ |
|
433 |
dt = ds.Tables[0].Copy(); |
|
434 |
} |
|
435 |
} |
|
436 |
catch (Exception ex) |
|
437 |
{ |
|
438 |
Log.Write(ex.Message + "\r\n" + ex.StackTrace); |
|
439 |
} |
|
440 |
} |
|
441 |
|
|
442 |
return dt; |
|
443 |
} |
|
444 |
|
|
445 |
public static DataTable SelectPSNINSULATIONPURPOSE() |
|
446 |
{ |
|
447 |
DataTable dt = null; |
|
448 |
ID2Info id2Info = ID2Info.GetInstance(); |
|
449 |
|
|
450 |
using (IAbstractDatabase connection = id2Info.CreateConnection(ID2DB_Type.SQLite)) |
|
451 |
{ |
|
452 |
try |
|
453 |
{ |
|
454 |
var query = $"SELECT * FROM {PSN_INSULATIONPURPOSE}"; |
|
455 |
using (var ds = connection.ExecuteDataSet(connection.GetSqlStringCommand(query))) |
|
456 |
{ |
|
457 |
dt = ds.Tables[0].Copy(); |
|
458 |
} |
|
459 |
} |
|
460 |
catch (Exception ex) |
|
461 |
{ |
|
462 |
Log.Write(ex.Message + "\r\n" + ex.StackTrace); |
|
463 |
} |
|
464 |
} |
|
465 |
|
|
466 |
return dt; |
|
467 |
} |
|
468 |
|
|
408 | 469 |
public static DataTable SelectNominalDiameter() |
409 | 470 |
{ |
410 | 471 |
DataTable dt = null; |
내보내기 Unified diff