hytos / ID2.Manager / ID2.Manager.Compare / Main.cs @ 1620ca9c
이력 | 보기 | 이력해설 | 다운로드 (22.5 KB)
1 | 13a36357 | humkyung | 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 | |||
11 | using System.IO; |
||
12 | using System.Reflection; |
||
13 | using System.Diagnostics; |
||
14 | |||
15 | using ID2.Manager.Controls; |
||
16 | using ID2.Manager.Classes; |
||
17 | |||
18 | using Telerik.WinControls; |
||
19 | using Telerik.WinControls.UI; |
||
20 | |||
21 | namespace ID2.Manager |
||
22 | { |
||
23 | public partial class Main : RadRibbonForm |
||
24 | { |
||
25 | protected override CreateParams CreateParams |
||
26 | { |
||
27 | get |
||
28 | { |
||
29 | CreateParams cp = base.CreateParams; |
||
30 | cp.ExStyle |= 0x02000000; |
||
31 | return cp; |
||
32 | } |
||
33 | } |
||
34 | |||
35 | //#if DEBUG |
||
36 | // Telerik.WinControls.RadControlSpy.RadControlSpyForm radControlSpyForm = new Telerik.WinControls.RadControlSpy.RadControlSpyForm(); |
||
37 | //#endif |
||
38 | private readonly Color _SummaryColor = Color.FromArgb(255, 108, 55); |
||
39 | |||
40 | public Main() |
||
41 | { |
||
42 | InitializeComponent(); |
||
43 | var verification = new Controls.Verification(this.radProgressBarElement) { Dock = DockStyle.Fill }; |
||
44 | this.LayoutValidation.Controls.Add(verification); |
||
45 | this.DockMainTabStrip.Select(); |
||
46 | |||
47 | var appDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), Application.ProductName); |
||
48 | |||
49 | if (!Directory.Exists(appDataPath)) |
||
50 | { |
||
51 | Directory.CreateDirectory(appDataPath); |
||
52 | } |
||
53 | |||
54 | #region 테마 설정 |
||
55 | this.radMenuItemControlDefault.Click += RadMenuItemTheme_Click; |
||
56 | this.radMenuItemOffice2013Dark.Click += RadMenuItemTheme_Click; |
||
57 | this.radMenuItemTelerikMetro.Click += RadMenuItemTheme_Click; |
||
58 | this.radMenuItemVisualStudio2012Dark.Click += RadMenuItemTheme_Click; |
||
59 | this.radMenuItemVisualStudio2012Light.Click += RadMenuItemTheme_Click; |
||
60 | this.radMenuItemWindows8.Click += RadMenuItemTheme_Click; |
||
61 | #endregion |
||
62 | |||
63 | this.Initialize(); |
||
64 | } |
||
65 | |||
66 | /// <summary> |
||
67 | /// 사용자가 선택한 테마를 적용한다. |
||
68 | /// </summary> |
||
69 | /// <param name="sender"></param> |
||
70 | /// <param name="e"></param> |
||
71 | private void RadMenuItemTheme_Click(object sender, EventArgs e) |
||
72 | { |
||
73 | string theme = (sender as RadMenuItem).Text; |
||
74 | if(theme != this.radDropDownButtonElementTheme.Text) |
||
75 | { |
||
76 | this.radDropDownButtonElementTheme.Text = theme; |
||
77 | Classes.ID2Helper.IniWriteValue(Program.IniFilePath, "App", "Theme", theme); |
||
78 | if (!string.IsNullOrEmpty(theme)) |
||
79 | { |
||
80 | Telerik.WinControls.ThemeResolutionService.ApplicationThemeName = theme; |
||
81 | Program.ThemeName = theme; |
||
82 | } |
||
83 | } |
||
84 | } |
||
85 | |||
86 | #region Init, Load |
||
87 | private void Initialize() |
||
88 | { |
||
89 | this.ID2ManagerRadRibbonBar.Expanded = false; |
||
90 | } |
||
91 | |||
92 | protected override void OnLoad(EventArgs e) |
||
93 | { |
||
94 | try |
||
95 | { |
||
96 | 3f59180e | humkyung | this.Text = $"ID2.Manager.Compare - V {Application.ProductVersion}"; |
97 | |||
98 | 13a36357 | humkyung | #region 테마를 읽어 적용 |
99 | string theme = Classes.ID2Helper.IniReadValue(Program.IniFilePath, "App", "Theme"); |
||
100 | if (!string.IsNullOrEmpty(theme)) |
||
101 | { |
||
102 | Telerik.WinControls.ThemeResolutionService.ApplicationThemeName = theme; |
||
103 | Program.ThemeName = theme; |
||
104 | } |
||
105 | #endregion |
||
106 | |||
107 | this.radDropDownButtonElementTheme.Text = Program.ThemeName; |
||
108 | this.radBrowseEditorAutoCADFolder.ValueChanged += RadBrowseEditorAutoCADFolder_ValueChanged; |
||
109 | this.radBrowseEditorAVEVAFolder.ValueChanged += RadBrowseEditorAVEVAFolder_ValueChanged; |
||
110 | this.radGridViewDocument.DataBindingComplete += RadGridViewDocument_DataBindingComplete; |
||
111 | this.radGridViewDocument.ViewRowFormatting += RadGridViewDocument_ViewRowFormatting; |
||
112 | this.radButtonElementCompare.Click += RadButtonElementCompare_Click; |
||
113 | this.radButtonElementConfiguration.Click += RadButtonElementConfiguration_Click; |
||
114 | |||
115 | this.radButtonElementRefreshCommand.Click += RadButtonElementRefreshCommand_Click; |
||
116 | |||
117 | Program.AutoCADFolder = Classes.ID2Helper.IniReadValue(Program.IniFilePath, "Path", "AutoCAD Folder"); |
||
118 | if (!string.IsNullOrEmpty(Program.AutoCADFolder)) this.radBrowseEditorAutoCADFolder.Value = Program.AutoCADFolder; |
||
119 | |||
120 | Program.AVEVAPIDFolder = Classes.ID2Helper.IniReadValue(Program.IniFilePath, "Path", "AVEVA P&ID Folder"); |
||
121 | if (!string.IsNullOrEmpty(Program.AVEVAPIDFolder)) this.radBrowseEditorAVEVAFolder.Value = Program.AVEVAPIDFolder; |
||
122 | 54be6611 | humkyung | |
123 | eb9a2498 | humkyung | this.radGridViewDocument.CellClick += RadGridViewDocument_CellClick; |
124 | 54be6611 | humkyung | this.radGridViewDocument.SelectionChanged += RadGridViewDocument_SelectionChanged; |
125 | 13a36357 | humkyung | } |
126 | catch (Exception ex) |
||
127 | { |
||
128 | Program.logger.Error($"An exception occurred from {MethodBase.GetCurrentMethod().Name}", ex); |
||
129 | RadMessageBox.Show("Failed to load project.", Application.ProductName, MessageBoxButtons.OK, RadMessageIcon.Error); |
||
130 | } |
||
131 | |||
132 | base.OnLoad(e); |
||
133 | } |
||
134 | |||
135 | eb9a2498 | humkyung | private void RadGridViewDocument_CellClick(object sender, GridViewCellEventArgs e) |
136 | { |
||
137 | if (this.radGridViewDocument.SelectedRows.Any() && this.radGridViewDocument.SelectedRows[0].Equals(e.Row)) |
||
138 | { |
||
139 | this.Cursor = Cursors.WaitCursor; |
||
140 | try |
||
141 | { |
||
142 | var doc = this.radGridViewDocument.SelectedRows[0].DataBoundItem as Document; |
||
143 | |||
144 | var verification = this.LayoutValidation.Controls[0] as Controls.Verification; |
||
145 | verification.CompareDrawings(new List<Document>() { doc }); |
||
146 | } |
||
147 | finally |
||
148 | { |
||
149 | this.Cursor = Cursors.Default; |
||
150 | } |
||
151 | } |
||
152 | } |
||
153 | |||
154 | 54be6611 | humkyung | private void RadGridViewDocument_SelectionChanged(object sender, EventArgs e) |
155 | { |
||
156 | if (this.radGridViewDocument.SelectedRows.Any() && this.radGridViewDocument.SelectedRows[0].DataBoundItem is Document doc) |
||
157 | { |
||
158 | this.Cursor = Cursors.WaitCursor; |
||
159 | try |
||
160 | { |
||
161 | var verification = this.LayoutValidation.Controls[0] as Controls.Verification; |
||
162 | verification.CompareDrawings(new List<Document>() { doc }); |
||
163 | } |
||
164 | finally |
||
165 | { |
||
166 | this.Cursor = Cursors.Default; |
||
167 | } |
||
168 | } |
||
169 | } |
||
170 | |||
171 | 13a36357 | humkyung | /// <summary> |
172 | /// 도면 리스트를 갱신한다. |
||
173 | /// </summary> |
||
174 | /// <param name="sender"></param> |
||
175 | /// <param name="e"></param> |
||
176 | private void RadButtonElementRefreshCommand_Click(object sender, EventArgs e) |
||
177 | { |
||
178 | try |
||
179 | { |
||
180 | this.Cursor = Cursors.WaitCursor; |
||
181 | |||
182 | var AutoCADFiles = Directory.GetFiles(Program.AutoCADFolder, "*.dwg"); |
||
183 | var AVEVAFiles = Directory.GetFiles(Program.AVEVAPIDFolder, "*.dwg"); |
||
184 | |||
185 | MakeDocumentList(AutoCADFiles, AVEVAFiles); |
||
186 | } |
||
187 | finally |
||
188 | { |
||
189 | this.Cursor = Cursors.Default; |
||
190 | } |
||
191 | } |
||
192 | |||
193 | /// <summary> |
||
194 | /// 환경 설정 창을 띄운다. |
||
195 | /// </summary> |
||
196 | /// <param name="sender"></param> |
||
197 | /// <param name="e"></param> |
||
198 | private void RadButtonElementConfiguration_Click(object sender, EventArgs e) |
||
199 | { |
||
200 | using (var frm = new Forms.ExceptLayer()) |
||
201 | { |
||
202 | if (DialogResult.OK == frm.ShowDialog(this)) |
||
203 | { |
||
204 | string ExceptLayers = string.Join(",", Forms.ExceptLayer.ExceptLayers.Select(x => x.Name)); |
||
205 | Classes.ID2Helper.IniWriteValue(Program.IniFilePath, "Verification", "Except Layers", ExceptLayers); |
||
206 | |||
207 | string ExceptLayersVisible = string.Join(",", Forms.ExceptLayer.ExceptLayers.Select(x => x.Visible)); |
||
208 | Classes.ID2Helper.IniWriteValue(Program.IniFilePath, "Verification", "Except Layers Visible", ExceptLayersVisible); |
||
209 | 288ed615 | humkyung | |
210 | string LineLayers = string.Join(",", Forms.ExceptLayer.LineLayers.Select(x => x.Name)); |
||
211 | Classes.ID2Helper.IniWriteValue(Program.IniFilePath, "Verification", "Line Layers", LineLayers); |
||
212 | c4ba621d | humkyung | |
213 | Classes.ID2Helper.IniWriteValue(Program.IniFilePath, "Verification", "Length Tolerance Ratio", |
||
214 | Forms.ExceptLayer.LengthToleranceRatio.ToString()); |
||
215 | 51b9a24a | humkyung | |
216 | Classes.ID2Helper.IniWriteValue(Program.IniFilePath, "Verification", "Arrow Max Length", |
||
217 | Forms.ExceptLayer.ArrowMaxLength.ToString()); |
||
218 | 353b7f9f | humkyung | |
219 | string SpecialCharacters = string.Join(",", Forms.ExceptLayer.SpecialCharacters.Select(x => $"{x.Special}={x.Normal}")); |
||
220 | Classes.ID2Helper.IniWriteValue(Program.IniFilePath, "Verification", "SpecialCharacters", SpecialCharacters); |
||
221 | 13a36357 | humkyung | } |
222 | } |
||
223 | } |
||
224 | |||
225 | private void RadButtonElementCompare_Click(object sender, EventArgs e) |
||
226 | { |
||
227 | try |
||
228 | { |
||
229 | this.Cursor = Cursors.WaitCursor; |
||
230 | |||
231 | var docs = this.radGridViewDocument.Rows.Where(x => (x.DataBoundItem is Document doc) && doc.Checked). |
||
232 | Select(x => (x.DataBoundItem as Document)).ToList(); |
||
233 | var verification = this.LayoutValidation.Controls[0] as Controls.Verification; |
||
234 | verification.CompareDrawings(docs, true); |
||
235 | } |
||
236 | finally |
||
237 | { |
||
238 | this.Cursor = Cursors.Default; |
||
239 | } |
||
240 | } |
||
241 | |||
242 | private void RadGridViewDocument_ViewRowFormatting(object sender, RowFormattingEventArgs e) |
||
243 | { |
||
244 | if(e.RowElement is GridRowElement) |
||
245 | { |
||
246 | if (e.RowElement.RowInfo.DataBoundItem is Document doc) |
||
247 | { |
||
248 | if (!doc.IsValid) |
||
249 | { |
||
250 | e.RowElement.ForeColor = Color.Gray; |
||
251 | e.RowElement.Font = Program.UnmatchedFont; |
||
252 | } |
||
253 | else |
||
254 | { |
||
255 | e.RowElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local); |
||
256 | e.RowElement.Font = Program.MatchedFont; |
||
257 | } |
||
258 | } |
||
259 | } |
||
260 | else |
||
261 | { |
||
262 | e.RowElement.ResetValue(LightVisualElement.ForeColorProperty, ValueResetFlags.Local); |
||
263 | e.RowElement.ResetValue(LightVisualElement.FontProperty, ValueResetFlags.Local); |
||
264 | } |
||
265 | } |
||
266 | |||
267 | private void RadGridViewDocument_DataBindingComplete(object sender, GridViewBindingCompleteEventArgs e) |
||
268 | { |
||
269 | radGridViewDocument.BestFitColumns(); |
||
270 | } |
||
271 | |||
272 | private void RadBrowseEditorAVEVAFolder_ValueChanged(object sender, EventArgs e) |
||
273 | { |
||
274 | if(Directory.Exists(this.radBrowseEditorAVEVAFolder.Value)) |
||
275 | { |
||
276 | Program.AVEVAPIDFolder = this.radBrowseEditorAVEVAFolder.Value; |
||
277 | Classes.ID2Helper.IniWriteValue(Program.IniFilePath, "Path", "AVEVA P&ID Folder", Program.AVEVAPIDFolder); |
||
278 | |||
279 | var AVEVAFiles = Directory.GetFiles(Program.AVEVAPIDFolder, "*.dwg"); |
||
280 | |||
281 | var AutoCADFiles = new List<string>(); |
||
282 | if (Directory.Exists(this.radBrowseEditorAutoCADFolder.Value)) |
||
283 | { |
||
284 | AutoCADFiles.AddRange(Directory.GetFiles(this.radBrowseEditorAutoCADFolder.Value, "*.dwg")); |
||
285 | } |
||
286 | |||
287 | MakeDocumentList(AutoCADFiles, AVEVAFiles); |
||
288 | } |
||
289 | } |
||
290 | |||
291 | private void RadBrowseEditorAutoCADFolder_ValueChanged(object sender, EventArgs e) |
||
292 | { |
||
293 | if (Directory.Exists(this.radBrowseEditorAutoCADFolder.Value)) |
||
294 | { |
||
295 | Program.AutoCADFolder = this.radBrowseEditorAutoCADFolder.Value; |
||
296 | Classes.ID2Helper.IniWriteValue(Program.IniFilePath, "Path", "AutoCAD Folder", Program.AutoCADFolder); |
||
297 | |||
298 | var AutoCADFiles = Directory.GetFiles(Program.AutoCADFolder, "*.dwg"); |
||
299 | |||
300 | var AVEVAFiles = new List<string>(); |
||
301 | if (Directory.Exists(this.radBrowseEditorAVEVAFolder.Value)) |
||
302 | { |
||
303 | AVEVAFiles.AddRange(Directory.GetFiles(this.radBrowseEditorAVEVAFolder.Value, "*.dwg")); |
||
304 | } |
||
305 | |||
306 | MakeDocumentList(AutoCADFiles, AVEVAFiles); |
||
307 | } |
||
308 | } |
||
309 | |||
310 | private void MakeDocumentList(IList<string> AutoCADFiles, IList<string> AVEVAFiles) |
||
311 | { |
||
312 | radGridViewDocument.DataSource = null; |
||
313 | |||
314 | Program.Documents.Clear(); |
||
315 | AutoCADFiles.ForAll(x => Program.Documents.Add(new Document(Path.GetFileNameWithoutExtension(x).ToUpper()) { AutoCADFileName = Path.GetFileNameWithoutExtension(x).ToUpper()})); |
||
316 | |||
317 | var addings = new List<Document>(); |
||
318 | foreach(var file in AVEVAFiles) |
||
319 | { |
||
320 | string FileName = Path.GetFileNameWithoutExtension(file).ToUpper(); |
||
321 | var doc = Program.Documents.Find(x => x.AutoCADFileName == FileName); |
||
322 | if(doc != null) |
||
323 | { |
||
324 | doc.AVEVAFileName = FileName; |
||
325 | } |
||
326 | else |
||
327 | { |
||
328 | addings.Add(new Document(FileName) { AVEVAFileName = FileName }); |
||
329 | } |
||
330 | } |
||
331 | |||
332 | addings.ForAll(x => Program.Documents.Add(x)); |
||
333 | |||
334 | radGridViewDocument.DataSource = Program.Documents; |
||
335 | } |
||
336 | #endregion |
||
337 | |||
338 | private void RadDropDownList_SelectedIndexChanged(object sender, Telerik.WinControls.UI.Data.PositionChangedEventArgs e) |
||
339 | { |
||
340 | if (sender is RadDropDownList ddl) |
||
341 | { |
||
342 | if (ddl.SelectedValue != null) |
||
343 | { |
||
344 | if (string.IsNullOrEmpty(ddl.SelectedValue.ToString())) |
||
345 | { |
||
346 | ddl.BackColor = Color.White; |
||
347 | ddl.ForeColor = Color.Black; |
||
348 | ddl.Font = new Font("Segoe UI", 8.25F, FontStyle.Regular); |
||
349 | } |
||
350 | else |
||
351 | { |
||
352 | ddl.BackColor = Color.DarkSlateBlue; |
||
353 | ddl.ForeColor = Color.Yellow; |
||
354 | ddl.Font = new Font("Segoe UI", 8.25F, FontStyle.Bold); |
||
355 | } |
||
356 | } |
||
357 | } |
||
358 | } |
||
359 | |||
360 | private void RadTextBoxDocumentNo_KeyUp(object sender, KeyEventArgs e) |
||
361 | { |
||
362 | if (sender is RadTextBox txtBox) |
||
363 | { |
||
364 | if (txtBox.Text.Length > 0) |
||
365 | { |
||
366 | txtBox.BackColor = Color.DarkSlateBlue; |
||
367 | txtBox.ForeColor = Color.Yellow; |
||
368 | txtBox.Font = new Font("Segoe UI", 8.25F, FontStyle.Bold); |
||
369 | } |
||
370 | else |
||
371 | { |
||
372 | txtBox.BackColor = Color.White; |
||
373 | txtBox.ForeColor = Color.Black; |
||
374 | txtBox.Font = new Font("Segoe UI", 8.25F, FontStyle.Regular); |
||
375 | } |
||
376 | } |
||
377 | } |
||
378 | |||
379 | /* |
||
380 | private void GetCheckedList() |
||
381 | { |
||
382 | RadGridView grid = this.radGridViewDocuments; |
||
383 | |||
384 | //var checkers = grid.Rows.Where(x => |
||
385 | //{ |
||
386 | // return x.Cells["Checked"].Value != null && Convert.ToBoolean(x.Cells["Checked"].Value); |
||
387 | //}).Select(x => x.DataBoundItem as Documents).ToList(); |
||
388 | |||
389 | //var viewRows = new Queue<GridViewRowInfo>(this.radGridViewDocuments.MasterTemplate.DataView.Where(x => x.Cells["spq"); |
||
390 | var viewRows = grid.MasterTemplate.DataView; |
||
391 | |||
392 | var checkers = viewRows.Where(x => |
||
393 | { |
||
394 | return x.Cells["Checked"].Value != null && Convert.ToBoolean(x.Cells["Checked"].Value); |
||
395 | }).ToList(); |
||
396 | |||
397 | var rows = new GridViewDataRowInfo[checkers.Count]; |
||
398 | checkers.CopyTo(rows, 0); |
||
399 | |||
400 | if (rows.Length > 0) |
||
401 | { |
||
402 | grid.BeginUpdate(); |
||
403 | |||
404 | int nLoop = 0; |
||
405 | rows.ForAll(x => |
||
406 | { |
||
407 | grid.Rows.Remove(rows[nLoop]); |
||
408 | nLoop++; |
||
409 | }); |
||
410 | |||
411 | grid.EndUpdate(); |
||
412 | } |
||
413 | |||
414 | |||
415 | //grid.Rows.re grid.Rows.ToList().Intersect(checkers) |
||
416 | |||
417 | |||
418 | //RadMessageBox.Show($"{checkers.Count()}", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info); |
||
419 | //RadMessageBox.Show($"{this.documents.Count}", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info); |
||
420 | this.lbSelectAndTotal.Text = $"{grid.MasterTemplate.DataView.Count} / {this.TotalCount} (Selected / Total)"; |
||
421 | } |
||
422 | */ |
||
423 | |||
424 | #region ColumnGroup |
||
425 | private void InitColumnGroupsViewDefinition(RadGridView gridView) |
||
426 | { |
||
427 | ColumnGroupsViewDefinition columnGroupsView = new ColumnGroupsViewDefinition(); |
||
428 | |||
429 | List<string> chkColNames = new List<string>() { "Checked" }; |
||
430 | |||
431 | List<string> docLinkColNames = new List<string>() { "AutoCADLink", "ID2Connection", "PDFLink", "MarkupLink", "AVEVALink", "Compare" }; |
||
432 | List<string> docInfoColNames = new List<string>() { "RefProjectCode", "System", "SubSystemCode", "DocumentNo", "PersonInCharge", "Worker", "AVEVAPersonInCharge", "AVEVAWorker", "JobLevel", "RevisonNo" }; |
||
433 | List<string> rvToColNames = new List<string>() { "ToIsDiscussion", "ToRemarks", "ToCreator", "ToCapture" }; |
||
434 | List<string> rvFrColNames = new List<string>() { "FrReviewStatus", "FrRemarks", "FrCreator", "FrCapture" }; |
||
435 | List<string> wkID2ColNames = new List<string>() { "ID2StartDate", "ID2EndDate", "ID2Status", "ID2Issues", "ID2Capture", "ReplyModifications", "ReplyRequester" }; |
||
436 | List<string> wkAVEVAColNames = new List<string>() { "IsConvert", "AVEVAConvertDate", "AVEVAWorkDate", "AVEVAStatus", "AVEVAIssues" }; |
||
437 | List<string> valProdColNames = new List<string>() { "AVEVAReviewDate", "ProdReviewer", "ProdIsResult", "ProdRemarks" }; |
||
438 | List<string> valCntColNames = new List<string>() { "ClientReviewer", "ClientIsResult", "ClientRemarks" }; |
||
439 | List<string> dtColNames = new List<string>() { "DTIsGateWay", "DTIsImport", "DTIsRegSystem", "DTRemarks" }; |
||
440 | |||
441 | //체크 |
||
442 | GridViewColumnGroup chkColGrp = new GridViewColumnGroup("√") { IsPinned = true }; |
||
443 | GridViewColumnGroupRow chkColGrpRow = new GridViewColumnGroupRow(); |
||
444 | chkColGrpRow.ColumnNames.AddRange(chkColNames); |
||
445 | chkColGrp.Rows.Add(chkColGrpRow); |
||
446 | |||
447 | //도면 |
||
448 | GridViewColumnGroup docColGrp = new GridViewColumnGroup("도면 "); |
||
449 | GridViewColumnGroup docLinkColGrp = new GridViewColumnGroup("프로그램 연동"); |
||
450 | GridViewColumnGroup docInfoColGrp = new GridViewColumnGroup("도면정보"); |
||
451 | |||
452 | GridViewColumnGroupRow docLinkColGrpRow = new GridViewColumnGroupRow(); |
||
453 | docLinkColGrpRow.ColumnNames.AddRange(docLinkColNames); |
||
454 | |||
455 | GridViewColumnGroupRow docInfoColGrpRow = new GridViewColumnGroupRow(); |
||
456 | docInfoColGrpRow.ColumnNames.AddRange(docInfoColNames); |
||
457 | |||
458 | docLinkColGrp.Rows.Add(docLinkColGrpRow); |
||
459 | docColGrp.Groups.Add(docLinkColGrp); |
||
460 | docInfoColGrp.Rows.Add(docInfoColGrpRow); |
||
461 | docColGrp.Groups.Add(docInfoColGrp); |
||
462 | |||
463 | //검토 |
||
464 | GridViewColumnGroup rvColGrp = new GridViewColumnGroup("검토", "review"); |
||
465 | GridViewColumnGroup rvToColGrp = new GridViewColumnGroup("도프텍"); |
||
466 | GridViewColumnGroup rvFrColGrp = new GridViewColumnGroup("삼성"); |
||
467 | |||
468 | GridViewColumnGroupRow rvToColGrpRow = new GridViewColumnGroupRow(); |
||
469 | rvToColGrpRow.ColumnNames.AddRange(rvToColNames); |
||
470 | |||
471 | GridViewColumnGroupRow rvFrColGrpRow = new GridViewColumnGroupRow(); |
||
472 | rvFrColGrpRow.ColumnNames.AddRange(rvFrColNames); |
||
473 | |||
474 | rvToColGrp.Rows.Add(rvToColGrpRow); |
||
475 | rvFrColGrp.Rows.Add(rvFrColGrpRow); |
||
476 | |||
477 | rvColGrp.Groups.Add(rvToColGrp); |
||
478 | rvColGrp.Groups.Add(rvFrColGrp); |
||
479 | |||
480 | //작업 |
||
481 | GridViewColumnGroup wkColGrp = new GridViewColumnGroup("작업", "work"); |
||
482 | GridViewColumnGroup wkID2ColGrp = new GridViewColumnGroup("ID2"); |
||
483 | GridViewColumnGroup wkAVEVAColGrp = new GridViewColumnGroup("AVEVA"); |
||
484 | |||
485 | GridViewColumnGroupRow wkID2ColGrpRow = new GridViewColumnGroupRow(); |
||
486 | wkID2ColGrpRow.ColumnNames.AddRange(wkID2ColNames); |
||
487 | |||
488 | GridViewColumnGroupRow wkAVEVAColGrpRow = new GridViewColumnGroupRow(); |
||
489 | wkAVEVAColGrpRow.ColumnNames.AddRange(wkAVEVAColNames); |
||
490 | |||
491 | wkID2ColGrp.Rows.Add(wkID2ColGrpRow); |
||
492 | wkAVEVAColGrp.Rows.Add(wkAVEVAColGrpRow); |
||
493 | |||
494 | wkColGrp.Groups.Add(wkID2ColGrp); |
||
495 | wkColGrp.Groups.Add(wkAVEVAColGrp); |
||
496 | |||
497 | //Validation |
||
498 | GridViewColumnGroup valColGrp = new GridViewColumnGroup("Validation", "validation"); |
||
499 | GridViewColumnGroup valProdColGrp = new GridViewColumnGroup("도프텍"); |
||
500 | GridViewColumnGroup valCntColGrp = new GridViewColumnGroup("삼성전자"); |
||
501 | |||
502 | GridViewColumnGroupRow valProdColGrpRow = new GridViewColumnGroupRow(); |
||
503 | valProdColGrpRow.ColumnNames.AddRange(valProdColNames); |
||
504 | |||
505 | GridViewColumnGroupRow valCntColGrpRow = new GridViewColumnGroupRow(); |
||
506 | valCntColGrpRow.ColumnNames.AddRange(valCntColNames); |
||
507 | |||
508 | valProdColGrp.Rows.Add(valProdColGrpRow); |
||
509 | valCntColGrp.Rows.Add(valCntColGrpRow); |
||
510 | |||
511 | valColGrp.Groups.Add(valProdColGrp); |
||
512 | valColGrp.Groups.Add(valCntColGrp); |
||
513 | |||
514 | //AVEVA Net |
||
515 | GridViewColumnGroup dtColGrp = new GridViewColumnGroup("AVEVA Net\n(Digital Twin)", "avevanet"); |
||
516 | |||
517 | GridViewColumnGroupRow dtColGrpRow = new GridViewColumnGroupRow(); |
||
518 | dtColGrpRow.ColumnNames.AddRange(dtColNames); |
||
519 | |||
520 | dtColGrp.Rows.Add(dtColGrpRow); |
||
521 | |||
522 | //Group 추가 |
||
523 | columnGroupsView.ColumnGroups.Add(chkColGrp); |
||
524 | columnGroupsView.ColumnGroups.Add(docColGrp); |
||
525 | columnGroupsView.ColumnGroups.Add(wkColGrp); |
||
526 | columnGroupsView.ColumnGroups.Add(rvColGrp); |
||
527 | columnGroupsView.ColumnGroups.Add(valColGrp); |
||
528 | columnGroupsView.ColumnGroups.Add(dtColGrp); |
||
529 | |||
530 | gridView.MasterTemplate.ViewDefinition = columnGroupsView; |
||
531 | } |
||
532 | #endregion |
||
533 | } |
||
534 | } |
||
535 | |||
536 | public class FilterColumn |
||
537 | { |
||
538 | public string Name { get; set; } |
||
539 | public string FieldName { get; set; } |
||
540 | public bool IsSelect { get; set; } |
||
541 | } |