프로젝트

일반

사용자정보

개정판 3823b4ab

ID3823b4abc697a5807ebf20d38d31c30031dcd2a7
상위 ec0ff05a
하위 d1dbd4fd

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

dev issue #826 : edit form logic

차이점 보기:

DTI_PID/SPPIDConverter_AutoModeling/App.config
1
<?xml version="1.0" encoding="utf-8"?>
2
<configuration>
3
  <configSections>
4
    <section name="oracle.manageddataaccess.client"
5
      type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
6
    </configSections>
7
  <system.data>
8
    <DbProviderFactories>
9
      <remove invariant="Oracle.ManagedDataAccess.Client"/>
10
      <add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver"
11
        type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342"/>
12
    </DbProviderFactories>
13
  </system.data>
14
  <runtime>
15
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
16
      <dependentAssembly>
17
        <publisherPolicy apply="no"/>
18
        <assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral"/>
19
        <bindingRedirect oldVersion="4.122.0.0 - 4.65535.65535.65535" newVersion="4.122.18.3"/>
20
      </dependentAssembly>
21
    </assemblyBinding>
22
  </runtime>
23
  <oracle.manageddataaccess.client>
24
    <version number="*">
25
      <dataSources>
26
        <dataSource alias="SampleDataSource" descriptor="(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORCL))) "/>
27
      </dataSources>
28
    </version>
29
  </oracle.manageddataaccess.client>
30
</configuration>
DTI_PID/SPPIDConverter_AutoModeling/DB/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 Oracle.ManagedDataAccess.Client;
7
using Oracle.ManagedDataAccess.Types;
8
using SPPID.Model;
9
using System.Data;
10
using System.Globalization;
11
using System.IO;
12

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

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

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

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

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

  
53

  
54
                                    using (OracleDataAdapter adapter = new OracleDataAdapter())
55
                                    {
56
                                        DataTable dt = new DataTable();
57
                                        adapter.SelectCommand = cmd;
58
                                        adapter.Fill(dt);
59

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

  
91
                }
92
            }
93
            catch (Exception ex)
94
            {
95

  
96
            }
97

  
98
            return bResult;
99
        }
100

  
101
        public static DataTable GetUnitTree()
102
        {
103
            DataTable dt = new DataTable();
104
            try
105
            {
106
                DBInformation dbInfo = DBInformation.GetInstance();
107

  
108
                if (dbInfo.DBType == "ORACLE")
109
                {
110
                    string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service);
111
                    connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword;
112

  
113
                    using (OracleConnection conn = new OracleConnection(connString))
114
                    {
115
                        conn.Open();
116
                        if (conn.State == System.Data.ConnectionState.Open)
117
                        {
118
                            string sQuery = string.Format(CultureInfo.CurrentCulture, 
119
                                @"SELECT LEVEL, SP_ID, NAME, PARENTID 
120
                                    FROM {0}.T_PLANTGROUP 
121
                                    START WITH PARENTID='-1'
122
                                    CONNECT BY PRIOR SP_ID=PARENTID", dbInfo.Plant);
123

  
124
                            using (OracleCommand cmd = new OracleCommand(sQuery, conn))
125
                            using (OracleDataAdapter adapter = new OracleDataAdapter()) 
126
                            {
127
                                adapter.SelectCommand = cmd;
128
                                adapter.Fill(dt);
129
                            }
130
                        }
131
                    }
132
                }
133
                else
134
                {
135

  
136
                }
137
            }
138
            catch (Exception ex)
139
            {
140

  
141
            }
142

  
143
            return dt;
144
        }
145

  
146
        public static string GetPlantPID_T_OPTIONSETTING_Value(string name)
147
        {
148
            string TemplatePath = string.Empty;
149
            DBInformation dbInfo = DBInformation.GetInstance();
150
            try
151
            {
152
                if (dbInfo.DBType == "ORACLE")
153
                {
154
                    string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service);
155
                    connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword;
156

  
157
                    using (OracleConnection conn = new OracleConnection(connString))
158
                    {
159
                        conn.Open();
160
                        if (conn.State == System.Data.ConnectionState.Open)
161
                        {
162
                            using (OracleCommand cmd = new OracleCommand())
163
                            {
164
                                cmd.Connection = conn;
165
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT VALUE FROM {0}.T_OPTIONSETTING WHERE NAME = '{1}'", dbInfo.PlantPID, name);
166

  
167
                                using (OracleDataReader reader = cmd.ExecuteReader())
168
                                {
169
                                    while (reader.Read())
170
                                    {
171
                                        TemplatePath = reader["VALUE"].ToString();
172
                                        break;
173
                                    }
174
                                }
175
                            }
176
                        }
177
                    }
178
                }
179
                else
180
                {
181

  
182
                }
183

  
184
            }
185
            catch (Exception ex)
186
            {
187

  
188
            }
189

  
190
            return TemplatePath;
191
        }
192

  
193
        public static List<string> GetSPPIDAttribute()
194
        {
195
            List<string> attributes = new List<string>();
196
            DBInformation dbInfo = DBInformation.GetInstance();
197
            try
198
            {
199
                if (dbInfo.DBType == "ORACLE")
200
                {
201
                    string connString = string.Format(oConnString, dbInfo.ServerIP, dbInfo.Port, dbInfo.Service);
202
                    connString = "Data Source=" + connString + ";User Id=" + dbInfo.DBUser + ";Password=" + dbInfo.DBPassword;
203

  
204
                    using (OracleConnection conn = new OracleConnection(connString))
205
                    {
206
                        conn.Open();
207
                        if (conn.State == System.Data.ConnectionState.Open)
208
                        {
209
                            using (OracleCommand cmd = new OracleCommand())
210
                            {
211
                                cmd.Connection = conn;
212

  
213
                                // 정리 필요
214
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_EQUIPMENT");
215
                                using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly))
216
                                {
217
                                    DataTable dt = reader.GetSchemaTable();
218
                                    foreach (DataRow row in dt.Rows)
219
                                        attributes.Add(row["ColumnName"].ToString());
220
                                }
221

  
222
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_NOZZLE");
223
                                using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly))
224
                                {
225
                                    DataTable dt = reader.GetSchemaTable();
226
                                    foreach (DataRow row in dt.Rows)
227
                                        attributes.Add(row["ColumnName"].ToString());
228
                                }
229

  
230
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_PIPINGCOMP");
231
                                using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly))
232
                                {
233
                                    DataTable dt = reader.GetSchemaTable();
234
                                    foreach (DataRow row in dt.Rows)
235
                                        attributes.Add(row["ColumnName"].ToString());
236
                                }
237

  
238
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_PIPERUN");
239
                                using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly))
240
                                {
241

  
242
                                    DataTable dt = reader.GetSchemaTable();
243
                                    foreach (DataRow row in dt.Rows)
244
                                        attributes.Add(row["ColumnName"].ToString());
245
                                }
246

  
247
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_INSTRUMENT");
248
                                using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly))
249
                                {
250
                                    DataTable dt = reader.GetSchemaTable();
251
                                    foreach (DataRow row in dt.Rows)
252
                                        attributes.Add(row["ColumnName"].ToString());
253
                                }
254

  
255
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_INLINECOMP");
256
                                using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly))
257
                                {
258
                                    DataTable dt = reader.GetSchemaTable();
259
                                    foreach (DataRow row in dt.Rows)
260
                                        attributes.Add(row["ColumnName"].ToString());
261
                                }
262

  
263
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_VESSEL");
264
                                using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly))
265
                                {
266
                                    DataTable dt = reader.GetSchemaTable();
267
                                    foreach (DataRow row in dt.Rows)
268
                                        attributes.Add(row["ColumnName"].ToString());
269
                                }
270

  
271
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_EXCHANGER");
272
                                using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly))
273
                                {
274
                                    DataTable dt = reader.GetSchemaTable();
275
                                    foreach (DataRow row in dt.Rows)
276
                                        attributes.Add(row["ColumnName"].ToString());
277
                                }
278

  
279
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_MECHANICAL");
280
                                using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly))
281
                                {
282
                                    DataTable dt = reader.GetSchemaTable();
283
                                    foreach (DataRow row in dt.Rows)
284
                                        attributes.Add(row["ColumnName"].ToString());
285
                                }
286

  
287
                                cmd.CommandText = string.Format(CultureInfo.CurrentCulture, "SELECT * FROM {0}.{1}", dbInfo.PlantPID, "T_EQUIPCOMPONENT");
288
                                using (OracleDataReader reader = cmd.ExecuteReader(CommandBehavior.SchemaOnly))
289
                                {
290
                                    DataTable dt = reader.GetSchemaTable();
291
                                    foreach (DataRow row in dt.Rows)
292
                                        attributes.Add(row["ColumnName"].ToString());
293
                                }
294

  
295
                            }
296
                        }
297
                    }
298
                }
299
                else
300
                {
301

  
302
                }
303
            }
304
            catch (Exception ex)
305
            {
306

  
307
            }
308

  
309

  
310

  
311
            return attributes.Distinct().ToList();
