프로젝트

일반

사용자정보

개정판 af63e77a

IDaf63e77a333827aa8a12b24d03effeaefb6351b4
상위 8738667f
하위 53d3326b

gaqhf 이(가) 약 6년 전에 추가함

dev issue #000 : rename

Change-Id: I2ad19d99e95849e69f7a05ff917d5dfd7a00c091

차이점 보기:

DTI_PID/SPPIDConverter/App.config
1
<?xml version="1.0" encoding="utf-8"?>
2
<configuration>
3
  <configSections>
4
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
5
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
6
    <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
7
      <section name="Converter.SPPID.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
8
    </sectionGroup>
9
  </configSections>
10
  <entityFramework>
11
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
12
      <parameters>
13
        <parameter value="mssqllocaldb" />
14
      </parameters>
15
    </defaultConnectionFactory>
16
    <providers>
17
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
18
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
19
    </providers>
20
  </entityFramework>
21
  
22
  <userSettings>
23
    <Converter.SPPID.Properties.Settings>
24
      <setting name="LatestProjectPath" serializeAs="String">
25
        <value />
26
      </setting>
27
    </Converter.SPPID.Properties.Settings>
28
  </userSettings>
29
</configuration>
DTI_PID/SPPIDConverter/ConverterForm.Designer.cs
1
namespace Converter.SPPID
2
{
3
    partial class ConverterForm
4
    {
5
        /// <summary>
6
        /// Required designer variable.
7
        /// </summary>
8
        private System.ComponentModel.IContainer components = null;
9

  
10
        /// <summary>
11
        /// Clean up any resources being used.
12
        /// </summary>
13
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14
        protected override void Dispose(bool disposing)
15
        {
16
            if (disposing && (components != null))
17
            {
18
                components.Dispose();
19
            }
20
            base.Dispose(disposing);
21
        }
22

  
23
        #region Windows Form Designer generated code
24

  
25
        /// <summary>
26
        /// Required method for Designer support - do not modify
27
        /// the contents of this method with the code editor.
28
        /// </summary>
29
        private void InitializeComponent()
30
        {
31
            this.components = new System.ComponentModel.Container();
32
            this.defaultLookAndFeel = new DevExpress.LookAndFeel.DefaultLookAndFeel(this.components);
33
            this.ribbonControl = new DevExpress.XtraBars.Ribbon.RibbonControl();
34
            this.layoutControl1 = new DevExpress.XtraLayout.LayoutControl();
35
            this.btnRun = new DevExpress.XtraEditors.SimpleButton();
36
            this.btnLoadFile = new DevExpress.XtraEditors.SimpleButton();
37
            this.btnItemMapping = new DevExpress.XtraEditors.SimpleButton();
38
            this.btnSPPIDDB = new DevExpress.XtraEditors.SimpleButton();
39
            this.gridControlConverter = new DevExpress.XtraGrid.GridControl();
40
            this.gridViewConverter = new DevExpress.XtraGrid.Views.Grid.GridView();
41
            this.btnID2Project = new DevExpress.XtraEditors.ButtonEdit();
42
            this.Root = new DevExpress.XtraLayout.LayoutControlGroup();
43
            this.layoutControlGroupSPPIDDB = new DevExpress.XtraLayout.LayoutControlGroup();
44
            this.labelSPPIDPlantName = new DevExpress.XtraLayout.SimpleLabelItem();
45
            this.labelSPPIDDBStatus = new DevExpress.XtraLayout.SimpleLabelItem();
46
            this.layoutControlItem2 = new DevExpress.XtraLayout.LayoutControlItem();
47
            this.simpleLabelItem2 = new DevExpress.XtraLayout.SimpleLabelItem();
48
            this.simpleLabelItem1 = new DevExpress.XtraLayout.SimpleLabelItem();
49
            this.layoutControlGroupItemMapping = new DevExpress.XtraLayout.LayoutControlGroup();
50
            this.layoutControlItem4 = new DevExpress.XtraLayout.LayoutControlItem();
51
            this.labelItemMappingStatus = new DevExpress.XtraLayout.SimpleLabelItem();
52
            this.simpleLabelItem5 = new DevExpress.XtraLayout.SimpleLabelItem();
53
            this.layoutControlGroupAutoConverter = new DevExpress.XtraLayout.LayoutControlGroup();
54
            this.layoutControlItem1 = new DevExpress.XtraLayout.LayoutControlItem();
55
            this.layoutControlItem5 = new DevExpress.XtraLayout.LayoutControlItem();
56
            this.emptySpaceItem2 = new DevExpress.XtraLayout.EmptySpaceItem();
57
            this.layoutControlItem6 = new DevExpress.XtraLayout.LayoutControlItem();
58
            this.emptySpaceItem1 = new DevExpress.XtraLayout.EmptySpaceItem();
59
            this.layoutControlGroupID2Project = new DevExpress.XtraLayout.LayoutControlGroup();
60
            this.labelID2ProjectName = new DevExpress.XtraLayout.SimpleLabelItem();
61
            this.labelID2ProjectStatus = new DevExpress.XtraLayout.SimpleLabelItem();
62
            this.layoutControlItem7 = new DevExpress.XtraLayout.LayoutControlItem();
63
            this.simpleLabelItem3 = new DevExpress.XtraLayout.SimpleLabelItem();
64
            this.simpleLabelItem4 = new DevExpress.XtraLayout.SimpleLabelItem();
65
            this.splitterItem1 = new DevExpress.XtraLayout.SplitterItem();
66
            this.xtraFolderBrowserDialog = new DevExpress.XtraEditors.XtraFolderBrowserDialog(this.components);
67
            this.xtraOpenFileDialog = new DevExpress.XtraEditors.XtraOpenFileDialog(this.components);
68
            ((System.ComponentModel.ISupportInitialize)(this.ribbonControl)).BeginInit();
69
            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).BeginInit();
70
            this.layoutControl1.SuspendLayout();
71
            ((System.ComponentModel.ISupportInitialize)(this.gridControlConverter)).BeginInit();
72
            ((System.ComponentModel.ISupportInitialize)(this.gridViewConverter)).BeginInit();
73
            ((System.ComponentModel.ISupportInitialize)(this.btnID2Project.Properties)).BeginInit();
74
            ((System.ComponentModel.ISupportInitialize)(this.Root)).BeginInit();
75
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroupSPPIDDB)).BeginInit();
76
            ((System.ComponentModel.ISupportInitialize)(this.labelSPPIDPlantName)).BeginInit();
77
            ((System.ComponentModel.ISupportInitialize)(this.labelSPPIDDBStatus)).BeginInit();
78
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
79
            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem2)).BeginInit();
80
            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem1)).BeginInit();
81
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroupItemMapping)).BeginInit();
82
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).BeginInit();
83
            ((System.ComponentModel.ISupportInitialize)(this.labelItemMappingStatus)).BeginInit();
84
            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem5)).BeginInit();
85
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroupAutoConverter)).BeginInit();
86
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).BeginInit();
87
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).BeginInit();
88
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).BeginInit();
89
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).BeginInit();
90
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).BeginInit();
91
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroupID2Project)).BeginInit();
92
            ((System.ComponentModel.ISupportInitialize)(this.labelID2ProjectName)).BeginInit();
93
            ((System.ComponentModel.ISupportInitialize)(this.labelID2ProjectStatus)).BeginInit();
94
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).BeginInit();
95
            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem3)).BeginInit();
96
            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem4)).BeginInit();
97
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).BeginInit();
98
            this.SuspendLayout();
99
            // 
100
            // defaultLookAndFeel
101
            // 
102
            this.defaultLookAndFeel.LookAndFeel.SkinName = "Office 2019 Colorful";
103
            // 
104
            // ribbonControl
105
            // 
106
            this.ribbonControl.ExpandCollapseItem.Id = 0;
107
            this.ribbonControl.Items.AddRange(new DevExpress.XtraBars.BarItem[] {
108
            this.ribbonControl.ExpandCollapseItem});
109
            this.ribbonControl.Location = new System.Drawing.Point(0, 0);
110
            this.ribbonControl.MaxItemId = 1;
111
            this.ribbonControl.Name = "ribbonControl";
112
            this.ribbonControl.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.False;
113
            this.ribbonControl.ShowDisplayOptionsMenuButton = DevExpress.Utils.DefaultBoolean.False;
114
            this.ribbonControl.ShowPageHeadersMode = DevExpress.XtraBars.Ribbon.ShowPageHeadersMode.ShowOnMultiplePages;
115
            this.ribbonControl.ShowToolbarCustomizeItem = false;
116
            this.ribbonControl.Size = new System.Drawing.Size(1226, 32);
117
            this.ribbonControl.Toolbar.ShowCustomizeItem = false;
118
            // 
119
            // layoutControl1
120
            // 
121
            this.layoutControl1.Controls.Add(this.btnRun);
122
            this.layoutControl1.Controls.Add(this.btnLoadFile);
123
            this.layoutControl1.Controls.Add(this.btnItemMapping);
124
            this.layoutControl1.Controls.Add(this.btnSPPIDDB);
