프로젝트

일반

사용자정보

개정판 91c75c0b

ID91c75c0b200a6e6d78b80f1ee6bca1c184db2053
상위 df1424cb
하위 bf9e8432

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

issue #000: No Pocket 로직 수정, Combobox 추가, Revision 컬럼 및 데이터 로직 수정

Change-Id: Ic83e5d2b2b73a86fb1a07a0d8f3444ac4496ac54

차이점 보기:

DTI_PID/ID2PSN/DB.cs
1533 1533
                            $"[ProjectCode] nvarchar(255), [RevNumber] int ,[UserName] nvarchar(255) ,[TimeData] nvarchar(255) ," +
1534 1534
                            $"[PSNDatabasePath] nvarchar(255) ,	[PsnByPBSFilter] varchar(20) ,[PsnByNPDFilter] varchar(20) ,[PidDrawings] int ,	" +
1535 1535
                            $"[PipeSystems] int ,[PipeLines] int ,[Topologies] int ,[PipeSystemNetworks] int ,[InValidPSNs] int ,[E2E] int ," +
1536
                            $"[E2B] int ,[B2E] int ,[HDE] int ,[HD2] int ,[HDB] int ,[B2B] int, [LastModificationdate] nvarchar(255))";
1536
                            $"[E2B] int ,[B2E] int ,[HDE] int ,[HD2] int ,[HDB] int ,[B2B] int, [LastModificationdate] nvarchar(255), [ID2_PSN] nvarchar(10))";
1537 1537
                        using (var cmd = connection.GetSqlStringCommand(query))