312
        }
313
    }
314
}
DTI_PID/SPPIDConverter_AutoModeling/DB/DBInformation.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6

  
7
namespace SPPID.DB
8
{
9
    public sealed class DBInformation
10
    {
11
        private static DBInformation dbInfo;
12

  
13
        private string _DBType = string.Empty;
14
        private string _Service = string.Empty;
15
        private string _Site = string.Empty;
16
        private string _ServerIP = string.Empty;
17
        private string _Port = string.Empty;
18
        private string _DBUser = string.Empty;
19
        private string _DBPassword = string.Empty;
20

  
21
        private string _PlantPath = string.Empty;
22
        private string _Plant = string.Empty;
23
        private string _PlantDic = string.Empty;
24
        private string _PlantPID = string.Empty;
25
        private string _PlantPIDDic = string.Empty;
26

  
27
        private bool _Status = false;
28

  
29
        public string DBType { get => _DBType; set => _DBType = value; }
30
        public string Service { get => _Service; set => _Service = value; }
31
        public string Site { get => _Site; set => _Site = value; }
32
        public string ServerIP { get => _ServerIP; set => _ServerIP = value; }
33
        public string Port { get => _Port; set => _Port = value; }
34
        public string DBUser { get => _DBUser; set => _DBUser = value; }
35
        public string DBPassword { get => _DBPassword; set => _DBPassword = value; }
36
        public string PlantPath { get => _PlantPath; set => _PlantPath = value; }
37
        public string PlantDic { get => _PlantDic; set => _PlantDic = value; }
38
        public string PlantPID { get => _PlantPID; set => _PlantPID = value; }
39
        public string PlantPIDDic { get => _PlantPIDDic; set => _PlantPIDDic = value; }
40
        public string Plant { get => _Plant; set => _Plant = value; }
41
        public bool Status { get => _Status; set => _Status = value; }
42

  
43
        public static DBInformation GetInstance()
44
        {
45
            if (dbInfo == null)
46
                dbInfo = new DBInformation();
47

  
48
            return dbInfo;
49
        }
50
    }
51
}
DTI_PID/SPPIDConverter_AutoModeling/MainControl.Designer.cs
28 28
        /// </summary>
29 29
        private void InitializeComponent()
30 30
        {
31
            Telerik.WinControls.UI.GridViewCheckBoxColumn gridViewCheckBoxColumn1 = new Telerik.WinControls.UI.GridViewCheckBoxColumn();
32
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn1 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
33
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn2 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
34
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn3 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
35
            Telerik.WinControls.UI.TableViewDefinition tableViewDefinition1 = new Telerik.WinControls.UI.TableViewDefinition();
36
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn4 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
37
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn5 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
38
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn6 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
39
            Telerik.WinControls.UI.TableViewDefinition tableViewDefinition2 = new Telerik.WinControls.UI.TableViewDefinition();
31
            Telerik.WinControls.UI.GridViewCheckBoxColumn gridViewCheckBoxColumn3 = new Telerik.WinControls.UI.GridViewCheckBoxColumn();
32
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn21 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
33
            Telerik.WinControls.UI.GridViewCommandColumn gridViewCommandColumn9 = new Telerik.WinControls.UI.GridViewCommandColumn();
34
            Telerik.WinControls.UI.GridViewComboBoxColumn gridViewComboBoxColumn9 = new Telerik.WinControls.UI.GridViewComboBoxColumn();
35
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn22 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
36
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn23 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
37
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn24 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
38
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn25 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
39
            Telerik.WinControls.UI.TableViewDefinition tableViewDefinition11 = new Telerik.WinControls.UI.TableViewDefinition();
40
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn26 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
41
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn27 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
42
            Telerik.WinControls.UI.TableViewDefinition tableViewDefinition12 = new Telerik.WinControls.UI.TableViewDefinition();
43
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn19 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
44
            Telerik.WinControls.UI.GridViewComboBoxColumn gridViewComboBoxColumn7 = new Telerik.WinControls.UI.GridViewComboBoxColumn();
45
            Telerik.WinControls.UI.GridViewCommandColumn gridViewCommandColumn7 = new Telerik.WinControls.UI.GridViewCommandColumn();
46
            Telerik.WinControls.UI.TableViewDefinition tableViewDefinition9 = new Telerik.WinControls.UI.TableViewDefinition();
47
            Telerik.WinControls.UI.GridViewTextBoxColumn gridViewTextBoxColumn20 = new Telerik.WinControls.UI.GridViewTextBoxColumn();
48
            Telerik.WinControls.UI.GridViewComboBoxColumn gridViewComboBoxColumn8 = new Telerik.WinControls.UI.GridViewComboBoxColumn();
49
            Telerik.WinControls.UI.GridViewCommandColumn gridViewCommandColumn8 = new Telerik.WinControls.UI.GridViewCommandColumn();
50
            Telerik.WinControls.UI.TableViewDefinition tableViewDefinition10 = new Telerik.WinControls.UI.TableViewDefinition();
40 51
            this.panelMain = new System.Windows.Forms.Panel();
41 52
            this.pageView = new Telerik.WinControls.UI.RadPageView();
42 53
            this.pageConverter = new Telerik.WinControls.UI.RadPageViewPage();
......
45 56
            this.radPanel1 = new Telerik.WinControls.UI.RadPanel();
46 57
            this.btnLoadFiles = new Telerik.WinControls.UI.RadButton();
47 58
            this.btnRun = new Telerik.WinControls.UI.RadButton();
59
            this.pageSetting = new Telerik.WinControls.UI.RadPageViewPage();
60
            this.radPanel3 = new Telerik.WinControls.UI.RadPanel();
61
            this.gridViewDB = new Telerik.WinControls.UI.RadGridView();
62
            this.radPanel5 = new Telerik.WinControls.UI.RadPanel();
63
            this.btnLoadiniFile = new Telerik.WinControls.UI.RadButton();
64
            this.btnSPPIDDBTest = new Telerik.WinControls.UI.RadButton();
65
            this.btnSave = new Telerik.WinControls.UI.RadButton();
48 66
            this.pageItemMapping = new Telerik.WinControls.UI.RadPageViewPage();
49 67
            this.radPanel4 = new Telerik.WinControls.UI.RadPanel();
68
            this.radSplitContainer1 = new Telerik.WinControls.UI.RadSplitContainer();
69
            this.splitPanel1 = new Telerik.WinControls.UI.SplitPanel();
50 70
            this.gridViewItemMapping = new Telerik.WinControls.UI.RadGridView();
51
            this.radPanel3 = new Telerik.WinControls.UI.RadPanel();
52
            this.radLabel1 = new Telerik.WinControls.UI.RadLabel();
53
            this.btnSitePath = new Telerik.WinControls.UI.RadBrowseEditor();
71
            this.splitPanel2 = new Telerik.WinControls.UI.SplitPanel();
72
            this.gridViewAttribute = new Telerik.WinControls.UI.RadGridView();
73
            this.radPanel6 = new Telerik.WinControls.UI.RadPanel();
74
            this.btnMappingSave = new Telerik.WinControls.UI.RadButton();
54 75
            this.pageReport = new Telerik.WinControls.UI.RadPageViewPage();
55 76
            this.telerikMetroBlueTheme = new Telerik.WinControls.Themes.TelerikMetroBlueTheme();
56 77
            this.materialBlueGreyTheme = new Telerik.WinControls.Themes.MaterialBlueGreyTheme();
......
66 87
            this.radPanel1.SuspendLayout();
67 88
            ((System.ComponentModel.ISupportInitialize)(this.btnLoadFiles)).BeginInit();
68 89
            ((System.ComponentModel.ISupportInitialize)(this.btnRun)).BeginInit();
90
            this.pageSetting.SuspendLayout();
91
            ((System.ComponentModel.ISupportInitialize)(this.radPanel3)).BeginInit();
92
            this.radPanel3.SuspendLayout();
93
            ((System.ComponentModel.ISupportInitialize)(this.gridViewDB)).BeginInit();
94
            ((System.ComponentModel.ISupportInitialize)(this.gridViewDB.MasterTemplate)).BeginInit();
95
            ((System.ComponentModel.ISupportInitialize)(this.radPanel5)).BeginInit();
96
            this.radPanel5.SuspendLayout();
97
            ((System.ComponentModel.ISupportInitialize)(this.btnLoadiniFile)).BeginInit();
98
            ((System.ComponentModel.ISupportInitialize)(this.btnSPPIDDBTest)).BeginInit();
99
            ((System.ComponentModel.ISupportInitialize)(this.btnSave)).BeginInit();
69 100
            this.pageItemMapping.SuspendLayout();
70 101
            ((System.ComponentModel.ISupportInitialize)(this.radPanel4)).BeginInit();
71 102
            this.radPanel4.SuspendLayout();
103
            ((System.ComponentModel.ISupportInitialize)(this.radSplitContainer1)).BeginInit();
104
            this.radSplitContainer1.SuspendLayout();
105
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel1)).BeginInit();
106
            this.splitPanel1.SuspendLayout();
