프로젝트

일반

사용자정보

통계
| 개정판:

hytos / DTI_PID / ID2PSN / Form / EquipmentSetting.cs @ 0d8516d2

이력 | 보기 | 이력해설 | 다운로드 (22 KB)

1 f2a63376 이지연
using DevExpress.Utils.Drawing;
2
using DevExpress.XtraEditors.Controls;
3
using DevExpress.XtraEditors.Repository;
4
using DevExpress.XtraGrid.Columns;
5
using DevExpress.XtraGrid.Views.Grid;
6
using System;
7
using System.Collections.Generic;
8
using System.ComponentModel;
9
using System.Data;
10
using System.Drawing;
11
using System.IO;
12
using System.Linq;
13
using System.Text;
14
using System.Threading.Tasks;
15
using System.Windows.Forms;
16
17
namespace ID2PSN
18
{
19
    public partial class EquipmentSetting : DevExpress.XtraBars.Ribbon.RibbonForm
20
    {
21
        ID2Info ID2Info = ID2Info.GetInstance();
22
        List<EquipmentNoPocketInfo> EquipmentNoPocketInfos = new List<EquipmentNoPocketInfo>();
23
        EquipmentNoPocketInfo currentEquipmentNoPocketInfo = null;
24
        private RepositoryItemComboBox repositoryGroupType = new RepositoryItemComboBox();
25
26
        List<EquipmentAirFinCoolerInfo> EquipmentAirFinCoolerInfos = new List<EquipmentAirFinCoolerInfo>();
27
        EquipmentAirFinCoolerInfo currentEquipmentAirFinCoolerInfo = null;
28
        private RepositoryItemComboBox repositoryGroupType2 = new RepositoryItemComboBox();
29
30 284fa2c9 이지연
        private RepositoryItemComboBox repositoryAttributeItem = new RepositoryItemComboBox();
31
        private DataTable SymbolList = new DataTable();
32 f2a63376 이지연
        public EquipmentSetting()
33
        {
34
            InitializeComponent();
35
36
            InitGridEquipmentNoPocket();
37
            InitGridEquipmentAirFinCooler();
38
39 284fa2c9 이지연
            gridViewAirFinCooler.CellValueChanging += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(gridViewSymbol_CellValueChanged);
40
41 f2a63376 이지연
            EquipmentNoPocketInfos = new List<EquipmentNoPocketInfo>();
42
            currentEquipmentNoPocketInfo = new EquipmentNoPocketInfo();
43
44
            EquipmentAirFinCoolerInfos = new List<EquipmentAirFinCoolerInfo>();
45
            currentEquipmentAirFinCoolerInfo = new EquipmentAirFinCoolerInfo();
46
47
            InitData();
48
            InitAirFinCoolerData();
49
        }
50
51 284fa2c9 이지연
        private void gridViewSymbol_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
52 7d6d1693 이지연
        {            
53 284fa2c9 이지연
            if (e.Column.FieldName == "Type")
54
            {
55
                DevExpress.XtraGrid.Views.Base.ColumnView columnView = sender as DevExpress.XtraGrid.Views.Base.ColumnView;
56
                if (!string.IsNullOrEmpty(e.Value.ToString()))
57
                {
58
                    string selectItem = e.Value.ToString();
59
                    if (selectItem.Contains("Air Fin Cooler"))
60
                    {
61 7d6d1693 이지연
                        gridViewAirFinCooler.SetRowCellValue(columnView.FocusedRowHandle, "TagIdentifier", "AFC");
62 284fa2c9 이지연
                    }
63
                    else if (selectItem.Contains("Pump"))
64
                    {
65 7d6d1693 이지연
                        gridViewAirFinCooler.SetRowCellValue(columnView.FocusedRowHandle, "TagIdentifier", "PUMP");
66
                    }                    
67 284fa2c9 이지연
                }
68
            }
69
        }
70
71 f2a63376 이지연
        public void InitGridEquipmentNoPocket()
72
        {
73
            RepositoryItemButtonEdit btnRemove = new RepositoryItemButtonEdit();
74
            btnRemove.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
75
            btnRemove.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(removeSymbolButton_Click);
76
            btnRemove.Buttons[0].Kind = DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph;
77
            btnRemove.Buttons[0].ImageOptions.Image = ID2PSN.Properties.Resources.cancel_16x16;
78
79
            gridEquipment.RepositoryItems.Add(btnRemove);
80
81
            DataTable dtType = new DataTable();
82
            dtType.Columns.Add("Index");
83
            dtType.Columns.Add("Type");
84
            dtType.Columns.Add("SppidSymbolName");
85
            dtType.Columns.Add(" ");
86
            gridEquipment.DataSource = dtType;
87
88
            GridColumn gridColumn = gridViewEquipment.Columns[0];
89
90
91
            gridColumn.Name = "Index";
92
            gridColumn.Caption = "Index";
93
            gridColumn.OptionsColumn.AllowEdit = false;
94
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
95
            gridColumn.VisibleIndex = 0;
96
97
            repositoryGroupType = new RepositoryItemComboBox();
98 91c75c0b 이지연
            repositoryGroupType.Items.AddRange(new string[] { "Pump", "Vertical Vessel" });
99 f2a63376 이지연
            repositoryGroupType.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
100
101
            gridEquipment.RepositoryItems.Add(repositoryGroupType);
102
            gridColumn = gridViewEquipment.Columns[1];
103
            gridColumn.Name = "Type";
104
            gridColumn.Caption = "Equipment Type";
105
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
106
            gridColumn.VisibleIndex = 1;
107
            gridViewEquipment.Columns["Type"].ColumnEdit = repositoryGroupType;
108
109
            gridColumn = gridViewEquipment.Columns[2];
110
            gridColumn.Name = "SppidSymbolName";
111
            gridColumn.Caption = "ID2 Symbol Name";
112
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
113
            gridColumn.VisibleIndex = 2;
114
115
            RepositoryItemTreeListLookUpEdit treeListLookUpEdit = new RepositoryItemTreeListLookUpEdit();
116
            gridEquipment.RepositoryItems.Add(treeListLookUpEdit);
117
            SetSymbol(treeListLookUpEdit);
118
119
            gridViewEquipment.Columns["SppidSymbolName"].ColumnEdit = treeListLookUpEdit;
120
121
            gridColumn = gridViewEquipment.Columns[3];
122
            gridColumn.Name = "Remove";
123
            gridColumn.Caption = "";
124
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
125
            gridColumn.VisibleIndex = 3;
126
            gridColumn.MaxWidth = 16;
127
128
            gridColumn.ColumnEdit = btnRemove;
129
            gridColumn.ShowButtonMode = DevExpress.XtraGrid.Views.Base.ShowButtonModeEnum.ShowAlways;
130
        }
131
132
        public void InitGridEquipmentAirFinCooler()
133
        {
134
            RepositoryItemButtonEdit btnRemove = new RepositoryItemButtonEdit();
135
            btnRemove.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.HideTextEditor;
136
            btnRemove.ButtonClick += new DevExpress.XtraEditors.Controls.ButtonPressedEventHandler(removeAirSymbolButton_Click);
137
            btnRemove.Buttons[0].Kind = DevExpress.XtraEditors.Controls.ButtonPredefines.Glyph;
138
            btnRemove.Buttons[0].ImageOptions.Image = ID2PSN.Properties.Resources.cancel_16x16;
139
140
            gridControlAirFinCooler.RepositoryItems.Add(btnRemove);
141
142
            DataTable dtType = new DataTable();
143
            dtType.Columns.Add("Index");
144
            dtType.Columns.Add("Type");
145 284fa2c9 이지연
            dtType.Columns.Add("TagIdentifier");
146
            dtType.Columns.Add("AttributeName");
147 f2a63376 이지연
            dtType.Columns.Add("SppidSymbolName");
148
            dtType.Columns.Add(" ");
149
            gridControlAirFinCooler.DataSource = dtType;
150
151
            GridColumn gridColumn = gridViewAirFinCooler.Columns[0];
152
153
            gridColumn.Name = "Index";
154
            gridColumn.Caption = "Index";
155
            gridColumn.OptionsColumn.AllowEdit = false;
156
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
157
            gridColumn.VisibleIndex = 0;
158
159
            repositoryGroupType2 = new RepositoryItemComboBox();
160
            repositoryGroupType2.Items.AddRange(new string[] { "Air Fin Cooler", "Pump" });
161
            repositoryGroupType2.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
162
            gridControlAirFinCooler.RepositoryItems.Add(repositoryGroupType2);
163
            gridColumn = gridViewAirFinCooler.Columns[1];
164
            gridColumn.Name = "Type";
165
            gridColumn.Caption = "Equipment Type";
166
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
167
            gridColumn.VisibleIndex = 1;
168
            gridViewAirFinCooler.Columns["Type"].ColumnEdit = repositoryGroupType2;
169
170
            gridColumn = gridViewAirFinCooler.Columns[2];
171 284fa2c9 이지연
            gridColumn.Name = "TagIdentifier";
172
            gridColumn.Caption = "Prefix";
173
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
174
            gridColumn.VisibleIndex = 2;
175
176
            repositoryAttributeItem.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor;
177
            repositoryAttributeItem.AppearanceDropDown.Font = Font;
178
            gridControlAirFinCooler.RepositoryItems.Add(repositoryAttributeItem);
179
180
            gridColumn = gridViewAirFinCooler.Columns[3];
181
            gridColumn.Name = "AttributeName";
182
            gridColumn.Caption = "ID2 Attribute Name";
183
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
184
            gridColumn.VisibleIndex = 3;
185
            gridViewAirFinCooler.Columns["AttributeName"].ColumnEdit = repositoryAttributeItem;
186
187
            gridColumn = gridViewAirFinCooler.Columns[4];
188 f2a63376 이지연
            gridColumn.Name = "SppidSymbolName";
189
            gridColumn.Caption = "ID2 Symbol Name";
190
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
191 284fa2c9 이지연
            gridColumn.VisibleIndex = 4;
192
193
            SymbolList = DB.SelectAllSymbolAttribute();
194 f2a63376 이지연
195
            RepositoryItemTreeListLookUpEdit treeListLookUpEdit = new RepositoryItemTreeListLookUpEdit();
196
            gridControlAirFinCooler.RepositoryItems.Add(treeListLookUpEdit);
197
            SetSymbol(treeListLookUpEdit);
198
199
            gridViewAirFinCooler.Columns["SppidSymbolName"].ColumnEdit = treeListLookUpEdit;
200
201 284fa2c9 이지연
            gridColumn = gridViewAirFinCooler.Columns[5];
202 f2a63376 이지연
            gridColumn.Name = "Remove";
203
            gridColumn.Caption = "";
204
            gridColumn.OptionsColumn.AllowSort = DevExpress.Utils.DefaultBoolean.False;
205 284fa2c9 이지연
            gridColumn.VisibleIndex = 5;
206 f2a63376 이지연
            gridColumn.MaxWidth = 16;
207
208
            gridColumn.ColumnEdit = btnRemove;
209
            gridColumn.ShowButtonMode = DevExpress.XtraGrid.Views.Base.ShowButtonModeEnum.ShowAlways;
210 284fa2c9 이지연
            gridViewAirFinCooler.CustomRowCellEditForEditing += GridViewAirFinCooler_CustomRowCellEditForEditing;
211
        }
212
213 7d6d1693 이지연
214 284fa2c9 이지연
        private void GridViewAirFinCooler_CustomRowCellEditForEditing(object sender, CustomRowCellEditEventArgs e)
215
        {
216
            if (e.Column == (sender as GridView).Columns["AttributeName"])
217
            {
218
                DevExpress.XtraGrid.Views.Base.ColumnView columnView = sender as DevExpress.XtraGrid.Views.Base.ColumnView;
219
                DataTable dt = gridControlAirFinCooler.DataSource as DataTable;
220
                string SppidSymbolName = dt.Rows[columnView.FocusedRowHandle]["SppidSymbolName"].ToString();
221
222
                if (string.IsNullOrEmpty(SppidSymbolName))
223
                {
224
                    MessageBox.Show("Choose a symbol !", "ID2 " + ID2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Information);
225
                    return;
226
                }
227
228
                repositoryAttributeItem.Items.Clear();
229
                repositoryAttributeItem.Items.Add("");
230
                foreach (DataRow dr in SymbolList.Rows)
231
                {
232
                    if (dr["SymbolName"].ToString().ToUpper().Equals(SppidSymbolName.ToUpper()))
233
                    {
234
                        repositoryAttributeItem.Items.Add(dr["SymbolAttribute"].ToString());
235
                    }
236
                }
237
            }
238 f2a63376 이지연
        }
239
240
        private void GridViewKeyword_CustomDrawColumnHeader(object sender, ColumnHeaderCustomDrawEventArgs e)
241
        {
242
            if (e.Column == null || (e.Column.AppearanceHeader.BackColor == Color.Empty && !e.Column.AppearanceHeader.Options.UseBackColor))
243
244
                return;
245
246
            Rectangle rect = e.Bounds;
247
248
            rect.Inflate(-1, -1);
249
250
            // Fill the title color.
251
252
            e.Graphics.FillRectangle(new SolidBrush(e.Column.AppearanceHeader.BackColor), rect);
253
254
            e.Appearance.DrawString(e.Cache, e.Info.Caption, e.Info.CaptionRect);
255
256
            // Draw filter and sort buttons.
257
258
            foreach (DrawElementInfo info in e.Info.InnerElements)
259
260
            {
261
262
                if (!info.Visible) continue;
263
264
                ObjectPainter.DrawObject(e.Cache, info.ElementPainter, info.ElementInfo);
265
266
            }
267
268
            e.Handled = true;
269
        }
270
271
        public void InitData()
272
        {
273
            DataTable dt = DB.SelectEquipmentNoPocketSetting();
274
            DataTable typeDT = gridEquipment.DataSource as DataTable;
275
            foreach (DataRow row in dt.Rows)
276
            {
277
                int index = Convert.ToInt32(row["INDEX"]);
278
                string Type = row["TYPE"].ToString();
279
                string SppidSymbolName = row["NAME"].ToString();
280
281
                typeDT.Rows.Add(index, Type, SppidSymbolName, null);
282
            }
283 7d6d1693 이지연
           // typeDT.DefaultView.Sort = "INDEX ASC";
284
            
285 f2a63376 이지연
        }
286
287
        public void InitAirFinCoolerData()
288
        {
289
            DataTable dt = DB.SelectAirFinCoolerSetting();
290 91c75c0b 이지연
            DataTable typeDT = gridControlAirFinCooler.DataSource as DataTable;
291 f2a63376 이지연
            foreach (DataRow row in dt.Rows)
292
            {
293
                int index = Convert.ToInt32(row["INDEX"]);
294
                string Type = row["TYPE"].ToString();
295 284fa2c9 이지연
                string TagIdentifier = row["TagIdentifier"].ToString();
296
                string AttributeName = row["AttributeName"].ToString();
297 f2a63376 이지연
                string SppidSymbolName = row["NAME"].ToString();
298
299 284fa2c9 이지연
                typeDT.Rows.Add(index, Type, TagIdentifier, AttributeName, SppidSymbolName, null);
300 f2a63376 이지연
            }
301 7d6d1693 이지연
           // typeDT.DefaultView.Sort = "INDEX ASC";
302 f2a63376 이지연
        }
303
304
        private void removeSymbolButton_Click(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
305
        {
306
            DataTable dt = gridEquipment.DataSource as DataTable;
307
            DataRow rows = dt.Rows[gridViewEquipment.FocusedRowHandle];
308
            if (rows != null)
309
                dt.Rows.Remove(rows);
310
        }
311
312
        private void removeAirSymbolButton_Click(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
313
        {
314
            DataTable dt = gridControlAirFinCooler.DataSource as DataTable;
315
            DataRow rows = dt.Rows[gridViewAirFinCooler.FocusedRowHandle];
316
            if (rows != null)
317
                dt.Rows.Remove(rows);
318
        }
319
320
        public void SetSymbol(RepositoryItemTreeListLookUpEdit treeListLookUpEdit)
321
        {
322
            string imgPath = ID2Info.ImageDirPath;
323
            string[] filesPath = Directory.GetFiles(imgPath, "*.png", SearchOption.AllDirectories);
324
325
            DataTable dt = new DataTable();
326
            dt.Columns.Add("ID", typeof(int));
327
            dt.Columns.Add("ParentID", typeof(int));
328
            dt.Columns.Add("Name", typeof(string));
329
            dt.Columns.Add("Level", typeof(int));
330
            dt.Columns.Add("Image", typeof(Image));
331
            dt.PrimaryKey = new DataColumn[] { dt.Columns["ID"] };
332
333
            treeListLookUpEdit.DataSource = dt;
334
            treeListLookUpEdit.ValueMember = "Name";
335
            treeListLookUpEdit.DisplayMember = "Name";
336
            treeListLookUpEdit.TreeList.Columns["Level"].Visible = false;
337
            treeListLookUpEdit.NullText = "";
338
339
            treeListLookUpEdit.EditValueChanging += new DevExpress.XtraEditors.Controls.ChangingEventHandler(TreeList_BeforeCheckNode);
340
341
            treeListLookUpEdit.BestFitMode = DevExpress.XtraEditors.Controls.BestFitMode.BestFitResizePopup;
342
343
            bool bLine = true;
344
            List<string> level1Index = new List<string>();
345
            foreach (var path in filesPath)
346
            {
347
                if (Path.GetFileNameWithoutExtension(path).Contains("_display"))
348
                    continue;
349
350
                string root = path.Remove(0, imgPath.Length);
351
                string[] split = root.Split(new string[] { @"\" }, StringSplitOptions.None);
352
                string level1 = split[0];
353
                if (!level1Index.Contains(level1))
354
                {
355
                    level1Index.Add(level1);
356
                    dt.Rows.Add(level1Index.IndexOf(level1) + 1, 0, level1, 0);
357
                }
358
359
                int parentId = level1Index.IndexOf(level1) + 1;
360
                string level2 = split[1];
361
                //combobox image size 변경
362
                Image image = Image.FromFile(Path.Combine(imgPath, root));
363
                Bitmap imgbitmap = new Bitmap(image);
364
                Image resizedImage = resizeImage(imgbitmap, new Size(200, 200));
365
366
                dt.Rows.Add(filesPath.ToList().IndexOf(path) + 10000, parentId, Path.GetFileNameWithoutExtension(path), 1, resizedImage);
367
368 bd86dd48 이지연
                //if (Path.GetFileNameWithoutExtension(path) == "Connect To Process" && bLine)
369
                if(bLine)
370 f2a63376 이지연
                {
371
                    bLine = false;
372 9bb7a028 이지연
                    dt.Rows.Add(filesPath.ToList().IndexOf(path) + 20000, parentId, "Primary", 1, null);
373
                    dt.Rows.Add(filesPath.ToList().IndexOf(path) + 30000, parentId, "Secondary", 1, null);
374 f2a63376 이지연
                }
375
            }
376
        }
377
378
        public static Image resizeImage(Image imgToResize, Size size)
379
        {
380
            return (Image)(new Bitmap(imgToResize, size));
381
        }
382
383
        private void btnAddSymbol_Click(object sender, EventArgs e)
384
        {
385
            if (currentEquipmentNoPocketInfo == null)
386
            {
387
                currentEquipmentNoPocketInfo = new EquipmentNoPocketInfo();
388
            }
389
390
            DataTable dt = gridEquipment.DataSource as DataTable;
391
            dt.Rows.Add(dt.Rows.Count + 1, null, null, null);
392
            gridViewEquipment.Columns["Index"].BestFit();
393
        }
394
395
        private void btnAddAirSymbol_Click(object sender, EventArgs e)
396
        {
397
            if (currentEquipmentAirFinCoolerInfo == null)
398
            {
399
                currentEquipmentAirFinCoolerInfo = new EquipmentAirFinCoolerInfo();
400
            }
401
402
            DataTable dt = gridControlAirFinCooler.DataSource as DataTable;
403 284fa2c9 이지연
            dt.Rows.Add(dt.Rows.Count + 1, null, null, null, null, null);
404 f2a63376 이지연
            gridViewAirFinCooler.Columns["Index"].BestFit();
405
        }
406
407
        public void ReNumbering(EquipmentNoPocketInfo equipmentNoPocketInfo)
408
        {
409
            DataTable dt = gridEquipment.DataSource as DataTable;
410
            equipmentNoPocketInfo.EquipmentNoPocketItem.Clear();
411
            for (int i = 0; i < dt.Rows.Count; i++)
412
            {
413
                DataRow row = dt.Rows[i];
414
                row["Index"] = i + 1;
415
                equipmentNoPocketInfo.EquipmentNoPocketItem.Add(new EquipmentNoPocketItem()
416
                {
417
                    Index = i + 1,
418
                    Type = row["Type"].ToString(),
419
                    Name = row["SppidSymbolName"].ToString()
420
                });
421
            }
422
        }
423
424
        public void ReNumberingAir(EquipmentAirFinCoolerInfo equipmentAirFinCoolerInfo)
425
        {
426
            DataTable dt = gridControlAirFinCooler.DataSource as DataTable;
427
            equipmentAirFinCoolerInfo.EquipmentAirFinCoolerItem.Clear();
428
            for (int i = 0; i < dt.Rows.Count; i++)
429
            {
430
                DataRow row = dt.Rows[i];
431
                row["Index"] = i + 1;
432
                equipmentAirFinCoolerInfo.EquipmentAirFinCoolerItem.Add(new EquipmentAirFinCoolerItem()
433
                {
434
                    Index = i + 1,
435
                    Type = row["Type"].ToString(),
436 284fa2c9 이지연
                    TagIdentifier = row["TagIdentifier"].ToString(),
437
                    AttributeName = row["AttributeName"].ToString(),
438 f2a63376 이지연
                    Name = row["SppidSymbolName"].ToString()
439
                });
440
            }
441
        }
442
443
444
445
        private void TreeList_BeforeCheckNode(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e)
446
        {
447
            DevExpress.XtraEditors.TreeListLookUpEdit treeListLookUpEdit = sender as DevExpress.XtraEditors.TreeListLookUpEdit;
448
            if (treeListLookUpEdit.Properties.TreeList.FocusedNode == null)
449
                return;
450
451
            if (treeListLookUpEdit.Properties.TreeList.FocusedNode.Level == 0)
452
                e.Cancel = true;
453
454
455
        }
456
457
        private void btnSave_Click(object sender, EventArgs e)
458
        {
459
            if (currentEquipmentNoPocketInfo == null)
460
            {
461
                currentEquipmentNoPocketInfo = new EquipmentNoPocketInfo();
462
            }
463
464
            if (currentEquipmentAirFinCoolerInfo == null)
465
            {
466
                currentEquipmentAirFinCoolerInfo = new EquipmentAirFinCoolerInfo();
467
            }
468
469
            ReNumbering(currentEquipmentNoPocketInfo);
470
            ReNumberingAir(currentEquipmentAirFinCoolerInfo);
471
            if (currentEquipmentNoPocketInfo.EquipmentNoPocketItem.Find(x => x.Type == string.Empty || x.Name == string.Empty) != null)
472
            {
473
                MessageBox.Show("Please save after entering data.", "ID2 " + ID2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
474
                return;
475
            }
476
477 284fa2c9 이지연
            if (currentEquipmentAirFinCoolerInfo.EquipmentAirFinCoolerItem.Find(x => x.TagIdentifier == string.Empty || x.AttributeName == string.Empty || x.Name == string.Empty) != null)
478
            {
479
                IEnumerable<EquipmentAirFinCoolerItem> lstafc = currentEquipmentAirFinCoolerInfo.EquipmentAirFinCoolerItem.Where(x => x.TagIdentifier == string.Empty || x.AttributeName == string.Empty || x.Name == string.Empty);
480
                //Scope Break
481
                foreach (EquipmentAirFinCoolerItem vg in lstafc)
482
                {
483
                    if(vg.Type == string.Empty || vg.Name == string.Empty)
484
                    {
485
                        MessageBox.Show("Please save after entering data.", "ID2 " + ID2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
486
                        return;
487
                    }
488
                }
489
            }
490
            
491 f2a63376 이지연
            if (DB.SaveEquipmentNopocketSetting(currentEquipmentNoPocketInfo.EquipmentNoPocketItem) &&
492
                DB.SaveAirFinCoolerSetting(currentEquipmentAirFinCoolerInfo.EquipmentAirFinCoolerItem))
493
                MessageBox.Show("Save was successful", "ID2 " + ID2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Information);
494
            else
495
                MessageBox.Show("Failed to save", "ID2 " + ID2Info.ProgramName, MessageBoxButtons.OK, MessageBoxIcon.Warning);
496
497
498
        }
499
500
        private void btnClose_Click(object sender, EventArgs e)
501
        {
502
            DialogResult = DialogResult.Cancel;
503
        }
504
    }
505
}
클립보드 이미지 추가 (최대 크기: 500 MB)