프로젝트

일반

사용자정보

개정판 f0656b3a

IDf0656b3a12c10edfbf16b47be7297653e94561d7
상위 45784c97
하위 395896a3, b963c708

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

issue #000: psn

Change-Id: I13e589d6dd990cb34ca843f143e91a145c87602d

차이점 보기:

DTI_PID/ID2PSN/PSN.cs
292 292
                DataRow[] nopocketRows = PipeSystemNetwork.Select("Pocket = 'Yes'");
293 293
                foreach (DataRow row in nopocketRows)
294 294
                {
295
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", row["OID"].ToString()));
295
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", row["OID"].ToString()));
296 296
                    foreach (DataRow dr in pathItemRows)
297 297
                    {
298 298
                        if (!string.IsNullOrEmpty(dr["BranchTopologySet_OID"].ToString()))
......
301 301

  
302 302
                            if (rows.First()["SubType"].ToString() == "Bypass")
303 303
                            {
304
                                DataRow[] bypassRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", dr.Field<string>("ViewPipeSystemNetwork_OID")));
304
                                DataRow[] bypassRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", dr.Field<string>("PipeSystemNetwork_OID")));
305 305

  
306 306
                                foreach (DataRow drby in bypassRows)
307 307
                                {
......
354 354

  
355 355
                foreach (DataRow drpipe in dtPipeSystemNetwork.Rows)
356 356
                {
357
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", drpipe["OID"].ToString()));
357
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", drpipe["OID"].ToString()));
358 358
                    DataTable dtSequenceItems = SequenceData.Clone();
359 359
                    foreach (DataRow drpath in pathItemRows)
360 360
                    {
......
417 417
                // 1, 2번
418 418
                foreach (DataRow dataRow in pumpRows) 
419 419
                {                  
420
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString()));
420
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"].ToString()));
421 421

  
422 422
                    string EGTAG = "EGTAG";
423 423
                   // string ItemTag = "ItemTag";
......
495 495
                foreach (DataRow dataRow in pumpRows) 
496 496
                {
497 497

  
498
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString()));
498
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"].ToString()));
499 499
                    PSNItem PSNItem = PSNItems.Find(x => x.PSN_OID() == dataRow["OID"].ToString());
500 500
                    string EGFlowDirection = string.Empty;
501 501

  
......
520 520

  
521 521
                    foreach (DataRow dr in pathItemRows)
522 522
                    {
523
                        if(dr.Field<string>("ViewPipeSystemNetwork_OID") != dataRow["OID"].ToString())
523
                        if(dr.Field<string>("PipeSystemNetwork_OID") != dataRow["OID"].ToString())
524 524
                        {
525 525
                            string viewEGFlowDirection = string.Empty;
526
                            if (PipeSystemNetwork.Select(string.Format("OID = '{0}'", dr.Field<string>("ViewPipeSystemNetwork_OID"))).Count() > 0)
526
                            if (PipeSystemNetwork.Select(string.Format("OID = '{0}'", dr.Field<string>("PipeSystemNetwork_OID"))).Count() > 0)
527 527
                            {
528
                                PSNItem viewPSNItem = PSNItems.Find(x => x.PSN_OID() == dr.Field<string>("ViewPipeSystemNetwork_OID"));                               
528
                                PSNItem viewPSNItem = PSNItems.Find(x => x.PSN_OID() == dr.Field<string>("PipeSystemNetwork_OID"));                               
529 529

  
530 530
                                if (viewPSNItem.Groups.First().Items.First().Equipment != null)
531 531
                                {
......
544 544
                                    }
545 545
                                }
546 546

  
547
                                if (EGFlowDirection.Equals(viewEGFlowDirection) && !lstViewPipeSystemNetwork_OID.Contains(dr.Field<string>("ViewPipeSystemNetwork_OID")))
548
                                    lstViewPipeSystemNetwork_OID.Add(dr.Field<string>("ViewPipeSystemNetwork_OID"));
547
                                if (EGFlowDirection.Equals(viewEGFlowDirection) && !lstViewPipeSystemNetwork_OID.Contains(dr.Field<string>("PipeSystemNetwork_OID")))
548
                                    lstViewPipeSystemNetwork_OID.Add(dr.Field<string>("PipeSystemNetwork_OID"));
549 549
                            }
550 550
                            else
551 551
                            {
......
561 561
                        {
562 562
                            if (PipeSystemNetwork.Select(string.Format("PUMP = 'PUMP' AND OID = '{0}'", viewOID)).Count() > 0)
563 563
                            {                                
564
                                selectViewOID = pathItemRows.Where(x => x.Field<string>("ViewPipeSystemNetwork_OID") == viewOID).Last().Field<string>("OID");
564
                                selectViewOID = pathItemRows.Where(x => x.Field<string>("PipeSystemNetwork_OID") == viewOID).Last().Field<string>("OID");
565 565
                            }
566 566
                        }
567 567
                    }
......
571 571
                        {
572 572
                            if (PipeSystemNetwork.Select(string.Format("PUMP = 'PUMP' AND OID = '{0}'", viewOID)).Count() > 0)
573 573
                            {
574
                                selectViewOID = pathItemRows.Where(x => x.Field<string>("ViewPipeSystemNetwork_OID") == viewOID).Last().Field<string>("OID");
574
                                selectViewOID = pathItemRows.Where(x => x.Field<string>("PipeSystemNetwork_OID") == viewOID).Last().Field<string>("OID");
575 575
                                break;
576 576
                            }
577 577
                        }
......
581 581
                    {              
582 582
                        string EqpGroupTag = string.Empty;                       
583 583

  
584
                        if((EGFlowDirection == "O" && lstViewPipeSystemNetwork_OID.Contains(pathItemRows.Last().Field<string>("ViewPipeSystemNetwork_OID"))) ||
585
                            (EGFlowDirection == "I" && lstViewPipeSystemNetwork_OID.Contains(pathItemRows.First().Field<string>("ViewPipeSystemNetwork_OID"))))
584
                        if((EGFlowDirection == "O" && lstViewPipeSystemNetwork_OID.Contains(pathItemRows.Last().Field<string>("PipeSystemNetwork_OID"))) ||
585
                            (EGFlowDirection == "I" && lstViewPipeSystemNetwork_OID.Contains(pathItemRows.First().Field<string>("PipeSystemNetwork_OID"))))
586 586
                        { 
587
                            DataRow[] viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", pathItemRows.First().Field<string>("ViewPipeSystemNetwork_OID")));
587
                            DataRow[] viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", pathItemRows.First().Field<string>("PipeSystemNetwork_OID")));
588 588

  
589 589
                            foreach (DataRow row in viewpathItemRows)
590 590
                            {
......
670 670
                // 5번
671 671
                foreach (DataRow dataRow in pumpRows)
672 672
                {
673
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString()));
673
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"].ToString()));
674 674

  
675 675
                    bool bCheck = false;
676 676
                    string EqpGroupTag = string.Empty;
......
708 708
                                if(!lstEqTagRows.Contains(EqpGroupTag))
709 709
                                    lstEqTagRows.Add(EqpGroupTag);
710 710

  
711
                                if(dataRow["OID"].ToString() != dr.Field<string>("ViewPipeSystemNetwork_OID"))
711
                                if(dataRow["OID"].ToString() != dr.Field<string>("PipeSystemNetwork_OID"))
712 712
                                {
713
                                    PSNItem viewPSNItem = PSNItems.Find(x => x.PSN_OID() == dr.Field<string>("ViewPipeSystemNetwork_OID"));
713
                                    PSNItem viewPSNItem = PSNItems.Find(x => x.PSN_OID() == dr.Field<string>("PipeSystemNetwork_OID"));
714 714
                                    if (viewPSNItem.Groups.Last().Items.Last().Equipment == null)
715 715
                                        continue;
716 716

  
......
743 743
                            {
744 744
                                foreach (string viewPipesystem in lstViewPipeSystemNetwork_OID)
745 745
                                {
746
                                    DataRow[] viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", viewPipesystem));
746
                                    DataRow[] viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", viewPipesystem));
747 747
                                    foreach (DataRow viewdr in viewpathItemRows)
748 748
                                    {
749 749
                                        if (!string.IsNullOrEmpty(viewdr["EqpGroupTag"].ToString()))
......
828 828
                                EGTAG = Prefix + "-" + EGTAG;                          
829 829
                        }
830 830

  
831
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString()));
831
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"].ToString()));
832 832
                        foreach (DataRow dr in pathItemRows)
833 833
                        {
834 834
                            dr["EqpGroupTag"] = EGTAG;
......
844 844
                    if (changePSN.Contains(dataRow["OID"].ToString()))
845 845
                        continue;
846 846

  
847
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString()));
847
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"].ToString()));
848 848
                    string AFCTag = string.Empty;
849 849
                    if (pathItemRows.Where(x => !string.IsNullOrEmpty(x.Field<string>("EqpGroupTag"))).Count() > 0)
850 850
                        AFCTag = pathItemRows.Where(x => !string.IsNullOrEmpty(x.Field<string>("EqpGroupTag"))).First().Field<string>("EqpGroupTag");
851 851

  
852
                    List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("ViewPipeSystemNetwork_OID")).Distinct().ToList();
852
                    List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("PipeSystemNetwork_OID")).Distinct().ToList();
853 853

  
854 854
                    if (dataRow["Type"].ToString() == "E2E")
855 855
                    {
......
867 867

  
868 868
                            if (p2psn.Count() > 0)
869 869
                            {
870
                                DataRow[] viewPathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", lstoid));
871
                                List<string> lstview = viewPathItemRows.Select(x => x.Field<string>("ViewPipeSystemNetwork_OID")).Distinct().ToList();
870
                                DataRow[] viewPathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", lstoid));
871
                                List<string> lstview = viewPathItemRows.Select(x => x.Field<string>("PipeSystemNetwork_OID")).Distinct().ToList();
872 872
                                lstview.Remove(dataRow["OID"].ToString()); // P1인 자신 제거
873 873
                                lstview.Remove(lstoid); // P2 자신 제거
874 874

  
......
890 890
                                else
891 891
                                {
892 892
                                    // P2에 ML값 AGT값 지정
893
                                    DataRow[] viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", lstoid));
893
                                    DataRow[] viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", lstoid));
894 894
                                    DataRow[] pipesystemRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", lstoid));
895 895
                                    foreach (DataRow viewdr in pipesystemRows)
896 896
                                    {
......
905 905
                                    // 연결된 모든 P1들의 AGT값 치환
906 906
                                    foreach (string pipe in lstnewpipe)
907 907
                                    {
908
                                        viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", pipe));
908
                                        viewpathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", pipe));
909 909
                                        foreach (DataRow viewdr in viewpathItemRows)
910 910
                                        {
911 911
                                            viewdr["EqpGroupTag"] = AFCTag;
......
921 921
                airFinCoolerRows = PipeSystemNetwork.Select("AFC Like 'P1%'");
922 922
                foreach (DataRow dataRow in airFinCoolerRows)
923 923
                {
924
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"].ToString()));
924
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"].ToString()));
925 925
                    
926 926
                    if (pathItemRows.Count() > 0)
927 927
                    {
928
                        List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("ViewPipeSystemNetwork_OID")).Distinct().ToList();
928
                        List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("PipeSystemNetwork_OID")).Distinct().ToList();
929 929
                        List<string> lstpsn = new List<string>();
930 930
                        List<string> lstAll = new List<string>();
931 931
                        string EqpGroupTag = string.Empty;
......
946 946
                            {
947 947
                                //P3의 AGT를 가져와 P1에 입력
948 948
                                if(string.IsNullOrEmpty(EqpGroupTag))
949
                                    EqpGroupTag = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", viewOID)).First().Field<string>("EqpGroupTag");
949
                                    EqpGroupTag = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", viewOID)).First().Field<string>("EqpGroupTag");
950 950

  
951 951
                                foreach (DataRow dr in pathItemRows)
952 952
                                {
953 953
                                    dr["EqpGroupTag"] = EqpGroupTag;
954 954

  
955 955
                                    //P1의 AGT와 같은 모든 AGT를 P3의 AGT로 변경하기위해 
956
                                    if (!string.IsNullOrEmpty(dr.Field<string>("ViewPipeSystemNetwork_OID")) && !lstpsn.Contains(dr.Field<string>("ViewPipeSystemNetwork_OID")))
956
                                    if (!string.IsNullOrEmpty(dr.Field<string>("PipeSystemNetwork_OID")) && !lstpsn.Contains(dr.Field<string>("PipeSystemNetwork_OID")))
957 957
                                    {
958 958
                                        //AND MainLineTag = ''
959
                                        if (PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}' ", dr.Field<string>("ViewPipeSystemNetwork_OID"))).Count() > 0)
959
                                        if (PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}' ", dr.Field<string>("PipeSystemNetwork_OID"))).Count() > 0)
960 960
                                        {
961
                                            lstpsn.Add(dr.Field<string>("ViewPipeSystemNetwork_OID"));
962
                                            lstAll.Add(dr.Field<string>("ViewPipeSystemNetwork_OID"));
961
                                            lstpsn.Add(dr.Field<string>("PipeSystemNetwork_OID"));
962
                                            lstAll.Add(dr.Field<string>("PipeSystemNetwork_OID"));
963 963
                                        }
964 964
                                    }
965 965
                                }
......
968 968

  
969 969
                        while (lstpsn.Count() != 0)
970 970
                        {                            
971
                            DataRow[] rule4pathItems = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", lstpsn[0]));
971
                            DataRow[] rule4pathItems = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", lstpsn[0]));
972 972
                            foreach (DataRow dr in rule4pathItems)
973 973
                            {
974
                                if (!string.IsNullOrEmpty(dr.Field<string>("ViewPipeSystemNetwork_OID")) && !lstAll.Contains(dr.Field<string>("ViewPipeSystemNetwork_OID")))
974
                                if (!string.IsNullOrEmpty(dr.Field<string>("PipeSystemNetwork_OID")) && !lstAll.Contains(dr.Field<string>("PipeSystemNetwork_OID")))
975 975
                                {
976 976
                                    DataRow viewPSN = null;
977 977

  
978
                                    if (airFinCoolerRows.Where(x => x.Field<string>("OID") == dr.Field<string>("ViewPipeSystemNetwork_OID")).Count() > 0)
979
                                        viewPSN = airFinCoolerRows.Where(x => x.Field<string>("OID") == dr.Field<string>("ViewPipeSystemNetwork_OID")).First();
978
                                    if (airFinCoolerRows.Where(x => x.Field<string>("OID") == dr.Field<string>("PipeSystemNetwork_OID")).Count() > 0)
979
                                        viewPSN = airFinCoolerRows.Where(x => x.Field<string>("OID") == dr.Field<string>("PipeSystemNetwork_OID")).First();
980 980
                                                                        
981 981
                                    if (viewPSN != null)
982 982
                                    {
983
                                        lstpsn.Add(dr.Field<string>("ViewPipeSystemNetwork_OID"));
984
                                        lstAll.Add(dr.Field<string>("ViewPipeSystemNetwork_OID"));
983
                                        lstpsn.Add(dr.Field<string>("PipeSystemNetwork_OID"));
984
                                        lstAll.Add(dr.Field<string>("PipeSystemNetwork_OID"));
985 985
                                    }
986 986
                                }                                
987 987

  
......
996 996

  
997 997
                foreach(DataRow dr in PipeSystemNetwork.Rows)
998 998
                {
999
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}' AND MainLineTag = 'M'", dr["OID"].ToString()));
999
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}' AND MainLineTag = 'M'", dr["OID"].ToString()));
1000 1000
                    if(pathItemRows.Count() > 0)
1001 1001
                    {
1002 1002
                        if(dr["Type"].ToString() == "HD2")
1003 1003
                        {
1004
                            List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("ViewPipeSystemNetwork_OID")).Distinct().ToList();
1004
                            List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("PipeSystemNetwork_OID")).Distinct().ToList();
1005 1005
                            foreach(string viewpsn in lstViewPipeSystemNetwork_OID)
1006 1006
                            {                              
1007 1007
                                if (PipeSystemNetwork.Select(string.Format("OID = '{0}' AND AFC = 'P2'", viewpsn)).Count() > 0)
1008 1008
                                {
1009
                                    foreach(DataRow dataRow in pathItemRows.Where(x => x.Field<string>("ViewPipeSystemNetwork_OID") == viewpsn))
1009
                                    foreach(DataRow dataRow in pathItemRows.Where(x => x.Field<string>("PipeSystemNetwork_OID") == viewpsn))
1010 1010
                                    {
1011 1011
                                        dataRow["EGTConnectedPoint"] = "1";
1012 1012
                                    }
......
1039 1039

  
1040 1040
                            if (!string.IsNullOrEmpty(EGFlowDirection))
1041 1041
                            {
1042
                                List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("ViewPipeSystemNetwork_OID")).Distinct().ToList();
1042
                                List<string> lstViewPipeSystemNetwork_OID = pathItemRows.Select(x => x.Field<string>("PipeSystemNetwork_OID")).Distinct().ToList();
1043 1043
                                string lastP1 = string.Empty;
1044 1044

  
1045 1045
                                foreach (string viewpsn in lstViewPipeSystemNetwork_OID)
......
1075 1075
                                                dataRow["EGFlowDirection"] = string.Empty;
1076 1076
                                            }
1077 1077

  
1078
                                            if (dataRow.Field<string>("ViewPipeSystemNetwork_OID").Equals(lastP1))
1078
                                            if (dataRow.Field<string>("PipeSystemNetwork_OID").Equals(lastP1))
1079 1079
                                            {
1080 1080
                                                bCheck = true;
1081 1081
                                                dataRow["EGTConnectedPoint"] = 1;
......
1086 1086
                                    {
1087 1087
                                        foreach (DataRow dataRow in pathItemRows)
1088 1088
                                        {
1089
                                            if (dataRow.Field<string>("ViewPipeSystemNetwork_OID").Equals(lastP1))
1089
                                            if (dataRow.Field<string>("PipeSystemNetwork_OID").Equals(lastP1))
1090 1090
                                            {
1091 1091
                                                dataRow["EGTConnectedPoint"] = 1;
1092 1092
                                                break;
......
1108 1108
                //psn data 정리
1109 1109
                foreach(DataRow pipesystem in PipeSystemNetwork.Rows)
1110 1110
                {
1111
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", pipesystem["OID"].ToString()));
1111
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", pipesystem["OID"].ToString()));
1112 1112
                    string EGTag = string.Empty;
1113 1113
                    string HasMLTags = "False";
1114 1114

  
......
1165 1165
                        continue;
1166 1166

  
1167 1167
                    string[] valvetag = drPathitem["GROUPTAG"].ToString().Split(new string[] { "\\" }, StringSplitOptions.None);
1168
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", drPathitem["PipeSystemNetwork_OID"].ToString()));
1168
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", drPathitem["PipeSystemNetwork_OID_ID2"].ToString()));
1169 1169
                    ValveGroupItem valveitem = ValveGrouping.ValveGroupItems.Where(x => x.SppidSymbolName == valvetag[0]).FirstOrDefault();
1170 1170
                    if (valveitem == null || valveitem.GroupType == "Scope Break")
1171 1171
                        continue;
......
1250 1250
                                {
1251 1251
                                    if(TopologySet.Select(string.Format("OID = '{0}'", dr["BranchTopologySet_OID"].ToString())).First().Field<string>("SubType") == "Bypass")
1252 1252
                                    {
1253
                                        DataRow[] rows = keyValuePair.Value.Where(x => x.Field<string>("ViewPipeSystemNetwork_OID").Equals(dr["ViewPipeSystemNetwork_OID"].ToString())).ToArray();
1253
                                        DataRow[] rows = keyValuePair.Value.Where(x => x.Field<string>("PipeSystemNetwork_OID").Equals(dr["PipeSystemNetwork_OID"].ToString())).ToArray();
1254 1254
                                        foreach(DataRow path in rows)
1255 1255
                                        {
1256 1256
                                            DataRow topology = TopologySet.Select(string.Format("OID = '{0}'", path["BranchTopologySet_OID"].ToString())).First();
......
1308 1308
                                            {
1309 1309
                                                if (TopologySet.Select(string.Format("OID = '{0}'", dr["BranchTopologySet_OID"].ToString())).First().Field<string>("SubType") == "Bypass")
1310 1310
                                                {
1311
                                                    DataRow[] rows = keyValuePair.Value.Where(x => x.Field<string>("ViewPipeSystemNetwork_OID").Equals(dr["ViewPipeSystemNetwork_OID"].ToString())).ToArray();
1311
                                                    DataRow[] rows = keyValuePair.Value.Where(x => x.Field<string>("PipeSystemNetwork_OID").Equals(dr["PipeSystemNetwork_OID"].ToString())).ToArray();
1312 1312
                                                    foreach (DataRow path in rows)
1313 1313
                                                    {
1314 1314
                                                        DataRow topology = TopologySet.Select(string.Format("OID = '{0}'", path["BranchTopologySet_OID"].ToString())).First();
......
1330 1330

  
1331 1331
                                        if (valveitems.GroupType.Contains("PSV"))
1332 1332
                                        {
1333
                                            DataRow[] psnRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", drPathitem["PipeSystemNetwork_OID"].ToString()));
1333
                                            DataRow[] psnRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", drPathitem["PipeSystemNetwork_OID_ID2"].ToString()));
1334 1334
                                            foreach (DataRow row in psnRows)
1335 1335
                                                row["Pocket"] = "Yes";
1336 1336
                                        }
......
1342 1342

  
1343 1343
                    if(valveitem.GroupType.Contains("PSV"))
1344 1344
                    {
1345
                        DataRow[] psnRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", drPathitem["PipeSystemNetwork_OID"].ToString()));
1345
                        DataRow[] psnRows = PipeSystemNetwork.Select(string.Format("OID = '{0}'", drPathitem["PipeSystemNetwork_OID_ID2"].ToString()));
1346 1346
                        foreach (DataRow row in psnRows)
1347 1347
                            row["Pocket"] = "Yes";
1348 1348
                    }                    
......
2261 2261
                pathItemsDT.Columns.Add("Equipment_OID", typeof(string));
2262 2262
                pathItemsDT.Columns.Add("NPD", typeof(string));
2263 2263
                pathItemsDT.Columns.Add("GROUPTAG", typeof(string));
2264
                pathItemsDT.Columns.Add("PipeSystemNetwork_OID_ID2", typeof(string));
2264 2265
                pathItemsDT.Columns.Add("PipeSystemNetwork_OID", typeof(string));
2265
                pathItemsDT.Columns.Add("ViewPipeSystemNetwork_OID", typeof(string));
2266 2266
                pathItemsDT.Columns.Add("PipeRun_OID", typeof(string));
2267 2267
                pathItemsDT.Columns.Add("EqpGroupTag", typeof(string));
2268 2268
                pathItemsDT.Columns.Add("MainLineTag", typeof(string));
......
2693 2693
                                            newRow["NPD"] = null;
2694 2694

  
2695 2695
                                        newRow["GROUPTAG"] = GROUPTAG;
2696
                                        newRow["PipeSystemNetwork_OID"] = PSNItem.PSN_OID();
2696
                                        newRow["PipeSystemNetwork_OID_ID2"] = PSNItem.PSN_OID();
2697 2697
                                        if (branchItem == null)
2698
                                            newRow["ViewPipeSystemNetwork_OID"] = PSNItem.PSN_OID();
2698
                                            newRow["PipeSystemNetwork_OID"] = PSNItem.PSN_OID();
2699 2699
                                        else
2700
                                            newRow["ViewPipeSystemNetwork_OID"] = branchItem.PSNItem.PSN_OID();
2700
                                            newRow["PipeSystemNetwork_OID"] = branchItem.PSNItem.PSN_OID();
2701 2701

  
2702 2702
                                        newRow["PipeRun_OID"] = item.LineNumber != null ? item.LineNumber.Name : string.Empty;
2703 2703
                                        newRow["EGTConnectedPoint"] = 0;
......
3052 3052
                    if (rows.Length == 1)
3053 3053
                    {
3054 3054
                        rows.First()["BranchTopologySet_OID"] = topologyName;
3055
                        rows.First()["ViewPipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID();
3055
                        rows.First()["PipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID();
3056 3056
                    }
3057 3057
                    else if (rows.Length > 1)
3058 3058
                    {
......
3075 3075
                        if (targetRow != null)
3076 3076
                        {
3077 3077
                            targetRow["BranchTopologySet_OID"] = topologyName;
3078
                            targetRow["ViewPipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID();
3078
                            targetRow["PipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID();
3079 3079
                        }
3080 3080
                    }
3081 3081
                }
......
3088 3088
                    if (rows.Length == 1)
3089 3089
                    {
3090 3090
                        rows.First()["BranchTopologySet_OID"] = topologyName;
3091
                        rows.First()["ViewPipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID();
3091
                        rows.First()["PipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID();
3092 3092
                    }
3093 3093
                    else if (rows.Length > 1)
3094 3094
                    {
......
3111 3111
                        if (targetRow != null)
3112 3112
                        {
3113 3113
                            targetRow["BranchTopologySet_OID"] = topologyName;
3114
                            targetRow["ViewPipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID();
3114
                            targetRow["PipeSystemNetwork_OID"] = item.Value.PSNItem.PSN_OID();
3115 3115
                        }
3116 3116
                    }
3117 3117
                }
......
3375 3375

  
3376 3376
                if (dataRow.Field<string>("From_Data") == "ENDOFHEADER")
3377 3377
                {
3378
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"]));
3378
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"]));
3379 3379
                    DataRow dr = pathItemRows.First();
3380 3380
                    dr["CLASS"] = PSNItem.Groups.First().Items.First().ID2DBName;
3381 3381
                    dr["TYPE"] = "End";
......
3385 3385

  
3386 3386
                if (dataRow.Field<string>("To_Data") == "ENDOFHEADER")
3387 3387
                {
3388
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"]));
3388
                    DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"]));
3389 3389
                    DataRow dr = pathItemRows.Last();
3390 3390
                    dr["CLASS"] = PSNItem.Groups.Last().Items.Last().ID2DBName;
3391 3391
                    dr["TYPE"] = "End";
......
3403 3403

  
3404 3404
                    if (dataRow.Field<string>("From_Data") == keyitem.Keyword)
3405 3405
                    {
3406
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"]));
3406
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"]));
3407 3407

  
3408 3408
                        //
3409 3409
                        //if(.)
......
3420 3420

  
3421 3421
                    if (dataRow.Field<string>("To_Data") == keyitem.Keyword)
3422 3422
                    {
3423
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"]));
3423
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"]));
3424 3424

  
3425 3425
                        if (PSNItem.Groups.Last().Items.Last().Name.Equals(keyitem.Name))
3426 3426
                        {
......
3451 3451
                    if (!PSNItem.EnableType(PSNItem.StartType))
3452 3452
                    {
3453 3453
                        
3454
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"]));
3454
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"]));
3455 3455
                        int insertIndex = PathItems.Rows.IndexOf(pathItemRows.First());
3456 3456

  
3457 3457
                        Item item = PSNItem.Groups.First().Items.First();
......
3497 3497
                                    }
3498 3498
                                    else
3499 3499
                                    {
3500
                                        PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).First()), insertIndex);
3500
                                        PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND PipeSystemNetwork_OID_ID2 = '{1}'", item.PSNPipeLineID, dataRow["OID"])).First()), insertIndex);
3501 3501
                                        PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.First(), FROM_DATA), insertIndex);
3502 3502

  
3503 3503
                                        bCheck = true;
......
3548 3548

  
3549 3549
                    if (!PSNItem.EnableType(PSNItem.EndType))
3550 3550
                    {
3551
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", dataRow["OID"]));
3551
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", dataRow["OID"]));
3552 3552
                        //int insertIndex = PathItems.Rows.IndexOf(pathItemRows.First()) + pathItemRows.Count() - 1;
3553 3553
                        DataRow dr = pathItemRows.Last();
3554 3554
                        if (change)
......
3607 3607
                                    else
3608 3608
                                    {
3609 3609
                                        PathItems.Rows.InsertAt(createTerminatorRow(pathItemRows.Last(), TO_DATA), insertIndex);
3610
                                        PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND PipeSystemNetwork_OID = '{1}'", item.PSNPipeLineID, dataRow["OID"])).Last()), insertIndex);
3610
                                        PathItems.Rows.InsertAt(createLineRow(PathItems.Select(string.Format("PipeLine_OID = '{0}' AND PipeSystemNetwork_OID_ID2 = '{1}'", item.PSNPipeLineID, dataRow["OID"])).Last()), insertIndex);
3611 3611
                                    }
3612 3612
                                }
3613 3613
                                else
......
3662 3662
                        for (int i = 0; i < PathItems.Rows.Count; i++)
3663 3663
                        {
3664 3664
                            DataRow row = PathItems.Rows[i];
3665
                            if (row["PipeSystemNetwork_OID"].ToString() != dataRow["OID"].ToString())
3665
                            if (row["PipeSystemNetwork_OID_ID2"].ToString() != dataRow["OID"].ToString())
3666 3666
                                continue;
3667 3667
                            string sequenceData = row["SequenceData_OID"].ToString();
3668 3668
                            string[] split = sequenceData.Split(new char[] { '_' });
......
3714 3714
                        newRow["MULTIWAY"] = "";
3715 3715
                        newRow["PIDNAME"] = itemRow["PIDNAME"];
3716 3716
                        newRow["NPD"] = itemRow["NPD"];
3717
                        newRow["PipeSystemNetwork_OID_ID2"] = itemRow["PipeSystemNetwork_OID_ID2"];
3717 3718
                        newRow["PipeSystemNetwork_OID"] = itemRow["PipeSystemNetwork_OID"];
3718
                        newRow["ViewPipeSystemNetwork_OID"] = itemRow["ViewPipeSystemNetwork_OID"];
3719 3719
                        newRow["PipeRun_OID"] = itemRow["PipeRun_OID"];
3720 3720
                        newRow["EGTConnectedPoint"] = "0";
3721 3721
                        return newRow;
......
3737 3737
                        newRow["MULTIWAY"] = "";
3738 3738
                        newRow["PIDNAME"] = itemRow["PIDNAME"];
3739 3739
                        newRow["NPD"] = itemRow["NPD"];
3740
                        newRow["PipeSystemNetwork_OID_ID2"] = itemRow["PipeSystemNetwork_OID_ID2"];
3740 3741
                        newRow["PipeSystemNetwork_OID"] = itemRow["PipeSystemNetwork_OID"];
3741
                        newRow["ViewPipeSystemNetwork_OID"] = itemRow["ViewPipeSystemNetwork_OID"];
3742 3742
                        newRow["PipeRun_OID"] = itemRow["PipeRun_OID"];
3743 3743
                        newRow["EGTConnectedPoint"] = "0";
3744 3744
                        return newRow;
......
3765 3765
                    DataRow[] pipeSystem = PipeSystemNetwork.Select(string.Format("OID = '{0}'", PSNItem.PSN_OID()));
3766 3766
                    if (PSNItem.StartType == PSNType.Branch)
3767 3767
                    {
3768
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", PSNItem.PSN_OID()));
3768
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", PSNItem.PSN_OID()));
3769 3769
                        int insertIndex = PathItems.Rows.IndexOf(pathItemRows.First());
3770 3770
                        Item Teeitem = PSNItem.Groups.First().Items.First();
3771 3771
                        try
......
3779 3779
                                    PathItems.Rows.InsertAt(createTeeRow(pathItemRows.First()), insertIndex);
3780 3780
                                    change = true;
3781 3781
                                    pathItemRows.First().SetField("BranchTopologySet_OID", string.Empty);
3782
                                    pathItemRows.First().SetField("ViewPipeSystemNetwork_OID", dataRow["OID"].ToString());                                    
3782
                                    pathItemRows.First().SetField("PipeSystemNetwork_OID", dataRow["OID"].ToString());                                    
3783 3783
                                }
3784 3784
                                else
3785 3785
                                { //dicMultiwaySymbolUID.Add(item.UID, 1);
......
3790 3790
                                    PathItems.Rows.InsertAt(createMultiWayConnRow(PathItems.Select(string.Format("OID = '{0}'", Teeitem.Relations[0].Item.UID + "_M1")).First(), multiItemOID, pathItemRows.First()), insertIndex);
3791 3791
                                    change = true;
3792 3792
                                    pathItemRows.First().SetField("BranchTopologySet_OID", string.Empty);
3793
                                    pathItemRows.First().SetField("ViewPipeSystemNetwork_OID", dataRow["OID"].ToString());
3793
                                    pathItemRows.First().SetField("PipeSystemNetwork_OID", dataRow["OID"].ToString());
3794 3794

  
3795 3795
                                    SequenceData.Rows.InsertAt(CreateSequenceDataDataRow(pathItemRows.First(), multiItemOID, 0), 0);
3796 3796

  
......
3811 3811
                                    dicMultiwaySymbolUID[_items[0].UID] = index;
3812 3812
                                    PathItems.Rows.InsertAt(createMultiWayConnRow(PathItems.Select(string.Format("OID = '{0}'", _items[0].UID + "_M1")).First(), multiItemOID, pathItemRows.First()), insertIndex);
3813 3813
                                    pathItemRows.First().SetField("BranchTopologySet_OID", string.Empty);
3814
                                    pathItemRows.First().SetField("ViewPipeSystemNetwork_OID", dataRow["OID"].ToString());
3814
                                    pathItemRows.First().SetField("PipeSystemNetwork_OID", dataRow["OID"].ToString());
3815 3815

  
3816 3816
                                    change = true;
3817 3817

  
......
3835 3835
                    if (PSNItem.EndType == PSNType.Branch)
3836 3836
                    {
3837 3837
                        //change = true;
3838
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", PSNItem.PSN_OID()));
3838
                        DataRow[] pathItemRows = PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", PSNItem.PSN_OID()));
3839 3839

  
3840 3840
                        Item Teeitem = PSNItem.Groups.Last().Items.Last();
3841 3841

  
......
3856 3856
                                        PathItems.Rows.InsertAt(createTeeRow(dr), insertIndex);
3857 3857
                                        change = true;
3858 3858
                                        dr.SetField("BranchTopologySet_OID", string.Empty);
3859
                                        dr.SetField("ViewPipeSystemNetwork_OID", dataRow["OID"].ToString());
3859
                                        dr.SetField("PipeSystemNetwork_OID", dataRow["OID"].ToString());
3860 3860
                                    }
3861 3861
                                    else
3862 3862
                                    {
......
3866 3866
                                        PathItems.Rows.InsertAt(createMultiWayConnRow(PathItems.Select(string.Format("OID = '{0}'", Teeitem.Relations[1].Item.UID + "_M1")).First(), multiItemOID, dr), insertIndex);
3867 3867
                                        change = true;
3868 3868
                                        dr.SetField("BranchTopologySet_OID", string.Empty);
3869
                                        dr.SetField("ViewPipeSystemNetwork_OID", dataRow["OID"].ToString());
3869
                                        dr.SetField("PipeSystemNetwork_OID", dataRow["OID"].ToString());
3870 3870

  
3871
                                        SequenceData.Rows.InsertAt(CreateSequenceDataDataRow(dr, multiItemOID, PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", PSNItem.PSN_OID())).Count()), 0);
3871
                                        SequenceData.Rows.InsertAt(CreateSequenceDataDataRow(dr, multiItemOID, PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", PSNItem.PSN_OID())).Count()), 0);
3872 3872

  
3873 3873
                                        foreach (DataRow pipedr in pipeSystem)
3874 3874
                                        {
......
3891 3891
                                    PathItems.Rows.InsertAt(createMultiWayConnRow(PathItems.Select(string.Format("OID = '{0}'", _items[0].UID + "_M1")).First(), multiItemOID, dr), insertIndex);
3892 3892
                                    change = true;
3893 3893
                                    dr.SetField("BranchTopologySet_OID", string.Empty);
3894
                                    dr.SetField("ViewPipeSystemNetwork_OID", dataRow["OID"].ToString());
3895
                                    SequenceData.Rows.InsertAt(CreateSequenceDataDataRow(dr, multiItemOID, PathItems.Select(string.Format("PipeSystemNetwork_OID = '{0}'", PSNItem.PSN_OID())).Count()), 0);
3894
                                    dr.SetField("PipeSystemNetwork_OID", dataRow["OID"].ToString());
3895
                                    SequenceData.Rows.InsertAt(CreateSequenceDataDataRow(dr, multiItemOID, PathItems.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", PSNItem.PSN_OID())).Count()), 0);
3896 3896

  
3897 3897
                                    foreach (DataRow pipedr in pipeSystem)
3898 3898
                                    {
......
3910 3910

  
3911 3911
                    if (change)
3912 3912
                    {
3913
                        //DataRow[] pathItemRows = pathItemsDT.Select(string.Format("PipeSystemNetwork_OID = '{0}'", PSNItem.PSN_OID()));
3913
                        //DataRow[] pathItemRows = pathItemsDT.Select(string.Format("PipeSystemNetwork_OID_ID2 = '{0}'", PSNItem.PSN_OID()));
3914 3914
                        int rowIndex = 0;
3915 3915
                        for (int i = 0; i < PathItems.Rows.Count; i++)
3916 3916
                        {
3917 3917
                            DataRow row = PathItems.Rows[i];
3918
                            if (row["PipeSystemNetwork_OID"].ToString() != PSNItem.PSN_OID())
3918
                            if (row["PipeSystemNetwork_OID_ID2"].ToString() != PSNItem.PSN_OID())
3919 3919
                                continue;
3920 3920
                            string sequenceData = row["SequenceData_OID"].ToString();
3921 3921
                            string[] split = sequenceData.Split(new char[] { '_' });
......
3967 3967
                        newRow["MULTIWAY"] = itemRow["MULTIWAY"];
3968 3968
                        newRow["PIDNAME"] = itemRow["PIDNAME"];
3969 3969
                        newRow["NPD"] = itemRow["NPD"];
3970
                        newRow["PipeSystemNetwork_OID_ID2"] = itemRow["PipeSystemNetwork_OID_ID2"];
3970 3971
                        newRow["PipeSystemNetwork_OID"] = itemRow["PipeSystemNetwork_OID"];
3971
                        newRow["ViewPipeSystemNetwork_OID"] = itemRow["ViewPipeSystemNetwork_OID"];
3972 3972
                        newRow["PipeRun_OID"] = itemRow["PipeRun_OID"];
3973 3973
                      
3974 3974
                        newRow["EGTConnectedPoint"] = 0;
......
4003 4003
                        newRow["MULTIWAY"] = itemRow["MULTIWAY"];
4004 4004
                        newRow["PIDNAME"] = itemRow["PIDNAME"];
4005 4005
                        newRow["NPD"] = itemRow["NPD"];
4006
                        newRow["PipeSystemNetwork_OID_ID2"] = itemRow2["PipeSystemNetwork_OID_ID2"];
4006 4007
                        newRow["PipeSystemNetwork_OID"] = itemRow2["PipeSystemNetwork_OID"];
4007
                        newRow["ViewPipeSystemNetwork_OID"] = itemRow2["ViewPipeSystemNetwork_OID"];
4008 4008
                        newRow["PipeRun_OID"] = itemRow2["PipeRun_OID"];
4009 4009
                        newRow["EGTConnectedPoint"] = itemRow["EGTConnectedPoint"];
4010 4010
                        return newRow;

내보내기 Unified diff

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