프로젝트

일반

사용자정보

개정판 839708c6

ID839708c689efe1597c65726f5ada9d0a02f55945
상위 45856d85
하위 defbabc8, 8187418d

이지연이(가) 약 3년 전에 추가함

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

클립보드 이미지 추가 (최대 크기: 500 MB)