125
            this.layoutControl1.Controls.Add(this.gridControlConverter);
126
            this.layoutControl1.Controls.Add(this.btnID2Project);
127
            this.layoutControl1.Dock = System.Windows.Forms.DockStyle.Fill;
128
            this.layoutControl1.Location = new System.Drawing.Point(0, 32);
129
            this.layoutControl1.Name = "layoutControl1";
130
            this.layoutControl1.OptionsCustomizationForm.DesignTimeCustomizationFormPositionAndSize = new System.Drawing.Rectangle(982, 292, 650, 400);
131
            this.layoutControl1.Root = this.Root;
132
            this.layoutControl1.Size = new System.Drawing.Size(1226, 561);
133
            this.layoutControl1.TabIndex = 1;
134
            this.layoutControl1.Text = "layoutControl1";
135
            // 
136
            // btnRun
137
            // 
138
            this.btnRun.ImageOptions.SvgImage = global::Converter.SPPID.Properties.Resources.next;
139
            this.btnRun.Location = new System.Drawing.Point(849, 58);
140
            this.btnRun.Name = "btnRun";
141
            this.btnRun.Size = new System.Drawing.Size(79, 36);
142
            this.btnRun.StyleController = this.layoutControl1;
143
            this.btnRun.TabIndex = 9;
144
            this.btnRun.Text = "  Run  ";
145
            this.btnRun.Click += new System.EventHandler(this.btnRun_Click);
146
            // 
147
            // btnLoadFile
148
            // 
149
            this.btnLoadFile.ImageOptions.SvgImage = global::Converter.SPPID.Properties.Resources.open2;
150
            this.btnLoadFile.Location = new System.Drawing.Point(24, 58);
151
            this.btnLoadFile.Name = "btnLoadFile";
152
            this.btnLoadFile.Size = new System.Drawing.Size(110, 36);
153
            this.btnLoadFile.StyleController = this.layoutControl1;
154
            this.btnLoadFile.TabIndex = 8;
155
            this.btnLoadFile.Text = "  Load Files  ";
156
            this.btnLoadFile.Click += new System.EventHandler(this.btnLoadFile_Click);
157
            // 
158
            // btnItemMapping
159
            // 
160
            this.btnItemMapping.ImageOptions.SvgImage = global::Converter.SPPID.Properties.Resources.properties;
161
            this.btnItemMapping.Location = new System.Drawing.Point(966, 310);
162
            this.btnItemMapping.Name = "btnItemMapping";
163
            this.btnItemMapping.Size = new System.Drawing.Size(236, 36);
164
            this.btnItemMapping.StyleController = this.layoutControl1;
165
            this.btnItemMapping.TabIndex = 7;
166
            this.btnItemMapping.Text = "Item Mapping Setting";
167
            this.btnItemMapping.Click += new System.EventHandler(this.btnItemMapping_Click);
168
            // 
169
            // btnSPPIDDB
170
            // 
171
            this.btnSPPIDDB.ImageOptions.SvgImage = global::Converter.SPPID.Properties.Resources.properties;
172
            this.btnSPPIDDB.Location = new System.Drawing.Point(966, 176);
173
            this.btnSPPIDDB.Name = "btnSPPIDDB";
174
            this.btnSPPIDDB.Size = new System.Drawing.Size(236, 36);
175
            this.btnSPPIDDB.StyleController = this.layoutControl1;
176
            this.btnSPPIDDB.TabIndex = 5;
177
            this.btnSPPIDDB.Text = "Setting";
178
            this.btnSPPIDDB.Click += new System.EventHandler(this.btnSPPIDDB_Click);
179
            // 
180
            // gridControlConverter
181
            // 
182
            this.gridControlConverter.Location = new System.Drawing.Point(24, 98);
183
            this.gridControlConverter.MainView = this.gridViewConverter;
184
            this.gridControlConverter.MenuManager = this.ribbonControl;
185
            this.gridControlConverter.Name = "gridControlConverter";
186
            this.gridControlConverter.Size = new System.Drawing.Size(904, 439);
187
            this.gridControlConverter.TabIndex = 4;
188
            this.gridControlConverter.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
189
            this.gridViewConverter});
190
            // 
191
            // gridViewConverter
192
            // 
193
            this.gridViewConverter.GridControl = this.gridControlConverter;
194
            this.gridViewConverter.Name = "gridViewConverter";
195
            this.gridViewConverter.OptionsView.ShowGroupPanel = false;
196
            this.gridViewConverter.RowCellClick += new DevExpress.XtraGrid.Views.Grid.RowCellClickEventHandler(this.gridViewConverter_RowCellClick);
197
            // 
198
            // btnID2Project
199
            // 
200
            this.btnID2Project.Location = new System.Drawing.Point(1004, 58);
201
            this.btnID2Project.MenuManager = this.ribbonControl;
202
            this.btnID2Project.Name = "btnID2Project";
203
            this.btnID2Project.Properties.Buttons.AddRange(new DevExpress.XtraEditors.Controls.EditorButton[] {
204
            new DevExpress.XtraEditors.Controls.EditorButton()});
205
            this.btnID2Project.Properties.ReadOnly = true;
206
            this.btnID2Project.Size = new System.Drawing.Size(198, 20);
207
            this.btnID2Project.StyleController = this.layoutControl1;
208
            this.btnID2Project.TabIndex = 10;
209
            this.btnID2Project.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(this.btnID2Project_ButtonClick);
210
            // 
211
            // Root
212
            // 
213
            this.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.True;
214
            this.Root.GroupBordersVisible = false;
215
            this.Root.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
216
            this.layoutControlGroupSPPIDDB,
217
            this.layoutControlGroupItemMapping,
218
            this.layoutControlGroupAutoConverter,
219
            this.emptySpaceItem1,
220
            this.layoutControlGroupID2Project,
221
            this.splitterItem1});
222
            this.Root.Name = "Root";
223
            this.Root.Size = new System.Drawing.Size(1226, 561);
224
            this.Root.TextVisible = false;
225
            // 
226
            // layoutControlGroupSPPIDDB
227
            // 
228
            this.layoutControlGroupSPPIDDB.CaptionImageOptions.SvgImage = global::Converter.SPPID.Properties.Resources.actions_database;
229
            this.layoutControlGroupSPPIDDB.GroupStyle = DevExpress.Utils.GroupStyle.Card;
230
            this.layoutControlGroupSPPIDDB.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
231
            this.labelSPPIDPlantName,
232
            this.labelSPPIDDBStatus,
233
            this.layoutControlItem2,
234
            this.simpleLabelItem2,
235
            this.simpleLabelItem1});
236
            this.layoutControlGroupSPPIDDB.Location = new System.Drawing.Point(942, 118);
237
            this.layoutControlGroupSPPIDDB.Name = "layoutControlGroupSPPIDDB";
238
            this.layoutControlGroupSPPIDDB.Size = new System.Drawing.Size(264, 134);
239
            this.layoutControlGroupSPPIDDB.Text = "SPPID DB";
240
            // 
241
            // labelSPPIDPlantName
242
            // 
243
            this.labelSPPIDPlantName.AllowHotTrack = false;
244
            this.labelSPPIDPlantName.AppearanceItemCaption.Options.UseForeColor = true;
245
            this.labelSPPIDPlantName.Location = new System.Drawing.Point(78, 40);
246
            this.labelSPPIDPlantName.Name = "labelSPPIDPlantName";
247
            this.labelSPPIDPlantName.Size = new System.Drawing.Size(162, 18);
248
            this.labelSPPIDPlantName.Text = "SPPIDPlantName";
249
            this.labelSPPIDPlantName.TextSize = new System.Drawing.Size(93, 14);
250
            // 
251
            // labelSPPIDDBStatus
252
            // 
253
            this.labelSPPIDDBStatus.AllowHotTrack = false;
254
            this.labelSPPIDDBStatus.AppearanceItemCaption.Options.UseForeColor = true;
255
            this.labelSPPIDDBStatus.Location = new System.Drawing.Point(51, 58);
256
            this.labelSPPIDDBStatus.Name = "labelSPPIDDBStatus";
257
            this.labelSPPIDDBStatus.Size = new System.Drawing.Size(189, 18);
258
            this.labelSPPIDDBStatus.Text = "SPPIDDBStatus";
259
            this.labelSPPIDDBStatus.TextSize = new System.Drawing.Size(93, 14);
260
            // 
261
            // layoutControlItem2
262
            // 
263
            this.layoutControlItem2.Control = this.btnSPPIDDB;
264
            this.layoutControlItem2.Location = new System.Drawing.Point(0, 0);
265
            this.layoutControlItem2.Name = "layoutControlItem2";
266
            this.layoutControlItem2.Size = new System.Drawing.Size(240, 40);
267
            this.layoutControlItem2.TextSize = new System.Drawing.Size(0, 0);
268
            this.layoutControlItem2.TextVisible = false;
269
            // 
270
            // simpleLabelItem2
271
            // 
272
            this.simpleLabelItem2.AllowHotTrack = false;
