hytos / DTI_PID / SPPIDConverter / ConverterForm.cs @ 6ca8a44c
이력 | 보기 | 이력해설 | 다운로드 (34.6 KB)
1 | 96a2080c | gaqhf | 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 | 1278ba59 | gaqhf | using DevExpress.XtraEditors.Repository; |
12 | using DevExpress.XtraEditors.Controls; |
||
13 | using DevExpress.XtraEditors; |
||
14 | 23eb98bf | gaqhf | using System.Globalization; |
15 | using System.Threading; |
||
16 | using System.IO; |
||
17 | d19ae675 | gaqhf | using Ingr.RAD2D; |
18 | using Converter.BaseModel; |
||
19 | b8e2644e | gaqhf | using Converter.SPPID.Properties; |
20 | using Converter.SPPID.DB; |
||
21 | using Converter.SPPID.Util; |
||
22 | using Converter.SPPID.Form; |
||
23 | using Converter.SPPID.Model; |
||
24 | ea54adc8 | gaqhf | using Plaice; |
25 | using Llama; |
||
26 | |||
27 | 96a2080c | gaqhf | |
28 | b8e2644e | gaqhf | namespace Converter.SPPID |
29 | 96a2080c | gaqhf | { |
30 | public partial class ConverterForm : DevExpress.XtraBars.Ribbon.RibbonForm |
||
31 | { |
||
32 | bca86986 | gaqhf | private Dictionary<string, SPPID_Document> _DicDocuments = new Dictionary<string, SPPID_Document>(); |
33 | 4314b3f3 | gaqhf | private List<SPPID_Document> _Documents = new List<SPPID_Document>(); |
34 | public List<SPPID_Document> Documents { get { return _Documents; } } |
||
35 | bca86986 | gaqhf | private DataTable _ConverterDT = new DataTable(); |
36 | private DataTable _SPPIDSymbolPathDT = new DataTable(); |
||
37 | 635a8747 | gaqhf | private DataTable _SPPIDUnitDT = new DataTable(); |
38 | e88aae98 | gaqhf | private DataTable _SPPIDAttributeDT = new DataTable(); |
39 | 23eb98bf | gaqhf | private RepositoryItemComboBox templateComboBox; |
40 | |||
41 | bca86986 | gaqhf | |
42 | private DataTable _ID2SymbolDT = new DataTable(); |
||
43 | 4b4dbca9 | gaqhf | private DataTable _ID2ChildSymbolDT = new DataTable(); |
44 | bca86986 | gaqhf | private DataTable _ID2LineDT = new DataTable(); |
45 | 1efc25a3 | gaqhf | private DataTable _ID2AttributeDT = new DataTable(); |
46 | 306a0af9 | gaqhf | private DataTable _ID2DrawingAttributeDT = new DataTable(); |
47 | bca86986 | gaqhf | private DataTable _ID2LinePropertyDT = new DataTable(); |
48 | f1c9dbaa | gaqhf | private DataTable _ID2SymbolTypeDT = new DataTable(); |
49 | 4d2571ab | gaqhf | private DataTable _ID2SymbolTable = new DataTable(); |
50 | f1c9dbaa | gaqhf | |
51 | bca86986 | gaqhf | |
52 | private List<SymbolMapping> symbolMappings = new List<SymbolMapping>(); |
||
53 | 4b4dbca9 | gaqhf | private List<ChildSymbolMapping> childSymbolMappings = new List<ChildSymbolMapping>(); |
54 | bca86986 | gaqhf | private List<LineMapping> lineMappings = new List<LineMapping>(); |
55 | private List<LineNumberMapping> lineNumberMappings = new List<LineNumberMapping>(); |
||
56 | 1efc25a3 | gaqhf | private List<AttributeMapping> attributeMappings = new List<AttributeMapping>(); |
57 | bca86986 | gaqhf | |
58 | ea54adc8 | gaqhf | string TemplatePath; |
59 | |||
60 | 96a2080c | gaqhf | public ConverterForm() |
61 | { |
||
62 | InitializeComponent(); |
||
63 | 1278ba59 | gaqhf | |
64 | b048c104 | gaqhf | CultureInfo culture = CultureInfo.GetCultureInfo("ko"); |
65 | Msg.Culture = culture; |
||
66 | 23eb98bf | gaqhf | |
67 | ea54adc8 | gaqhf | this._SPPIDUnitDT = SPPIDUtil.GetUnitInfo(); |
68 | TemplatePath = SPPIDUtil.T_OPTIONSETTING_Value("PID Template Path"); |
||
69 | |||
70 | bca86986 | gaqhf | InitUsedDataTable(); |
71 | 1278ba59 | gaqhf | InitGridControl(); |
72 | fab4f207 | gaqhf | InitID2Project(); |
73 | 0632775b | gaqhf | |
74 | // |
||
75 | 0760d1ad | gaqhf | //labelID2ProjectName.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
76 | //labelDBType.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
||
77 | //labelID2ProjectStatus.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
||
78 | //labelSPPIDPlantName.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
||
79 | //labelSPPIDDBStatus.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
||
80 | //labelItemMappingStatus.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
||
81 | 1278ba59 | gaqhf | } |
82 | |||
83 | bca86986 | gaqhf | private void InitUsedDataTable() |
84 | 1278ba59 | gaqhf | { |
85 | bca86986 | gaqhf | // Converter Table |
86 | DataColumn col = _ConverterDT.Columns.Add("colDrawingFileName"); |
||
87 | 1278ba59 | gaqhf | col.Caption = "Drawing File Name"; |
88 | bca86986 | gaqhf | col = _ConverterDT.Columns.Add("colDrawingFilePath"); |
89 | 0d8062b2 | gaqhf | col.Caption = "DrawingFilePath"; |
90 | bca86986 | gaqhf | col = _ConverterDT.Columns.Add("colUnit"); |
91 | 1278ba59 | gaqhf | col.Caption = "Unit"; |
92 | bca86986 | gaqhf | col = _ConverterDT.Columns.Add("colTemplate"); |
93 | 1278ba59 | gaqhf | col.Caption = "Template"; |
94 | bca86986 | gaqhf | col = _ConverterDT.Columns.Add("colDrawingNumber"); |
95 | 1278ba59 | gaqhf | col.Caption = "Drawing Number"; |
96 | bca86986 | gaqhf | col = _ConverterDT.Columns.Add("colDrawingName"); |
97 | 1278ba59 | gaqhf | col.Caption = "Drawing Name"; |
98 | bca86986 | gaqhf | col = _ConverterDT.Columns.Add("colStatus"); |
99 | 1278ba59 | gaqhf | col.Caption = "Status"; |
100 | bca86986 | gaqhf | col = _ConverterDT.Columns.Add("colUID"); |
101 | |||
102 | col = _ID2LineDT.Columns.Add("UID"); |
||
103 | col = _ID2LineDT.Columns.Add("Name"); |
||
104 | col.Caption = "Name"; |
||
105 | col = _ID2LineDT.Columns.Add("Type"); |
||
106 | col.Caption = "Type"; |
||
107 | col = _ID2LineDT.Columns.Add("SPPID_SYMBOL_PATH"); |
||
108 | col.Caption = "SPPID Symbol Path"; |
||
109 | col = _ID2LineDT.Columns.Add("Clear"); |
||
110 | col.Caption = ""; |
||
111 | } |
||
112 | |||
113 | private void InitGridControl() |
||
114 | { |
||
115 | #region Converter Page |
||
116 | gridViewConverter.OptionsSelection.MultiSelect = true; |
||
117 | gridViewConverter.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect; |
||
118 | |||
119 | gridControlConverter.DataSource = _ConverterDT; |
||
120 | 1278ba59 | gaqhf | |
121 | templateComboBox = new RepositoryItemComboBox(); |
||
122 | templateComboBox.TextEditStyle = TextEditStyles.DisableTextEditor; |
||
123 | 635a8747 | gaqhf | templateComboBox.EditValueChanged += templateComboBox_EditValueChanged; |
124 | 1278ba59 | gaqhf | gridControlConverter.RepositoryItems.Add(templateComboBox); |
125 | gridViewConverter.Columns["colTemplate"].ColumnEdit = templateComboBox; |
||
126 | |||
127 | 635a8747 | gaqhf | gridViewConverter.Columns["colUnit"].OptionsColumn.AllowEdit = false; |
128 | 1278ba59 | gaqhf | gridViewConverter.Columns["colDrawingFileName"].OptionsColumn.AllowEdit = false; |
129 | gridViewConverter.Columns["colUnit"].OptionsColumn.ReadOnly = true; |
||
130 | gridViewConverter.Columns["colStatus"].OptionsColumn.AllowEdit = false; |
||
131 | 0d8062b2 | gaqhf | gridViewConverter.Columns["colDrawingFilePath"].Visible = false; |
132 | 1278ba59 | gaqhf | gridViewConverter.Columns["colUID"].Visible = false; |
133 | |||
134 | gridViewConverter.BestFitColumns(); |
||
135 | #endregion |
||
136 | } |
||
137 | f1c9dbaa | gaqhf | |
138 | 635a8747 | gaqhf | private void templateComboBox_EditValueChanged(object sender, EventArgs e) |
139 | { |
||
140 | gridViewConverter.CloseEditor(); |
||
141 | gridViewConverter.UpdateCurrentRow(); |
||
142 | } |
||
143 | |||
144 | private void gridViewConverter_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e) |
||
145 | { |
||
146 | if (e.Column.Name == "colcolTemplate") |
||
147 | { |
||
148 | gridViewConverter.ShowEditor(); |
||
149 | (gridViewConverter.ActiveEditor as ComboBoxEdit).ShowPopup(); |
||
150 | } |
||
151 | else if (e.Column.Name == "colcolUnit") |
||
152 | { |
||
153 | UnitForm unitForm = new UnitForm(_SPPIDUnitDT); |
||
154 | if (unitForm.ShowDialog() == DialogResult.OK) |
||
155 | { |
||
156 | gridViewConverter.SetRowCellValue(e.RowHandle, e.Column, unitForm.SelectedUnit); |
||
157 | gridViewConverter.CloseEditor(); |
||
158 | gridViewConverter.UpdateCurrentRow(); |
||
159 | } |
||
160 | } |
||
161 | } |
||
162 | 1278ba59 | gaqhf | |
163 | 8847ea67 | gaqhf | private void btnID2DB_Click(object sender, EventArgs e) |
164 | 23eb98bf | gaqhf | { |
165 | 8847ea67 | gaqhf | ID2DBSetting form = new ID2DBSetting(); |
166 | e7427d3c | gaqhf | DialogResult dialogResult = form.ShowDialog(); |
167 | 8847ea67 | gaqhf | Project_Info _ProjectInfo = Project_Info.GetInstance(); |
168 | _ProjectInfo.DefaultPath = Settings.Default.ProjectPath; |
||
169 | _ProjectInfo.DBType = (ID2DB_Type)Settings.Default.ProjectDBType; |
||
170 | _ProjectInfo.ServerIP = Settings.Default.ProjectServerIP; |
||
171 | _ProjectInfo.Port = Settings.Default.ProjectPort; |
||
172 | _ProjectInfo.DBUser = Settings.Default.ProjectDBUser; |
||
173 | _ProjectInfo.DBPassword = Settings.Default.ProjectDBPassword; |
||
174 | |||
175 | e7427d3c | gaqhf | if (dialogResult == DialogResult.OK) |
176 | 23eb98bf | gaqhf | { |
177 | fab4f207 | gaqhf | if (InitID2Project()) |
178 | MessageBox.Show(Msg.SuccessProjectSelect, Msg.Information, MessageBoxButtons.OK, MessageBoxIcon.Information); |
||
179 | else |
||
180 | 23eb98bf | gaqhf | MessageBox.Show(Msg.FailProjectSelect, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
181 | } |
||
182 | } |
||
183 | |||
184 | fab4f207 | gaqhf | private bool InitID2Project() |
185 | 23eb98bf | gaqhf | { |
186 | ec0c7045 | gaqhf | Project_Info _ProjectInfo = Project_Info.GetInstance(); |
187 | fab4f207 | gaqhf | if (Project_DB.ConnTestAndCreateTable()) |
188 | 23eb98bf | gaqhf | { |
189 | fab4f207 | gaqhf | _ProjectInfo.Enable = true; |
190 | 8847ea67 | gaqhf | labelDBType.Text = _ProjectInfo.DBType.ToString(); |
191 | labelDBType.AppearanceItemCaption.ForeColor = Color.Blue; |
||
192 | 23eb98bf | gaqhf | labelID2ProjectName.Text = _ProjectInfo.Name; |
193 | labelID2ProjectName.AppearanceItemCaption.ForeColor = Color.Blue; |
||
194 | labelID2ProjectStatus.Text = Msg.ConnectionSuccessful; |
||
195 | labelID2ProjectStatus.AppearanceItemCaption.ForeColor = Color.Blue; |
||
196 | fab4f207 | gaqhf | layoutControlGroupSPPIDDB.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; |
197 | layoutControlGroupItemMapping.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always; |
||
198 | 23eb98bf | gaqhf | } |
199 | else |
||
200 | { |
||
201 | fab4f207 | gaqhf | _ProjectInfo.Enable = false; |
202 | da84b14b | gaqhf | labelDBType.Text = " "; |
203 | 23eb98bf | gaqhf | labelID2ProjectName.Text = " "; |
204 | labelID2ProjectName.AppearanceItemCaption.ForeColor = Color.Red; |
||
205 | labelID2ProjectStatus.Text = Msg.ConnectionFail; |
||
206 | labelID2ProjectStatus.AppearanceItemCaption.ForeColor = Color.Red; |
||
207 | fab4f207 | gaqhf | layoutControlGroupSPPIDDB.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
208 | layoutControlGroupItemMapping.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never; |
||
209 | bca86986 | gaqhf | } |
210 | fab4f207 | gaqhf | |
211 | bca86986 | gaqhf | InitMapping(); |
212 | InitSPPIDDB(); |
||
213 | |||
214 | return _ProjectInfo.Enable; |
||
215 | } |
||
216 | |||
217 | private void InitMapping() |
||
218 | { |
||
219 | Project_Info _ProjectInfo = Project_Info.GetInstance(); |
||
220 | if (_ProjectInfo.Enable) |
||
221 | { |
||
222 | 4d2571ab | gaqhf | if (_ID2SymbolTable != null) |
223 | { |
||
224 | _ID2SymbolTable.Dispose(); |
||
225 | _ID2SymbolTable = null; |
||
226 | } |
||
227 | _ID2SymbolTable = Project_DB.SelectID2SymbolTable(); |
||
228 | 7e680366 | gaqhf | |
229 | if (_ID2SymbolTypeDT != null) |
||
230 | { |
||
231 | _ID2SymbolTypeDT.Dispose(); |
||
232 | _ID2SymbolTypeDT = null; |
||
233 | } |
||
234 | _ID2SymbolTypeDT = Project_DB.SelectSymbolType(); |
||
235 | bca86986 | gaqhf | InitID2Symbol(); |
236 | InitID2Line(); |
||
237 | InitID2LineNumber(); |
||
238 | 1efc25a3 | gaqhf | InitID2Attribute(); |
239 | 306a0af9 | gaqhf | InitID2DrawingAttribute(); |
240 | e00e891d | gaqhf | |
241 | InitETCSetting(); |
||
242 | } |
||
243 | } |
||
244 | fbdb9f2a | gaqhf | |
245 | e00e891d | gaqhf | private void InitETCSetting() |
246 | { |
||
247 | Project_Info _ProjectInfo = Project_Info.GetInstance(); |
||
248 | if (_ProjectInfo.Enable) |
||
249 | { |
||
250 | 7cbb1038 | gaqhf | DataTable dt = Project_DB.SelectSetting(); |
251 | foreach (DataRow item in dt.Rows) |
||
252 | { |
||
253 | string settingType = item["SettingType"].ToString(); |
||
254 | if (settingType == "ETCSetting") |
||
255 | SPPIDUtil.ConvertToETCSetting(item["JsonString"].ToString()); |
||
256 | else if (settingType == "GridSetting") |
||
257 | SPPIDUtil.ConvertToGridSetting(item["JsonString"].ToString()); |
||
258 | } |
||
259 | bca86986 | gaqhf | } |
260 | } |
||
261 | |||
262 | private void InitID2Symbol() |
||
263 | { |
||
264 | using (DataTable symbolDT = Project_DB.SelectProjectSymbol()) |
||
265 | { |
||
266 | symbolMappings.Clear(); |
||
267 | _ID2SymbolDT = symbolDT; |
||
268 | _ID2SymbolDT.Columns.Add("Clear"); |
||
269 | _ID2SymbolDT.Columns["Clear"].Caption = ""; |
||
270 | foreach (DataRow row in symbolDT.Rows) |
||
271 | { |
||
272 | symbolMappings.Add(new SymbolMapping() |
||
273 | { |
||
274 | UID = row["UID"] == null ? "" : row["UID"].ToString(), |
||
275 | SYMBOLNAME = row["Name"] == null ? "" : row["Name"].ToString(), |
||
276 | SPPIDSYMBOLNAME = row["SPPID_SYMBOL_PATH"] == null ? "" : row["SPPID_SYMBOL_PATH"].ToString(), |
||
277 | cf924377 | gaqhf | LEADERLINE = DBNull.Value.Equals(row["LEADERLINE"]) ? false : (bool)row["LEADERLINE"] |
278 | bca86986 | gaqhf | }); |
279 | } |
||
280 | 4b4dbca9 | gaqhf | |
281 | MergeID2ChildSymbol(); |
||
282 | } |
||
283 | } |
||
284 | |||
285 | private void MergeID2ChildSymbol() |
||
286 | { |
||
287 | using (DataTable childSymbolDT = Project_DB.SelectProjectChildSymbol()) |
||
288 | { |
||
289 | childSymbolMappings.Clear(); |
||
290 | _ID2ChildSymbolDT = childSymbolDT; |
||
291 | _ID2ChildSymbolDT.Columns.Add("Clear"); |
||
292 | _ID2ChildSymbolDT.Columns["Clear"].Caption = ""; |
||
293 | foreach (DataRow row in childSymbolDT.Rows) |
||
294 | { |
||
295 | childSymbolMappings.Add(new ChildSymbolMapping() |
||
296 | { |
||
297 | UID = row["UID"] == null ? "" : row["UID"].ToString(), |
||
298 | SYMBOLNAME = row["Name"] == null ? "" : row["Name"].ToString(), |
||
299 | SPPIDSYMBOLNAME = row["SPPID_SYMBOL_PATH"] == null ? "" : row["SPPID_SYMBOL_PATH"].ToString(), |
||
300 | }); |
||
301 | } |
||
302 | |||
303 | _ID2SymbolDT.Merge(_ID2ChildSymbolDT); |
||
304 | bca86986 | gaqhf | } |
305 | } |
||
306 | |||
307 | private void InitID2Line() |
||
308 | { |
||
309 | using (DataTable lineTypes = Project_DB.SelectProjectLine()) |
||
310 | { |
||
311 | lineMappings.Clear(); |
||
312 | _ID2LineDT.Rows.Clear(); |
||
313 | foreach (DataRow row in lineTypes.Rows) |
||
314 | { |
||
315 | DataRow newRow = _ID2LineDT.NewRow(); |
||
316 | newRow["UID"] = row["UID"] == null ? "" : row["UID"].ToString(); |
||
317 | newRow["Name"] = row["Name"] == null ? "" : row["Name"].ToString(); |
||
318 | newRow["Type"] = "Line"; |
||
319 | newRow["SPPID_SYMBOL_PATH"] = row["SPPID_SYMBOL_PATH"] == null ? "" : row["SPPID_SYMBOL_PATH"].ToString(); |
||
320 | _ID2LineDT.Rows.Add(newRow); |
||
321 | |||
322 | lineMappings.Add(new LineMapping() |
||
323 | { |
||
324 | UID = row["UID"] == null ? "" : row["UID"].ToString(), |
||
325 | LINENAME = row["Name"] == null ? "" : row["Name"].ToString(), |
||
326 | SPPIDSYMBOLNAME = row["SPPID_SYMBOL_PATH"] == null ? "" : row["SPPID_SYMBOL_PATH"].ToString(), |
||
327 | }); |
||
328 | } |
||
329 | } |
||
330 | } |
||
331 | |||
332 | private void InitID2LineNumber() |
||
333 | { |
||
334 | using (DataTable linePropertiesDT = Project_DB.SelectProjectLineProperties()) |
||
335 | { |
||
336 | lineNumberMappings.Clear(); |
||
337 | _ID2LinePropertyDT = linePropertiesDT; |
||
338 | _ID2LinePropertyDT.Columns.Add("Type"); |
||
339 | foreach (DataRow row in linePropertiesDT.Rows) |
||
340 | { |
||
341 | row["Type"] = "Line Property"; |
||
342 | lineNumberMappings.Add(new LineNumberMapping() |
||
343 | { |
||
344 | UID = row["UID"] == null ? "" : row["UID"].ToString(), |
||
345 | DisplayName = row["DisplayName"] == null ? "" : row["DisplayName"].ToString(), |
||
346 | SPPIDATTRIBUTENAME = row["SPPID_ATTRIBUTE"] == null ? "" : row["SPPID_ATTRIBUTE"].ToString(), |
||
347 | SPPIDSYMBOLNAME = row["SPPID_SYMBOL_PATH"] == null ? "" : row["SPPID_SYMBOL_PATH"].ToString() |
||
348 | }); |
||
349 | } |
||
350 | } |
||
351 | } |
||
352 | |||
353 | 1efc25a3 | gaqhf | private void InitID2Attribute() |
354 | bca86986 | gaqhf | { |
355 | 1efc25a3 | gaqhf | using (DataTable attributeDT = Project_DB.SelectProjectAttribute()) |
356 | bca86986 | gaqhf | { |
357 | 1efc25a3 | gaqhf | attributeMappings.Clear(); |
358 | _ID2AttributeDT = attributeDT; |
||
359 | _ID2AttributeDT.Columns.Add("Clear"); |
||
360 | _ID2AttributeDT.Columns["Clear"].Caption = ""; |
||
361 | foreach (DataRow row in attributeDT.Rows) |
||
362 | bca86986 | gaqhf | { |
363 | 1efc25a3 | gaqhf | attributeMappings.Add(new AttributeMapping() |
364 | bca86986 | gaqhf | { |
365 | UID = row["UID"] == null ? "" : row["UID"].ToString(), |
||
366 | DisplayAttribute = row["DisplayAttribute"] == null ? "" : row["DisplayAttribute"].ToString(), |
||
367 | Type = row["Type"] == null ? "" : row["Type"].ToString(), |
||
368 | SPPIDATTRIBUTENAME = row["SPPID_ATTRIBUTE"] == null ? "" : row["SPPID_ATTRIBUTE"].ToString(), |
||
369 | 1a3a74a8 | gaqhf | SPPIDSYMBOLNAME = row["SPPID_SYMBOL_PATH"] == null ? "" : row["SPPID_SYMBOL_PATH"].ToString(), |
370 | 1ba9c671 | gaqhf | Location = DBNull.Value.Equals(row["LOCATION"]) ? Model.Location.None : (Location)row["LOCATION"], |
371 | 1ecaaba8 | gaqhf | LeaderLine = DBNull.Value.Equals(row["LEADERLINE"]) ? false : (bool)row["LEADERLINE"], |
372 | IsText = DBNull.Value.Equals(row["ISTEXT"]) ? false : (bool)row["ISTEXT"] |
||
373 | bca86986 | gaqhf | }); |
374 | } |
||
375 | 23eb98bf | gaqhf | } |
376 | } |
||
377 | |||
378 | 306a0af9 | gaqhf | private void InitID2DrawingAttribute() |
379 | { |
||
380 | using (DataTable drawingAttributeDT = Project_DB.SelectDrawingProjectAttribute()) |
||
381 | { |
||
382 | _ID2DrawingAttributeDT = drawingAttributeDT; |
||
383 | } |
||
384 | } |
||
385 | |||
386 | fab4f207 | gaqhf | private void InitSPPIDDB() |
387 | 23eb98bf | gaqhf | { |
388 | 12b7a2a8 | gaqhf | buttonEditDefaultUnit.TextChanged -= new EventHandler(buttonEditDefaultUnit_TextChanged); |
389 | comboBoxEditDefaultTemplate.SelectedIndexChanged -= new EventHandler(comboBoxEditDefaultTemplate_SelectedIndexChanged); |
||
390 | |||
391 | ec0c7045 | gaqhf | Project_Info _ProjectInfo = Project_Info.GetInstance(); |
392 | fab4f207 | gaqhf | if (_ProjectInfo.Enable) |
393 | { |
||
394 | DataTable dt = Project_DB.SelectSPPID_DB_INFO(); |
||
395 | ec0c7045 | gaqhf | if (dt.Columns.Count > 0 && dt.Rows.Count > 0) |
396 | SPPIDUtil.ConvertToSPPIDInfo(dt.Rows[0][0].ToString()); |
||
397 | else |
||
398 | SPPID_DBInfo.Clear(); |
||
399 | fab4f207 | gaqhf | } |
400 | ec0c7045 | gaqhf | |
401 | 635a8747 | gaqhf | templateComboBox.Items.Clear(); |
402 | d73c791c | gaqhf | comboBoxEditDefaultTemplate.SelectedIndex = -1; |
403 | comboBoxEditDefaultTemplate.Properties.Items.Clear(); |
||
404 | buttonEditDefaultUnit.Text = ""; |
||
405 | |||
406 | ec0c7045 | gaqhf | SPPID_DBInfo _SPPIDInfo = SPPID_DBInfo.GetInstance(); |
407 | 23eb98bf | gaqhf | if (_SPPIDInfo.Enable) |
408 | { |
||
409 | labelSPPIDPlantName.Text = _SPPIDInfo.SelectedPlant; |
||
410 | labelSPPIDPlantName.AppearanceItemCaption.ForeColor = Color.Blue; |
||
411 | labelSPPIDDBStatus.Text = Msg.ConnectionSuccessful; |
||
412 | labelSPPIDDBStatus.AppearanceItemCaption.ForeColor = Color.Blue; |
||
413 | 635a8747 | gaqhf | |
414 | if (!string.IsNullOrEmpty(TemplatePath)) |
||
415 | d73c791c | gaqhf | { |
416 | List<string> templateFiles = Directory.GetFiles(TemplatePath, "*.pid").ToList().Select(filePath => Path.GetFileName(filePath)).ToList(); |
||
417 | templateComboBox.Items.AddRange(templateFiles); |
||
418 | comboBoxEditDefaultTemplate.Properties.Items.AddRange(templateFiles); |
||
419 | } |
||
420 | |||
421 | e88aae98 | gaqhf | if (_SPPIDAttributeDT != null) |
422 | { |
||
423 | _SPPIDAttributeDT.Dispose(); |
||
424 | _SPPIDAttributeDT = null; |
||
425 | } |
||
426 | |||
427 | _SPPIDAttributeDT = SPPID_DB.GetSPPIDAttribute(); |
||
428 | if (_SPPIDAttributeDT != null) |
||
429 | { |
||
430 | _SPPIDAttributeDT.Columns["DISPLAYNAME"].ColumnName = "DISPLAY NAME"; |
||
431 | } |
||
432 | 12b7a2a8 | gaqhf | |
433 | if (!string.IsNullOrEmpty(Settings.Default.DefaultTemplate) && comboBoxEditDefaultTemplate.Properties.Items.Contains(Settings.Default.DefaultTemplate)) |
||
434 | comboBoxEditDefaultTemplate.SelectedItem = Settings.Default.DefaultTemplate; |
||
435 | |||
436 | // Unit 있는지 없는지 검사 필요 |
||
437 | if (!string.IsNullOrEmpty(Settings.Default.DefaultUnit)) |
||
438 | buttonEditDefaultUnit.Text = Settings.Default.DefaultUnit; |
||
439 | 23eb98bf | gaqhf | } |
440 | else |
||
441 | { |
||
442 | labelSPPIDPlantName.Text = " "; |
||
443 | labelSPPIDPlantName.AppearanceItemCaption.ForeColor = Color.Red; |
||
444 | labelSPPIDDBStatus.Text = Msg.ConnectionFail; |
||
445 | labelSPPIDDBStatus.AppearanceItemCaption.ForeColor = Color.Red; |
||
446 | } |
||
447 | bca86986 | gaqhf | |
448 | 635a8747 | gaqhf | _DicDocuments.Clear(); |
449 | _ConverterDT.Rows.Clear(); |
||
450 | bca86986 | gaqhf | InitSPPIDSymbolTreeTable(); |
451 | 12b7a2a8 | gaqhf | |
452 | buttonEditDefaultUnit.TextChanged += new EventHandler(buttonEditDefaultUnit_TextChanged); |
||
453 | comboBoxEditDefaultTemplate.SelectedIndexChanged += new EventHandler(comboBoxEditDefaultTemplate_SelectedIndexChanged); |
||
454 | 23eb98bf | gaqhf | } |
455 | |||
456 | bca86986 | gaqhf | private void InitSPPIDSymbolTreeTable() |
457 | 23eb98bf | gaqhf | { |
458 | 26c6f818 | gaqhf | try |
459 | { |
||
460 | _SPPIDSymbolPathDT = new DataTable(); |
||
461 | _SPPIDSymbolPathDT.Columns.Add("ID"); |
||
462 | _SPPIDSymbolPathDT.Columns.Add("Parent"); |
||
463 | _SPPIDSymbolPathDT.Columns.Add("Name"); |
||
464 | _SPPIDSymbolPathDT.Columns.Add("FullPath"); |
||
465 | bca86986 | gaqhf | |
466 | ea54adc8 | gaqhf | string symbolPath = SPPIDUtil.T_OPTIONSETTING_Value("Catalog Explorer root path"); |
467 | DirectoryInfo info = new DirectoryInfo(symbolPath); |
||
468 | _SPPIDSymbolPathDT.Rows.Add(new object[] { "0", "-1", info.Name }); |
||
469 | loop(info, "0", symbolPath); |
||
470 | 26c6f818 | gaqhf | } |
471 | catch (Exception ex) |
||
472 | 23eb98bf | gaqhf | { |
473 | 26c6f818 | gaqhf | MessageBox.Show(ex.Message + "\r\n" + ex.StackTrace); |
474 | 23eb98bf | gaqhf | } |
475 | bca86986 | gaqhf | } |
476 | 23eb98bf | gaqhf | |
477 | bca86986 | gaqhf | private void loop(DirectoryInfo parentInfo, string parentUID, string defaultPath) |
478 | { |
||
479 | DirectoryInfo[] infos = parentInfo.GetDirectories(); |
||
480 | foreach (DirectoryInfo info in infos) |
||
481 | { |
||
482 | string uid = Guid.NewGuid().ToString(); |
||
483 | _SPPIDSymbolPathDT.Rows.Add(new object[] { uid, parentUID, info.Name }); |
||
484 | loop(info, uid, defaultPath); |
||
485 | |||
486 | FileInfo[] files = info.GetFiles("*.sym"); |
||
487 | foreach (FileInfo fileInfo in files) |
||
488 | { |
||
489 | _SPPIDSymbolPathDT.Rows.Add(new object[] { Guid.NewGuid().ToString(), uid, fileInfo.Name, fileInfo.FullName.Replace(defaultPath, "") }); |
||
490 | } |
||
491 | } |
||
492 | 23eb98bf | gaqhf | } |
493 | |||
494 | 1278ba59 | gaqhf | private void btnLoadFile_Click(object sender, EventArgs e) |
495 | { |
||
496 | 0a111e7d | gaqhf | List< BaseModel.Document> validationFailDocs = new List<BaseModel.Document>(); |
497 | ec0c7045 | gaqhf | Project_Info _ProjectInfo = Project_Info.GetInstance(); |
498 | d73c791c | gaqhf | SPPID_DBInfo _SPPIDInfo = SPPID_DBInfo.GetInstance(); |
499 | if (!_ProjectInfo.Enable || !_SPPIDInfo.Enable) |
||
500 | 23eb98bf | gaqhf | { |
501 | d73c791c | gaqhf | MessageBox.Show(Msg.PleaseSetProjectInfo, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
502 | 23eb98bf | gaqhf | return; |
503 | } |
||
504 | 1278ba59 | gaqhf | |
505 | 171142c5 | gaqhf | xtraOpenFileDialog.InitialDirectory = _ProjectInfo.TempDirPath; |
506 | 23eb98bf | gaqhf | if (xtraOpenFileDialog.ShowDialog() == DialogResult.OK) |
507 | 1278ba59 | gaqhf | { |
508 | 23eb98bf | gaqhf | foreach (string fileName in xtraOpenFileDialog.FileNames) |
509 | 1278ba59 | gaqhf | { |
510 | 7e680366 | gaqhf | SPPID_Document document = new SPPID_Document(fileName, _ID2SymbolTypeDT); |
511 | 4314b3f3 | gaqhf | |
512 | 68e9394a | gaqhf | document.SymbolTable = _ID2SymbolTable; |
513 | document.SymbolMappings = symbolMappings; |
||
514 | document.ChildSymbolMappings = childSymbolMappings; |
||
515 | document.LineMappings = lineMappings; |
||
516 | document.LineNumberMappings = lineNumberMappings; |
||
517 | document.AttributeMappings = attributeMappings; |
||
518 | document.ETCSetting = ETCSetting.GetInstance(); |
||
519 | document.SetSPPIDInfo(); |
||
520 | |||
521 | |||
522 | if (!document.SetSPPIDMapping()) |
||
523 | { |
||
524 | document.Enable = false; |
||
525 | document.MappingValidation = false; |
||
526 | } |
||
527 | |||
528 | bca86986 | gaqhf | DataRow[] rows = _ConverterDT.Select(string.Format("colDrawingFilePath = '{0}'", fileName)); |
529 | 0d8062b2 | gaqhf | if (rows.Length == 0) |
530 | { |
||
531 | f9cc5190 | gaqhf | DataRow row = _ConverterDT.NewRow(); |
532 | 0d8062b2 | gaqhf | row["colDrawingFileName"] = Path.GetFileNameWithoutExtension(fileName); |
533 | row["colDrawingFilePath"] = fileName; |
||
534 | row["colDrawingNumber"] = document.DWGNAME; |
||
535 | row["colDrawingName"] = document.DWGNAME; |
||
536 | if (document.Enable) |
||
537 | row["colStatus"] = "Ready"; |
||
538 | else |
||
539 | row["colStatus"] = "Error"; |
||
540 | row["colUID"] = ""; |
||
541 | d73c791c | gaqhf | if (comboBoxEditDefaultTemplate.SelectedIndex > -1) |
542 | 12b7a2a8 | gaqhf | row["colTemplate"] = comboBoxEditDefaultTemplate.SelectedItem; |
543 | d73c791c | gaqhf | if (!string.IsNullOrEmpty(buttonEditDefaultUnit.Text)) |
544 | row["colUnit"] = buttonEditDefaultUnit.Text; |
||
545 | |||
546 | bca86986 | gaqhf | _ConverterDT.Rows.Add(row); |
547 | 442bd51e | gaqhf | |
548 | if (document.Enable && document.Validation && document.MappingValidation) |
||
549 | gridViewConverter.SelectRow(gridViewConverter.GetRowHandle(_ConverterDT.Rows.IndexOf(row))); |
||
550 | 0d8062b2 | gaqhf | } |
551 | f9cc5190 | gaqhf | else |
552 | { |
||
553 | foreach (DataRow row in rows) |
||
554 | { |
||
555 | if (document.Enable) |
||
556 | row["colStatus"] = "Ready"; |
||
557 | else |
||
558 | row["colStatus"] = "Error"; |
||
559 | d73c791c | gaqhf | |
560 | if (comboBoxEditDefaultTemplate.SelectedIndex > -1) |
||
561 | row["colTemplate"] = comboBoxEditDefaultTemplate.SelectedItem; |
||
562 | if (!string.IsNullOrEmpty(buttonEditDefaultUnit.Text)) |
||
563 | row["colUnit"] = buttonEditDefaultUnit.Text; |
||
564 | 442bd51e | gaqhf | |
565 | if (document.Enable && document.Validation && document.MappingValidation) |
||
566 | gridViewConverter.SelectRow(gridViewConverter.GetRowHandle(_ConverterDT.Rows.IndexOf(row))); |
||
567 | f9cc5190 | gaqhf | } |
568 | } |
||
569 | 0d8062b2 | gaqhf | if (!_DicDocuments.ContainsKey(fileName)) |
570 | _DicDocuments.Add(fileName, null); |
||
571 | |||
572 | 68e9394a | gaqhf | if (!document.Validation || !document.MappingValidation) |
573 | 0a111e7d | gaqhf | validationFailDocs.Add(document); |
574 | e613d0e8 | gaqhf | |
575 | 0d8062b2 | gaqhf | _DicDocuments[fileName] = document; |
576 | 1278ba59 | gaqhf | } |
577 | 0a111e7d | gaqhf | if (validationFailDocs.Count > 0) |
578 | { |
||
579 | MessageForm messageForm = new MessageForm(validationFailDocs); |
||
580 | messageForm.ShowDialog(); |
||
581 | } |
||
582 | 1278ba59 | gaqhf | } |
583 | 65a1ed4b | gaqhf | } |
584 | 17f2a3a7 | gaqhf | |
585 | 5a9396ae | humkyung | /// <summary> |
586 | /// 선택한 도면의 정보를 로딩한다 |
||
587 | /// </summary> |
||
588 | /// <param name="sender"></param> |
||
589 | /// <param name="e"></param> |
||
590 | 1278ba59 | gaqhf | private void btnRun_Click(object sender, EventArgs e) |
591 | { |
||
592 | d73c791c | gaqhf | Project_Info _ProjectInfo = Project_Info.GetInstance(); |
593 | SPPID_DBInfo _SPPIDInfo = SPPID_DBInfo.GetInstance(); |
||
594 | if (!_ProjectInfo.Enable || !_SPPIDInfo.Enable) |
||
595 | { |
||
596 | MessageBox.Show(Msg.PleaseSetProjectInfo, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
||
597 | return; |
||
598 | } |
||
599 | |||
600 | 6924abc6 | gaqhf | if (gridViewConverter.GetSelectedRows().Length == 0) |
601 | e0bb889b | gaqhf | { |
602 | MessageBox.Show(Msg.SelectDocument, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
||
603 | 6924abc6 | gaqhf | return; |
604 | e0bb889b | gaqhf | } |
605 | 154d8f43 | gaqhf | DataTable tDrawing = Project_DB.SelectDrawings(); |
606 | 5a9396ae | humkyung | this._Documents.Clear(); |
607 | 17f2a3a7 | gaqhf | foreach (int rowHandle in gridViewConverter.GetSelectedRows()) |
608 | { |
||
609 | string _FilePath = gridViewConverter.GetRowCellDisplayText(rowHandle, "colDrawingFilePath"); |
||
610 | string _Unit = gridViewConverter.GetRowCellDisplayText(rowHandle, "colUnit"); |
||
611 | string _Template = gridViewConverter.GetRowCellDisplayText(rowHandle, "colTemplate"); |
||
612 | string _DrawingNumber = gridViewConverter.GetRowCellDisplayText(rowHandle, "colDrawingNumber"); |
||
613 | string _DrawingName = gridViewConverter.GetRowCellDisplayText(rowHandle, "colDrawingName"); |
||
614 | 154d8f43 | gaqhf | |
615 | DataRow[] rows = tDrawing.Select(string.Format("NAME = '{0}'", Path.GetFileNameWithoutExtension(_FilePath) + ".png")); |
||
616 | if (rows.Length != 1) |
||
617 | continue; |
||
618 | |||
619 | 17f2a3a7 | gaqhf | SPPID_Document document = _DicDocuments[_FilePath]; |
620 | document.Unit = _Unit; |
||
621 | document.Template = _Template; |
||
622 | document.DrawingNumber = _DrawingNumber; |
||
623 | document.DrawingName = _DrawingName; |
||
624 | 154d8f43 | gaqhf | document.UID = rows[0]["UID"].ToString(); |
625 | 712860bb | gaqhf | |
626 | 4d2571ab | gaqhf | document.SymbolTable = _ID2SymbolTable; |
627 | 712860bb | gaqhf | document.SymbolMappings = symbolMappings; |
628 | document.ChildSymbolMappings = childSymbolMappings; |
||
629 | document.LineMappings = lineMappings; |
||
630 | document.LineNumberMappings = lineNumberMappings; |
||
631 | document.AttributeMappings = attributeMappings; |
||
632 | document.ETCSetting = ETCSetting.GetInstance(); |
||
633 | document.SetSPPIDInfo(); |
||
634 | |||
635 | e3e2d41f | gaqhf | if (document.SetSPPIDMapping() && document.Enable) |
636 | 5a9396ae | humkyung | this._Documents.Add(document); |
637 | 17f2a3a7 | gaqhf | } |
638 | 5dfb8a24 | gaqhf | |
639 | 154d8f43 | gaqhf | if (_Documents.Count > 50) |
640 | checkEditCloseDocument.Checked = true; |
||
641 | |||
642 | tDrawing.Dispose(); |
||
643 | d19ae675 | gaqhf | DialogResult = DialogResult.OK; |
644 | 96a2080c | gaqhf | } |
645 | 23eb98bf | gaqhf | |
646 | private void btnSPPIDDB_Click(object sender, EventArgs e) |
||
647 | { |
||
648 | SPPID_DB_SettingForm form = new SPPID_DB_SettingForm(); |
||
649 | if (form.ShowDialog() == DialogResult.OK) |
||
650 | fab4f207 | gaqhf | InitSPPIDDB(); |
651 | 23eb98bf | gaqhf | } |
652 | df4559fc | gaqhf | |
653 | private void btnItemMapping_Click(object sender, EventArgs e) |
||
654 | { |
||
655 | ec0c7045 | gaqhf | Project_Info _ProjectInfo = Project_Info.GetInstance(); |
656 | d73c791c | gaqhf | SPPID_DBInfo _SPPIDInfo = SPPID_DBInfo.GetInstance(); |
657 | if (!_ProjectInfo.Enable || !_SPPIDInfo.Enable) |
||
658 | df4559fc | gaqhf | { |
659 | d73c791c | gaqhf | MessageBox.Show(Msg.PleaseSetProjectInfo, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
660 | df4559fc | gaqhf | return; |
661 | } |
||
662 | |||
663 | 306a0af9 | gaqhf | MappingForm form = new MappingForm(_ID2SymbolDT,_SPPIDSymbolPathDT, _ID2LineDT, _ID2LinePropertyDT, _ID2AttributeDT, _SPPIDAttributeDT, _ID2DrawingAttributeDT); |
664 | df4559fc | gaqhf | form.ShowDialog(); |
665 | bca86986 | gaqhf | InitMapping(); |
666 | df4559fc | gaqhf | } |
667 | 4314b3f3 | gaqhf | private List<int> prevSelectedList = new List<int>(); |
668 | |||
669 | private void gridViewConverter_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e) |
||
670 | { |
||
671 | if (e.Action == CollectionChangeAction.Add) |
||
672 | { |
||
673 | string _Unit = gridViewConverter.GetRowCellDisplayText(e.ControllerRow, "colUnit"); |
||
674 | string _Template = gridViewConverter.GetRowCellDisplayText(e.ControllerRow, "colTemplate"); |
||
675 | |||
676 | if (string.IsNullOrEmpty(_Unit) || string.IsNullOrEmpty(_Template)) |
||
677 | gridViewConverter.UnselectRow(e.ControllerRow); |
||
678 | } |
||
679 | else if (e.Action == CollectionChangeAction.Refresh) |
||
680 | { |
||
681 | foreach (int rowHandle in gridViewConverter.GetSelectedRows()) |
||
682 | { |
||
683 | string _Unit = gridViewConverter.GetRowCellDisplayText(rowHandle, "colUnit"); |
||
684 | string _Template = gridViewConverter.GetRowCellDisplayText(rowHandle, "colTemplate"); |
||
685 | |||
686 | if (string.IsNullOrEmpty(_Unit) || string.IsNullOrEmpty(_Template)) |
||
687 | gridViewConverter.UnselectRow(rowHandle); |
||
688 | } |
||
689 | |||
690 | List<int> selectedRowHandleList = gridViewConverter.GetSelectedRows().ToList(); |
||
691 | var firstNotSecond = prevSelectedList.Except(selectedRowHandleList).ToList(); |
||
692 | var secondNotFirst = selectedRowHandleList.Except(prevSelectedList).ToList(); |
||
693 | 635a8747 | gaqhf | |
694 | 4314b3f3 | gaqhf | if (!firstNotSecond.Any() && !secondNotFirst.Any()) |
695 | { |
||
696 | this.gridViewConverter.SelectionChanged -= new DevExpress.Data.SelectionChangedEventHandler(this.gridViewConverter_SelectionChanged); |
||
697 | gridViewConverter.ClearSelection(); |
||
698 | this.gridViewConverter.SelectionChanged += new DevExpress.Data.SelectionChangedEventHandler(this.gridViewConverter_SelectionChanged); |
||
699 | } |
||
700 | } |
||
701 | |||
702 | prevSelectedList = gridViewConverter.GetSelectedRows().ToList(); |
||
703 | } |
||
704 | d73c791c | gaqhf | |
705 | private void buttonEditDefaulUnit_ButtonClick(object sender, ButtonPressedEventArgs e) |
||
706 | { |
||
707 | UnitForm unitForm = new UnitForm(_SPPIDUnitDT); |
||
708 | if (unitForm.ShowDialog() == DialogResult.OK) |
||
709 | { |
||
710 | buttonEditDefaultUnit.Text = unitForm.SelectedUnit; |
||
711 | } |
||
712 | } |
||
713 | 02a45794 | gaqhf | |
714 | private void btnRefresh_Click(object sender, EventArgs e) |
||
715 | { |
||
716 | List<BaseModel.Document> validationFailDocs = new List<BaseModel.Document>(); |
||
717 | Project_Info _ProjectInfo = Project_Info.GetInstance(); |
||
718 | SPPID_DBInfo _SPPIDInfo = SPPID_DBInfo.GetInstance(); |
||
719 | if (!_ProjectInfo.Enable || !_SPPIDInfo.Enable) |
||
720 | { |
||
721 | MessageBox.Show(Msg.PleaseSetProjectInfo, Msg.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
||
722 | return; |
||
723 | } |
||
724 | |||
725 | foreach (DataRow row in _ConverterDT.Rows) |
||
726 | { |
||
727 | string fileName = row["colDrawingFilePath"].ToString(); |
||
728 | 7e680366 | gaqhf | SPPID_Document document = new SPPID_Document(fileName, _ID2SymbolTypeDT); |
729 | 68e9394a | gaqhf | document.SymbolTable = _ID2SymbolTable; |
730 | document.SymbolMappings = symbolMappings; |
||
731 | document.ChildSymbolMappings = childSymbolMappings; |
||
732 | document.LineMappings = lineMappings; |
||
733 | document.LineNumberMappings = lineNumberMappings; |
||
734 | document.AttributeMappings = attributeMappings; |
||
735 | document.ETCSetting = ETCSetting.GetInstance(); |
||
736 | document.SetSPPIDInfo(); |
||
737 | |||
738 | |||
739 | if (!document.SetSPPIDMapping()) |
||
740 | { |
||
741 | document.Enable = false; |
||
742 | document.MappingValidation = false; |
||
743 | } |
||
744 | |||
745 | 02a45794 | gaqhf | row["colDrawingNumber"] = document.DWGNAME; |
746 | row["colDrawingName"] = document.DWGNAME; |
||
747 | if (document.Enable) |
||
748 | row["colStatus"] = "Ready"; |
||
749 | else |
||
750 | row["colStatus"] = "Error"; |
||
751 | |||
752 | if (!_DicDocuments.ContainsKey(fileName)) |
||
753 | _DicDocuments.Add(fileName, null); |
||
754 | |||
755 | 68e9394a | gaqhf | if (!document.Validation || !document.MappingValidation) |
756 | 02a45794 | gaqhf | validationFailDocs.Add(document); |
757 | |||
758 | _DicDocuments[fileName] = document; |
||
759 | 442bd51e | gaqhf | |
760 | if (document.Enable && document.Validation && document.MappingValidation) |
||
761 | gridViewConverter.SelectRow(gridViewConverter.GetRowHandle(_ConverterDT.Rows.IndexOf(row))); |
||
762 | 02a45794 | gaqhf | } |
763 | |||
764 | |||
765 | if (validationFailDocs.Count > 0) |
||
766 | { |
||
767 | MessageForm messageForm = new MessageForm(validationFailDocs); |
||
768 | messageForm.ShowDialog(); |
||
769 | } |
||
770 | } |
||
771 | 12b7a2a8 | gaqhf | |
772 | private void buttonEditDefaultUnit_TextChanged(object sender, EventArgs e) |
||
773 | { |
||
774 | Settings.Default.DefaultUnit = buttonEditDefaultUnit.Text; |
||
775 | Settings.Default.Save(); |
||
776 | } |
||
777 | |||
778 | private void comboBoxEditDefaultTemplate_SelectedIndexChanged(object sender, EventArgs e) |
||
779 | { |
||
780 | Settings.Default.DefaultTemplate = comboBoxEditDefaultTemplate.SelectedItem.ToString(); |
||
781 | Settings.Default.Save(); |
||
782 | } |
||
783 | 8847ea67 | gaqhf | |
784 | |||
785 | 96a2080c | gaqhf | } |
786 | } |