72 107
            ((System.ComponentModel.ISupportInitialize)(this.gridViewItemMapping)).BeginInit();
73 108
            ((System.ComponentModel.ISupportInitialize)(this.gridViewItemMapping.MasterTemplate)).BeginInit();
74
            ((System.ComponentModel.ISupportInitialize)(this.radPanel3)).BeginInit();
75
            this.radPanel3.SuspendLayout();
76
            ((System.ComponentModel.ISupportInitialize)(this.radLabel1)).BeginInit();
77
            ((System.ComponentModel.ISupportInitialize)(this.btnSitePath)).BeginInit();
109
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel2)).BeginInit();
110
            this.splitPanel2.SuspendLayout();
111
            ((System.ComponentModel.ISupportInitialize)(this.gridViewAttribute)).BeginInit();
112
            ((System.ComponentModel.ISupportInitialize)(this.gridViewAttribute.MasterTemplate)).BeginInit();
113
            ((System.ComponentModel.ISupportInitialize)(this.radPanel6)).BeginInit();
114
            this.radPanel6.SuspendLayout();
115
            ((System.ComponentModel.ISupportInitialize)(this.btnMappingSave)).BeginInit();
78 116
            this.SuspendLayout();
79 117
            // 
80 118
            // panelMain
......
83 121
            this.panelMain.Dock = System.Windows.Forms.DockStyle.Fill;
84 122
            this.panelMain.Location = new System.Drawing.Point(0, 0);
85 123
            this.panelMain.Name = "panelMain";
86
            this.panelMain.Size = new System.Drawing.Size(361, 900);
124
            this.panelMain.Size = new System.Drawing.Size(735, 900);
87 125
            this.panelMain.TabIndex = 0;
88 126
            // 
89 127
            // pageView
90 128
            // 
91 129
            this.pageView.Controls.Add(this.pageConverter);
130
            this.pageView.Controls.Add(this.pageSetting);
92 131
            this.pageView.Controls.Add(this.pageItemMapping);
93 132
            this.pageView.Controls.Add(this.pageReport);
94 133
            this.pageView.Dock = System.Windows.Forms.DockStyle.Fill;
95 134
            this.pageView.Location = new System.Drawing.Point(0, 0);
96 135
            this.pageView.Name = "pageView";
97
            this.pageView.SelectedPage = this.pageConverter;
98
            this.pageView.Size = new System.Drawing.Size(361, 900);
136
            this.pageView.SelectedPage = this.pageItemMapping;
137
            this.pageView.Size = new System.Drawing.Size(735, 900);
99 138
            this.pageView.TabIndex = 0;
100 139
            this.pageView.ThemeName = "TelerikMetroBlue";
140
            this.pageView.SelectedPageChanged += new System.EventHandler(this.pageView_SelectedPageChanged);
101 141
            ((Telerik.WinControls.UI.RadPageViewStripElement)(this.pageView.GetChildAt(0))).StripButtons = Telerik.WinControls.UI.StripViewButtons.None;
102 142
            // 
103 143
            // pageConverter
......
108 148
            this.pageConverter.ItemSize = new System.Drawing.SizeF(98F, 40F);
109 149
            this.pageConverter.Location = new System.Drawing.Point(5, 46);
110 150
            this.pageConverter.Name = "pageConverter";
111
            this.pageConverter.Size = new System.Drawing.Size(351, 849);
151
            this.pageConverter.Size = new System.Drawing.Size(725, 849);
112 152
            this.pageConverter.Text = "Converter";
113 153
            // 
114 154
            // radPanel2
......
117 157
            this.radPanel2.Dock = System.Windows.Forms.DockStyle.Fill;
118 158
            this.radPanel2.Location = new System.Drawing.Point(0, 33);
119 159
            this.radPanel2.Name = "radPanel2";
120
            this.radPanel2.Size = new System.Drawing.Size(351, 816);
160
            this.radPanel2.Size = new System.Drawing.Size(725, 816);
121 161
            this.radPanel2.TabIndex = 1;
122 162
            this.radPanel2.Text = "radPanel2";
123 163
            this.radPanel2.ThemeName = "MaterialBlueGrey";
......
131 171
            // 
132 172
            this.gridViewDrawingList.MasterTemplate.AllowAddNewRow = false;
133 173
            this.gridViewDrawingList.MasterTemplate.AllowCellContextMenu = false;
174
            this.gridViewDrawingList.MasterTemplate.AllowColumnHeaderContextMenu = false;
134 175
            this.gridViewDrawingList.MasterTemplate.AllowDeleteRow = false;
135
            gridViewCheckBoxColumn1.EnableHeaderCheckBox = true;
136
            gridViewCheckBoxColumn1.HeaderCheckBoxAlignment = System.Drawing.ContentAlignment.MiddleCenter;
137
            gridViewCheckBoxColumn1.HeaderText = "";
138
            gridViewCheckBoxColumn1.Name = "colCheckBox";
139
            gridViewCheckBoxColumn1.RowSpan = 100;
140
            gridViewCheckBoxColumn1.Width = 41;
141
            gridViewTextBoxColumn1.HeaderText = "Drawing Name";
142
            gridViewTextBoxColumn1.Name = "colDrawingName";
143
            gridViewTextBoxColumn1.ReadOnly = true;
144
            gridViewTextBoxColumn1.RowSpan = 100;
145
            gridViewTextBoxColumn1.Width = 191;
146
            gridViewTextBoxColumn2.HeaderText = "Status";
147
            gridViewTextBoxColumn2.MinWidth = 100;
148
            gridViewTextBoxColumn2.Name = "colStatus";
149
            gridViewTextBoxColumn2.ReadOnly = true;
150
            gridViewTextBoxColumn2.RowSpan = 100;
151
            gridViewTextBoxColumn2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
152
            gridViewTextBoxColumn2.Width = 100;
153
            gridViewTextBoxColumn3.HeaderText = "DrawingFullName";
154
            gridViewTextBoxColumn3.IsVisible = false;
155
            gridViewTextBoxColumn3.Name = "colDrawingFullName";
156
            gridViewTextBoxColumn3.ReadOnly = true;
157
            gridViewTextBoxColumn3.Width = 43;
176
            this.gridViewDrawingList.MasterTemplate.AllowRowHeaderContextMenu = false;
177
            gridViewCheckBoxColumn3.EnableHeaderCheckBox = true;
178
            gridViewCheckBoxColumn3.HeaderCheckBoxAlignment = System.Drawing.ContentAlignment.MiddleCenter;
179
            gridViewCheckBoxColumn3.HeaderText = "";
180
            gridViewCheckBoxColumn3.MaxWidth = 30;
181
            gridViewCheckBoxColumn3.MinWidth = 30;
182
            gridViewCheckBoxColumn3.Name = "colCheckBox";
183
            gridViewCheckBoxColumn3.RowSpan = 100;
184
            gridViewCheckBoxColumn3.Width = 30;
185
            gridViewTextBoxColumn21.HeaderText = "Drawing File Name";
186
            gridViewTextBoxColumn21.Name = "colDrawingFileName";
187
            gridViewTextBoxColumn21.ReadOnly = true;
188
            gridViewTextBoxColumn21.RowSpan = 100;
189
            gridViewTextBoxColumn21.Width = 130;
190
            gridViewCommandColumn9.HeaderText = "Unit";
191
            gridViewCommandColumn9.Name = "colUnit";
192
            gridViewCommandColumn9.Width = 70;
193
            gridViewComboBoxColumn9.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
194
            gridViewComboBoxColumn9.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
195
            gridViewComboBoxColumn9.HeaderText = "Template";
196
            gridViewComboBoxColumn9.Name = "colTemplate";
197
            gridViewComboBoxColumn9.Width = 140;
198
            gridViewTextBoxColumn22.HeaderText = "Drawing Number";
199
            gridViewTextBoxColumn22.Name = "colDrawingNumber";
200
            gridViewTextBoxColumn22.Width = 119;
201
            gridViewTextBoxColumn23.HeaderText = "Drawing Name";
202
            gridViewTextBoxColumn23.Name = "colDrawingName";
203
            gridViewTextBoxColumn23.Width = 104;
204
            gridViewTextBoxColumn24.HeaderText = "Status";
205
            gridViewTextBoxColumn24.MinWidth = 100;
206
            gridViewTextBoxColumn24.Name = "colStatus";
207
            gridViewTextBoxColumn24.ReadOnly = true;
208
            gridViewTextBoxColumn24.RowSpan = 100;
209
            gridViewTextBoxColumn24.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter;
210
            gridViewTextBoxColumn24.Width = 100;
211
            gridViewTextBoxColumn25.HeaderText = "DrawingFullName";
212
            gridViewTextBoxColumn25.IsVisible = false;
213
            gridViewTextBoxColumn25.Name = "colDrawingFullName";
214
            gridViewTextBoxColumn25.ReadOnly = true;
215
            gridViewTextBoxColumn25.Width = 43;
158 216
            this.gridViewDrawingList.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] {
159
            gridViewCheckBoxColumn1,
160
            gridViewTextBoxColumn1,
161
            gridViewTextBoxColumn2,
162
            gridViewTextBoxColumn3});