273
            this.simpleLabelItem2.AppearanceItemCaption.Options.UseForeColor = true;
274
            this.simpleLabelItem2.Location = new System.Drawing.Point(0, 58);
275
            this.simpleLabelItem2.MaxSize = new System.Drawing.Size(51, 18);
276
            this.simpleLabelItem2.MinSize = new System.Drawing.Size(51, 18);
277
            this.simpleLabelItem2.Name = "simpleLabelItem2";
278
            this.simpleLabelItem2.Size = new System.Drawing.Size(51, 18);
279
            this.simpleLabelItem2.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
280
            this.simpleLabelItem2.Text = "Status : ";
281
            this.simpleLabelItem2.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
282
            this.simpleLabelItem2.TextSize = new System.Drawing.Size(47, 14);
283
            // 
284
            // simpleLabelItem1
285
            // 
286
            this.simpleLabelItem1.AllowHotTrack = false;
287
            this.simpleLabelItem1.AppearanceItemCaption.Options.UseForeColor = true;
288
            this.simpleLabelItem1.Location = new System.Drawing.Point(0, 40);
289
            this.simpleLabelItem1.MaxSize = new System.Drawing.Size(78, 18);
290
            this.simpleLabelItem1.MinSize = new System.Drawing.Size(78, 18);
291
            this.simpleLabelItem1.Name = "simpleLabelItem1";
292
            this.simpleLabelItem1.Size = new System.Drawing.Size(78, 18);
293
            this.simpleLabelItem1.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
294
            this.simpleLabelItem1.Text = "Plant Name : ";
295
            this.simpleLabelItem1.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
296
            this.simpleLabelItem1.TextSize = new System.Drawing.Size(74, 14);
297
            // 
298
            // layoutControlGroupItemMapping
299
            // 
300
            this.layoutControlGroupItemMapping.CaptionImageOptions.SvgImage = global::Converter.SPPID.Properties.Resources.arrangegroups;
301
            this.layoutControlGroupItemMapping.GroupStyle = DevExpress.Utils.GroupStyle.Card;
302
            this.layoutControlGroupItemMapping.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
303
            this.layoutControlItem4,
304
            this.labelItemMappingStatus,
305
            this.simpleLabelItem5});
306
            this.layoutControlGroupItemMapping.Location = new System.Drawing.Point(942, 252);
307
            this.layoutControlGroupItemMapping.Name = "layoutControlGroupItemMapping";
308
            this.layoutControlGroupItemMapping.Size = new System.Drawing.Size(264, 116);
309
            this.layoutControlGroupItemMapping.Text = "Item Mapping";
310
            // 
311
            // layoutControlItem4
312
            // 
313
            this.layoutControlItem4.Control = this.btnItemMapping;
314
            this.layoutControlItem4.Location = new System.Drawing.Point(0, 0);
315
            this.layoutControlItem4.Name = "layoutControlItem4";
316
            this.layoutControlItem4.Size = new System.Drawing.Size(240, 40);
317
            this.layoutControlItem4.TextSize = new System.Drawing.Size(0, 0);
318
            this.layoutControlItem4.TextVisible = false;
319
            // 
320
            // labelItemMappingStatus
321
            // 
322
            this.labelItemMappingStatus.AllowHotTrack = false;
323
            this.labelItemMappingStatus.AppearanceItemCaption.Options.UseForeColor = true;
324
            this.labelItemMappingStatus.Location = new System.Drawing.Point(51, 40);
325
            this.labelItemMappingStatus.Name = "labelItemMappingStatus";
326
            this.labelItemMappingStatus.Size = new System.Drawing.Size(189, 18);
327
            this.labelItemMappingStatus.Text = "MappingStatus";
328
            this.labelItemMappingStatus.TextSize = new System.Drawing.Size(93, 14);
329
            // 
330
            // simpleLabelItem5
331
            // 
332
            this.simpleLabelItem5.AllowHotTrack = false;
333
            this.simpleLabelItem5.AppearanceItemCaption.Options.UseForeColor = true;
334
            this.simpleLabelItem5.Location = new System.Drawing.Point(0, 40);
335
            this.simpleLabelItem5.MaxSize = new System.Drawing.Size(51, 18);
336
            this.simpleLabelItem5.MinSize = new System.Drawing.Size(51, 18);
337
            this.simpleLabelItem5.Name = "simpleLabelItem5";
338
            this.simpleLabelItem5.Size = new System.Drawing.Size(51, 18);
339
            this.simpleLabelItem5.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
340
            this.simpleLabelItem5.Text = "Status : ";
341
            this.simpleLabelItem5.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
342
            this.simpleLabelItem5.TextSize = new System.Drawing.Size(47, 14);
343
            // 
344
            // layoutControlGroupAutoConverter
345
            // 
346
            this.layoutControlGroupAutoConverter.CaptionImageOptions.SvgImage = global::Converter.SPPID.Properties.Resources.convertto;
347
            this.layoutControlGroupAutoConverter.GroupStyle = DevExpress.Utils.GroupStyle.Card;
348
            this.layoutControlGroupAutoConverter.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
349
            this.layoutControlItem1,
350
            this.layoutControlItem5,
351
            this.emptySpaceItem2,
352
            this.layoutControlItem6});
353
            this.layoutControlGroupAutoConverter.Location = new System.Drawing.Point(0, 0);
354
            this.layoutControlGroupAutoConverter.Name = "layoutControlGroupAutoConverter";
355
            this.layoutControlGroupAutoConverter.Size = new System.Drawing.Size(932, 541);
356
            this.layoutControlGroupAutoConverter.Text = "Auto Converter";
357
            // 
358
            // layoutControlItem1
359
            // 
360
            this.layoutControlItem1.Control = this.gridControlConverter;
361
            this.layoutControlItem1.Location = new System.Drawing.Point(0, 40);
362
            this.layoutControlItem1.Name = "layoutControlItem1";
363
            this.layoutControlItem1.Size = new System.Drawing.Size(908, 443);
364
            this.layoutControlItem1.TextSize = new System.Drawing.Size(0, 0);
365
            this.layoutControlItem1.TextVisible = false;
366
            // 
367
            // layoutControlItem5
368
            // 
369
            this.layoutControlItem5.Control = this.btnLoadFile;
370
            this.layoutControlItem5.Location = new System.Drawing.Point(0, 0);
371
            this.layoutControlItem5.MaxSize = new System.Drawing.Size(114, 40);
372
            this.layoutControlItem5.MinSize = new System.Drawing.Size(114, 40);
373
            this.layoutControlItem5.Name = "layoutControlItem5";
374
            this.layoutControlItem5.Size = new System.Drawing.Size(114, 40);
375
            this.layoutControlItem5.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
376
            this.layoutControlItem5.TextSize = new System.Drawing.Size(0, 0);
377
            this.layoutControlItem5.TextVisible = false;
378
            // 
379
            // emptySpaceItem2
380
            // 
381
            this.emptySpaceItem2.AllowHotTrack = false;
382
            this.emptySpaceItem2.Location = new System.Drawing.Point(114, 0);
383
            this.emptySpaceItem2.Name = "emptySpaceItem2";
384
            this.emptySpaceItem2.Size = new System.Drawing.Size(711, 40);
385
            this.emptySpaceItem2.TextSize = new System.Drawing.Size(0, 0);
386
            // 
387
            // layoutControlItem6
388
            // 
389
            this.layoutControlItem6.Control = this.btnRun;
390
            this.layoutControlItem6.Location = new System.Drawing.Point(825, 0);
391
            this.layoutControlItem6.MaxSize = new System.Drawing.Size(83, 40);
392
            this.layoutControlItem6.MinSize = new System.Drawing.Size(83, 40);
393
            this.layoutControlItem6.Name = "layoutControlItem6";
394
            this.layoutControlItem6.Size = new System.Drawing.Size(83, 40);
395
            this.layoutControlItem6.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
396
            this.layoutControlItem6.TextSize = new System.Drawing.Size(0, 0);
397
            this.layoutControlItem6.TextVisible = false;
398
            // 
399
            // emptySpaceItem1
400
            // 
401
            this.emptySpaceItem1.AllowHotTrack = false;
402
            this.emptySpaceItem1.Location = new System.Drawing.Point(942, 368);
403
            this.emptySpaceItem1.Name = "emptySpaceItem1";
404
            this.emptySpaceItem1.Size = new System.Drawing.Size(264, 173);
405
            this.emptySpaceItem1.TextSize = new System.Drawing.Size(0, 0);
406
            // 
407
            // layoutControlGroupID2Project
408
            // 
409
            this.layoutControlGroupID2Project.CaptionImageOptions.SvgImage = global::Converter.SPPID.Properties.Resources.actions_image;
410
            this.layoutControlGroupID2Project.GroupStyle = DevExpress.Utils.GroupStyle.Card;
411
            this.layoutControlGroupID2Project.Items.AddRange(new DevExpress.XtraLayout.BaseLayoutItem[] {
412
            this.labelID2ProjectName,
413
            this.labelID2ProjectStatus,
414
            this.layoutControlItem7,
415
            this.simpleLabelItem3,
416
            this.simpleLabelItem4});
