개정판 d4b1ab29
issue #000: psn Keyword 수정중
Change-Id: I16f70d04ab35137c90823cfd319f0d96cd6161f3
DTI_PID/ID2PSN/DB.cs | ||
---|---|---|
220 | 220 |
matched = names.FirstOrDefault(param => param == PSN_TRANSFORMKEYWORD_SETTING); |
221 | 221 |
if (matched == null) |
222 | 222 |
{ |
223 |
var query = $"CREATE TABLE {PSN_TRANSFORMKEYWORD_SETTING} (GROUP_ID TEXT, DESCRIPTION TEXT, [INDEX] INTEGER, [NAME] TEXT, [KEYWORD] TEXT)";
|
|
223 |
var query = $"CREATE TABLE {PSN_TRANSFORMKEYWORD_SETTING} ([INDEX] INTEGER, [NAME] TEXT, [KEYWORD] TEXT)"; |
|
224 | 224 |
using (var cmd = connection.GetSqlStringCommand(query)) |
225 | 225 |
{ |
226 | 226 |
cmd.ExecuteNonQuery(); |
... | ... | |
676 | 676 |
{ |
677 | 677 |
try |
678 | 678 |
{ |
679 |
var query = $@"SELECT GROUP_ID, DESCRIPTION, [INDEX], [NAME], [KEYWORD] FROM {PSN_TRANSFORMKEYWORD_SETTING};";
|
|
679 |
var query = $@"SELECT [KEYWORD], [INDEX], [NAME] FROM {PSN_TRANSFORMKEYWORD_SETTING};";
|
|
680 | 680 |
using (var ds = connection.ExecuteDataSet(connection.GetSqlStringCommand(query))) |
681 | 681 |
{ |
682 | 682 |
dt = ds.Tables[0].Copy(); |
... | ... | |
784 | 784 |
{ |
785 | 785 |
foreach (KeywordItem item in keywordInfo.KeywordItems) |
786 | 786 |
{ |
787 |
query = $"INSERT INTO {PSN_TRANSFORMKEYWORD_SETTING} VALUES (@GROUP_ID, @DESCRIPTION, @INDEX, @NAME, @KEYWORD)";
|
|
787 |
query = $"INSERT INTO {PSN_TRANSFORMKEYWORD_SETTING} VALUES (@INDEX, @NAME, @KEYWORD)"; |
|
788 | 788 |
var cmd = connection.GetSqlStringCommand(query); |
789 |
AddWithValue(cmd, "@GROUP_ID", keywordInfo.UID); |
|
790 |
AddWithValue(cmd, "@DESCRIPTION", keywordInfo.Description); |
|
791 | 789 |
AddWithValue(cmd, "@INDEX", item.Index); |
792 | 790 |
AddWithValue(cmd, "@NAME", item.Name); |
793 | 791 |
AddWithValue(cmd, "@KEYWORD", item.Keyword); |
DTI_PID/ID2PSN/Document.cs | ||
---|---|---|
470 | 470 |
} |
471 | 471 |
#endregion |
472 | 472 | |
473 |
#region KeywordSetting |
|
474 |
List<KeywordInfo> KeywordInfos = new List<KeywordInfo>(); |
|
475 |
DataTable dtKeyword = DB.SelectKeywordsSetting(); |
|
476 |
foreach (DataRow row in dtKeyword.Rows) |
|
477 |
{ |
|
478 |
string groupID = row["GROUP_ID"].ToString(); |
|
479 |
string desc = row["DESCRIPTION"].ToString(); |
|
480 |
int index = Convert.ToInt32(row["INDEX"]); |
|
481 |
string name = row["NAME"].ToString(); |
|
482 |
string keyword = row["KEYWORD"].ToString(); |
|
483 | ||
484 |
KeywordInfo keywordInfo = KeywordInfos.Find(x => x.UID.Equals(groupID)); |
|
485 |
if (keywordInfo == null) |
|
486 |
{ |
|
487 |
keywordInfo = new KeywordInfo(groupID); |
|
488 |
keywordInfo.Description = desc; |
|
489 |
KeywordInfos.Add(keywordInfo); |
|
490 |
} |
|
491 | ||
492 |
keywordInfo.KeywordItems.Add(new KeywordItem() |
|
493 |
{ |
|
494 |
Index = index, |
|
495 |
Name = name, |
|
496 |
Keyword = keyword |
|
497 |
}); |
|
498 |
} |
|
499 |
foreach (KeywordInfo keywordInfo in KeywordInfos) |
|
500 |
keywordInfo.KeywordItems = keywordInfo.KeywordItems.OrderBy(x => x.Index).ToList(); |
|
501 | ||
502 |
foreach (Group group in Groups) |
|
503 |
{ |
|
504 |
List<KeywordInfo> endInfos = new List<KeywordInfo>(); |
|
505 |
bool bFind = false; |
|
506 |
for (int i = 0; i < group.Items.Count; i++) |
|
507 |
{ |
|
508 |
Item item = group.Items[i]; |
|
509 |
foreach (KeywordInfo keyword in KeywordInfos) |
|
510 |
{ |
|
511 |
if (endInfos.Contains(keyword)) |
|
512 |
continue; |
|
513 | ||
514 |
if (!keyword.KeywordItems[i].Name.Equals(item.Name)) |
|
515 |
{ |
|
516 |
endInfos.Add(keyword); |
|
517 |
continue; |
|
518 |
} |
|
519 | ||
520 |
if (keyword.KeywordItems.Count.Equals(i + 1)) |
|
521 |
{ |
|
522 |
for (int j = 0; j < i + 1; j++) |
|
523 |
group.Items[j].Keyword = keyword.KeywordItems[i].Keyword; |
|
524 |
bFind = true; |
|
525 |
break; |
|
526 |
} |
|
527 |
} |
|
528 | ||
529 |
if (bFind || endInfos.Count.Equals(KeywordInfos.Count)) |
|
530 |
break; |
|
531 |
} |
|
532 | ||
533 |
endInfos = new List<KeywordInfo>(); |
|
534 |
bFind = false; |
|
535 |
for (int i = 0; i < group.Items.Count; i++) |
|
536 |
{ |
|
537 |
Item item = group.Items[group.Items.Count - i - 1]; |
|
538 |
foreach (KeywordInfo keyword in KeywordInfos) |
|
539 |
{ |
|
540 |
if (endInfos.Contains(keyword)) |
|
541 |
continue; |
|
542 | ||
543 |
if (!keyword.KeywordItems[i].Name.Equals(item.Name)) |
|
544 |
{ |
|
545 |
endInfos.Add(keyword); |
|
546 |
continue; |
|
547 |
} |
|
548 | ||
549 |
if (keyword.KeywordItems.Count.Equals(i + 1)) |
|
550 |
{ |
|
551 |
for (int j = 0; j < i + 1; j++) |
|
552 |
group.Items[group.Items.Count - j - 1].Keyword = keyword.KeywordItems[i].Keyword; |
|
553 |
bFind = true; |
|
554 |
break; |
|
555 |
} |
|
556 |
} |
|
557 | ||
558 |
if (bFind || endInfos.Count.Equals(KeywordInfos.Count)) |
|
559 |
break; |
|
560 |
} |
|
561 |
} |
|
562 |
#endregion |
|
563 | ||
564 | 473 |
int GetConnectedItemCount(Item item) |
565 | 474 |
{ |
566 | 475 |
return item.Relations.FindAll(x => x.Item != null).Count; |
DTI_PID/ID2PSN/Form/TopologyRuleForm.Designer.cs | ||
---|---|---|
67 | 67 |
this.ribbonControl.ShowDisplayOptionsMenuButton = DevExpress.Utils.DefaultBoolean.False; |
68 | 68 |
this.ribbonControl.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.ShowOnMultiplePages; |
69 | 69 |
this.ribbonControl.ShowToolbarCustomizeItem = false; |
70 |
this.ribbonControl.Size = new System.Drawing.Size(411, 32);
|
|
70 |
this.ribbonControl.Size = new System.Drawing.Size(411, 27);
|
|
71 | 71 |
this.ribbonControl.Toolbar.ShowCustomizeItem = false; |
72 | 72 |
// |
73 | 73 |
// layoutControl1 |
... | ... | |
76 | 76 |
this.layoutControl1.Controls.Add(this.btnSave); |
77 | 77 |
this.layoutControl1.Controls.Add(this.gridControlRule); |
78 | 78 |
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill; |
79 |
this.layoutControl1.Location = new System.Drawing.Point(0, 32);
|
|
79 |
this.layoutControl1.Location = new System.Drawing.Point(0, 27);
|
|
80 | 80 |
this.layoutControl1.Name = "layoutControl1"; |
81 | 81 |
this.layoutControl1.OptionsView.UseDefaultDragAndDropRendering = false; |
82 | 82 |
this.layoutControl1.Root = this.Root; |
83 |
this.layoutControl1.Size = new System.Drawing.Size(411, 497);
|
|
83 |
this.layoutControl1.Size = new System.Drawing.Size(411, 502);
|
|
84 | 84 |
this.layoutControl1.TabIndex = 1; |
85 | 85 |
this.layoutControl1.Text = "layoutControl1"; |
86 | 86 |
// |
87 | 87 |
// btnClose |
88 | 88 |
// |
89 | 89 |
this.btnClose.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.ImageOptions.Image"))); |
90 |
this.btnClose.Location = new System.Drawing.Point(329, 449);
|
|
90 |
this.btnClose.Location = new System.Drawing.Point(329, 454);
|
|
91 | 91 |
this.btnClose.Name = "btnClose"; |
92 | 92 |
this.btnClose.Size = new System.Drawing.Size(70, 36); |
93 | 93 |
this.btnClose.StyleController = this.layoutControl1; |
... | ... | |
98 | 98 |
// btnSave |
99 | 99 |
// |
100 | 100 |
this.btnSave.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.ImageOptions.Image"))); |
101 |
this.btnSave.Location = new System.Drawing.Point(237, 449);
|
|
101 |
this.btnSave.Location = new System.Drawing.Point(237, 454);
|
|
102 | 102 |
this.btnSave.Name = "btnSave"; |
103 | 103 |
this.btnSave.Size = new System.Drawing.Size(68, 36); |
104 | 104 |
this.btnSave.StyleController = this.layoutControl1; |
... | ... | |
112 | 112 |
this.gridControlRule.MainView = this.gridViewRule; |
113 | 113 |
this.gridControlRule.MenuManager = this.ribbonControl; |
114 | 114 |
this.gridControlRule.Name = "gridControlRule"; |
115 |
this.gridControlRule.Size = new System.Drawing.Size(387, 433);
|
|
115 |
this.gridControlRule.Size = new System.Drawing.Size(387, 438);
|
|
116 | 116 |
this.gridControlRule.TabIndex = 2; |
117 | 117 |
this.gridControlRule.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { |
118 | 118 |
this.gridViewRule}); |
... | ... | |
135 | 135 |
this.emptySpaceItem1, |
136 | 136 |
this.emptySpaceItem2}); |
137 | 137 |
this.Root.Name = "Root"; |
138 |
this.Root.Size = new System.Drawing.Size(411, 497);
|
|
138 |
this.Root.Size = new System.Drawing.Size(411, 502);
|
|
139 | 139 |
this.Root.TextVisible = false; |
140 | 140 |
// |
141 | 141 |
// layoutControlItem1 |
... | ... | |
143 | 143 |
this.layoutControlItem1.Control = this.gridControlRule; |
144 | 144 |
this.layoutControlItem1.Location = new System.Drawing.Point(0, 0); |
145 | 145 |
this.layoutControlItem1.Name = "layoutControlItem1"; |
146 |
this.layoutControlItem1.Size = new System.Drawing.Size(391, 437);
|
|
146 |
this.layoutControlItem1.Size = new System.Drawing.Size(391, 442);
|
|
147 | 147 |
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0); |
148 | 148 |
this.layoutControlItem1.TextVisible = false; |
149 | 149 |
// |
150 | 150 |
// layoutControlItem2 |
151 | 151 |
// |
152 | 152 |
this.layoutControlItem2.Control = this.btnSave; |
153 |
this.layoutControlItem2.Location = new System.Drawing.Point(225, 437);
|
|
153 |
this.layoutControlItem2.Location = new System.Drawing.Point(225, 442);
|
|
154 | 154 |
this.layoutControlItem2.MaxSize = new System.Drawing.Size(72, 40); |
155 | 155 |
this.layoutControlItem2.MinSize = new System.Drawing.Size(72, 40); |
156 | 156 |
this.layoutControlItem2.Name = "layoutControlItem2"; |
... | ... | |
162 | 162 |
// layoutControlItem3 |
163 | 163 |
// |
164 | 164 |
this.layoutControlItem3.Control = this.btnClose; |
165 |
this.layoutControlItem3.Location = new System.Drawing.Point(317, 437);
|
|
165 |
this.layoutControlItem3.Location = new System.Drawing.Point(317, 442);
|
|
166 | 166 |
this.layoutControlItem3.MaxSize = new System.Drawing.Size(74, 40); |
167 | 167 |
this.layoutControlItem3.MinSize = new System.Drawing.Size(74, 40); |
168 | 168 |
this.layoutControlItem3.Name = "layoutControlItem3"; |
... | ... | |
174 | 174 |
// emptySpaceItem1 |
175 | 175 |
// |
176 | 176 |
this.emptySpaceItem1.AllowHotTrack = false; |
177 |
this.emptySpaceItem1.Location = new System.Drawing.Point(297, 437);
|
|
177 |
this.emptySpaceItem1.Location = new System.Drawing.Point(297, 442);
|
|
178 | 178 |
this.emptySpaceItem1.MaxSize = new System.Drawing.Size(20, 40); |
179 | 179 |
this.emptySpaceItem1.MinSize = new System.Drawing.Size(20, 40); |
180 | 180 |
this.emptySpaceItem1.Name = "emptySpaceItem1"; |
... | ... | |
185 | 185 |
// emptySpaceItem2 |
186 | 186 |
// |
187 | 187 |
this.emptySpaceItem2.AllowHotTrack = false; |
188 |
this.emptySpaceItem2.Location = new System.Drawing.Point(0, 437);
|
|
188 |
this.emptySpaceItem2.Location = new System.Drawing.Point(0, 442);
|
|
189 | 189 |
this.emptySpaceItem2.Name = "emptySpaceItem2"; |
190 | 190 |
this.emptySpaceItem2.Size = new System.Drawing.Size(225, 40); |
191 | 191 |
this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0); |
DTI_PID/ID2PSN/Form/TransformKeywordsSettingForm.Designer.cs | ||
---|---|---|
32 | 32 |
this.ribbonControl = new DevExpress.XtraBars.Ribbon.RibbonControl(); |
33 | 33 |
this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl(); |
34 | 34 |
this.labelControlToolTip = new DevExpress.XtraEditors.LabelControl(); |
35 |
this.btnAddType = new DevExpress.XtraEditors.SimpleButton(); |
|
36 | 35 |
this.gridControlKeyword = new DevExpress.XtraGrid.GridControl(); |
37 | 36 |
this.gridViewKeyword = new DevExpress.XtraGrid.Views.Grid.GridView(); |
38 |
this.gridControlType = new DevExpress.XtraGrid.GridControl(); |
|
39 |
this.gridViewType = new DevExpress.XtraGrid.Views.Grid.GridView(); |
|
40 | 37 |
this.btnClose = new DevExpress.XtraEditors.SimpleButton(); |
41 | 38 |
this.btnSave = new DevExpress.XtraEditors.SimpleButton(); |
42 | 39 |
this.btnAddSymbol = new DevExpress.XtraEditors.SimpleButton(); |
... | ... | |
46 | 43 |
this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem(); |
47 | 44 |
this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem(); |
48 | 45 |
this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem(); |
49 |
this.layoutControlGroup1 = new DevExpress.XtraLayout.LayoutControlGroup(); |
|
50 |
this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem(); |
|
51 |
this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem(); |
|
52 |
this.emptySpaceItem4 = new DevExpress.XtraLayout.EmptySpaceItem(); |
|
53 | 46 |
this.layoutControlGroup2 = new DevExpress.XtraLayout.LayoutControlGroup(); |
54 | 47 |
this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem(); |
55 | 48 |
this.layoutControlItem3 = new DevExpress.XtraLayout.LayoutControlItem(); |
... | ... | |
61 | 54 |
this.layoutControl1.SuspendLayout(); |
62 | 55 |
((System.ComponentModel.ISupportInitialize)(this.gridControlKeyword)).BeginInit(); |
63 | 56 |
((System.ComponentModel.ISupportInitialize)(this.gridViewKeyword)).BeginInit(); |
64 |
((System.ComponentModel.ISupportInitialize)(this.gridControlType)).BeginInit(); |
|
65 |
((System.ComponentModel.ISupportInitialize)(this.gridViewType)).BeginInit(); |
|
66 | 57 |
((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit(); |
67 | 58 |
((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).BeginInit(); |
68 | 59 |
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).BeginInit(); |
69 | 60 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit(); |
70 | 61 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit(); |
71 | 62 |
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit(); |
72 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).BeginInit(); |
|
73 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit(); |
|
74 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit(); |
|
75 |
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem4)).BeginInit(); |
|
76 | 63 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).BeginInit(); |
77 | 64 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit(); |
78 | 65 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).BeginInit(); |
... | ... | |
94 | 81 |
this.ribbonControl.ShowDisplayOptionsMenuButton = DevExpress.Utils.DefaultBoolean.False; |
95 | 82 |
this.ribbonControl.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.ShowOnMultiplePages; |
96 | 83 |
this.ribbonControl.ShowToolbarCustomizeItem = false; |
97 |
this.ribbonControl.Size = new System.Drawing.Size(920, 32);
|
|
84 |
this.ribbonControl.Size = new System.Drawing.Size(461, 27);
|
|
98 | 85 |
this.ribbonControl.Toolbar.ShowCustomizeItem = false; |
99 | 86 |
// |
100 | 87 |
// layoutControl1 |
101 | 88 |
// |
102 | 89 |
this.layoutControl1.Controls.Add(this.labelControlToolTip); |
103 |
this.layoutControl1.Controls.Add(this.btnAddType); |
|
104 | 90 |
this.layoutControl1.Controls.Add(this.gridControlKeyword); |
105 |
this.layoutControl1.Controls.Add(this.gridControlType); |
|
106 | 91 |
this.layoutControl1.Controls.Add(this.btnClose); |
107 | 92 |
this.layoutControl1.Controls.Add(this.btnSave); |
108 | 93 |
this.layoutControl1.Controls.Add(this.btnAddSymbol); |
109 | 94 |
this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill; |
110 |
this.layoutControl1.Location = new System.Drawing.Point(0, 32);
|
|
95 |
this.layoutControl1.Location = new System.Drawing.Point(0, 27);
|
|
111 | 96 |
this.layoutControl1.Name = "layoutControl1"; |
112 | 97 |
this.layoutControl1.Root = this.Root; |
113 |
this.layoutControl1.Size = new System.Drawing.Size(920, 631);
|
|
98 |
this.layoutControl1.Size = new System.Drawing.Size(461, 636);
|
|
114 | 99 |
this.layoutControl1.TabIndex = 1; |
115 | 100 |
this.layoutControl1.Text = "layoutControl1"; |
116 | 101 |
// |
... | ... | |
120 | 105 |
this.labelControlToolTip.ImageAlignToText = DevExpress.XtraEditors.ImageAlignToText.RightCenter; |
121 | 106 |
this.labelControlToolTip.ImageOptions.Alignment = System.Drawing.ContentAlignment.MiddleLeft; |
122 | 107 |
this.labelControlToolTip.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("labelControlToolTip.ImageOptions.Image"))); |
123 |
this.labelControlToolTip.Location = new System.Drawing.Point(838, 12);
|
|
108 |
this.labelControlToolTip.Location = new System.Drawing.Point(379, 12);
|
|
124 | 109 |
this.labelControlToolTip.Name = "labelControlToolTip"; |
125 | 110 |
this.labelControlToolTip.Size = new System.Drawing.Size(70, 16); |
126 | 111 |
this.labelControlToolTip.StyleController = this.layoutControl1; |
127 | 112 |
this.labelControlToolTip.TabIndex = 7; |
128 | 113 |
this.labelControlToolTip.Text = "Tool Tip"; |
129 | 114 |
// |
130 |
// btnAddType |
|
131 |
// |
|
132 |
this.btnAddType.Location = new System.Drawing.Point(360, 63); |
|
133 |
this.btnAddType.Name = "btnAddType"; |
|
134 |
this.btnAddType.Size = new System.Drawing.Size(79, 22); |
|
135 |
this.btnAddType.StyleController = this.layoutControl1; |
|
136 |
this.btnAddType.TabIndex = 0; |
|
137 |
this.btnAddType.Text = "Add Type"; |
|
138 |
this.btnAddType.Click += new System.EventHandler(this.btnAddType_Click); |
|
139 |
// |
|
140 | 115 |
// gridControlKeyword |
141 | 116 |
// |
142 |
this.gridControlKeyword.Location = new System.Drawing.Point(479, 89);
|
|
117 |
this.gridControlKeyword.Location = new System.Drawing.Point(29, 89);
|
|
143 | 118 |
this.gridControlKeyword.MainView = this.gridViewKeyword; |
144 | 119 |
this.gridControlKeyword.MenuManager = this.ribbonControl; |
145 | 120 |
this.gridControlKeyword.Name = "gridControlKeyword"; |
146 |
this.gridControlKeyword.Size = new System.Drawing.Size(417, 478);
|
|
121 |
this.gridControlKeyword.Size = new System.Drawing.Size(408, 483);
|
|
147 | 122 |
this.gridControlKeyword.TabIndex = 4; |
148 | 123 |
this.gridControlKeyword.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { |
149 | 124 |
this.gridViewKeyword}); |
... | ... | |
154 | 129 |
this.gridViewKeyword.Name = "gridViewKeyword"; |
155 | 130 |
this.gridViewKeyword.OptionsView.ShowGroupPanel = false; |
156 | 131 |
// |
157 |
// gridControlType |
|
158 |
// |
|
159 |
this.gridControlType.Location = new System.Drawing.Point(24, 89); |
|
160 |
this.gridControlType.MainView = this.gridViewType; |
|
161 |
this.gridControlType.MenuManager = this.ribbonControl; |
|
162 |
this.gridControlType.Name = "gridControlType"; |
|
163 |
this.gridControlType.Size = new System.Drawing.Size(415, 478); |
|
164 |
this.gridControlType.TabIndex = 3; |
|
165 |
this.gridControlType.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] { |
|
166 |
this.gridViewType}); |
|
167 |
// |
|
168 |
// gridViewType |
|
169 |
// |
|
170 |
this.gridViewType.GridControl = this.gridControlType; |
|
171 |
this.gridViewType.Name = "gridViewType"; |
|
172 |
this.gridViewType.OptionsView.ShowGroupPanel = false; |
|
173 |
this.gridViewType.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(this.gridViewType_CellValueChanged); |
|
174 |
this.gridViewType.BeforeLeaveRow += new DevExpress.XtraGrid.Views.Base.RowAllowEventHandler(this.gridViewType_BeforeLeaveRow); |
|
175 |
// |
|
176 | 132 |
// btnClose |
177 | 133 |
// |
178 | 134 |
this.btnClose.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.ImageOptions.Image"))); |
179 |
this.btnClose.Location = new System.Drawing.Point(838, 583);
|
|
135 |
this.btnClose.Location = new System.Drawing.Point(379, 588);
|
|
180 | 136 |
this.btnClose.Name = "btnClose"; |
181 | 137 |
this.btnClose.Size = new System.Drawing.Size(70, 36); |
182 | 138 |
this.btnClose.StyleController = this.layoutControl1; |
... | ... | |
187 | 143 |
// btnSave |
188 | 144 |
// |
189 | 145 |
this.btnSave.ImageOptions.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.ImageOptions.Image"))); |
190 |
this.btnSave.Location = new System.Drawing.Point(746, 583);
|
|
146 |
this.btnSave.Location = new System.Drawing.Point(287, 588);
|
|
191 | 147 |
this.btnSave.Name = "btnSave"; |
192 | 148 |
this.btnSave.Size = new System.Drawing.Size(68, 36); |
193 | 149 |
this.btnSave.StyleController = this.layoutControl1; |
... | ... | |
197 | 153 |
// |
198 | 154 |
// btnAddSymbol |
199 | 155 |
// |
200 |
this.btnAddSymbol.Location = new System.Drawing.Point(805, 63);
|
|
156 |
this.btnAddSymbol.Location = new System.Drawing.Point(348, 63);
|
|
201 | 157 |
this.btnAddSymbol.Name = "btnAddSymbol"; |
202 |
this.btnAddSymbol.Size = new System.Drawing.Size(91, 22);
|
|
158 |
this.btnAddSymbol.Size = new System.Drawing.Size(89, 22);
|
|
203 | 159 |
this.btnAddSymbol.StyleController = this.layoutControl1; |
204 | 160 |
this.btnAddSymbol.TabIndex = 2; |
205 | 161 |
this.btnAddSymbol.Text = " Add Symbol"; |
... | ... | |
215 | 171 |
this.layoutControlItem4, |
216 | 172 |
this.layoutControlItem5, |
217 | 173 |
this.emptySpaceItem2, |
218 |
this.layoutControlGroup1, |
|
219 | 174 |
this.layoutControlGroup2, |
220 | 175 |
this.layoutControlItem7, |
221 | 176 |
this.emptySpaceItem5}); |
222 | 177 |
this.Root.Name = "Root"; |
223 |
this.Root.Size = new System.Drawing.Size(920, 631);
|
|
178 |
this.Root.Size = new System.Drawing.Size(461, 636);
|
|
224 | 179 |
this.Root.TextVisible = false; |
225 | 180 |
// |
226 | 181 |
// splitterItem1 |
227 | 182 |
// |
228 | 183 |
this.splitterItem1.AllowHotTrack = true; |
229 |
this.splitterItem1.Location = new System.Drawing.Point(443, 20);
|
|
184 |
this.splitterItem1.Location = new System.Drawing.Point(0, 20);
|
|
230 | 185 |
this.splitterItem1.Name = "splitterItem1"; |
231 |
this.splitterItem1.Size = new System.Drawing.Size(12, 551);
|
|
186 |
this.splitterItem1.Size = new System.Drawing.Size(5, 556);
|
|
232 | 187 |
// |
233 | 188 |
// emptySpaceItem3 |
234 | 189 |
// |
235 | 190 |
this.emptySpaceItem3.AllowHotTrack = false; |
236 |
this.emptySpaceItem3.Location = new System.Drawing.Point(0, 571);
|
|
191 |
this.emptySpaceItem3.Location = new System.Drawing.Point(0, 576);
|
|
237 | 192 |
this.emptySpaceItem3.Name = "emptySpaceItem3"; |
238 |
this.emptySpaceItem3.Size = new System.Drawing.Size(734, 40);
|
|
193 |
this.emptySpaceItem3.Size = new System.Drawing.Size(275, 40);
|
|
239 | 194 |
this.emptySpaceItem3.TextSize = new System.Drawing.Size(0, 0); |
240 | 195 |
// |
241 | 196 |
// layoutControlItem4 |
242 | 197 |
// |
243 | 198 |
this.layoutControlItem4.Control = this.btnSave; |
244 |
this.layoutControlItem4.Location = new System.Drawing.Point(734, 571);
|
|
199 |
this.layoutControlItem4.Location = new System.Drawing.Point(275, 576);
|
|
245 | 200 |
this.layoutControlItem4.MaxSize = new System.Drawing.Size(72, 40); |
246 | 201 |
this.layoutControlItem4.MinSize = new System.Drawing.Size(72, 40); |
247 | 202 |
this.layoutControlItem4.Name = "layoutControlItem4"; |
... | ... | |
253 | 208 |
// layoutControlItem5 |
254 | 209 |
// |
255 | 210 |
this.layoutControlItem5.Control = this.btnClose; |
256 |
this.layoutControlItem5.Location = new System.Drawing.Point(826, 571);
|
|
211 |
this.layoutControlItem5.Location = new System.Drawing.Point(367, 576);
|
|
257 | 212 |
this.layoutControlItem5.MaxSize = new System.Drawing.Size(74, 40); |
258 | 213 |
this.layoutControlItem5.MinSize = new System.Drawing.Size(74, 40); |
259 | 214 |
this.layoutControlItem5.Name = "layoutControlItem5"; |
... | ... | |
265 | 220 |
// emptySpaceItem2 |
266 | 221 |
// |
267 | 222 |
this.emptySpaceItem2.AllowHotTrack = false; |
268 |
this.emptySpaceItem2.Location = new System.Drawing.Point(806, 571);
|
|
223 |
this.emptySpaceItem2.Location = new System.Drawing.Point(347, 576);
|
|
269 | 224 |
this.emptySpaceItem2.MaxSize = new System.Drawing.Size(20, 40); |
270 | 225 |
this.emptySpaceItem2.MinSize = new System.Drawing.Size(20, 40); |
271 | 226 |
this.emptySpaceItem2.Name = "emptySpaceItem2"; |
... | ... | |
273 | 228 |
this.emptySpaceItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom; |
274 | 229 |
this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0); |
275 | 230 |
// |
276 |
// layoutControlGroup1 |
|
277 |
// |
|
278 |
this.layoutControlGroup1.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { |
|
279 |
this.layoutControlItem2, |
|
280 |
this.layoutControlItem1, |
|
281 |
this.emptySpaceItem4}); |
|
282 |
this.layoutControlGroup1.Location = new System.Drawing.Point(0, 20); |
|
283 |
this.layoutControlGroup1.Name = "layoutControlGroup1"; |
|
284 |
this.layoutControlGroup1.Size = new System.Drawing.Size(443, 551); |
|
285 |
this.layoutControlGroup1.Text = "Keyword Type"; |
|
286 |
// |
|
287 |
// layoutControlItem2 |
|
288 |
// |
|
289 |
this.layoutControlItem2.Control = this.gridControlType; |
|
290 |
this.layoutControlItem2.Location = new System.Drawing.Point(0, 26); |
|
291 |
this.layoutControlItem2.Name = "layoutControlItem2"; |
|
292 |
this.layoutControlItem2.Size = new System.Drawing.Size(419, 482); |
|
293 |
this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0); |
|
294 |
this.layoutControlItem2.TextVisible = false; |
|
295 |
// |
|
296 |
// layoutControlItem1 |
|
297 |
// |
|
298 |
this.layoutControlItem1.Control = this.btnAddType; |
|
299 |
this.layoutControlItem1.Location = new System.Drawing.Point(336, 0); |
|
300 |
this.layoutControlItem1.Name = "layoutControlItem1"; |
|
301 |
this.layoutControlItem1.Size = new System.Drawing.Size(83, 26); |
|
302 |
this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0); |
|
303 |
this.layoutControlItem1.TextVisible = false; |
|
304 |
// |
|
305 |
// emptySpaceItem4 |
|
306 |
// |
|
307 |
this.emptySpaceItem4.AllowHotTrack = false; |
|
308 |
this.emptySpaceItem4.Location = new System.Drawing.Point(0, 0); |
|
309 |
this.emptySpaceItem4.Name = "emptySpaceItem4"; |
|
310 |
this.emptySpaceItem4.Size = new System.Drawing.Size(336, 26); |
|
311 |
this.emptySpaceItem4.TextSize = new System.Drawing.Size(0, 0); |
|
312 |
// |
|
313 | 231 |
// layoutControlGroup2 |
314 | 232 |
// |
233 |
this.layoutControlGroup2.CustomizationFormText = "Keyword Items"; |
|
315 | 234 |
this.layoutControlGroup2.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] { |
316 | 235 |
this.layoutControlItem6, |
317 | 236 |
this.layoutControlItem3, |
318 | 237 |
this.emptySpaceItem1}); |
319 |
this.layoutControlGroup2.Location = new System.Drawing.Point(455, 20);
|
|
238 |
this.layoutControlGroup2.Location = new System.Drawing.Point(5, 20); |
|
320 | 239 |
this.layoutControlGroup2.Name = "layoutControlGroup2"; |
321 |
this.layoutControlGroup2.Size = new System.Drawing.Size(445, 551);
|
|
322 |
this.layoutControlGroup2.Text = "Type Items";
|
|
240 |
this.layoutControlGroup2.Size = new System.Drawing.Size(436, 556);
|
|
241 |
this.layoutControlGroup2.Text = "Keyword Items";
|
|
323 | 242 |
// |
324 | 243 |
// layoutControlItem6 |
325 | 244 |
// |
326 | 245 |
this.layoutControlItem6.Control = this.gridControlKeyword; |
327 | 246 |
this.layoutControlItem6.Location = new System.Drawing.Point(0, 26); |
328 | 247 |
this.layoutControlItem6.Name = "layoutControlItem6"; |
329 |
this.layoutControlItem6.Size = new System.Drawing.Size(421, 482);
|
|
248 |
this.layoutControlItem6.Size = new System.Drawing.Size(412, 487);
|
|
330 | 249 |
this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0); |
331 | 250 |
this.layoutControlItem6.TextVisible = false; |
332 | 251 |
// |
333 | 252 |
// layoutControlItem3 |
334 | 253 |
// |
335 | 254 |
this.layoutControlItem3.Control = this.btnAddSymbol; |
336 |
this.layoutControlItem3.Location = new System.Drawing.Point(326, 0);
|
|
255 |
this.layoutControlItem3.Location = new System.Drawing.Point(319, 0);
|
|
337 | 256 |
this.layoutControlItem3.Name = "layoutControlItem3"; |
338 |
this.layoutControlItem3.Size = new System.Drawing.Size(95, 26);
|
|
257 |
this.layoutControlItem3.Size = new System.Drawing.Size(93, 26);
|
|
339 | 258 |
this.layoutControlItem3.TextSize = new System.Drawing.Size(0, 0); |
340 | 259 |
this.layoutControlItem3.TextVisible = false; |
341 | 260 |
// |
... | ... | |
344 | 263 |
this.emptySpaceItem1.AllowHotTrack = false; |
345 | 264 |
this.emptySpaceItem1.Location = new System.Drawing.Point(0, 0); |
346 | 265 |
this.emptySpaceItem1.Name = "emptySpaceItem1"; |
347 |
this.emptySpaceItem1.Size = new System.Drawing.Size(326, 26);
|
|
266 |
this.emptySpaceItem1.Size = new System.Drawing.Size(319, 26);
|
|
348 | 267 |
this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0); |
349 | 268 |
// |
350 | 269 |
// layoutControlItem7 |
351 | 270 |
// |
352 | 271 |
this.layoutControlItem7.Control = this.labelControlToolTip; |
353 |
this.layoutControlItem7.Location = new System.Drawing.Point(826, 0);
|
|
272 |
this.layoutControlItem7.Location = new System.Drawing.Point(367, 0);
|
|
354 | 273 |
this.layoutControlItem7.MaxSize = new System.Drawing.Size(74, 20); |
355 | 274 |
this.layoutControlItem7.MinSize = new System.Drawing.Size(74, 20); |
356 | 275 |
this.layoutControlItem7.Name = "layoutControlItem7"; |
... | ... | |
364 | 283 |
this.emptySpaceItem5.AllowHotTrack = false; |
365 | 284 |
this.emptySpaceItem5.Location = new System.Drawing.Point(0, 0); |
366 | 285 |
this.emptySpaceItem5.Name = "emptySpaceItem5"; |
367 |
this.emptySpaceItem5.Size = new System.Drawing.Size(826, 20);
|
|
286 |
this.emptySpaceItem5.Size = new System.Drawing.Size(367, 20);
|
|
368 | 287 |
this.emptySpaceItem5.TextSize = new System.Drawing.Size(0, 0); |
369 | 288 |
// |
370 | 289 |
// TransformKeywordsSettingForm |
371 | 290 |
// |
372 | 291 |
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F); |
373 | 292 |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
374 |
this.ClientSize = new System.Drawing.Size(920, 663);
|
|
293 |
this.ClientSize = new System.Drawing.Size(461, 663);
|
|
375 | 294 |
this.Controls.Add(this.layoutControl1); |
376 | 295 |
this.Controls.Add(this.ribbonControl); |
377 | 296 |
this.Name = "TransformKeywordsSettingForm"; |
... | ... | |
383 | 302 |
this.layoutControl1.ResumeLayout(false); |
384 | 303 |
((System.ComponentModel.ISupportInitialize)(this.gridControlKeyword)).EndInit(); |
385 | 304 |
((System.ComponentModel.ISupportInitialize)(this.gridViewKeyword)).EndInit(); |
386 |
((System.ComponentModel.ISupportInitialize)(this.gridControlType)).EndInit(); |
|
387 |
((System.ComponentModel.ISupportInitialize)(this.gridViewType)).EndInit(); |
|
388 | 305 |
((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit(); |
389 | 306 |
((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).EndInit(); |
390 | 307 |
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem3)).EndInit(); |
391 | 308 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit(); |
392 | 309 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit(); |
393 | 310 |
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit(); |
394 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup1)).EndInit(); |
|
395 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit(); |
|
396 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit(); |
|
397 |
((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem4)).EndInit(); |
|
398 | 311 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlGroup2)).EndInit(); |
399 | 312 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit(); |
400 | 313 |
((System.ComponentModel.ISupportInitialize)(this.layoutControlItem3)).EndInit(); |
... | ... | |
422 | 335 |
private DevExpress.XtraLayout.SplitterItem splitterItem1; |
423 | 336 |
private DevExpress.XtraGrid.GridControl gridControlKeyword; |
424 | 337 |
private DevExpress.XtraGrid.Views.Grid.GridView gridViewKeyword; |
425 |
private DevExpress.XtraGrid.GridControl gridControlType; |
|
426 |
private DevExpress.XtraGrid.Views.Grid.GridView gridViewType; |
|
427 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2; |
|
428 | 338 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6; |
429 |
private DevExpress.XtraEditors.SimpleButton btnAddType; |
|
430 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1; |
|
431 |
private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem4; |
|
432 | 339 |
private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2; |
433 |
private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup1; |
|
434 | 340 |
private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroup2; |
435 | 341 |
private DevExpress.XtraEditors.LabelControl labelControlToolTip; |
436 | 342 |
private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7; |
DTI_PID/ID2PSN/Form/TransformKeywordsSettingForm.cs | ||
---|---|---|
31 | 31 |
{ |
32 | 32 |
InitializeComponent(); |
33 | 33 | |
34 |
InitGridType(); |
|
35 | 34 |
InitGridKeyword(); |
36 | 35 | |
37 |
gridViewType.FocusedRowChanged += new DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventHandler(gridViewType_FocusedRowChanged); |
|
38 | 36 |
gridViewKeyword.CellValueChanged += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(gridViewSymbol_CellValueChanged); |
39 |
|
|
40 |
InitData(); |
|
41 | 37 | |
38 |
InitData(); |
|
42 | 39 |
|
43 | 40 |
SuperToolTip sTooltip1 = new SuperToolTip(); |
44 | 41 |
|
... | ... | |
52 | 49 |
sTooltip1.Items.Add(titleItem1); |
53 | 50 |
sTooltip1.Items.Add(item1); |
54 | 51 | |
55 | ||
56 | 52 |
labelControlToolTip.SuperTip = sTooltip1; |
57 | 53 |
} |
58 | 54 | |
59 |
public void InitGridType() |
|
60 |
{ |
|
61 |
RepositoryItemButtonEdit btnRemove = new RepositoryItemButtonEdit(); |
|
62 |
btnRemove.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor; |
|
63 |
btnRemove.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(removeTypeButton_Click); |
|
64 |
btnRemove.Buttons[0].Kind = DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph; |
|
65 |
btnRemove.Buttons[0].ImageOptions.Image = ID2PSN.Properties.Resources.cancel_16x16; |
|
66 |
//btnShow.Buttons[0].ImageOptions.Image = ((Image)Properties.Resources.ResourceManager.GetObject("ReviewImage", System.Globalization.CultureInfo.CurrentCulture)); |
|
67 | ||
68 | ||
69 |
DataTable dtType = new DataTable(); |
|
70 |
dtType.Columns.Add("UID"); |
|
71 |
dtType.Columns.Add("Description"); |
|
72 |
dtType.Columns.Add(" "); |
|
73 |
gridControlType.DataSource = dtType; |
|
74 | ||
75 |
GridColumn gridColumn = gridViewType.Columns[0]; |
|
76 |
gridColumn.Name = "UID"; |
|
77 |
gridColumn.Caption = "UID"; |
|
78 |
gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False; |
|
79 |
gridColumn.VisibleIndex = -1; |
|
80 | ||
81 |
gridColumn = gridViewType.Columns[1]; |
|
82 |
gridColumn.Name = "Description"; |
|
83 |
gridColumn.Caption = "Description"; |
|
84 |
gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False; |
|
85 |
gridColumn.VisibleIndex = 0; |
|
86 | ||
87 |
gridColumn = gridViewType.Columns[2]; |
|
88 |
gridColumn.Name = "Remove"; |
|
89 |
gridColumn.Caption = ""; |
|
90 |
gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False; |
|
91 |
gridColumn.VisibleIndex = 1; |
|
92 |
gridColumn.MaxWidth = 16; |
|
93 | ||
94 |
gridControlType.RepositoryItems.Add(btnRemove); |
|
95 |
gridColumn.ColumnEdit = btnRemove; |
|
96 |
gridColumn.ShowButtonMode = DevExpress.XtraGrid.Views.Base.ShowButtonModeEnum.ShowAlways; |
|
97 |
} |
|
98 | ||
99 | 55 |
public void InitGridKeyword() |
100 | 56 |
{ |
101 | 57 |
RepositoryItemButtonEdit btnRemove = new RepositoryItemButtonEdit(); |
... | ... | |
137 | 93 |
SetSymbol(treeListLookUpEdit); |
138 | 94 |
gridColumn.ColumnEdit = treeListLookUpEdit; |
139 | 95 | |
140 | ||
141 | 96 |
gridColumn = gridViewKeyword.Columns[3]; |
142 | 97 |
gridColumn.Name = "Remove"; |
143 | 98 |
gridColumn.Caption = ""; |
... | ... | |
152 | 107 |
public void InitData() |
153 | 108 |
{ |
154 | 109 |
DataTable dt = DB.SelectKeywordsSetting(); |
110 |
DataTable typeDT = gridControlKeyword.DataSource as DataTable; |
|
155 | 111 |
foreach (DataRow row in dt.Rows) |
156 | 112 |
{ |
157 |
string groupID = row["GROUP_ID"].ToString(); |
|
158 |
string desc = row["DESCRIPTION"].ToString(); |
|
159 | 113 |
int index = Convert.ToInt32(row["INDEX"]); |
160 | 114 |
string name = row["NAME"].ToString(); |
161 | 115 |
string keyword = row["KEYWORD"].ToString(); |
162 | 116 | |
163 |
KeywordInfo keywordInfo = KeywordInfos.Find(x => x.UID.Equals(groupID)); |
|
164 |
if (keywordInfo == null) |
|
165 |
{ |
|
166 |
keywordInfo = new KeywordInfo(groupID); |
|
167 |
keywordInfo.Description = desc; |
|
168 |
KeywordInfos.Add(keywordInfo); |
|
169 |
} |
|
170 | ||
171 |
keywordInfo.KeywordItems.Add(new KeywordItem() |
|
172 |
{ |
|
173 |
Index = index, |
|
174 |
Name = name, |
|
175 |
Keyword = keyword |
|
176 |
}); |
|
177 |
} |
|
178 | ||
179 |
DataTable typeDT = gridControlType.DataSource as DataTable; |
|
180 |
foreach (KeywordInfo keywordInfo in KeywordInfos) |
|
181 |
{ |
|
182 |
keywordInfo.KeywordItems = keywordInfo.KeywordItems.OrderBy(x => x.Index).ToList(); |
|
183 |
typeDT.Rows.Add(keywordInfo.UID, keywordInfo.Description, null); |
|
184 |
} |
|
185 |
} |
|
186 | ||
187 |
private void removeTypeButton_Click(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) |
|
188 |
{ |
|
189 |
string value = gridViewType.GetFocusedRowCellValue("UID").ToString(); |
|
190 |
DataTable dt = gridControlType.DataSource as DataTable; |
|
191 |
DataRow[] rows = dt.Select(string.Format("UID = '{0}'", value)); |
|
192 |
if (rows.Length.Equals(1)) |
|
193 |
dt.Rows.Remove(rows.First()); |
|
194 |
KeywordInfos.Remove(KeywordInfos.Find(x => x.UID.Equals(value))); |
|
195 | ||
196 |
int handle = gridViewType.FocusedRowHandle; |
|
197 |
if (handle >= 0) |
|
198 |
{ |
|
199 |
KeywordInfo keywordInfo = KeywordInfos.Find(x => x.UID == gridViewType.GetRowCellDisplayText(handle, "UID")); |
|
200 |
if (keywordInfo != null) |
|
201 |
{ |
|
202 |
currentKeywordInfo = keywordInfo; |
|
203 |
LoadGridSymbol(keywordInfo); |
|
204 |
} |
|
117 |
typeDT.Rows.Add(index, keyword, name, null); |
|
205 | 118 |
} |
206 | 119 |
} |
207 | 120 | |
... | ... | |
218 | 131 |
public void SetSymbol(RepositoryItemTreeListLookUpEdit treeListLookUpEdit) |
219 | 132 |
{ |
220 | 133 |
string imgPath = ID2Info.ImageDirPath; |
221 |
string[] filesPath = Directory.GetFiles(imgPath, "*.png", SearchOption.AllDirectories); |
|
222 |
|
|
134 |
string[] filesPath = Directory.GetFiles(imgPath, "*.png", SearchOption.AllDirectories); |
|
223 | 135 | |
224 | 136 |
DataTable dt = new DataTable(); |
225 | 137 |
dt.Columns.Add("ID", typeof(int)); |
... | ... | |
268 | 180 |
} |
269 | 181 |
} |
270 | 182 | |
271 |
private void btnAddType_Click(object sender, EventArgs e) |
|
272 |
{ |
|
273 |
string uid = Guid.NewGuid().ToString(); |
|
274 |
KeywordInfos.Add(new KeywordInfo(uid)); |
|
275 | ||
276 |
DataTable dt = gridControlType.DataSource as DataTable; |
|
277 |
dt.Rows.Add(uid, null, null); |
|
278 |
gridViewType.FocusedRowHandle = dt.Rows.Count - 1; |
|
279 |
} |
|
280 | ||
281 | 183 |
private void btnAddSymbol_Click(object sender, EventArgs e) |
282 | 184 |
{ |
283 | 185 |
if (currentKeywordInfo == null) |
... | ... | |
288 | 190 |
gridViewKeyword.Columns["Index"].BestFit(); |
289 | 191 |
} |
290 | 192 | |
291 |
private void gridViewType_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) |
|
292 |
{ |
|
293 |
int handle = gridViewType.FocusedRowHandle; |
|
294 |
if (handle >= 0) |
|
295 |
{ |
|
296 |
KeywordInfo keywordInfo = KeywordInfos.Find(x => x.UID == gridViewType.GetRowCellDisplayText(handle, "UID")); |
|
297 |
if (keywordInfo != null) |
|
298 |
{ |
|
299 |
currentKeywordInfo = keywordInfo; |
|
300 |
LoadGridSymbol(keywordInfo); |
|
301 |
} |
|
302 |
} |
|
303 |
} |
|
304 | ||
305 | 193 |
public void LoadGridSymbol(KeywordInfo keywordInfo) |
306 | 194 |
{ |
307 | 195 |
DataTable dt = gridControlKeyword.DataSource as DataTable; |
... | ... | |
356 | 244 |
MessageBox.Show("Failed to save", "ID2 " + ID2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
357 | 245 |
} |
358 | 246 | |
359 |
private void gridViewType_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) |
|
360 |
{ |
|
361 |
if (e.RowHandle >= 0) |
|
362 |
{ |
|
363 |
string uid = gridViewType.GetRowCellDisplayText(e.RowHandle, "UID"); |
|
364 |
KeywordInfos.Find(x => x.UID.Equals(uid)).Description = e.Value == null ? string.Empty : e.Value.ToString(); |
|
365 |
} |
|
366 |
} |
|
367 | ||
368 | 247 |
private void btnClose_Click(object sender, EventArgs e) |
369 | 248 |
{ |
370 | 249 |
DialogResult = DialogResult.Cancel; |
DTI_PID/ID2PSN/Object/KeywordInfo.cs | ||
---|---|---|
8 | 8 |
{ |
9 | 9 |
public class KeywordInfo |
10 | 10 |
{ |
11 |
private string _UID; |
|
12 |
public string UID { get { return _UID; } } |
|
13 |
public string Description { get; set; } |
|
14 | ||
15 | 11 |
private List<KeywordItem> _KeywordItems = new List<KeywordItem>(); |
16 |
public List<KeywordItem> KeywordItems { get { return _KeywordItems; } set { _KeywordItems = value; } } |
|
17 |
|
|
18 |
public KeywordInfo(string UID) |
|
19 |
{ |
|
20 |
_UID = UID; |
|
21 |
Description = string.Empty; |
|
22 |
} |
|
12 |
public List<KeywordItem> KeywordItems { get { return _KeywordItems; } set { _KeywordItems = value; } } |
|
23 | 13 |
} |
24 | 14 | |
25 | 15 |
public class KeywordItem |
DTI_PID/ID2PSN/PSN.cs | ||
---|---|---|
1011 | 1011 |
DataTable dtKeyword = DB.SelectKeywordsSetting(); |
1012 | 1012 |
foreach (DataRow row in dtKeyword.Rows) |
1013 | 1013 |
{ |
1014 |
string groupID = row["GROUP_ID"].ToString(); |
|
1015 |
string desc = row["DESCRIPTION"].ToString(); |
|
1016 | 1014 |
int index = Convert.ToInt32(row["INDEX"]); |
1017 | 1015 |
string name = row["NAME"].ToString(); |
1018 | 1016 |
string keyword = row["KEYWORD"].ToString(); |
1019 | 1017 | |
1020 |
KeywordInfo keywordInfo = KeywordInfos.Find(x => x.UID.Equals(groupID)); |
|
1021 |
if (keywordInfo == null) |
|
1022 |
{ |
|
1023 |
keywordInfo = new KeywordInfo(groupID); |
|
1024 |
keywordInfo.Description = desc; |
|
1025 |
KeywordInfos.Add(keywordInfo); |
|
1026 |
} |
|
1027 | ||
1018 |
KeywordInfo keywordInfo = new KeywordInfo(); |
|
1028 | 1019 |
keywordInfo.KeywordItems.Add(new KeywordItem() |
1029 | 1020 |
{ |
1030 | 1021 |
Index = index, |
DTI_PID/ID2PSN/Program.cs | ||
---|---|---|
42 | 42 | |
43 | 43 |
using (NetworkStream networkStream = tcpClient.GetStream()) |
44 | 44 |
{ |
45 |
networkStream.Write(message, 0, message.Length); |
|
45 |
try |
|
46 |
{ |
|
47 |
networkStream.Write(message, 0, message.Length); |
|
46 | 48 | |
47 |
byte[] outbuf = new byte[1024]; |
|
48 |
int nbytes = networkStream.Read(outbuf, 0, outbuf.Length); |
|
49 |
string output = Encoding.UTF8.GetString(outbuf, 4, nbytes - 5); |
|
50 |
var result = JsonConvert.DeserializeObject<Dictionary<string, string>>(output); |
|
49 |
byte[] outbuf = new byte[1024];
|
|
50 |
int nbytes = networkStream.Read(outbuf, 0, outbuf.Length);
|
|
51 |
string output = Encoding.UTF8.GetString(outbuf, 4, nbytes - 5);
|
|
52 |
var result = JsonConvert.DeserializeObject<Dictionary<string, string>>(output);
|
|
51 | 53 | |
52 |
|
|
54 |
if (result["db_type"] == "SQLite") |
|
55 |
{ |
|
56 |
info.ID2DBType = ID2DB_Type.SQLite; |
|
57 |
var parent = Directory.GetParent(Path.GetDirectoryName(result["db_name"])); |
|
58 |
info.DefaultPath = parent.ToString(); |
|
59 |
///DataRow dr = projectTable.Select(string.Format("DBTypes_UID = 2 AND Name = '{0}'", result["db_name"])).FirstOrDefault(); |
|
60 |
///info.DefaultPath = dr.Field<string>("Path"); |
|
61 |
} |
|
62 |
else if (result["db_type"] == "MSSQL") |
|
63 |
{ |
|
64 |
info.ID2DBType = ID2DB_Type.MSSQL; |
|
65 |
info.ServerIP = result["host"]; |
|
66 |
//info.Port = "3389"; |
|
67 |
info.DBUser = result["user"]; |
|
68 |
info.DBPassword = result["password"]; |
|
69 |
info.Database = result["db_name"]; |
|
70 |
info.DefaultPath = result["path"]; |
|
71 |
///DataRow dr = projectTable.Select(string.Format("DBTypes_UID = 2 AND Name = '{0}'", result["db_name"])).FirstOrDefault(); |
|
72 |
///info.DefaultPath = dr.Field<string>("Path"); |
|
73 |
/// |
|
53 | 74 | |
54 |
if (result["db_type"] == "SQLite") |
|
55 |
{ |
|
56 |
info.ID2DBType = ID2DB_Type.SQLite; |
|
57 |
var parent = Directory.GetParent(Path.GetDirectoryName(result["db_name"])); |
|
58 |
info.DefaultPath = parent.ToString(); |
|
59 |
///DataRow dr = projectTable.Select(string.Format("DBTypes_UID = 2 AND Name = '{0}'", result["db_name"])).FirstOrDefault(); |
|
60 |
///info.DefaultPath = dr.Field<string>("Path"); |
|
75 |
} |
|
76 | ||
77 |
MessageBox.Show(info.ID2DBType + "\n" + info.ServerIP + "\n" + info.DBUser + "\n" + info.DBPassword + "\n" + info.Database + "\n" + info.DefaultPath, "ID2PSN", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
61 | 78 |
} |
62 |
else if (result["db_type"] == "MSSQL")
|
|
79 |
catch(Exception ex)
|
|
63 | 80 |
{ |
64 |
info.ID2DBType = ID2DB_Type.MSSQL; |
|
65 |
info.ServerIP = result["host"]; |
|
66 |
//info.Port = "3389"; |
|
67 |
info.DBUser = result["user"]; |
|
68 |
info.DBPassword = result["password"]; |
|
69 |
info.Database = result["db_name"]; |
|
70 |
info.DefaultPath = result["path"]; |
|
71 |
///DataRow dr = projectTable.Select(string.Format("DBTypes_UID = 2 AND Name = '{0}'", result["db_name"])).FirstOrDefault(); |
|
72 |
///info.DefaultPath = dr.Field<string>("Path"); |
|
73 |
/// |
|
74 |
|
|
81 |
MessageBox.Show(ex.StackTrace, "ID2PSN", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
75 | 82 |
} |
76 | ||
77 |
MessageBox.Show(info.ID2DBType + "\n" + info.ServerIP + "\n" + info.DBUser + "\n" + info.DBPassword + "\n" + info.Database + "\n" + info.DefaultPath, "ID2PSN", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
78 | 83 |
} |
79 | 84 |
tcpClient.Close(); |
80 | 85 |
} |
... | ... | |
90 | 95 |
} |
91 | 96 |
catch (Exception ex) |
92 | 97 |
{ |
93 |
MessageBox.Show("Failed to open ID2 drawing.", "ID2PSN", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
98 |
MessageBox.Show(ex.StackTrace, "ID2PSN", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
94 | 99 |
} |
95 | 100 |
} |
96 | 101 |
} |
내보내기 Unified diff