217
            gridViewCheckBoxColumn3,
218
            gridViewTextBoxColumn21,
219
            gridViewCommandColumn9,
220
            gridViewComboBoxColumn9,
221
            gridViewTextBoxColumn22,
222
            gridViewTextBoxColumn23,
223
            gridViewTextBoxColumn24,
224
            gridViewTextBoxColumn25});
163 225
            this.gridViewDrawingList.MasterTemplate.EnableGrouping = false;
164
            this.gridViewDrawingList.MasterTemplate.ViewDefinition = tableViewDefinition1;
226
            this.gridViewDrawingList.MasterTemplate.ViewDefinition = tableViewDefinition11;
165 227
            this.gridViewDrawingList.Name = "gridViewDrawingList";
166
            this.gridViewDrawingList.Size = new System.Drawing.Size(351, 816);
228
            this.gridViewDrawingList.Size = new System.Drawing.Size(725, 816);
167 229
            this.gridViewDrawingList.TabIndex = 0;
168 230
            this.gridViewDrawingList.ThemeName = "TelerikMetroBlue";
231
            this.gridViewDrawingList.CellFormatting += new Telerik.WinControls.UI.CellFormattingEventHandler(this.gridViewDrawingList_CellFormatting);
232
            this.gridViewDrawingList.CellClick += new Telerik.WinControls.UI.GridViewCellEventHandler(this.gridViewDrawingList_CellClick);
233
            this.gridViewDrawingList.CellValueChanged += new Telerik.WinControls.UI.GridViewCellEventHandler(this.gridViewDrawingList_CellValueChanged);
169 234
            // 
170 235
            // radPanel1
171 236
            // 
......
174 239
            this.radPanel1.Dock = System.Windows.Forms.DockStyle.Top;
175 240
            this.radPanel1.Location = new System.Drawing.Point(0, 0);
176 241
            this.radPanel1.Name = "radPanel1";
177
            this.radPanel1.Size = new System.Drawing.Size(351, 33);
242
            this.radPanel1.Size = new System.Drawing.Size(725, 33);
178 243
            this.radPanel1.TabIndex = 0;
179 244
            this.radPanel1.ThemeName = "MaterialBlueGrey";
180 245
            // 
......
194 259
            // 
195 260
            this.btnRun.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
196 261
            this.btnRun.Image = global::SPPIDConverter_AutoModeling.Properties.Resources.Start;
197
            this.btnRun.Location = new System.Drawing.Point(303, 0);
262
            this.btnRun.Location = new System.Drawing.Point(677, 0);
198 263
            this.btnRun.Name = "btnRun";
199 264
            this.btnRun.Size = new System.Drawing.Size(48, 26);
200 265
            this.btnRun.TabIndex = 0;
......
203 268
            this.btnRun.ThemeName = "TelerikMetroBlue";
204 269
            this.btnRun.Click += new System.EventHandler(this.btnRun_Click);
205 270
            // 
271
            // pageSetting
272
            // 
273
            this.pageSetting.Controls.Add(this.radPanel3);
274
            this.pageSetting.Controls.Add(this.radPanel5);
275
            this.pageSetting.Image = global::SPPIDConverter_AutoModeling.Properties.Resources.Setting;
276
            this.pageSetting.ItemSize = new System.Drawing.SizeF(83F, 40F);
277
            this.pageSetting.Location = new System.Drawing.Point(5, 46);
278
            this.pageSetting.Name = "pageSetting";
279
            this.pageSetting.Size = new System.Drawing.Size(725, 849);
280
            this.pageSetting.Text = "Setting";
281
            // 
282
            // radPanel3
283
            // 
284
            this.radPanel3.Controls.Add(this.gridViewDB);
285
            this.radPanel3.Dock = System.Windows.Forms.DockStyle.Fill;
286
            this.radPanel3.Location = new System.Drawing.Point(0, 30);
287
            this.radPanel3.Name = "radPanel3";
288
            this.radPanel3.Size = new System.Drawing.Size(725, 819);
289
            this.radPanel3.TabIndex = 32;
290
            this.radPanel3.Text = "radPanel3";
291
            this.radPanel3.ThemeName = "MaterialBlueGrey";
292
            // 
293
            // gridViewDB
294
            // 
295
            this.gridViewDB.BackColor = System.Drawing.Color.White;
296
            this.gridViewDB.Cursor = System.Windows.Forms.Cursors.Default;
297
            this.gridViewDB.Dock = System.Windows.Forms.DockStyle.Fill;
298
            this.gridViewDB.Font = new System.Drawing.Font("Segoe UI", 9F);
299
            this.gridViewDB.ForeColor = System.Drawing.SystemColors.ControlText;
300
            this.gridViewDB.ImeMode = System.Windows.Forms.ImeMode.NoControl;
301
            this.gridViewDB.Location = new System.Drawing.Point(0, 0);
302
            // 
303
            // 
304
            // 
305
            this.gridViewDB.MasterTemplate.AllowAddNewRow = false;
306
            this.gridViewDB.MasterTemplate.AllowDeleteRow = false;
307
            this.gridViewDB.MasterTemplate.AllowDragToGroup = false;
308
            this.gridViewDB.MasterTemplate.AutoSizeColumnsMode = Telerik.WinControls.UI.GridViewAutoSizeColumnsMode.Fill;
309
            gridViewTextBoxColumn26.EnableExpressionEditor = false;
310
            gridViewTextBoxColumn26.HeaderText = "Key";
311
            gridViewTextBoxColumn26.Name = "colKey";
312
            gridViewTextBoxColumn26.ReadOnly = true;
313
            gridViewTextBoxColumn26.Width = 51;
314
            gridViewTextBoxColumn27.EnableExpressionEditor = false;
315
            gridViewTextBoxColumn27.HeaderText = "Value";
316
            gridViewTextBoxColumn27.Name = "colValue";
317
            gridViewTextBoxColumn27.Width = 674;
318
            this.gridViewDB.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] {
319
            gridViewTextBoxColumn26,
320
            gridViewTextBoxColumn27});
321
            this.gridViewDB.MasterTemplate.EnableGrouping = false;
322
            this.gridViewDB.MasterTemplate.EnableSorting = false;
323
            this.gridViewDB.MasterTemplate.ShowRowHeaderColumn = false;
324
            this.gridViewDB.MasterTemplate.ViewDefinition = tableViewDefinition12;
325
            this.gridViewDB.Name = "gridViewDB";
326
            this.gridViewDB.RightToLeft = System.Windows.Forms.RightToLeft.No;
327
            this.gridViewDB.Size = new System.Drawing.Size(725, 819);
328
            this.gridViewDB.TabIndex = 29;
329
            this.gridViewDB.ThemeName = "TelerikMetroBlue";
330
            this.gridViewDB.CellFormatting += new Telerik.WinControls.UI.CellFormattingEventHandler(this.gridViewDB_CellFormatting);
331
            // 
332
            // radPanel5
333
            // 
334
            this.radPanel5.Controls.Add(this.btnLoadiniFile);
335
            this.radPanel5.Controls.Add(this.btnSPPIDDBTest);
336
            this.radPanel5.Controls.Add(this.btnSave);
337
            this.radPanel5.Dock = System.Windows.Forms.DockStyle.Top;
338
            this.radPanel5.Location = new System.Drawing.Point(0, 0);
339
            this.radPanel5.Name = "radPanel5";
340
            this.radPanel5.Size = new System.Drawing.Size(725, 30);
341
            this.radPanel5.TabIndex = 31;
342
            this.radPanel5.ThemeName = "MaterialBlueGrey";
343
            // 
344
            // btnLoadiniFile
345
            // 
346
            this.btnLoadiniFile.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
347
            this.btnLoadiniFile.Location = new System.Drawing.Point(0, 3);
348
            this.btnLoadiniFile.Name = "btnLoadiniFile";
349
            this.btnLoadiniFile.Size = new System.Drawing.Size(110, 24);
350
            this.btnLoadiniFile.TabIndex = 13;
351
            this.btnLoadiniFile.Text = "Load Plant ini File";
352
            this.btnLoadiniFile.ThemeName = "TelerikMetroBlue";
353
            this.btnLoadiniFile.Click += new System.EventHandler(this.btnLoadiniFile_Click);
354
            // 
355
            // btnSPPIDDBTest
356
            // 
357
            this.btnSPPIDDBTest.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
358
            this.btnSPPIDDBTest.Location = new System.Drawing.Point(555, 3);
359
            this.btnSPPIDDBTest.Name = "btnSPPIDDBTest";
360
            this.btnSPPIDDBTest.Size = new System.Drawing.Size(82, 24);
361
            this.btnSPPIDDBTest.TabIndex = 25;
362
            this.btnSPPIDDBTest.Text = "DB Test";
363
            this.btnSPPIDDBTest.ThemeName = "TelerikMetroBlue";
364
            this.btnSPPIDDBTest.Click += new System.EventHandler(this.btnSPPIDDBTest_Click);
365
            // 