417
            this.layoutControlGroupID2Project.Location = new System.Drawing.Point(942, 0);
418
            this.layoutControlGroupID2Project.Name = "layoutControlGroupID2Project";
419
            this.layoutControlGroupID2Project.Size = new System.Drawing.Size(264, 118);
420
            this.layoutControlGroupID2Project.Text = "ID2 Project";
421
            // 
422
            // labelID2ProjectName
423
            // 
424
            this.labelID2ProjectName.AllowHotTrack = false;
425
            this.labelID2ProjectName.AppearanceItemCaption.Options.UseForeColor = true;
426
            this.labelID2ProjectName.Location = new System.Drawing.Point(90, 24);
427
            this.labelID2ProjectName.Name = "labelID2ProjectName";
428
            this.labelID2ProjectName.Size = new System.Drawing.Size(150, 18);
429
            this.labelID2ProjectName.Text = "ID2ProjectName";
430
            this.labelID2ProjectName.TextSize = new System.Drawing.Size(93, 14);
431
            // 
432
            // labelID2ProjectStatus
433
            // 
434
            this.labelID2ProjectStatus.AllowHotTrack = false;
435
            this.labelID2ProjectStatus.AppearanceItemCaption.Options.UseForeColor = true;
436
            this.labelID2ProjectStatus.Location = new System.Drawing.Point(51, 42);
437
            this.labelID2ProjectStatus.Name = "labelID2ProjectStatus";
438
            this.labelID2ProjectStatus.Size = new System.Drawing.Size(189, 18);
439
            this.labelID2ProjectStatus.Text = "ID2ProjectStatus";
440
            this.labelID2ProjectStatus.TextSize = new System.Drawing.Size(93, 14);
441
            // 
442
            // layoutControlItem7
443
            // 
444
            this.layoutControlItem7.Control = this.btnID2Project;
445
            this.layoutControlItem7.Location = new System.Drawing.Point(0, 0);
446
            this.layoutControlItem7.Name = "layoutControlItem7";
447
            this.layoutControlItem7.Size = new System.Drawing.Size(240, 24);
448
            this.layoutControlItem7.Text = "Path :";
449
            this.layoutControlItem7.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
450
            this.layoutControlItem7.TextSize = new System.Drawing.Size(33, 14);
451
            this.layoutControlItem7.TextToControlDistance = 5;
452
            // 
453
            // simpleLabelItem3
454
            // 
455
            this.simpleLabelItem3.AllowHotTrack = false;
456
            this.simpleLabelItem3.AppearanceItemCaption.Options.UseForeColor = true;
457
            this.simpleLabelItem3.Location = new System.Drawing.Point(0, 24);
458
            this.simpleLabelItem3.MaxSize = new System.Drawing.Size(90, 18);
459
            this.simpleLabelItem3.MinSize = new System.Drawing.Size(90, 18);
460
            this.simpleLabelItem3.Name = "simpleLabelItem3";
461
            this.simpleLabelItem3.Size = new System.Drawing.Size(90, 18);
462
            this.simpleLabelItem3.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
463
            this.simpleLabelItem3.Text = "Project Name : ";
464
            this.simpleLabelItem3.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
465
            this.simpleLabelItem3.TextSize = new System.Drawing.Size(86, 14);
466
            // 
467
            // simpleLabelItem4
468
            // 
469
            this.simpleLabelItem4.AllowHotTrack = false;
470
            this.simpleLabelItem4.AppearanceItemCaption.Options.UseForeColor = true;
471
            this.simpleLabelItem4.Location = new System.Drawing.Point(0, 42);
472
            this.simpleLabelItem4.MaxSize = new System.Drawing.Size(51, 18);
473
            this.simpleLabelItem4.MinSize = new System.Drawing.Size(51, 18);
474
            this.simpleLabelItem4.Name = "simpleLabelItem4";
475
            this.simpleLabelItem4.Size = new System.Drawing.Size(51, 18);
476
            this.simpleLabelItem4.SizeConstraintsType = DevExpress.XtraLayout.SizeConstraintsType.Custom;
477
            this.simpleLabelItem4.Text = "Status : ";
478
            this.simpleLabelItem4.TextAlignMode = DevExpress.XtraLayout.TextAlignModeItem.AutoSize;
479
            this.simpleLabelItem4.TextSize = new System.Drawing.Size(47, 14);
480
            // 
481
            // splitterItem1
482
            // 
483
            this.splitterItem1.AllowHotTrack = true;
484
            this.splitterItem1.Location = new System.Drawing.Point(932, 0);
485
            this.splitterItem1.Name = "splitterItem1";
486
            this.splitterItem1.Size = new System.Drawing.Size(10, 541);
487
            // 
488
            // xtraFolderBrowserDialog
489
            // 
490
            this.xtraFolderBrowserDialog.DialogStyle = DevExpress.Utils.CommonDialogs.FolderBrowserDialogStyle.Wide;
491
            this.xtraFolderBrowserDialog.SelectedPath = "xtraFolderBrowserDialog1";
492
            // 
493
            // xtraOpenFileDialog
494
            // 
495
            this.xtraOpenFileDialog.FileName = "xtraOpenFileDialog1";
496
            this.xtraOpenFileDialog.Filter = "Xml Files(*.xml)|*.xml";
497
            this.xtraOpenFileDialog.Multiselect = true;
498
            // 
499
            // ConverterForm
500
            // 
501
            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
502
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
503
            this.ClientSize = new System.Drawing.Size(1226, 593);
504
            this.Controls.Add(this.layoutControl1);
505
            this.Controls.Add(this.ribbonControl);
506
            this.Name = "ConverterForm";
507
            this.Ribbon = this.ribbonControl;
508
            this.ShowIcon = false;
509
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
510
            this.Text = "SPPID Converter";
511
            ((System.ComponentModel.ISupportInitialize)(this.ribbonControl)).EndInit();
512
            ((System.ComponentModel.ISupportInitialize)(this.layoutControl1)).EndInit();
513
            this.layoutControl1.ResumeLayout(false);
514
            ((System.ComponentModel.ISupportInitialize)(this.gridControlConverter)).EndInit();
515
            ((System.ComponentModel.ISupportInitialize)(this.gridViewConverter)).EndInit();
516
            ((System.ComponentModel.ISupportInitialize)(this.btnID2Project.Properties)).EndInit();
517
            ((System.ComponentModel.ISupportInitialize)(this.Root)).EndInit();
518
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroupSPPIDDB)).EndInit();
519
            ((System.ComponentModel.ISupportInitialize)(this.labelSPPIDPlantName)).EndInit();
520
            ((System.ComponentModel.ISupportInitialize)(this.labelSPPIDDBStatus)).EndInit();
521
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
522
            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem2)).EndInit();
523
            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem1)).EndInit();
524
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroupItemMapping)).EndInit();
525
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem4)).EndInit();
526
            ((System.ComponentModel.ISupportInitialize)(this.labelItemMappingStatus)).EndInit();
527
            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem5)).EndInit();
528
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroupAutoConverter)).EndInit();
529
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem1)).EndInit();
530
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem5)).EndInit();
531
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem2)).EndInit();
532
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem6)).EndInit();
533
            ((System.ComponentModel.ISupportInitialize)(this.emptySpaceItem1)).EndInit();
534
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlGroupID2Project)).EndInit();
535
            ((System.ComponentModel.ISupportInitialize)(this.labelID2ProjectName)).EndInit();
536
            ((System.ComponentModel.ISupportInitialize)(this.labelID2ProjectStatus)).EndInit();
537
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem7)).EndInit();
538
            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem3)).EndInit();
539
            ((System.ComponentModel.ISupportInitialize)(this.simpleLabelItem4)).EndInit();
540
            ((System.ComponentModel.ISupportInitialize)(this.splitterItem1)).EndInit();
541
            this.ResumeLayout(false);
542
            this.PerformLayout();
543

  
544
        }
545

  
546
        #endregion
547
        private DevExpress.LookAndFeel.DefaultLookAndFeel defaultLookAndFeel;
548
        private DevExpress.XtraBars.Ribbon.RibbonControl ribbonControl;
549
        private DevExpress.XtraLayout.LayoutControl layoutControl1;
550
        private DevExpress.XtraEditors.SimpleButton btnSPPIDDB;
551
        private DevExpress.XtraGrid.GridControl gridControlConverter;
552
        private DevExpress.XtraGrid.Views.Grid.GridView gridViewConverter;
553
        private DevExpress.XtraLayout.LayoutControlGroup Root;
554
        private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroupAutoConverter;
555
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem1;
556
        private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroupSPPIDDB;
557
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem2;
558
        private DevExpress.XtraEditors.SimpleButton btnItemMapping;
559
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem4;
560
        private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroupID2Project;
561
        private DevExpress.XtraLayout.LayoutControlGroup layoutControlGroupItemMapping;
562
        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem1;
563
        private DevExpress.XtraEditors.SimpleButton btnRun;
564
        private DevExpress.XtraEditors.SimpleButton btnLoadFile;