1538 1538
                        {
1539 1539
                            cmd.ExecuteNonQuery();
......
1606 1606
                            connection.ExecuteNonQuery(connection.GetSqlStringCommand(where), txn);
1607 1607
                            var query = $"INSERT INTO ARS_COMMON.dbo.PSNRevision (OID, Project_OID, ProjectCode, RevNumber, UserName, TimeData, PSNDatabasePath, " +
1608 1608
                                $"PsnByPBSFilter, PsnByNPDFilter, PidDrawings, PipeSystems, PipeLines, Topologies, PipeSystemNetworks, InValidPSNs, E2E, E2B, B2E, HDE, " +
1609
                                $"HD2, HDB, B2B, LastModificationdate) VALUES (NEWID(), NEWID(), @ProjectCode, @RevNumber, @UserName, @TimeData, @PSNDatabasePath" +
1609
                                $"HD2, HDB, B2B, LastModificationdate, ID2_PSN) VALUES (NEWID(), NEWID(), @ProjectCode, @RevNumber, @UserName, @TimeData, @PSNDatabasePath" +
1610 1610
                                $", @PsnByPBSFilter, @PsnByNPDFilter, @PidDrawings, @PipeSystems, @PipeLines, @Topologies, @PipeSystemNetworks, @InValidPSNs, " +
1611
                                $"@E2E, @E2B, @B2E, @HDE, @HD2, @HDB, @B2B, @LastModificationdate)";
1611
                                $"@E2E, @E2B, @B2E, @HDE, @HD2, @HDB, @B2B, @LastModificationdate, @ID2_PSN)";
1612 1612
                            var cmd = connection.GetSqlStringCommand(query);
1613 1613
                      
1614 1614
                            AddWithValue(cmd, "@ProjectCode", ProjectCode);
......
1637 1637
                            System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("en-US");
1638 1638
                            DateTime oDateTime = DateTime.Now;
1639 1639
                            AddWithValue(cmd, "@LastModificationdate", oDateTime.ToString(ci));
1640
                            AddWithValue(cmd, "@ID2_PSN", "Y");
1640 1641
                            connection.ExecuteNonQuery(cmd, txn);
1641 1642

  
1642 1643
                            txn.Commit();
......
1677 1678
                         
1678 1679
                            var query = $"INSERT INTO ARS_COMMON.dbo.PSNRevision (OID, Project_OID, ProjectCode, RevNumber, UserName, TimeData, PSNDatabasePath, " +
1679 1680
                                $"PsnByPBSFilter, PsnByNPDFilter, PidDrawings, PipeSystems, PipeLines, Topologies, PipeSystemNetworks, InValidPSNs, E2E, E2B, B2E, HDE, " +
1680
                                $"HD2, HDB, B2B, LastModificationdate) VALUES (NEWID(), NEWID(), @ProjectCode, @RevNumber, @UserName, @TimeData, @PSNDatabasePath" +
1681
                                $"HD2, HDB, B2B, LastModificationdate, ID2_PSN) VALUES (NEWID(), NEWID(), @ProjectCode, @RevNumber, @UserName, @TimeData, @PSNDatabasePath" +
1681 1682
                                $", @PsnByPBSFilter, @PsnByNPDFilter, @PidDrawings, @PipeSystems, @PipeLines, @Topologies, @PipeSystemNetworks, @InValidPSNs, " +
1682
                                $"@E2E, @E2B, @B2E, @HDE, @HD2, @HDB, @B2B, @LastModificationdate)";
1683
                                $"@E2E, @E2B, @B2E, @HDE, @HD2, @HDB, @B2B, @LastModificationdate, @ID2_PSN)";
1683 1684
                            var cmd = connection.GetSqlStringCommand(query);
1684 1685
                            AddWithValue(cmd, "@OID", Guid.NewGuid().ToString());
1685 1686
                            AddWithValue(cmd, "@Project_OID", Guid.NewGuid().ToString());
......
1712 1713
                            AddWithValue(cmd, "@B2B", B2B);
1713 1714
                            // AddWithValue(cmd, "@LastModificationdate", oDateTime.ToString(ci));
1714 1715
                            AddWithValue(cmd, "@LastModificationdate", "");
1716
                            AddWithValue(cmd, "@ID2_PSN", "Y");
1717
                            
1715 1718
                            connection.ExecuteNonQuery(cmd, txn);
1716 1719
                            
1717 1720
                            txn.Commit();
......
3069 3072

  
3070 3073
                            var query = $"INSERT INTO ARS_COMMON.dbo.PSNRevision (OID, Project_OID, ProjectCode, RevNumber, UserName, TimeData, PSNDatabasePath, " +
3071 3074
                                $"PsnByPBSFilter, PsnByNPDFilter, PidDrawings, PipeSystems, PipeLines, Topologies, PipeSystemNetworks, InValidPSNs, E2E, E2B, B2E, HDE, " +
3072
                                $"HD2, HDB, B2B, LastModificationdate) VALUES (NEWID(), NEWID(), @ProjectCode, @RevNumber, @UserName, @TimeData, @PSNDatabasePath" +
3075
                                $"HD2, HDB, B2B, LastModificationdate, ID2_PSN) VALUES (NEWID(), NEWID(), @ProjectCode, @RevNumber, @UserName, @TimeData, @PSNDatabasePath" +
3073 3076
                                $", @PsnByPBSFilter, @PsnByNPDFilter, @PidDrawings, @PipeSystems, @PipeLines, @Topologies, @PipeSystemNetworks, @InValidPSNs, " +
3074
                                $"@E2E, @E2B, @B2E, @HDE, @HD2, @HDB, @B2B, @LastModificationdate)";
3077
                                $"@E2E, @E2B, @B2E, @HDE, @HD2, @HDB, @B2B, @LastModificationdate, @ID2_PSN)";
3075 3078
                            var cmd = connection.GetSqlStringCommand(query);
3076 3079
                            AddWithValue(cmd, "@OID", Guid.NewGuid().ToString());
3077 3080
                            AddWithValue(cmd, "@Project_OID", Guid.NewGuid().ToString());
......
3104 3107
                            AddWithValue(cmd, "@B2B", B2B);
3105 3108

  
3106 3109
                            AddWithValue(cmd, "@LastModificationdate", oDateTime.ToString(ci));
3110
                            AddWithValue(cmd, "@ID2_PSN", "Y");
3111
                            
3107 3112
                            connection.ExecuteNonQuery(cmd, txn);
3108 3113

  
3109 3114
                            txn.Commit();
......
3141 3146
                            $"[ProjectCode] nvarchar(255), [RevNumber] int ,[UserName] nvarchar(255) ,[TimeData] nvarchar(255) ," +
3142 3147
                            $"[PSNDatabasePath] nvarchar(255) ,	[PsnByPBSFilter] varchar(20) ,[PsnByNPDFilter] varchar(20) ,[PidDrawings] int ,	" +
3143 3148
                            $"[PipeSystems] int ,[PipeLines] int ,[Topologies] int ,[PipeSystemNetworks] int ,[InValidPSNs] int ,[E2E] int ," +
3144
                            $"[E2B] int ,[B2E] int ,[HDE] int ,[HD2] int ,[HDB] int ,[B2B] int , [LastModificationdate] nvarchar(255))";
3149
                            $"[E2B] int ,[B2E] int ,[HDE] int ,[HD2] int ,[HDB] int ,[B2B] int , [LastModificationdate] nvarchar(255), [ID2_PSN] nvarchar(10))";
3145 3150
                        using (var cmd = connection.GetSqlStringCommand(query))
3146 3151
                        {
3147 3152
                            cmd.ExecuteNonQuery();
DTI_PID/ID2PSN/Form/DBSettingForm.cs
210 210
                        dicColCheck.Add("HDB", "int");
211 211
                        dicColCheck.Add("B2B", "int");
212 212
                        dicColCheck.Add("LastModificationdate", "nvarchar(255)");
213
                        dicColCheck.Add("ID2_PSN", "nvarchar(10)");
214
                        
213 215
                        if (names.Count != dicColCheck.Count)
214 216
                        {                            
215 217
                            //테이블 없으면 생성
DTI_PID/ID2PSN/Form/EquipmentSetting.cs
73 73
            gridColumn.VisibleIndex = 0;
74 74

  
75 75
            repositoryGroupType = new RepositoryItemComboBox();
76
            repositoryGroupType.Items.AddRange(new string[] { "Pump(To)", "Vertical Vessel" });
76
            repositoryGroupType.Items.AddRange(new string[] { "Pump", "Vertical Vessel" });
77 77
            repositoryGroupType.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
78 78

  
79 79
            gridEquipment.RepositoryItems.Add(repositoryGroupType);
......
217 217
        public void InitAirFinCoolerData()
218 218
        {
219 219
            DataTable dt = DB.SelectAirFinCoolerSetting();
220
            DataTable typeDT = gridViewAirFinCooler.DataSource as DataTable;
220
            DataTable typeDT = gridControlAirFinCooler.DataSource as DataTable;
221 221
            foreach (DataRow row in dt.Rows)
222 222
            {
223 223
                int index = Convert.ToInt32(row["INDEX"]);
DTI_PID/ID2PSN/Form/MainForm.cs
403 403
                        dicColCheck.Add("HDB", "int");
404 404
                        dicColCheck.Add("B2B", "int");
405 405
                        dicColCheck.Add("LastModificationdate", "nvarchar(255)");
406

  
406
                        dicColCheck.Add("ID2_PSN", "nvarchar(10)");
407
                        
407 408
                        if (names.Count != dicColCheck.Count)
408 409
                        {
409 410
                            //테이블 없으면 생성
......
480 481
            }
481 482
        }
482 483

  
483
        
484
        private RepositoryItemComboBox repositoryGroupType2 = new RepositoryItemComboBox();
484 485
        private void InitGrid()
485 486
        {
486 487
            gridControlPSN.BeginUpdate();
......
518 519
            PSNPageDT.Columns.Add("PSNRevisionNumber", typeof(string));
519 520
            PSNPageDT.Columns.Add("PBS", typeof(string));
520 521
            PSNPageDT.Columns.Add("Drawings", typeof(string));
521

  
522 522
            PSNPageDT.Columns.Add("IsValid", typeof(string));
523
            PSNPageDT.Columns.Add("Status", typeof(string));                    
524
            
523
            PSNPageDT.Columns.Add("Status", typeof(string));                   
525 524
            PSNPageDT.Columns.Add("IncludingVirtualData", typeof(string));
526 525
            PSNPageDT.Columns.Add("PSNAccuracy", typeof(string));
527

  
528
            PSNPageDT.Columns.Add("Pocket", typeof(string));
529
            
526
            PSNPageDT.Columns.Add("Pocket", typeof(string));            
530 527
            PSNPageDT.Columns.Add("Show", typeof(string));
531 528

  
529

  
532 530
            gridControlPSN.DataSource = PSNPageDT;
533 531
            gridViewPSN.Columns["OID"].Caption = ID2Info.ProgramName + " ID";
534 532
            gridViewPSN.Columns["OrderNumber"].Caption = "Order #";
......
539 537
            gridViewPSN.Columns["PSNRevisionNumber"].Caption = "Revision";
540 538
            gridViewPSN.Columns["Show"].Caption = " ";
541 539
            gridViewPSN.Columns["PSNAccuracy"].DisplayFormat.FormatString = "{ 0:#.##}";
542
            gridViewPSN.Columns["Pocket"].Caption = "Pocket";
543
            
540

  
541

  
542
            repositoryGroupType2 = new RepositoryItemComboBox();
543
            repositoryGroupType2.Items.AddRange(new string[] { "Yes", "No" });
544
            repositoryGroupType2.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
545

  
546
            gridControlPSN.RepositoryItems.Add(repositoryGroupType2);
547
            gridViewPSN.Columns["Pocket"].ColumnEdit = repositoryGroupType2;
548

  
549
            //gridViewPSN.Columns["Pocket"].Caption = "Pocket";
550

  
544 551
            #region PathItems Table
545 552
            DataTable pathItemsDT = new DataTable();
546 553
            pathItemsDT.Columns.Add("OID", typeof(string));
DTI_PID/ID2PSN/PSN.cs
1223 1223
                }
1224 1224
                #endregion
1225 1225

  
1226

  
1227 1226
                #region EquipmentNoPocket Info
1228 1227
                EquipmentNoPocketInfo EquipmentNoPocket = new EquipmentNoPocketInfo();
1229 1228
                DataTable dtEquipmentNoPocket = DB.SelectEquipmentNoPocketSetting();
......
1622 1621
                                        if (Condition.Equals("Flare"))
1623 1622
                                            Pocket = "Yes";
1624 1623

  
1625
                                        if (PSNItem.StartType == PSNType.Equipment) //From은 Pump 제외
1624
                                        if (item.ID2DBType == "Nozzles" && PSNItem.StartType == PSNType.Equipment) 
1626 1625
                                        {
1627 1626
                                          //  string itemName = From_item.Name;
1628 1627
                                            Equipment Equipment = From_item.Equipment;
1629
                                            EquipmentNoPocketItem nopocket = EquipmentNoPocket.EquipmentNoPocketItem.Where(x => x.Name == Equipment.Name && x.Type != "Pump(To)").FirstOrDefault();
1630
                                            if(nopocket != null)
1628
                                      
1629
                                            EquipmentNoPocketItem nopocket = EquipmentNoPocket.EquipmentNoPocketItem.Where(x => x.Name == Equipment.Name && x.Type != "Pump").FirstOrDefault();
1630
                                          
1631

  
1632
                                            if (nopocket != null)
1631 1633
                                            {
1632
                                                Pocket = "Yes";
1634
                                                DataRow bNozzle = null;
1635
                                                if (nopocket.Type.Equals("Vertical Vessel"))
1636
                                                {
1637
                                                    DataRow drNozzle = Nozzle.Select(string.Format("Equipment_OID = '{0}' AND OID = '{1}'", Equipment.UID, From_item.UID)).FirstOrDefault();
1638
                                                    if (drNozzle != null)
1639
                                                    {
1640
                                                        if (drNozzle.Field<string>("Rotation").Length >= 4 && drNozzle.Field<string>("Rotation").Substring(0, 4) == "4.71")
1641
                                                        {
1642
                                                            bNozzle = drNozzle;
1643
                                                        }
1644

  
1645
                                                        if (bNozzle == null)
1646
                                                        {
1647
                                                            DataRow[] nozzleRows = Nozzle.Select(string.Format("Equipment_OID = '{0}'", Equipment.UID));
1648

  
1649
                                                            if (drNozzle != null)
1650
                                                            {
1651
                                                                bNozzle = drNozzle;
1652
                                                                foreach (DataRow it in nozzleRows)
1653
                                                                {
1654
                                                                    if (Convert.ToDecimal(drNozzle.Field<string>("Ycoords")) > Convert.ToDecimal(it.Field<string>("Ycoords")))
1655
                                                                    {
1656
                                                                        bNozzle = null;
1657
                                                                        break;
1658
                                                                    }
1659
                                                                }
1660
                                                            }
1661
                                                        }
1662
                                                    }
1663

  
1664
                                                    if (bNozzle != null)
1665
                                                        Pocket = "Yes";
1666
                                                }
1667
                                                else
1668
                                                    Pocket = "Yes";
1633 1669
                                            }
1634 1670
                                        }
1635

  
1636
                                        if (PSNItem.EndType == PSNType.Equipment) //To는 전체
1671
                                        
1672
                                        if (item.ID2DBType == "Nozzles" && PSNItem.EndType == PSNType.Equipment) //To는 전체
1637 1673
                                        {
1638 1674
                                           // string itemName = To_item.Name;
1639 1675
                                            Equipment Equipment = To_item.Equipment;
1640 1676
                                            EquipmentNoPocketItem nopocket = EquipmentNoPocket.EquipmentNoPocketItem.Where(x => x.Name == Equipment.Name).FirstOrDefault();
1641 1677
                                            if (nopocket != null)
1642 1678
                                            {
1643
                                                Pocket = "Yes";
1679
                                                DataRow bNozzle = null;
1680
                                                if (nopocket.Type.Equals("Vertical Vessel"))
1681
                                                {
1682
                                                    DataRow drNozzle = Nozzle.Select(string.Format("Equipment_OID = '{0}' AND OID = '{1}'", Equipment.UID, To_item.UID)).FirstOrDefault();
1683
                                                    if(drNozzle != null)
1684
                                                    {
1685
                                                        if (drNozzle.Field<string>("Rotation").Length >= 4 && drNozzle.Field<string>("Rotation").Substring(0, 4) == "4.71")
1686
                                                        {
1687
                                                            bNozzle = drNozzle;
1688
                                                        }
1689

  
1690
                                                        if (bNozzle == null)
1691
                                                        {
1692
                                                            DataRow[] nozzleRows = Nozzle.Select(string.Format("Equipment_OID = '{0}'", Equipment.UID));
1693

  
1694
                                                            if (drNozzle != null)
1695
                                                            {
1696
                                                                bNozzle = drNozzle;
1697
                                                                foreach (DataRow it in nozzleRows)
1698
                                                                {
1699
                                                                    if (Convert.ToDecimal(drNozzle.Field<string>("Ycoords")) > Convert.ToDecimal(it.Field<string>("Ycoords")))
1700
                                                                    {
1701
                                                                        bNozzle = null;
1702
                                                                        break;
1703
                                                                    }
1704
                                                                }
1705
                                                            }
1706
                                                        }
1707
                                                    }                                                   
1708

  
1709
                                                    if (bNozzle != null)
1710
                                                        Pocket = "Yes";
1711
                                                }
1712
                                                else
1713
                                                    Pocket = "Yes";
1644 1714
                                            }
1645 1715
                                        }
1646

  
1716
                                        
1647 1717
                                        newRow["Pocket"] = Pocket;
1648 1718
                                        
1649 1719
                                        pipeSystemNetworkDT.Rows.Add(newRow);
......
1651 1721
                                }
1652 1722

  
1653 1723
                            }
1654
                            DataRow createTeeRow(DataRow itemRow)
1655
                            {
1656
                                DataRow newRow = pathItemsDT.NewRow();
1657
                                newRow["OID"] = Guid.NewGuid().ToString();
1658
                                newRow["SequenceData_OID"] = itemRow["SequenceData_OID"];
1659
                                newRow["TopologySet_OID"] = itemRow["TopologySet_OID"];
1660
                                newRow["BranchTopologySet_OID"] = itemRow["BranchTopologySet_OID"];
1661
                                newRow["PipeLine_OID"] = itemRow["PipeLine_OID"];
1662
                                newRow["ITEMNAME"] = "Branch"; //newRow["ITEMNAME"] = "End of line terminator";
1663
                                newRow["ITEMTAG"] = itemRow["ITEMTAG"];
1664
                                newRow["DESCRIPTION"] = "";
1665
                                newRow["Class"] = "Branch";
1666
                                newRow["SubClass"] = "Tee";
1667
                                newRow["TYPE"] = itemRow["TYPE"];
1668
                                newRow["PIDNAME"] = itemRow["PIDNAME"];
1669
                                newRow["NPD"] = itemRow["NPD"];
1670
                                newRow["PipeSystemNetwork_OID"] = itemRow["PipeSystemNetwork_OID"];
1671
                                newRow["ViewPipeSystemNetwork_OID"] = itemRow["ViewPipeSystemNetwork_OID"];
1672
                                newRow["PipeRun_OID"] = itemRow["PipeRun_OID"];
1673

  
1674
                                return newRow;
1675
                            }
1724
                        
1676 1725

  
1677 1726
                        }
1678 1727
                        catch (Exception ex)

내보내기 Unified diff

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