366
            // btnSave
367
            // 
368
            this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
369
            this.btnSave.Enabled = false;
370
            this.btnSave.Location = new System.Drawing.Point(643, 3);
371
            this.btnSave.Name = "btnSave";
372
            this.btnSave.Size = new System.Drawing.Size(82, 24);
373
            this.btnSave.TabIndex = 28;
374
            this.btnSave.Text = "Save";
375
            this.btnSave.ThemeName = "TelerikMetroBlue";
376
            this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
377
            // 
206 378
            // pageItemMapping
207 379
            // 
208 380
            this.pageItemMapping.Controls.Add(this.radPanel4);
209
            this.pageItemMapping.Controls.Add(this.radPanel3);
381
            this.pageItemMapping.Controls.Add(this.radPanel6);
210 382
            this.pageItemMapping.Image = global::SPPIDConverter_AutoModeling.Properties.Resources.ItemMapping;
211 383
            this.pageItemMapping.ItemSize = new System.Drawing.SizeF(122F, 40F);
212 384
            this.pageItemMapping.Location = new System.Drawing.Point(5, 46);
213 385
            this.pageItemMapping.Name = "pageItemMapping";
214
            this.pageItemMapping.Size = new System.Drawing.Size(351, 583);
386
            this.pageItemMapping.Size = new System.Drawing.Size(725, 849);
215 387
            this.pageItemMapping.Text = "Item Mapping";
216 388
            // 
217 389
            // radPanel4
218 390
            // 
219
            this.radPanel4.Controls.Add(this.gridViewItemMapping);
391
            this.radPanel4.Controls.Add(this.radSplitContainer1);
220 392
            this.radPanel4.Dock = System.Windows.Forms.DockStyle.Fill;
221
            this.radPanel4.Location = new System.Drawing.Point(0, 33);
393
            this.radPanel4.Location = new System.Drawing.Point(0, 30);
222 394
            this.radPanel4.Name = "radPanel4";
223
            this.radPanel4.Size = new System.Drawing.Size(351, 550);
224
            this.radPanel4.TabIndex = 3;
395
            this.radPanel4.Size = new System.Drawing.Size(725, 819);
396
            this.radPanel4.TabIndex = 5;
225 397
            this.radPanel4.ThemeName = "MaterialBlueGrey";
226 398
            // 
399
            // radSplitContainer1
400
            // 
401
            this.radSplitContainer1.Controls.Add(this.splitPanel1);
402
            this.radSplitContainer1.Controls.Add(this.splitPanel2);
403
            this.radSplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
404
            this.radSplitContainer1.Location = new System.Drawing.Point(0, 0);
405
            this.radSplitContainer1.Name = "radSplitContainer1";
406
            this.radSplitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
407
            // 
408
            // 
409
            // 
410
            this.radSplitContainer1.RootElement.MinSize = new System.Drawing.Size(25, 25);
411
            this.radSplitContainer1.Size = new System.Drawing.Size(725, 819);
412
            this.radSplitContainer1.TabIndex = 4;
413
            this.radSplitContainer1.TabStop = false;
414
            this.radSplitContainer1.ThemeName = "TelerikMetroBlue";
415
            // 
416
            // splitPanel1
417
            // 
418
            this.splitPanel1.Controls.Add(this.gridViewItemMapping);
419
            this.splitPanel1.Location = new System.Drawing.Point(0, 0);
420
            this.splitPanel1.Name = "splitPanel1";
421
            // 
422
            // 
423
            // 
424
            this.splitPanel1.RootElement.MinSize = new System.Drawing.Size(25, 25);
425
            this.splitPanel1.Size = new System.Drawing.Size(725, 408);
426
            this.splitPanel1.TabIndex = 0;
427
            this.splitPanel1.TabStop = false;
428
            this.splitPanel1.Text = "splitPanel1";
429
            this.splitPanel1.ThemeName = "TelerikMetroBlue";
430
            // 
227 431
            // gridViewItemMapping
228 432
            // 
229 433
            this.gridViewItemMapping.Dock = System.Windows.Forms.DockStyle.Fill;
......
232 436
            // 
233 437
            // 
234 438
            this.gridViewItemMapping.MasterTemplate.AllowAddNewRow = false;
235
            gridViewTextBoxColumn4.HeaderText = "Item Name";
236
            gridViewTextBoxColumn4.Name = "colItemName";
237
            gridViewTextBoxColumn4.Width = 111;
238
            gridViewTextBoxColumn5.HeaderText = "SPPID Name";
239
            gridViewTextBoxColumn5.Name = "colSPPIDName";
240
            gridViewTextBoxColumn5.Width = 111;
241
            gridViewTextBoxColumn6.HeaderText = "SPPID Full Name Path";
242
            gridViewTextBoxColumn6.Name = "colSPPIDFullNamePath";
243
            gridViewTextBoxColumn6.Width = 110;
439
            this.gridViewItemMapping.MasterTemplate.AllowCellContextMenu = false;
440
            this.gridViewItemMapping.MasterTemplate.AllowColumnHeaderContextMenu = false;
441
            this.gridViewItemMapping.MasterTemplate.AllowDeleteRow = false;
442
            this.gridViewItemMapping.MasterTemplate.AllowRowHeaderContextMenu = false;
443
            gridViewTextBoxColumn19.HeaderText = "Item Name";
444
            gridViewTextBoxColumn19.Name = "colItemName";
445
            gridViewTextBoxColumn19.Width = 80;
446
            gridViewComboBoxColumn7.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
447
            gridViewComboBoxColumn7.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
448
            gridViewComboBoxColumn7.HeaderText = "SPPID Name";
449
            gridViewComboBoxColumn7.Name = "colSPPIDName";
450
            gridViewComboBoxColumn7.Width = 89;
451
            gridViewCommandColumn7.HeaderText = "Select in Explorer";
452
            gridViewCommandColumn7.Name = "colSelect";
453
            gridViewCommandColumn7.Width = 118;
244 454
            this.gridViewItemMapping.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] {
245
            gridViewTextBoxColumn4,
246
            gridViewTextBoxColumn5,
247
            gridViewTextBoxColumn6});
455
            gridViewTextBoxColumn19,
456
            gridViewComboBoxColumn7,
457
            gridViewCommandColumn7});
248 458
            this.gridViewItemMapping.MasterTemplate.EnableGrouping = false;
249
            this.gridViewItemMapping.MasterTemplate.ViewDefinition = tableViewDefinition2;
459
            this.gridViewItemMapping.MasterTemplate.ViewDefinition = tableViewDefinition9;
250 460
            this.gridViewItemMapping.Name = "gridViewItemMapping";
251 461
            this.gridViewItemMapping.ShowGroupPanel = false;
252
            this.gridViewItemMapping.Size = new System.Drawing.Size(351, 550);
462
            this.gridViewItemMapping.Size = new System.Drawing.Size(725, 408);
253 463
            this.gridViewItemMapping.TabIndex = 0;
254 464
            this.gridViewItemMapping.ThemeName = "TelerikMetroBlue";
255
            // 
256
            // radPanel3
257
            // 
258
            this.radPanel3.Controls.Add(this.radLabel1);
259
            this.radPanel3.Controls.Add(this.btnSitePath);
260
            this.radPanel3.Dock = System.Windows.Forms.DockStyle.Top;
261
            this.radPanel3.Location = new System.Drawing.Point(0, 0);
262
            this.radPanel3.Name = "radPanel3";
263
            this.radPanel3.Size = new System.Drawing.Size(351, 33);
264
            this.radPanel3.TabIndex = 1;
265
            this.radPanel3.ThemeName = "MaterialBlueGrey";
266
            // 
267
            // radLabel1
268
            // 
269
            this.radLabel1.Location = new System.Drawing.Point(0, 3);
270
            this.radLabel1.Name = "radLabel1";
271
            this.radLabel1.Size = new System.Drawing.Size(74, 18);
272
            this.radLabel1.TabIndex = 3;
273
            this.radLabel1.Text = "Symbol Path :";
274
            this.radLabel1.ThemeName = "ControlDefault";
275
            // 
276
            // btnSitePath
277
            // 
278
            this.btnSitePath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 
279
            | System.Windows.Forms.AnchorStyles.Right)));
280
            this.btnSitePath.DialogType = Telerik.WinControls.UI.BrowseEditorDialogType.FolderBrowseDialog;
281
            this.btnSitePath.Location = new System.Drawing.Point(80, 0);
282
            this.btnSitePath.Name = "btnSitePath";
283
            this.btnSitePath.Size = new System.Drawing.Size(271, 0);
284
            this.btnSitePath.TabIndex = 2;
285
            this.btnSitePath.ThemeName = "TelerikMetroBlue";
465
            this.gridViewItemMapping.CellFormatting += new Telerik.WinControls.UI.CellFormattingEventHandler(this.gridViewItemMapping_CellFormatting);
466
            // 
467
            // splitPanel2
468
            // 
469
            this.splitPanel2.Controls.Add(this.gridViewAttribute);
470
            this.splitPanel2.Location = new System.Drawing.Point(0, 412);