565
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem5;
566
        private DevExpress.XtraLayout.EmptySpaceItem emptySpaceItem2;
567
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem6;
568
        private DevExpress.XtraLayout.SimpleLabelItem labelSPPIDPlantName;
569
        private DevExpress.XtraLayout.SimpleLabelItem labelSPPIDDBStatus;
570
        private DevExpress.XtraLayout.SimpleLabelItem labelID2ProjectName;
571
        private DevExpress.XtraLayout.SimpleLabelItem labelID2ProjectStatus;
572
        private DevExpress.XtraLayout.SimpleLabelItem labelItemMappingStatus;
573
        private DevExpress.XtraLayout.SimpleLabelItem simpleLabelItem1;
574
        private DevExpress.XtraLayout.SimpleLabelItem simpleLabelItem2;
575
        private DevExpress.XtraLayout.SimpleLabelItem simpleLabelItem3;
576
        private DevExpress.XtraLayout.SimpleLabelItem simpleLabelItem4;
577
        private DevExpress.XtraLayout.SimpleLabelItem simpleLabelItem5;
578
        private DevExpress.XtraLayout.SplitterItem splitterItem1;
579
        private DevExpress.XtraEditors.ButtonEdit btnID2Project;
580
        private DevExpress.XtraLayout.LayoutControlItem layoutControlItem7;
581
        private DevExpress.XtraEditors.XtraFolderBrowserDialog xtraFolderBrowserDialog;
582
        private DevExpress.XtraEditors.XtraOpenFileDialog xtraOpenFileDialog;
583
    }
584
}
DTI_PID/SPPIDConverter/ConverterForm.cs
1
using System;
2
using System.Collections.Generic;
3
using System.ComponentModel;
4
using System.Data;
5
using System.Drawing;
6
using System.Linq;
7
using System.Text;
8
using System.Threading.Tasks;
9
using System.Windows.Forms;
10
using Microsoft.VisualBasic;
11
using Converter.BaseModel;
12
using DevExpress.XtraEditors.Repository;
13
using DevExpress.XtraEditors.Controls;
14
using DevExpress.XtraEditors;
15
using System.Globalization;
16
using System.Threading;
17
using System.IO;
18
using Converter.SPPID.Properties;
19
using Converter.SPPID.DB;
20
using Converter.SPPID.Util;
21
using Converter.SPPID.Form;
22
using Converter.SPPID.Model;
23

  
24
namespace Converter.SPPID
25
{
26
    public partial class ConverterForm : DevExpress.XtraBars.Ribbon.RibbonForm
27
    {
28
        private Dictionary<string, SPPID_Document> _DicDocuments = new Dictionary<string, SPPID_Document>();
29
        public List< SPPID_Document> Documents { get { return _DicDocuments.Select(x => x.Value).ToList(); } }
30
        private DataTable _ConverterDT = new DataTable();
31
        private DataTable _SPPIDSymbolPathDT = new DataTable();
32
        private DataTable _SPPIDUnitDT = new DataTable();
33
        private RepositoryItemComboBox templateComboBox;
34

  
35

  
36
        private DataTable _ID2SymbolDT = new DataTable();
37
        private DataTable _ID2LineDT = new DataTable();
38
        private DataTable _ID2AssociationDT = new DataTable();
39
        private DataTable _ID2LinePropertyDT = new DataTable();
40

  
41
        private List<SymbolMapping> symbolMappings = new List<SymbolMapping>();
42
        private List<LineMapping> lineMappings = new List<LineMapping>();
43
        private List<LineNumberMapping> lineNumberMappings = new List<LineNumberMapping>();
44
        private List<AssociationMapping> associationMappings = new List<AssociationMapping>();
45

  
46
        public ConverterForm()
47
        {
48
            InitializeComponent();
49

  
50
            CultureInfo culture = CultureInfo.GetCultureInfo("ko");
51
            Msg.Culture = culture;
52

  
53
            InitUsedDataTable();
54
            InitGridControl();
55
            InitID2Project();
56
        }
57

  
58
        private void InitUsedDataTable()
59
        {
60
            // Converter Table
61
            DataColumn col = _ConverterDT.Columns.Add("colDrawingFileName");
62
            col.Caption = "Drawing File Name";
63
            col = _ConverterDT.Columns.Add("colDrawingFilePath");
64
            col.Caption = "DrawingFilePath";
65
            col = _ConverterDT.Columns.Add("colUnit");
66
            col.Caption = "Unit";
67
            col = _ConverterDT.Columns.Add("colTemplate");
68
            col.Caption = "Template";
69
            col = _ConverterDT.Columns.Add("colDrawingNumber");
70
            col.Caption = "Drawing Number";
71
            col = _ConverterDT.Columns.Add("colDrawingName");
72
            col.Caption = "Drawing Name";
73
            col = _ConverterDT.Columns.Add("colStatus");
74
            col.Caption = "Status";
75
            col = _ConverterDT.Columns.Add("colUID");
76

  
77
            col = _ID2LineDT.Columns.Add("UID");
78
            col = _ID2LineDT.Columns.Add("Name");
79
            col.Caption = "Name";
80
            col = _ID2LineDT.Columns.Add("Type");
81
            col.Caption = "Type";
82
            col = _ID2LineDT.Columns.Add("SPPID_SYMBOL_PATH");
83
            col.Caption = "SPPID Symbol Path";
84
            col = _ID2LineDT.Columns.Add("Clear");
85
            col.Caption = "";
86
        }
87

  
88
        private void InitGridControl()
89
        {
90
            #region Converter Page
91
            gridViewConverter.OptionsSelection.MultiSelect = true;
92
            gridViewConverter.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect;
93
            
94
            gridControlConverter.DataSource = _ConverterDT;
95

  
96
            templateComboBox = new RepositoryItemComboBox();
97
            templateComboBox.TextEditStyle = TextEditStyles.DisableTextEditor;
98
            templateComboBox.EditValueChanged += templateComboBox_EditValueChanged;
99
            gridControlConverter.RepositoryItems.Add(templateComboBox);
100
            gridViewConverter.Columns["colTemplate"].ColumnEdit = templateComboBox;
101

  
102
            gridViewConverter.Columns["colUnit"].OptionsColumn.AllowEdit = false;
103
            gridViewConverter.Columns["colDrawingFileName"].OptionsColumn.AllowEdit = false;
104
            gridViewConverter.Columns["colUnit"].OptionsColumn.ReadOnly = true;
105
            gridViewConverter.Columns["colStatus"].OptionsColumn.AllowEdit = false;
106
            gridViewConverter.Columns["colDrawingFilePath"].Visible = false;
107
            gridViewConverter.Columns["colUID"].Visible = false;
108

  
109
            gridViewConverter.BestFitColumns();
110
            #endregion
111
        }
112
        private void templateComboBox_EditValueChanged(object sender, EventArgs e)
113
        {
114
            gridViewConverter.CloseEditor();
115
            gridViewConverter.UpdateCurrentRow();
116
        }
117

  
118
        private void gridViewConverter_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
119
        {
120
            if (e.Column.Name == "colcolTemplate")
121
            {
122
                gridViewConverter.ShowEditor();
123
                (gridViewConverter.ActiveEditor as ComboBoxEdit).ShowPopup();
124
            }
125
            else if (e.Column.Name == "colcolUnit")
126
            {
127
                UnitForm unitForm = new UnitForm(_SPPIDUnitDT);
128
                if (unitForm.ShowDialog() == DialogResult.OK)
129
                {
130
                    gridViewConverter.SetRowCellValue(e.RowHandle, e.Column, unitForm.SelectedUnit);
131
                    gridViewConverter.CloseEditor();
132
                    gridViewConverter.UpdateCurrentRow();
133
                }
134
            }
135
        }
136

  
137
        private void btnID2Project_ButtonClick(object sender, ButtonPressedEventArgs e)
138
        {
139
            xtraFolderBrowserDialog.SelectedPath = btnID2Project.Text;
140

  
141
            if (xtraFolderBrowserDialog.ShowDialog() == DialogResult.OK)
142
            {
143
                if (xtraFolderBrowserDialog.SelectedPath[xtraFolderBrowserDialog.SelectedPath.Length - 1] == '\\')
144
                    xtraFolderBrowserDialog.SelectedPath = xtraFolderBrowserDialog.SelectedPath.Remove(xtraFolderBrowserDialog.SelectedPath.Length - 1);
145
                Settings.Default.LatestProjectPath = xtraFolderBrowserDialog.SelectedPath;
146
                Settings.Default.Save();
147
                if (InitID2Project())
148
                {
149
                    MessageBox.Show(Msg.SuccessProjectSelect, Msg.Information, MessageBoxButtons.OK, MessageBoxIcon.Information);
150
                }
151
                else
152
                    MessageBox.Show(Msg.FailProjectSelect, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
153
            }
154
        }
155

  
156
        private bool InitID2Project()
157
        {
158
            Project_Info _ProjectInfo = Project_Info.GetInstance();
159
            _ProjectInfo.DefaultPath = Settings.Default.LatestProjectPath;
160
            if (Project_DB.ConnTestAndCreateTable())
161
            {
162
                _ProjectInfo.Enable = true;
163
                btnID2Project.Text = _ProjectInfo.DefaultPath;
164
                labelID2ProjectName.Text = _ProjectInfo.Name;
165
                labelID2ProjectName.AppearanceItemCaption.ForeColor = Color.Blue;
166
                labelID2ProjectStatus.Text = Msg.ConnectionSuccessful;
167
                labelID2ProjectStatus.AppearanceItemCaption.ForeColor = Color.Blue;
168
                layoutControlGroupSPPIDDB.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
169
                layoutControlGroupItemMapping.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always;
170
            }
171
            else
172
            {
173
                _ProjectInfo.Enable = false;
174
                btnID2Project.Text = "";
175
                labelID2ProjectName.Text = " ";
176
                labelID2ProjectName.AppearanceItemCaption.ForeColor = Color.Red;
177
                labelID2ProjectStatus.Text = Msg.ConnectionFail;
178
                labelID2ProjectStatus.AppearanceItemCaption.ForeColor = Color.Red;
179
                layoutControlGroupSPPIDDB.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
180
                layoutControlGroupItemMapping.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
181
            }
182

  
183
            InitMapping();
184
            InitSPPIDDB();
185

  
186
            return _ProjectInfo.Enable;
187
        }
188

  
189
        private void InitMapping()
190
        {
191
            Project_Info _ProjectInfo = Project_Info.GetInstance();
192
            if (_ProjectInfo.Enable)
193
            {
194
                InitID2Symbol();
195
                InitID2Line();
196
                InitID2LineNumber();
197
                InitID2Association();
198

  
199
                InitETCSetting();
200
            }
201
        }
202
        private void InitETCSetting()
203
        {
204
            Project_Info _ProjectInfo = Project_Info.GetInstance();
205
            if (_ProjectInfo.Enable)
206
            {
207
                DataTable dt = Project_DB.SelectETCSetting();
208
                if (dt.Columns.Count > 0 && dt.Rows.Count > 0)
209
                    SPPIDUtil.ConvertToETCSetting(dt.Rows[0][0].ToString());
210
                else
211
                    SPPID_DBInfo.Clear();
212
            }
213
        }
214

  
215
        private void InitID2Symbol()
216
        {
217
            using (DataTable symbolDT = Project_DB.SelectProjectSymbol())
218
            {
219
                symbolMappings.Clear();
220
                _ID2SymbolDT = symbolDT;
221
                _ID2SymbolDT.Columns.Add("Clear");
222
                _ID2SymbolDT.Columns["Clear"].Caption = "";
223
                foreach (DataRow row in symbolDT.Rows)
224
                {
225
                    symbolMappings.Add(new SymbolMapping()
226
                    {
227
                        UID = row["UID"] == null ? "" : row["UID"].ToString(),
228
                        SYMBOLNAME = row["Name"] == null ? "" : row["Name"].ToString(),
229
                        SPPIDSYMBOLNAME = row["SPPID_SYMBOL_PATH"] == null ? "" : row["SPPID_SYMBOL_PATH"].ToString(),
230
                    });
231
                }
232
            }
233
        }
234

  
235
        private void InitID2Line()
236
        {
237
            using (DataTable lineTypes = Project_DB.SelectProjectLine())
238
            {
239
                lineMappings.Clear();
240
                _ID2LineDT.Rows.Clear();
241
                foreach (DataRow row in lineTypes.Rows)
242
                {
243
                    DataRow newRow = _ID2LineDT.NewRow();
244
                    newRow["UID"] = row["UID"] == null ? "" : row["UID"].ToString();
245
                    newRow["Name"] = row["Name"] == null ? "" : row["Name"].ToString();
246
                    newRow["Type"] = "Line";
247
                    newRow["SPPID_SYMBOL_PATH"] = row["SPPID_SYMBOL_PATH"] == null ? "" : row["SPPID_SYMBOL_PATH"].ToString();
248
                    _ID2LineDT.Rows.Add(newRow);
249

  
250
                    lineMappings.Add(new LineMapping()
251
                    {
252
                        UID = row["UID"] == null ? "" : row["UID"].ToString(),
253
                        LINENAME = row["Name"] == null ? "" : row["Name"].ToString(),
254
                        SPPIDSYMBOLNAME = row["SPPID_SYMBOL_PATH"] == null ? "" : row["SPPID_SYMBOL_PATH"].ToString(),
255
                    });
256
                }
257
            }
258
        }
259

  
260
        private void InitID2LineNumber()
261
        {
262
            using (DataTable linePropertiesDT = Project_DB.SelectProjectLineProperties())
263
            {
264
                lineNumberMappings.Clear();
265
                _ID2LinePropertyDT = linePropertiesDT;
266
                _ID2LinePropertyDT.Columns.Add("Type");
267
                foreach (DataRow row in linePropertiesDT.Rows)
268
                {
269
                    row["Type"] = "Line Property";
270
                    lineNumberMappings.Add(new LineNumberMapping()
271
                    {
272
                        UID = row["UID"] == null ? "" : row["UID"].ToString(),
273
                        DisplayName = row["DisplayName"] == null ? "" : row["DisplayName"].ToString(),
274
                        SPPIDATTRIBUTENAME = row["SPPID_ATTRIBUTE"] == null ? "" : row["SPPID_ATTRIBUTE"].ToString(),
275
                        SPPIDSYMBOLNAME = row["SPPID_SYMBOL_PATH"] == null ? "" : row["SPPID_SYMBOL_PATH"].ToString()
276
                    });
277
                }
278
            }
279
        }
280

  
281
        private void InitID2Association()
282
        {
283
            using (DataTable associationDT = Project_DB.SelectProjectAssociation())
284
            {
285
                associationMappings.Clear();
286
                _ID2AssociationDT = associationDT;
287
                _ID2AssociationDT.Columns.Add("Clear");
288
                _ID2AssociationDT.Columns["Clear"].Caption = "";
289
                foreach (DataRow row in associationDT.Rows)
290
                {
291
                    associationMappings.Add(new AssociationMapping()
292
                    {
293
                        UID = row["UID"] == null ? "" : row["UID"].ToString(),
294
                        DisplayAttribute = row["DisplayAttribute"] == null ? "" : row["DisplayAttribute"].ToString(),
295
                        Type = row["Type"] == null ? "" : row["Type"].ToString(),
296
                        SPPIDATTRIBUTENAME = row["SPPID_ATTRIBUTE"] == null ? "" : row["SPPID_ATTRIBUTE"].ToString(),
297
                        SPPIDSYMBOLNAME = row["SPPID_SYMBOL_PATH"] == null ? "" : row["SPPID_SYMBOL_PATH"].ToString()
298
                    });
299
                }
300
            }
301
        }
302

  
303
        private void InitSPPIDDB()
304
        {
305
            Project_Info _ProjectInfo = Project_Info.GetInstance();
306
            if (_ProjectInfo.Enable)
307
            {
308
                DataTable dt = Project_DB.SelectSPPID_DB_INFO();
309
                if (dt.Columns.Count > 0 && dt.Rows.Count > 0)
310
                    SPPIDUtil.ConvertToSPPIDInfo(dt.Rows[0][0].ToString());
311
                else
312
                    SPPID_DBInfo.Clear();
313
            }
314

  
315
            templateComboBox.Items.Clear();
316
            SPPID_DBInfo _SPPIDInfo = SPPID_DBInfo.GetInstance();
317
            if (_SPPIDInfo.Enable)
318
            {
319
                labelSPPIDPlantName.Text = _SPPIDInfo.SelectedPlant;
320
                labelSPPIDPlantName.AppearanceItemCaption.ForeColor = Color.Blue;
321
                labelSPPIDDBStatus.Text = Msg.ConnectionSuccessful;
322
                labelSPPIDDBStatus.AppearanceItemCaption.ForeColor = Color.Blue;
323

  
324
                string TemplatePath = SPPID_DB.GetPlantPID_T_OPTIONSETTING_Value("PID Template Path");
325
                if (!string.IsNullOrEmpty(TemplatePath))
326
                    templateComboBox.Items.AddRange(Directory.GetFiles(TemplatePath, "*.pid").ToList().Select(filePath => Path.GetFileName(filePath)).ToList());
327

  
328
                _SPPIDUnitDT = SPPID_DB.GetUnitTree();
329

  
330
                layoutControlGroupAutoConverter.Enabled = true;
331
            }
332
            else
333
            {
334
                labelSPPIDPlantName.Text = " ";
335
                labelSPPIDPlantName.AppearanceItemCaption.ForeColor = Color.Red;
336
                labelSPPIDDBStatus.Text = Msg.ConnectionFail;
337
                labelSPPIDDBStatus.AppearanceItemCaption.ForeColor = Color.Red;
338

  
339
                layoutControlGroupAutoConverter.Enabled = false;
340
            }
341

  
342
            _DicDocuments.Clear();
343
            _ConverterDT.Rows.Clear();
344
            InitSPPIDSymbolTreeTable();
345
        }
346

  
347
        private void InitSPPIDSymbolTreeTable()
348
        {
349
            SPPID_DBInfo _SPPIDInfo = SPPID_DBInfo.GetInstance();
350

  
351
            _SPPIDSymbolPathDT = new DataTable();
352
            _SPPIDSymbolPathDT.Columns.Add("ID");
353
            _SPPIDSymbolPathDT.Columns.Add("Parent");
354
            _SPPIDSymbolPathDT.Columns.Add("Name");
355
            _SPPIDSymbolPathDT.Columns.Add("FullPath");
356

  
357
            if (_SPPIDInfo.Enable)
358
            {
359
                string symbolPath = SPPID_DB.GetPlantPID_T_OPTIONSETTING_Value("Catalog Explorer root path");
360
                DirectoryInfo info = new DirectoryInfo(symbolPath);
361
                _SPPIDSymbolPathDT.Rows.Add(new object[] { "0", "-1", info.Name });
362
                loop(info, "0", symbolPath);
363
            }
364
        }
365

  
366
        private void loop(DirectoryInfo parentInfo, string parentUID, string defaultPath)
367
        {
368
            DirectoryInfo[] infos = parentInfo.GetDirectories();
369
            foreach (DirectoryInfo info in infos)
370
            {
371
                string uid = Guid.NewGuid().ToString();
372
                _SPPIDSymbolPathDT.Rows.Add(new object[] { uid, parentUID, info.Name });
373
                loop(info, uid, defaultPath);
374

  
375
                FileInfo[] files = info.GetFiles("*.sym");
376
                foreach (FileInfo fileInfo in files)
377
                {
378
                    _SPPIDSymbolPathDT.Rows.Add(new object[] { Guid.NewGuid().ToString(), uid, fileInfo.Name, fileInfo.FullName.Replace(defaultPath, "") });
379
                }
380
            }
381
        }
382

  
383
        private void btnLoadFile_Click(object sender, EventArgs e)
384
        {
385
            Project_Info _ProjectInfo = Project_Info.GetInstance();
386
            if (!_ProjectInfo.Enable)
387
            {
388
                MessageBox.Show(Msg.PleaseSetID2ProjectInfo, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
389
                return;
390
            }
391

  
392
            xtraOpenFileDialog.InitialDirectory = _ProjectInfo.TempDirPath;
393
            if (xtraOpenFileDialog.ShowDialog() == DialogResult.OK)
394
            {
395
                foreach (string fileName in xtraOpenFileDialog.FileNames)
396
                {
397
                    SPPID_Document document = new SPPID_Document(fileName);
398
                    document.SymbolMappings = symbolMappings;
399
                    DataRow[] rows = _ConverterDT.Select(string.Format("colDrawingFilePath = '{0}'", fileName));
400
                    DataRow row;
401
                    if (rows.Length == 0)
402
                    {
403
                        row = _ConverterDT.NewRow();
404
                        row["colDrawingFileName"] = Path.GetFileNameWithoutExtension(fileName);
405
                        row["colDrawingFilePath"] = fileName;
406
                        row["colDrawingNumber"] = document.DWGNAME;
407
                        row["colDrawingName"] = document.DWGNAME;
408
                        if (document.Enable)
409
                            row["colStatus"] = "Ready";
410
                        else
411
                            row["colStatus"] = "Error";
412
                        row["colUID"] = "";
413
                        _ConverterDT.Rows.Add(row);
414
                    }
415
                    if (!_DicDocuments.ContainsKey(fileName))
416
                        _DicDocuments.Add(fileName, null);
417

  
418
                    _DicDocuments[fileName] = document;
419
                }
420
            }
421
        } 
422

  
423
        private void btnRun_Click(object sender, EventArgs e)
424
        {
425
            DialogResult = DialogResult.OK;
426
        }
427

  
428
        private void btnSPPIDDB_Click(object sender, EventArgs e)
429
        {
430
            SPPID_DB_SettingForm form = new SPPID_DB_SettingForm();
431
            if (form.ShowDialog() == DialogResult.OK)
432
                InitSPPIDDB();
433
        }
434

  
435
        private void btnItemMapping_Click(object sender, EventArgs e)
436
        {
437
            Project_Info _ProjectInfo = Project_Info.GetInstance();
438
            if (!_ProjectInfo.Enable)
439
            {
440
                MessageBox.Show(Msg.PleaseSetID2ProjectInfo, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);
441
                return;
442
            }
443

  
444
            MappingForm form = new MappingForm(_ID2SymbolDT,_SPPIDSymbolPathDT, _ID2LineDT, _ID2LinePropertyDT, _ID2AssociationDT);
445
            form.ShowDialog();
446
            InitMapping();
447
        }
448

  
449
    }
450
}
DTI_PID/SPPIDConverter/ConverterForm.resx
1
<?xml version="1.0" encoding="utf-8"?>
2
<root>
3
  <!-- 
4
    Microsoft ResX Schema 
5
    
6
    Version 2.0
7
    
8
    The primary goals of this format is to allow a simple XML format 
9
    that is mostly human readable. The generation and parsing of the 
10
    various data types are done through the TypeConverter classes 
11
    associated with the data types.
12
    
13
    Example:
14
    
15
    ... ado.net/XML headers & schema ...
16
    <resheader name="resmimetype">text/microsoft-resx</resheader>
17
    <resheader name="version">2.0</resheader>
18
    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19
    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20
    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21
    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22
    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23
        <value>[base64 mime encoded serialized .NET Framework object]</value>
24
    </data>
25
    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26
        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27
        <comment>This is a comment</comment>
28
    </data>
29
                
30
    There are any number of "resheader" rows that contain simple 
31
    name/value pairs.
32
    
33
    Each data row contains a name, and value. The row also contains a 
34
    type or mimetype. Type corresponds to a .NET class that support 
35
    text/value conversion through the TypeConverter architecture. 
36
    Classes that don't support this are serialized and stored with the 
37
    mimetype set.
38
    
39
    The mimetype is used for serialized objects, and tells the 
40
    ResXResourceReader how to depersist the object. This is currently not 
41
    extensible. For a given mimetype the value must be set accordingly:
42
    
43
    Note - application/x-microsoft.net.object.binary.base64 is the format 
44
    that the ResXResourceWriter will generate, however the reader can 
45
    read any of the formats listed below.
46
    
47
    mimetype: application/x-microsoft.net.object.binary.base64
48
    value   : The object must be serialized with 
49
            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50
            : and then encoded with base64 encoding.
51
    
52
    mimetype: application/x-microsoft.net.object.soap.base64
53
    value   : The object must be serialized with 
54
            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55
            : and then encoded with base64 encoding.
56

  
57
    mimetype: application/x-microsoft.net.object.bytearray.base64
58
    value   : The object must be serialized into a byte array 
59
            : using a System.ComponentModel.TypeConverter
60
            : and then encoded with base64 encoding.
61
    -->
62
  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63
    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64
    <xsd:element name="root" msdata:IsDataSet="true">
65
      <xsd:complexType>
66
        <xsd:choice maxOccurs="unbounded">
67
          <xsd:element name="metadata">
68
            <xsd:complexType>
69
              <xsd:sequence>
70
                <xsd:element name="value" type="xsd:string" minOccurs="0" />
71
              </xsd:sequence>
72
              <xsd:attribute name="name" use="required" type="xsd:string" />
73
              <xsd:attribute name="type" type="xsd:string" />
74
              <xsd:attribute name="mimetype" type="xsd:string" />
75
              <xsd:attribute ref="xml:space" />
76
            </xsd:complexType>
77
          </xsd:element>
78
          <xsd:element name="assembly">
79
            <xsd:complexType>
80
              <xsd:attribute name="alias" type="xsd:string" />
81
              <xsd:attribute name="name" type="xsd:string" />
82
            </xsd:complexType>
83
          </xsd:element>
84
          <xsd:element name="data">
85
            <xsd:complexType>
86
              <xsd:sequence>
87
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88
                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89
              </xsd:sequence>
90
              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91
              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92
              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93
              <xsd:attribute ref="xml:space" />
94
            </xsd:complexType>
95
          </xsd:element>
96
          <xsd:element name="resheader">
97
            <xsd:complexType>
98
              <xsd:sequence>
99
                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100
              </xsd:sequence>
101
              <xsd:attribute name="name" type="xsd:string" use="required" />
102
            </xsd:complexType>
103
          </xsd:element>
104
        </xsd:choice>
105
      </xsd:complexType>
106
    </xsd:element>
107
  </xsd:schema>
108
  <resheader name="resmimetype">
109
    <value>text/microsoft-resx</value>
110
  </resheader>
111
  <resheader name="version">
112
    <value>2.0</value>
113
  </resheader>
114
  <resheader name="reader">
115
    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116
  </resheader>
117
  <resheader name="writer">
118
    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119
  </resheader>
120
  <metadata name="defaultLookAndFeel.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
121
    <value>17, 17</value>
122
  </metadata>
123
  <metadata name="xtraFolderBrowserDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
124
    <value>179, 17</value>
125
  </metadata>
126
  <metadata name="xtraOpenFileDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
127
    <value>367, 17</value>
128
  </metadata>
129
</root>
DTI_PID/SPPIDConverter/DB/SPPID_DB.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using System.Data;
7
using System.Globalization;
8
using System.IO;
9
using Oracle.ManagedDataAccess.Client;
10

  
11
namespace Converter.SPPID.DB
12
{
13
    public class SPPID_DB
14
    {
15
        private const string oConnString = "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST ={0}" + @")(PORT = {1}))(CONNECT_DATA = (SERVICE_NAME = {2})))";
16

  
17
        public static bool CheckAndSetSPPIDInfo(SPPID_DBInfo dbInfo)
18
        {
19
            bool bResult = false;
20
            try
21
            {
22
                if (dbInfo.DBType == "ORACLE")
23
                {
24
                    string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service);
25
                    connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword;
26

  
27
                    using (OracleConnection conn = new OracleConnection(connString))
28
                    {
29
                        conn.Open();
30
                        if (conn.State == System.Data.ConnectionState.Open)
31
                        {
32
                            using (OracleCommand cmd = new OracleCommand())
33
                            {
34
                                cmd.Connection = conn;
35
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT NAME, PATH FROM {0}.T_ROOTITEM", dbInfo.Site);
36

  
37
                                using (OracleDataReader reader = cmd.ExecuteReader())
38
                                {
39
                                    while (reader.Read())
40
                                    {
41
                                        dbInfo.Plant = reader["NAME"].ToString();
42
                                        dbInfo.PlantPath = reader["PATH"].ToString();
43
                                    }
44

  
45
                                    cmd.CommandText = string.Format(CultureInfo.CurrentCulture, @"SELECT SP_SCHEMA_TYPE, USERNAME
46
                                                FROM {0}.T_DB_DATA DB_DATA 
47
                                                INNER JOIN {0}.T_ROOTITEM ROOTITEM ON DB_DATA.SP_ROOTITEMID = ROOTITEM.SP_ID 
48
                                                WHERE ROOTITEM.NAME = '{1}'", dbInfo.Site, dbInfo.Plant);
49

  
50

  
51
                                    using (OracleDataAdapter adapter = new OracleDataAdapter())
52
                                    {
53
                                        DataTable dt = new DataTable();
54
                                        adapter.SelectCommand = cmd;
55
                                        adapter.Fill(dt);
56

  
57
                                        foreach (DataRow row in dt.Rows)
58
                                        {
59
                                            string sType = row["SP_SCHEMA_TYPE"].ToString();
60
                                            switch (sType)
61
                                            {
62
                                                case "SPPIDDATA_DICTIONARY":
63
                                                    dbInfo.PlantPIDDic = row["USERNAME"].ToString();
64
                                                    break;
65
                                                case "DATA_DICTIONARY":
66
                                                    dbInfo.PlantDic = row["USERNAME"].ToString();
67
                                                    break;
68
                                                case "SPAPLANT":
69
                                                    dbInfo.Plant = row["USERNAME"].ToString();
70
                                                    break;
71
                                                case "SPPID":
72
                                                    dbInfo.PlantPID = row["USERNAME"].ToString();
73
                                                    break;
74
                                                default:
75
                                                    break;
76
                                            }
77
                                        }
78
                                        bResult = true;
79
                                    }
80
                                }
81
                            }
82
                        }
83
                    }
84
                }
85
                else
86
                {
87

  
88
                }
89
            }
90
            catch (Exception ex)
91
            {
92

  
93
            }
94

  
95
            return bResult;
96
        }
97

  
98
        public static bool SetPlantDBSetting(SPPID_DBInfo dbInfo)
99
        {
100
            bool bResult = false;
101
            try
102
            {
103
                if (dbInfo.DBType == "ORACLE")
104
                {
105
                    string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service);
106
                    connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword;
107

  
108
                    using (OracleConnection conn = new OracleConnection(connString))
109
                    {
110
                        conn.Open();
111
                        if (conn.State == System.Data.ConnectionState.Open)
112
                        {
113
                            using (OracleCommand cmd = new OracleCommand())
114
                            {
115
                                cmd.Connection = conn;
116
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, @"SELECT SP_SCHEMA_TYPE, USERNAME
117
                                                FROM {0}.T_DB_DATA DB_DATA 
118
                                                INNER JOIN {0}.T_ROOTITEM ROOTITEM ON DB_DATA.SP_ROOTITEMID = ROOTITEM.SP_ID 
119
                                                WHERE ROOTITEM.NAME = '{1}'", dbInfo.Site, dbInfo.SelectedPlant);
120
                                using (OracleDataAdapter adapter = new OracleDataAdapter())
121
                                {
122
                                    DataTable dt = new DataTable();
123
                                    adapter.SelectCommand = cmd;
124
                                    adapter.Fill(dt);
125

  
126
                                    foreach (DataRow row in dt.Rows)
127
                                    {
128
                                        string sType = row["SP_SCHEMA_TYPE"].ToString();
129
                                        switch (sType)
130
                                        {
131
                                            case "SPPIDDATA_DICTIONARY":
132
                                                dbInfo.PlantPIDDic = row["USERNAME"].ToString();
133
                                                break;
134
                                            case "DATA_DICTIONARY":
135
                                                dbInfo.PlantDic = row["USERNAME"].ToString();
136
                                                break;
137
                                            case "SPAPLANT":
138
                                                dbInfo.Plant = row["USERNAME"].ToString();
139
                                                break;
140
                                            case "SPPID":
141
                                                dbInfo.PlantPID = row["USERNAME"].ToString();
142
                                                break;
143
                                            default:
144
                                                break;
145
                                        }
146
                                        bResult = true;
147
                                    }
148
                                }
149
                            }
150
                        }
151
                    }
152
                }
153
                else
154
                {
155

  
156
                }
157
            }
158
            catch (Exception ex)
159
            {
160

  
161
            }
162

  
163
            return bResult;
164
        }
165

  
166
        public static List<string> GetPlantList(SPPID_DBInfo dbInfo)
167
        {
168
            List<string> plantList = new List<string>();
169
            try
170
            {
171
                if (dbInfo.DBType == "ORACLE")
172
                {
173
                    string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service);
174
                    connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword;
175

  
176
                    using (OracleConnection conn = new OracleConnection(connString))
177
                    {
178
                        conn.Open();
179
                        if (conn.State == System.Data.ConnectionState.Open)
180
                        {
181
                            using (OracleCommand cmd = new OracleCommand())
182
                            {
183
                                cmd.Connection = conn;
184
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT NAME, PATH FROM {0}.T_ROOTITEM", dbInfo.Site);
185

  
186
                                using (OracleDataReader reader = cmd.ExecuteReader())
187
                                {
188
                                    while (reader.Read())
189
                                    {
190
                                        plantList.Add(reader["NAME"].ToString());
191
                                    }
192
                                }
193
                            }
194
                        }
195
                    }
196
                }
197
                else
198
                {
199

  
200
                }
201
            }
202
            catch (Exception ex)
203
            {
204

  
205
            }
206

  
207
            return plantList;
208
        }
209

  
210
        public static DataTable GetUnitTree()
211
        {
212
            DataTable dt = new DataTable();
213
            try
214
            {
215
                SPPID_DBInfo dbInfo = SPPID_DBInfo.GetInstance();
216

  
217
                if (dbInfo.DBType == "ORACLE")
218
                {
219
                    string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service);
220
                    connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword;
221

  
222
                    using (OracleConnection conn = new OracleConnection(connString))
223
                    {
224
                        conn.Open();
225
                        if (conn.State == System.Data.ConnectionState.Open)
226
                        {
227
                            string sQuery = string.Format(CultureInfo.CurrentCulture,
228
                                @"SELECT SP_ID, PARENTID, NAME
229
                                    FROM {0}.T_PLANTGROUP 
230
                                    START WITH PARENTID='-1'
231
                                    CONNECT BY PRIOR SP_ID=PARENTID", dbInfo.Plant);
232

  
233
                            using (OracleCommand cmd = new OracleCommand(sQuery, conn))
234
                            using (OracleDataAdapter adapter = new OracleDataAdapter())
235
                            {
236
                                adapter.SelectCommand = cmd;
237
                                adapter.Fill(dt);
238
                            }
239
                        }
240
                    }
241
                }
242
                else
243
                {
244

  
245
                }
246
            }
247
            catch (Exception ex)
248
            {
249

  
250
            }
251

  
252
            return dt;
253
        }
254

  
255
        public static string GetPlantPID_T_OPTIONSETTING_Value(string name)
256
        {
257
            string TemplatePath = string.Empty;
258
            SPPID_DBInfo dbInfo = SPPID_DBInfo.GetInstance();
259
            try
260
            {
261
                if (dbInfo.DBType == "ORACLE")
262
                {
263
                    string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service);
264
                    connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword;
265

  
266
                    using (OracleConnection conn = new OracleConnection(connString))
267
                    {
268
                        conn.Open();
... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.

내보내기 Unified diff

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