471
            this.splitPanel2.Name = "splitPanel2";
472
            // 
473
            // 
474
            // 
475
            this.splitPanel2.RootElement.MinSize = new System.Drawing.Size(25, 25);
476
            this.splitPanel2.Size = new System.Drawing.Size(725, 407);
477
            this.splitPanel2.TabIndex = 1;
478
            this.splitPanel2.TabStop = false;
479
            this.splitPanel2.Text = "splitPanel2";
480
            this.splitPanel2.ThemeName = "TelerikMetroBlue";
481
            // 
482
            // gridViewAttribute
483
            // 
484
            this.gridViewAttribute.Dock = System.Windows.Forms.DockStyle.Fill;
485
            this.gridViewAttribute.Location = new System.Drawing.Point(0, 0);
486
            // 
487
            // 
488
            // 
489
            this.gridViewAttribute.MasterTemplate.AllowAddNewRow = false;
490
            this.gridViewAttribute.MasterTemplate.AllowCellContextMenu = false;
491
            this.gridViewAttribute.MasterTemplate.AllowColumnHeaderContextMenu = false;
492
            this.gridViewAttribute.MasterTemplate.AllowDeleteRow = false;
493
            this.gridViewAttribute.MasterTemplate.AllowRowHeaderContextMenu = false;
494
            gridViewTextBoxColumn20.HeaderText = "Attribute";
495
            gridViewTextBoxColumn20.Name = "colAttribute";
496
            gridViewTextBoxColumn20.Width = 66;
497
            gridViewComboBoxColumn8.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
498
            gridViewComboBoxColumn8.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDown;
499
            gridViewComboBoxColumn8.HeaderText = "SPPID Attribute";
500
            gridViewComboBoxColumn8.Name = "colSPPIDAttribute";
501
            gridViewComboBoxColumn8.Width = 108;
502
            gridViewCommandColumn8.HeaderText = "Select in Explorer";
503
            gridViewCommandColumn8.Name = "colSelect";
504
            gridViewCommandColumn8.Width = 118;
505
            this.gridViewAttribute.MasterTemplate.Columns.AddRange(new Telerik.WinControls.UI.GridViewDataColumn[] {
506
            gridViewTextBoxColumn20,
507
            gridViewComboBoxColumn8,
508
            gridViewCommandColumn8});
509
            this.gridViewAttribute.MasterTemplate.EnableGrouping = false;
510
            this.gridViewAttribute.MasterTemplate.ViewDefinition = tableViewDefinition10;
511
            this.gridViewAttribute.Name = "gridViewAttribute";
512
            this.gridViewAttribute.ShowGroupPanel = false;
513
            this.gridViewAttribute.Size = new System.Drawing.Size(725, 407);
514
            this.gridViewAttribute.TabIndex = 1;
515
            this.gridViewAttribute.ThemeName = "TelerikMetroBlue";
516
            this.gridViewAttribute.CellFormatting += new Telerik.WinControls.UI.CellFormattingEventHandler(this.gridViewAttribute_CellFormatting);
517
            // 
518
            // radPanel6
519
            // 
520
            this.radPanel6.Controls.Add(this.btnMappingSave);
521
            this.radPanel6.Dock = System.Windows.Forms.DockStyle.Top;
522
            this.radPanel6.Location = new System.Drawing.Point(0, 0);
523
            this.radPanel6.Name = "radPanel6";
524
            this.radPanel6.Size = new System.Drawing.Size(725, 30);
525
            this.radPanel6.TabIndex = 4;
526
            this.radPanel6.ThemeName = "MaterialBlueGrey";
527
            // 
528
            // btnMappingSave
529
            // 
530
            this.btnMappingSave.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
531
            this.btnMappingSave.Location = new System.Drawing.Point(643, 3);
532
            this.btnMappingSave.Name = "btnMappingSave";
533
            this.btnMappingSave.Size = new System.Drawing.Size(82, 24);
534
            this.btnMappingSave.TabIndex = 29;
535
            this.btnMappingSave.Text = "Save";
536
            this.btnMappingSave.ThemeName = "TelerikMetroBlue";
537
            this.btnMappingSave.Click += new System.EventHandler(this.btnMappingSave_Click);
286 538
            // 
287 539
            // pageReport
288 540
            // 
......
291 543
            this.pageReport.ItemSize = new System.Drawing.SizeF(81F, 40F);
292 544
            this.pageReport.Location = new System.Drawing.Point(5, 46);
293 545
            this.pageReport.Name = "pageReport";
294
            this.pageReport.Size = new System.Drawing.Size(351, 583);
546
            this.pageReport.Size = new System.Drawing.Size(725, 849);
295 547
            this.pageReport.Text = "Report";
296 548
            // 
297 549
            // MainControl
......
300 552
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
301 553
            this.Controls.Add(this.panelMain);
302 554
            this.Name = "MainControl";
303
            this.Size = new System.Drawing.Size(361, 900);
555
            this.Size = new System.Drawing.Size(735, 900);
304 556
            this.panelMain.ResumeLayout(false);
305 557
            ((System.ComponentModel.ISupportInitialize)(this.pageView)).EndInit();
306 558
            this.pageView.ResumeLayout(false);
......
313 565
            this.radPanel1.ResumeLayout(false);
314 566
            ((System.ComponentModel.ISupportInitialize)(this.btnLoadFiles)).EndInit();
315 567
            ((System.ComponentModel.ISupportInitialize)(this.btnRun)).EndInit();
568
            this.pageSetting.ResumeLayout(false);
569
            ((System.ComponentModel.ISupportInitialize)(this.radPanel3)).EndInit();
570
            this.radPanel3.ResumeLayout(false);
571
            ((System.ComponentModel.ISupportInitialize)(this.gridViewDB.MasterTemplate)).EndInit();
572
            ((System.ComponentModel.ISupportInitialize)(this.gridViewDB)).EndInit();
573
            ((System.ComponentModel.ISupportInitialize)(this.radPanel5)).EndInit();
574
            this.radPanel5.ResumeLayout(false);
575
            ((System.ComponentModel.ISupportInitialize)(this.btnLoadiniFile)).EndInit();
576
            ((System.ComponentModel.ISupportInitialize)(this.btnSPPIDDBTest)).EndInit();
577
            ((System.ComponentModel.ISupportInitialize)(this.btnSave)).EndInit();
316 578
            this.pageItemMapping.ResumeLayout(false);
317 579
            ((System.ComponentModel.ISupportInitialize)(this.radPanel4)).EndInit();
318 580
            this.radPanel4.ResumeLayout(false);
581
            ((System.ComponentModel.ISupportInitialize)(this.radSplitContainer1)).EndInit();
582
            this.radSplitContainer1.ResumeLayout(false);
583
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel1)).EndInit();
584
            this.splitPanel1.ResumeLayout(false);
319 585
            ((System.ComponentModel.ISupportInitialize)(this.gridViewItemMapping.MasterTemplate)).EndInit();
320 586
            ((System.ComponentModel.ISupportInitialize)(this.gridViewItemMapping)).EndInit();
321
            ((System.ComponentModel.ISupportInitialize)(this.radPanel3)).EndInit();
322
            this.radPanel3.ResumeLayout(false);
323
            this.radPanel3.PerformLayout();
324
            ((System.ComponentModel.ISupportInitialize)(this.radLabel1)).EndInit();
325
            ((System.ComponentModel.ISupportInitialize)(this.btnSitePath)).EndInit();
587
            ((System.ComponentModel.ISupportInitialize)(this.splitPanel2)).EndInit();
588
            this.splitPanel2.ResumeLayout(false);
589
            ((System.ComponentModel.ISupportInitialize)(this.gridViewAttribute.MasterTemplate)).EndInit();
590
            ((System.ComponentModel.ISupportInitialize)(this.gridViewAttribute)).EndInit();
591
            ((System.ComponentModel.ISupportInitialize)(this.radPanel6)).EndInit();
592
            this.radPanel6.ResumeLayout(false);
593
            ((System.ComponentModel.ISupportInitialize)(this.btnMappingSave)).EndInit();
326 594
            this.ResumeLayout(false);
327 595

  
328 596
        }
......
341 609
        private Telerik.WinControls.UI.RadGridView gridViewDrawingList;
342 610
        private Telerik.WinControls.UI.RadButton btnLoadFiles;
343 611
        private Telerik.WinControls.UI.RadButton btnRun;
344
        private Telerik.WinControls.UI.RadPanel radPanel4;
612
        private Telerik.WinControls.UI.RadPageViewPage pageSetting;
613
        private Telerik.WinControls.UI.RadButton btnSPPIDDBTest;
614
        private Telerik.WinControls.UI.RadButton btnLoadiniFile;
615
        private Telerik.WinControls.UI.RadButton btnSave;
345 616
        private Telerik.WinControls.UI.RadPanel radPanel3;
346
        private Telerik.WinControls.UI.RadLabel radLabel1;
347
        private Telerik.WinControls.UI.RadBrowseEditor btnSitePath;
617
        private Telerik.WinControls.UI.RadGridView gridViewDB;
618
        private Telerik.WinControls.UI.RadPanel radPanel5;
619
        private Telerik.WinControls.UI.RadPanel radPanel4;
620
        private Telerik.WinControls.UI.RadSplitContainer radSplitContainer1;
621
        private Telerik.WinControls.UI.SplitPanel splitPanel1;
348 622
        private Telerik.WinControls.UI.RadGridView gridViewItemMapping;
623
        private Telerik.WinControls.UI.SplitPanel splitPanel2;
624
        private Telerik.WinControls.UI.RadPanel radPanel6;
625
        private Telerik.WinControls.UI.RadButton btnMappingSave;
626
        private Telerik.WinControls.UI.RadGridView gridViewAttribute;
349 627
    }
350 628
}
DTI_PID/SPPIDConverter_AutoModeling/MainControl.cs
14 14
using SPPID.Modeling;
15 15
using SPPID.Model;
16 16
using SPPID.Utill;
17
using SPPID.DB;
17 18
using Microsoft.VisualBasic;
19
using Newtonsoft.Json;
18 20

  
19 21
namespace SPPIDConverter_AutoModeling
20 22
{
21 23
    public partial class MainControl : UserControl
22 24
    {
25
        Thread autoModelingThread;
26

  
23 27
        private Dictionary<string, string> symbolMapping = new Dictionary<string, string>();
24 28
        private Dictionary<string, string> attributeMapping = new Dictionary<string, string>();
25
        Thread autoModelingThread;
29
        private DataTable dUnit = new DataTable();
30
        private string TemplatePath;
31
        private string SymbolPath;
26 32

  
27 33
        public MainControl()
28 34
        {
29 35
            InitializeComponent();
30
            SetPath();
31
        }
32

  
33
        private void btnLoadFiles_Click(object sender, EventArgs e)
34
        {
35
            OpenFileDialog dia = new OpenFileDialog();
36
            dia.Multiselect = true;
37
            dia.Filter = "Xml Files(*.xml)|*.xml";
38
            if (dia.ShowDialog() == DialogResult.OK)
36
            
37
            if (SetPath())
38
            {
39
                if (SPPIDUtill.LoadDB())
40
                    InitDBInformation();
41
                else
42
                    MessageBox.Show("Please Check DB Setting", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
43
                InitGridViewDB();
44
            }
45
            else
39 46
            {
40
                SPPIDUtill.LoadMapping(symbolMapping, attributeMapping);
41 47

  
42
                foreach (string fileName in dia.FileNames)
43
                {
44
                    GridViewDataRowInfo row = new GridViewDataRowInfo(gridViewDrawingList.MasterView);
45
                    Document document = Document.Load(fileName, symbolMapping, attributeMapping);
46

  
47
                    row.Cells["colCheckBox"].Value = false;
48
                    row.Cells["colDrawingName"].Value = fileName;
49
                    row.Cells["colStatus"].Value = "Ready";
50
                    row.Cells["colDrawingFullName"].Value = fileName;
51
                    gridViewDrawingList.Rows.Add(row);
52
                }
53 48
            }
54 49
        }
55 50

  
56
        private void SetPath()
51
        private bool SetPath()
57 52
        {
58 53
            try
59 54
            {
......
68 63
                        SPPIDUtill.defaultPath = ID2.GetValue("Path").ToString();
69 64
                        Log.logPath = SPPIDUtill.defaultPath + @"Converter\SPPID Converter.log";
70 65
                        SPPIDUtill.mappingFilePath = SPPIDUtill.defaultPath + @"Converter\mapping.xml";
66
                        SPPIDUtill.dbFilePath = SPPIDUtill.defaultPath + @"Converter\DB.config";
67

  
68
                        return true;
71 69
                    }
72 70
                }
73 71
            }
74 72
            catch (Exception ex)
75 73
            {
74
                
75
            }
76

  
77
            return false;
78
        }
79

  
80
        #region Init Data Setting
81

  
82
        public void InitDBInformation()
83
        {
84
            // Unit DataTable
85
            dUnit = DB.GetUnitTree();
86

  
87
            // Template List
88
            TemplatePath = DB.GetPlantPID_T_OPTIONSETTING_Value("PID Template Path");
89
            GridViewComboBoxColumn colTemplate = gridViewDrawingList.Columns["colTemplate"] as GridViewComboBoxColumn;
90
            colTemplate.DataSource = Directory.GetFiles(TemplatePath, "*.pid").ToList().Select(filePath => Path.GetFileName(filePath));
91

  
92
            // Load Mapping
93
            SPPIDUtill.LoadMapping(symbolMapping, attributeMapping);
94

  
95
            // Symbol Path
96
            SymbolPath = DB.GetPlantPID_T_OPTIONSETTING_Value("Catalog Explorer root path");
97
            GridViewComboBoxColumn colSPPIDName = gridViewItemMapping.Columns["colSPPIDName"] as GridViewComboBoxColumn;
98
            colSPPIDName.DataSource = Directory.GetFiles(SymbolPath, "*.sym", SearchOption.AllDirectories).ToList().Select(symbol => symbol.Remove(0, SymbolPath.Length));
99

  
100
            // Load Mapping
101
            SPPIDUtill.LoadMapping(symbolMapping, attributeMapping);
102
            gridViewItemMapping.BeginUpdate();
103
            foreach (var item in symbolMapping)
104
                gridViewItemMapping.Rows.Add(new object[] {item.Key,item.Value, "View" });
105
            gridViewItemMapping.BestFitColumns();
106
            gridViewItemMapping.EndUpdate();
107

  
108

  
109
            // Attribute
110
            GridViewComboBoxColumn colSPPIDAttribute = gridViewAttribute.Columns["colSPPIDAttribute"] as GridViewComboBoxColumn;
111
            colSPPIDAttribute.DataSource = DB.GetSPPIDAttribute();
112

  
113
            // Load Attribute
114
            gridViewAttribute.BeginUpdate();
115
            foreach (var item in attributeMapping)
116
                gridViewAttribute.Rows.Add(new object[] { item.Key, item.Value, "View" });
117
            gridViewAttribute.BestFitColumns();
118
            gridViewAttribute.EndUpdate();
119
        }
120
        
121
        #endregion
122

  
123

  
124
        #region Setting Page
125
        private const string _DBType = "DB Type";
126
        private const string _ServiceName = "Service Name";
127
        private const string _SiteName = "Site Name";
128
        private const string _ServerIP = "Server IP";
129
        private const string _Port = "Port";
130
        private const string _DBUser = "DB User";
131
        private const string _DBPassword = "DB Password";
132

  
133
        private void InitGridViewDB()
134
        {
135
            DBInformation dbInfo = DBInformation.GetInstance();
136

  
137
            gridViewDB.Rows.Add(new object[] { _DBType , dbInfo.DBType});
138
            gridViewDB.Rows.Add(new object[] { _ServiceName, dbInfo.Service });
139
            gridViewDB.Rows.Add(new object[] { _SiteName, dbInfo.Site});
140
            gridViewDB.Rows.Add(new object[] { _ServerIP, dbInfo.ServerIP});
141
            gridViewDB.Rows.Add(new object[] { _Port, dbInfo.Port});
142
            gridViewDB.Rows.Add(new object[] { _DBUser, dbInfo.DBUser});
143
            gridViewDB.Rows.Add(new object[] { _DBPassword, dbInfo.DBPassword});
144
            gridViewDB.BestFitColumns();
145

  
146
            this.gridViewDB.RowFormatting += new Telerik.WinControls.UI.RowFormattingEventHandler(this.gridViewDB_RowFormatting);
147
            this.gridViewDB.CellBeginEdit += new Telerik.WinControls.UI.GridViewCellCancelEventHandler(this.gridViewDB_CellBeginEdit);
148
            this.gridViewDB.CellValueChanged += new Telerik.WinControls.UI.GridViewCellEventHandler(this.gridViewDB_CellValueChanged);
149
        }
150

  
151
        private void gridViewDB_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
152
        {
153
            string sKey = (string)e.Row.Cells["colKey"].Value;
154
            if (sKey == _DBType ||
155
                sKey == _ServiceName ||
156
                sKey == _SiteName)
157
            {
158
                e.Cancel = true;
159
            }
160
            else
161
            {
162

  
163
            }
164
        }
76 165

  
166
        private void gridViewDB_RowFormatting(object sender, RowFormattingEventArgs e)
167
        {
168
            string sKey = (string)e.RowElement.RowInfo.Cells["colKey"].Value;
169
            if (sKey == _DBType ||
170
               sKey == _ServiceName ||
171
               sKey == _SiteName)
172
            {
173
                e.RowElement.DrawFill = true;
174
                e.RowElement.GradientStyle = Telerik.WinControls.GradientStyles.Solid;
175
                e.RowElement.BackColor = Color.Aquamarine;
176
            }
177
        }
178

  
179
        private void gridViewDB_CellValueChanged(object sender, GridViewCellEventArgs e)
180
        {
181
            btnSave.Enabled = false;
182
        }
183

  
184
        private void btnLoadiniFile_Click(object sender, EventArgs e)
185
        {
186
            try
187
            {
188
                OpenFileDialog dialog = new OpenFileDialog();
189
                dialog.Multiselect = false;
190
                dialog.Filter = "ini File(*.ini)|*.ini";
191
                if (dialog.ShowDialog() == DialogResult.OK)
192
                {
193
                    string sDBTYPE = string.Empty;
194
                    string sSERVICENAME = string.Empty;
195
                    string sUID = string.Empty;
196

  
197
                    string[] texts = File.ReadAllLines(dialog.FileName);
198

  
199
                    bool find = false;
200
                    for (int i = 0; i < texts.Length; i++)
201
                    {
202
                        string text = texts[i];
203

  
204
                        if (text.Trim() == "[SITESCHEMA]")
205
                            find = true;
206

  
207
                        if (find)
208
                        {
209
                            if (text.StartsWith("DBTYPE=") && string.IsNullOrEmpty(sDBTYPE))
210
                                sDBTYPE = text.Remove(0, "DBTYPE=".Length);
211
                            else if (text.StartsWith("DBSERVER=") && string.IsNullOrEmpty(sSERVICENAME))
212
                                sSERVICENAME = text.Remove(0, "DBSERVER=".Length);
213
                            else if (text.StartsWith("UID=") && string.IsNullOrEmpty(sUID))
214
                                sUID = text.Remove(0, "UID=".Length);
215
                        }
216
                    }
217

  
218
                    if (string.IsNullOrEmpty(sDBTYPE) || string.IsNullOrEmpty(sSERVICENAME) || string.IsNullOrEmpty(sUID))
219
                        MessageBox.Show("Unavailable ini file.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
220
                    else
221
                    {
222
                        foreach (GridViewRowInfo rowInfo in gridViewDB.Rows)
223
                        {
224
                            string sKey = (string)rowInfo.Cells["colKey"].Value;
225
                            if (sKey == _DBType)
226
                                rowInfo.Cells["colValue"].Value = sDBTYPE;
227
                            else if (sKey == _ServiceName)
228
                                rowInfo.Cells["colValue"].Value = sSERVICENAME;
229
                            else if (sKey == _SiteName)
230
                                rowInfo.Cells["colValue"].Value = sUID;
231
                        }
232
                    }
233
                }
234
            }
235
            catch (Exception ex)
236
            {
237
                MessageBox.Show("Unavailable ini file.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
238
            }
239
        }
240

  
241
        private void btnSPPIDDBTest_Click(object sender, EventArgs e)
242
        {
243
            DBInformation dbInfo = DBInformation.GetInstance();
244
            dbInfo.Status = false;
245
            foreach (GridViewRowInfo rowInfo in gridViewDB.Rows)
246
            {
247
                string sKey = (string)rowInfo.Cells["colKey"].Value;
248
                string sValue = (string)rowInfo.Cells["colValue"].Value;
249

  
250
                switch (sKey)
251
                {
252
                    case _DBType:
253
                        dbInfo.DBType = sValue;
254
                        break;
255
                    case _ServiceName:
256
                        dbInfo.Service = sValue;
257
                        break;
258
                    case _SiteName:
259
                        dbInfo.Site = sValue;
260
                        break;
261
                    case _ServerIP:
262
                        dbInfo.ServerIP = sValue;
263
                        break;
264
                    case _Port:
265
                        dbInfo.Port = sValue;
266
                        break;
267
                    case _DBUser:
268
                        dbInfo.DBUser = sValue;
269
                        break;
270
                    case _DBPassword:
271
                        dbInfo.DBPassword = sValue;
272
                        break;
273
                    default:
274
                        break;
275
                }
276
            }
277

  
278
            if (DB.CheckAndSetDBInformation())
279
            {
280
                btnSave.Enabled = true;
281
                MessageBox.Show("Test Connection Success!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
282
            }
283
            else
284
            {
285
                MessageBox.Show("Check DB Information!", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
286
            }
287
        }
288

  
289
        private void gridViewDB_CellFormatting(object sender, CellFormattingEventArgs e)
290
        {
291
            if (e.Column.Name == "colValue" && (string)e.Row.Cells["colKey"].Value == _DBPassword)
292
            {
293
                object value = e.CellElement.RowInfo.Cells["colValue"].Value;
294
                string text = string.Empty;
295
                if (value != null)
296
                {
297
                    int passwordLen = Convert.ToString(value).Length + 1;
298
                    text = string.Join("*", new string[passwordLen]);
299
                }
300

  
301
                e.CellElement.Text = text;
302
            }
303
        }
304

  
305
        private void btnSave_Click(object sender, EventArgs e)
306
        {
307
            DBInformation dbInfo = DBInformation.GetInstance();
308
            if (dbInfo != null)
309
            {
310
                dbInfo.Status = true;
311
                string sJson = JsonConvert.SerializeObject(dbInfo);
312
                SPPIDUtill.SaveDB(sJson);
313
                
314
                MessageBox.Show("Save Success!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
315
            }
316
            else
317
            {
318

  
319
            }
320
        }
321

  
322
        #endregion
323

  
324
        #region Convert Page
325
        const string _Ready = "Ready";
326
        const string _LoadFail = "Can't Load";
327
        const string _NeedMapping = "Need Mapping";
328
        const string _NeedUnit = "Select Unit";
329
        const string _NeedTemplate = "Select Template";
330

  
331
        private void btnLoadFiles_Click(object sender, EventArgs e)
332
        {
333
            OpenFileDialog dia = new OpenFileDialog();
334
            dia.Multiselect = true;
335
            dia.Filter = "Xml Files(*.xml)|*.xml";
336
            if (dia.ShowDialog() == DialogResult.OK)
337
            {
338
                gridViewDrawingList.CellValueChanged -= new GridViewCellEventHandler(this.gridViewDrawingList_CellValueChanged);
339
                foreach (string fileName in dia.FileNames)
340
                {
341
                    try
342
                    {
343
                        GridViewDataRowInfo row = new GridViewDataRowInfo(gridViewDrawingList.MasterView);
344
                        Document document = Document.Load(fileName, symbolMapping, attributeMapping);
345
                        row.Tag = document;
346

  
347
                        if (document == null)
348
                        {
349
                            row.Cells["colDrawingFileName"].Value = fileName;
350
                            row.Cells["colStatus"].Value = _LoadFail;
351
                            row.Cells["colDrawingFullName"].Value = fileName;
352
                        }
353
                        else
354
                        {
355
                            row.Cells["colCheckBox"].Value = false;
356
                            row.Cells["colDrawingFileName"].Value = document.DWGNAME;
357
                            row.Cells["colDrawingNumber"].Value = document.DWGNAME;
358
                            row.Cells["colDrawingName"].Value = document.DWGNAME;
359
                            row.Cells["colDrawingFullName"].Value = fileName;
360
                        }
361

  
362
                        gridViewDrawingList.Rows.Add(row);
363
                        CheckValidateDrawing(row);
364
                    }
365
                    catch (Exception ex)
366
                    {
367

  
368
                    }
369
                }
370
                gridViewDrawingList.CellValueChanged += new GridViewCellEventHandler(this.gridViewDrawingList_CellValueChanged);
77 371
            }
78 372
        }
79 373

  
......
82 376
            try
83 377
            {
84 378
                dynamic application = Interaction.GetObject("", "PIDAutomation.Application");
85
                for (int i = 0; i < 4; i++)
379

  
380
                foreach (GridViewRowInfo rowInfo in gridViewDrawingList.Rows)
86 381
                {
87
                    dynamic newDrawing = application.Drawings.Add("PA", @"\\server70\DOFTECHSITE\P&ID Reference Data\Template Files\STIM A1.pid", "Test" + i, "Test" + i);
88
                    application.ActiveWindow.Fit();
89
                    Thread.Sleep(10);
90
                    application.ActiveWindow.Zoom = 2000;
91
                    Thread.Sleep(10);
382
                    try
383
                    {
384
                        bool bChecked = (bool)rowInfo.Cells["colCheckBox"].Value;
385
                        string sStatus = rowInfo.Cells["colStatus"].Value.ToString();
92 386

  
387
                        if (bChecked && sStatus == _Ready)
388
                        {
389
                            string sUnit = rowInfo.Cells["colUnit"].Value.ToString();
390
                            string sTemplate = TemplatePath + @"\" + rowInfo.Cells["colTemplate"].Value.ToString();
391
                            string sDrawingNumber = rowInfo.Cells["colDrawingNumber"].Value.ToString();
392
                            string sDrawingName = rowInfo.Cells["colDrawingName"].Value.ToString();
93 393

  
394
                            //
395
                            dynamic newDrawing = application.Drawings.Add(sUnit, sTemplate, sDrawingNumber, sDrawingName);
396
                            application.ActiveWindow.Fit();
397
                            Thread.Sleep(10);
398
                            application.ActiveWindow.Zoom = 2000;
399
                            Thread.Sleep(10);
400
                            //
94 401

  
402
                            Document document = rowInfo.Tag as Document;
... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.

내보내기 Unified diff

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