프로젝트

일반

사용자정보

개정판 d2d4f84b

IDd2d4f84b9c1b89f53eb0847af908fc523ba319f0
상위 9f26701c
하위 53fde692

유성호이(가) 일년 이상 전에 추가함

issue #0000
- Excel Import/Export
- Excel Import 시 기존데이터는 그대로 두고 append만 가능하도록
- Excel Impor 시 유효성 체크(document no), excel 유효성 체크
- 저장
- Document 비교로직 추가

Change-Id: Iee4d385bc85eb9ea71b6d817a6462c0775eefe2d

차이점 보기:

ID2.Manager/ID2.Manager.Dapper/Repository/BaseRepository.cs
15 15
    public abstract class BaseRepository : IBaseRepository
16 16
    {
17 17
        protected readonly IDbConnection _DbConnection;//readonly 삭제해야하는지 확인
18
        protected IDbTransaction _DbTransaction = null;
18 19

  
19 20
        public SqlConnection DBConnection(string connectionStr)
20 21
        {
21 22
            return new SqlConnection(connectionStr);
22 23
        }
23 24

  
25
        public IDbTransaction BeginTransaction()
26
        {
27
            if (this._DbConnection.State != ConnectionState.Open)
28
            {
29
                this._DbConnection.Open();
30
            }
31

  
32
            return this._DbConnection.BeginTransaction();
33
        }
34

  
24 35
        public void Dispose()
25 36
        {
37
            if (this._DbTransaction != null)
38
            {
39
                this._DbTransaction.Commit();
40
            }
41

  
26 42
            if (this._DbConnection != null)
27 43
            {
28 44
                this._DbConnection.Close();
......
97 113

  
98 114
        public int Execute(string query, IDbTransaction dbTran)
99 115
        {
100
            if (this._DbConnection.State != ConnectionState.Open)
101
            {
102
                this._DbConnection.Open();
103
            }
104

  
105
            return this._DbConnection.Execute(query, dbTran);
116
            return this.Execute(query, null, dbTran);
106 117
        }
107 118

  
108 119
        public int Execute(string query, object param, IDbTransaction dbTran)
ID2.Manager/ID2.Manager.Dapper/Repository/DocumentRepository.cs
28 28

  
29 29
            try
30 30
            {
31
                using (var transaction = base._DbConnection.BeginTransaction())
31
                using (var transaction = base.BeginTransaction())
32 32
                {
33 33
                    string query = string.Empty;
34 34

  
......
38 38

  
39 39
                        if (docIDList.Length > 0)
40 40
                        {
41
                            query = $@"delete from dbo.Documents where Cases_UID=@Cases_UID and [DocID] in ('{docIDList}');";
41
                            query = $@"delete from dbo.Documents where [DocID] in ('{docIDList}');";
42 42
                            base.Execute(query, transaction);
43 43
                        }
44 44
                    }
......
228 228
            return isSuccess;
229 229
        }
230 230
    }
231
}
231
}
ID2.Manager/ID2.Manager.Data/Models/Documents.cs
20 20
        [DataMember]
21 21
        public string RevisonNo { get; set; }
22 22
        [DataMember]
23
        public string ProjectID { get; set; }
23
        public string RefProjectID { get; set; }
24 24
        [DataMember]
25 25
        public bool IsLatest { get; set; }
26 26
        [DataMember]
......
131 131

  
132 132
        public bool Equals(Documents other)
133 133
        {
134
            return other != null && this.DocumentNo == other.DocumentNo && this.RevisonNo == other.RevisonNo && this.ProjectID == other.ProjectID && this.IsLatest == other.IsLatest 
134
            return other != null && this.DocumentNo == other.DocumentNo && this.RevisonNo == other.RevisonNo && this.RefProjectID == other.RefProjectID && this.IsLatest == other.IsLatest
135 135
                && this.AutoCADFilie == other.AutoCADFilie && this.PDFFile == other.PDFFile && this.MarkupLink == other.MarkupLink && this.AVEVALink == other.AVEVALink
136 136
                && this.DocFilePath == other.DocFilePath && this.DocFileName == other.DocFileName && this.Place == other.Place && this.JobLevel == other.JobLevel && this.IsTypical == other.IsTypical
137 137
                && this.PersonInCharge == other.PersonInCharge && this.IsDeleted == other.IsDeleted && this.ToIsDiscussion == other.ToIsDiscussion && this.ToRemarks == other.ToRemarks
......
148 148
        }
149 149
        public override int GetHashCode()
150 150
        {
151
            return this.DocumentNo.GetHashCode() + this.RevisonNo.GetHashCode() + this.ProjectID.GetHashCode() + this.IsLatest.GetHashCode()
151
            return this.DocumentNo.GetHashCode() + this.RevisonNo.GetHashCode() + this.RefProjectID.GetHashCode() + this.IsLatest.GetHashCode()
152 152
                + this.AutoCADFilie.GetHashCode() + this.PDFFile.GetHashCode() + this.MarkupLink.GetHashCode() + this.AVEVALink.GetHashCode()
153 153
                + this.DocFilePath.GetHashCode() + this.DocFileName.GetHashCode() + this.Place.GetHashCode() + this.JobLevel.GetHashCode() + this.IsTypical.GetHashCode()
154 154
                + this.PersonInCharge.GetHashCode() + this.IsDeleted.GetHashCode() + this.ToIsDiscussion.GetHashCode() + this.ToRemarks.GetHashCode()
......
162 162
                + this.ClientIsResult.GetHashCode() + this.ClientRemarks.GetHashCode() + this.DTIsGateWay.GetHashCode() + this.DTIsImport.GetHashCode()
163 163
                + this.DTIsRegSystem.GetHashCode() + this.DTRemarks.GetHashCode();
164 164
        }
165

  
166
        //public class DocumentsComparer : IEqualityComparer<Documents>
167
        //{
168
        //    public bool Equals(Documents x, Documents y)
169
        //    {
170
        //        if (x == null && y == null)
171
        //            return true;
172
        //        else if (x == null || y == null)
173
        //            return false;
174
        //        else
175
        //        {
176
        //            return x.DocumentNo == y.DocumentNo && x.RevisonNo == y.RevisonNo && x.ProjectID == y.ProjectID && x.IsLatest == y.IsLatest
177
        //                && x.AutoCADFilie == y.AutoCADFilie && x.PDFFile == y.PDFFile && x.MarkupLink == y.MarkupLink && x.AVEVALink == y.AVEVALink
178
        //                && x.DocFilePath == y.DocFilePath && x.DocFileName == y.DocFileName && x.Place == y.Place && x.JobLevel == y.JobLevel && x.IsTypical == y.IsTypical
179
        //                && x.PersonInCharge == y.PersonInCharge && x.IsDeleted == y.IsDeleted && x.ToIsDiscussion == y.ToIsDiscussion && x.ToRemarks == y.ToRemarks
180
        //                && x.ToCreator == y.ToCreator && x.ToModifier == y.ToModifier && x.ToCapturePath == y.ToCapturePath && x.ToIsMarkup == y.ToIsMarkup
181
        //                && x.FrReviewStatus == y.FrReviewStatus && x.FrRemarks == y.FrRemarks && x.FrCreator == y.FrCreator && x.FrModifier == y.FrModifier
182
        //                && x.FrCapturePath == y.FrCapturePath && x.FrIsMarkup == y.FrIsMarkup && x.IsID2Work == y.IsID2Work && x.ID2Connection == y.ID2Connection
183
        //                && x.ID2StartDate == y.ID2StartDate && x.ID2EndDate == y.ID2EndDate && x.ID2JobTime == y.ID2JobTime && x.ID2Status == y.ID2Status
184
        //                && x.ID2Issues == y.ID2Issues && x.AVEVAConnection == y.AVEVAConnection && x.AVEVAConvertDate == y.AVEVAConvertDate && x.AVEVAReviewDate == y.AVEVAReviewDate
185
        //                && x.AVEVAStatus == y.AVEVAStatus && x.AVEVAIssues == y.AVEVAIssues && x.ReviewFilePath == y.ReviewFilePath && x.ReviewFileName == y.ReviewFileName
186
        //                && x.ProdReviewer == y.ProdReviewer && x.ProdIsResult == y.ProdIsResult && x.ProdRemarks == y.ProdRemarks && x.ClientReviewer == y.ClientReviewer
187
        //                && x.ClientIsResult == y.ClientIsResult && x.ClientRemarks == y.ClientRemarks && x.DTIsGateWay == y.DTIsGateWay && x.DTIsImport == y.DTIsImport
188
        //                && x.DTIsRegSystem == y.DTIsRegSystem && x.DTRemarks == y.DTRemarks;
189
        //        }
190
        //    }
191

  
192
        //    public int GetHashCode(Documents obj)
193
        //    {
194
        //        return obj.DocumentNo.GetHashCode() + obj.RevisonNo.GetHashCode() + obj.ProjectID.GetHashCode() + obj.IsLatest.GetHashCode()
195
        //            + obj.AutoCADFilie.GetHashCode() + obj.PDFFile.GetHashCode() + obj.MarkupLink.GetHashCode() + obj.AVEVALink.GetHashCode()
196
        //            + obj.DocFilePath.GetHashCode() + obj.DocFileName.GetHashCode() + obj.Place.GetHashCode() + obj.JobLevel.GetHashCode() + obj.IsTypical.GetHashCode()
197
        //            + obj.PersonInCharge.GetHashCode() + obj.IsDeleted.GetHashCode() + obj.ToIsDiscussion.GetHashCode() + obj.ToRemarks.GetHashCode()
198
        //            + obj.ToCreator.GetHashCode() + obj.ToModifier.GetHashCode() + obj.ToCapturePath.GetHashCode() + obj.ToIsMarkup.GetHashCode()
199
        //            + obj.FrReviewStatus.GetHashCode() + obj.FrRemarks.GetHashCode() + obj.FrCreator.GetHashCode() + obj.FrModifier.GetHashCode()
200
        //            + obj.FrCapturePath.GetHashCode() + obj.FrIsMarkup.GetHashCode() + obj.IsID2Work.GetHashCode() + obj.ID2Connection.GetHashCode()
201
        //            + obj.ID2StartDate.GetHashCode() + obj.ID2EndDate.GetHashCode() + obj.ID2JobTime.GetHashCode() + obj.ID2Status.GetHashCode()
202
        //            + obj.ID2Issues.GetHashCode() + obj.AVEVAConnection.GetHashCode() + obj.AVEVAConvertDate.GetHashCode() + obj.AVEVAReviewDate.GetHashCode()
203
        //            + obj.AVEVAStatus.GetHashCode() + obj.AVEVAIssues.GetHashCode() + obj.ReviewFilePath.GetHashCode() + obj.ReviewFileName.GetHashCode()
204
        //            + obj.ProdReviewer.GetHashCode() + obj.ProdIsResult.GetHashCode() + obj.ProdRemarks.GetHashCode() + obj.ClientReviewer.GetHashCode()
205
        //            + obj.ClientIsResult.GetHashCode() + obj.ClientRemarks.GetHashCode() + obj.DTIsGateWay.GetHashCode() + obj.DTIsImport.GetHashCode()
206
        //            + obj.DTIsRegSystem.GetHashCode() + obj.DTRemarks.GetHashCode();
207
        //    }
208
        //}
209

  
210
        public class DocumentsKeyComparer : IEqualityComparer<Documents>
211
        {
212
            public bool Equals(Documents x, Documents y)
213
            {
214
                if (x == null && y == null)
215
                    return true;
216
                else if (x == null || y == null)
217
                    return false;
218
                else
219
                {
220
                    return x.DocID == y.DocID;
221
                }
222
            }
223

  
224
            public int GetHashCode(Documents obj)
225
            {
226
                return (obj.DocID != null ? obj.DocID.GetHashCode() : 0);
227
            }
228
        }
165 229
    }
166 230
}
ID2.Manager/ID2.Manager/Main.cs
9 9
using System.Windows.Forms;
10 10

  
11 11
using System.IO;
12
using System.Reflection;
12 13

  
13 14
using ID2.Manager.Common;
14 15
using ID2.Manager.Data.Models;
15 16
using ID2.Manager.Controller.Controllers;
17
using static ID2.Manager.Data.Models.Documents;
16 18

  
17 19
using Telerik.WinControls;
18 20
using Telerik.WinControls.UI;
......
316 318
        #region Excel
317 319
        private void RadButtonElementExcelImport_Click(object sender, EventArgs e)
318 320
        {
319
            RadMessageBox.Show("개발중...", "Information", MessageBoxButtons.OK, RadMessageIcon.Info);
320
            return;
321

  
322 321
            using (OpenFileDialog ofd = new OpenFileDialog()
323 322
            {
324 323
                Filter = "Excel files (*.xlsx)|*.xlsx",
......
336 335

  
337 336
                    int rowCount = ws.Rows.Count;
338 337
                    int columnCount = ws.CalculateMaxUsedColumns();
338
                    int exRow = 8;
339 339

  
340 340
                    #region Excel 유효성검사
341

  
342
                    //Excel 포멧체크
341 343
                    if (rowCount <= 10 || columnCount != 45)
342 344
                    {
343
                        RadMessageBox.Show("Please, check the excel.\n", "Information", System.Windows.Forms.MessageBoxButtons.OK, RadMessageIcon.Info);
345
                        RadMessageBox.Show("Please, check the excel.\n", "Information", MessageBoxButtons.OK, RadMessageIcon.Info);
344 346
                        return;
345 347
                    }
346 348

  
347
                    ws.Rows.SelectMany(row => row.AllocatedCells).Where(col => col.Column.Index > 4 && col.Row.Index > 11 && col.Value == null).ToList().ForEach(p => sbErrMsg.Append(", " + p.Column.Name + p.Row.Name));
349
                    #region 엑셀 필수값 체크(도면 : 이름,담당자, 난이도, Typical)
350
                    ws.Rows.SelectMany(row => row.AllocatedCells)
351
                           .Where(col => col.Column.Index > 5 && col.Column.Index < 10 && col.Row.Index > exRow && col.Value == null)
352
                           .ToList()
353
                           .ForEach(p => sbErrMsg.Append(", " + p.Column.Name + p.Row.Name));
354

  
348 355
                    if (sbErrMsg.Length > 0)
349 356
                    {
350
                        RadMessageBox.Show("Please, check null value in excel.\n" + sbErrMsg.ToString().Substring(2), "Information", System.Windows.Forms.MessageBoxButtons.OK, RadMessageIcon.Info);
357
                        string errMsg = sbErrMsg.ToString().Substring(2);
358
                        if (errMsg.Length > 100)
359
                        {
360
                            errMsg = $"{errMsg.Substring(0, 100)}...";
361
                        }
362

  
363
                        RadMessageBox.Show($"Please, check null value in excel.\n{errMsg}", "Information", MessageBoxButtons.OK, RadMessageIcon.Info);
351 364
                        return;
352 365
                    }
366
                    #endregion
353 367

  
368
                    #region 엑셀 도명명 중복 값 체크
354 369
                    ws.Rows.SelectMany(row => row.AllocatedCells)
355
                                                 .Where(col => col.Column.Index > 4 && col.Row.Index > 11)
370
                                                 .Where(col => col.Column.Index == 6 && col.Row.Index > exRow)
356 371
                                                 .GroupBy(g => g.Row.Index)
357 372
                                                 .Select(p => new {
358
                                                     rIndex = p.Key,
359
                                                     value = p.Select(x => x.Value.ToString())
360
                                                                                             .Aggregate((x, y) => x + "|" + y)
361
                                                                                             .ToString()
373
                                                     rowIndex = p.Key,
374
                                                     docNo = p.Select(x => x.Value.ToString()).FirstOrDefault()
362 375
                                                 })
363
                                                 .GroupBy(g => g.value)
376
                                                 .GroupBy(g => g.docNo)
364 377
                                                 .Where(p => p.Count() > 1)
365
                                                 .Select(p => p.Select(x => (x.rIndex + 1).ToString())
366
                                                               .Aggregate((x, y) => x.ToString() + "," + y.ToString())
367
                                                               .ToString())
368
                                                 .ToList().ForEach(p => sbErrMsg.Append("\nExcel row : " + p.ToString()));
378
                                                 .Select(p => p.Select(x => (x.rowIndex + 1).ToString())
379
                                                                                            .Aggregate((x, y) => x.ToString() + "," + y.ToString())
380
                                                                                            .ToString())
381
                                                 .ToList().ForEach(p => sbErrMsg.Append("\n" + p.ToString()));
369 382
                    if (sbErrMsg.Length > 0)
370 383
                    {
371
                        RadMessageBox.Show("Please, check the duplicate value in excel." + sbErrMsg.ToString(), "Information", System.Windows.Forms.MessageBoxButtons.OK, RadMessageIcon.Info);
384
                        sbErrMsg.Insert(0, "\n중복 된 도면명 Excel row : ");
385
                        string errMsg = sbErrMsg.ToString();
386
                        if (errMsg.Length > 100)
387
                        {
388
                            errMsg = $"{errMsg.Substring(0, 100)}...";
389
                        }
390

  
391
                        RadMessageBox.Show($"Please, check the duplicate value in excel.\n{errMsg}", "Information", MessageBoxButtons.OK, RadMessageIcon.Info);
372 392
                        return;
373 393
                    }
374 394
                    #endregion
375 395

  
376
                    List<List<string>> ltPrjWbsPath = ws.Rows.SelectMany(row => row.AllocatedCells)
377
                                                             .Where(col => col.Column.Index > 0 && col.Row.Index > 4)
378
                                                             .GroupBy(g => g.Row.Index)
379
                                                             .Select(p => p.Select(x => x.Value.ToString())
380
                                                                           .Aggregate(new List<string>().AsEnumerable<string>(), (x, y) => x.Concat(new[] { x.Count() == 0 ? y : x.LastOrDefault() + "\\" + y }))
381
                                                                           .ToList())
382
                                                             .ToList();
396
                    #endregion
397

  
398
                    List<Documents> appendDocuments = new List<Documents>();
399

  
400
                    ws.Rows.Where(row => row.Index > exRow)
401
                           .ToList()
402
                           .ForEach(p => appendDocuments.Add(new Documents()
403
                           {
404
                               //UID = string.Empty,
405
                               //Type = this.radTextBoxInsulationType.Text,
406
                               //TempFrom = ws.Rows[exRow].Cells[p.Column.Index].Value == null ? 0 : Convert.ToSingle(ws.Rows[exRow].Cells[p.Column.Index].Value),
407
                               //TempTo = ws.Rows[exRow + 2].Cells[p.Column.Index].Value == null ? 0 : Convert.ToSingle(ws.Rows[exRow + 2].Cells[p.Column.Index].Value),
408
                               //NPS = ws.Rows[p.Row.Index].Cells[0].Value == null ? 0 : Convert.ToSingle(ws.Rows[p.Row.Index].Cells[0].Value),
409
                               //Thickness = p.Value == null ? 0 : Convert.ToSingle(p.Value)
410

  
411
                               Place = ws.Rows[p.Index].Cells[5].Value == null ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
412
                               DocumentNo = ws.Rows[p.Index].Cells[6].Value == null ? string.Empty : ws.Rows[p.Index].Cells[6].Value.ToString(),
413
                               PersonInCharge = ws.Rows[p.Index].Cells[7].Value == null ? string.Empty : ws.Rows[p.Index].Cells[7].Value.ToString(),
414
                               JobLevel = ws.Rows[p.Index].Cells[8].Value == null ? string.Empty : ws.Rows[p.Index].Cells[8].Value.ToString(),
415
                               IsTypical = ws.Rows[p.Index].Cells[9].Value == null ? string.Empty : ws.Rows[p.Index].Cells[9].Value.ToString(),
416
                               RevisonNo = ws.Rows[p.Index].Cells[10].Value == null ? string.Empty : ws.Rows[p.Index].Cells[10].Value.ToString(),
417
                               ToIsDiscussion = ws.Rows[p.Index].Cells[11].Value == null ? string.Empty : ws.Rows[p.Index].Cells[11].Value.ToString(),
418
                               ToRemarks = ws.Rows[p.Index].Cells[12].Value == null ? string.Empty : ws.Rows[p.Index].Cells[12].Value.ToString(),
419
                               ToCreator = ws.Rows[p.Index].Cells[13].Value == null ? string.Empty : ws.Rows[p.Index].Cells[13].Value.ToString(),
420
                               //ToCapturePath = ws.Rows[p.Index].Cells[5].Value == null ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
421
                               //ToIsMarkup = ws.Rows[p.Index].Cells[5].Value == null ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
422
                               FrReviewStatus = ws.Rows[p.Index].Cells[16].Value == null ? string.Empty : ws.Rows[p.Index].Cells[16].Value.ToString(),
423
                               FrRemarks = ws.Rows[p.Index].Cells[17].Value == null ? string.Empty : ws.Rows[p.Index].Cells[17].Value.ToString(),
424
                               FrCreator = ws.Rows[p.Index].Cells[18].Value == null ? string.Empty : ws.Rows[p.Index].Cells[18].Value.ToString(),
425
                               //FrCapturePath = ws.Rows[p.Index].Cells[5].Value == null ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
426
                               //FrIsMarkup = ws.Rows[p.Index].Cells[5].Value == null ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
427
                               IsID2Work = ws.Rows[p.Index].Cells[21].Value == null ? string.Empty : ws.Rows[p.Index].Cells[21].Value.ToString(),
428
                               //ID2Connection = ws.Rows[p.Index].Cells[5].Value == null ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
429
                               //ID2StartDate = ws.Rows[p.Index].Cells[5].Value == null ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
430
                               //ID2EndDate = ws.Rows[p.Index].Cells[5].Value == null ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
431
                               //ID2JobTime = ws.Rows[p.Index].Cells[5].Value == null ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
432
                               ID2Status = ws.Rows[p.Index].Cells[26].Value == null ? string.Empty : ws.Rows[p.Index].Cells[26].Value.ToString(),
433
                               ID2Issues = ws.Rows[p.Index].Cells[27].Value == null ? string.Empty : ws.Rows[p.Index].Cells[27].Value.ToString(),
434
                               //AVEVAConnection = ws.Rows[p.Index].Cells[5].Value == null ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
435
                               //AVEVAConvertDate = ws.Rows[p.Index].Cells[5].Value == null ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
436
                               //AVEVAReviewDate = ws.Rows[p.Index].Cells[5].Value == null ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
437
                               AVEVAStatus = ws.Rows[p.Index].Cells[31].Value == null ? string.Empty : ws.Rows[p.Index].Cells[31].Value.ToString(),
438
                               AVEVAIssues = ws.Rows[p.Index].Cells[32].Value == null ? string.Empty : ws.Rows[p.Index].Cells[32].Value.ToString(),
439
                               ProdReviewer = ws.Rows[p.Index].Cells[35].Value == null ? string.Empty : ws.Rows[p.Index].Cells[35].Value.ToString(),
440
                               ProdIsResult = ws.Rows[p.Index].Cells[36].Value == null ? string.Empty : ws.Rows[p.Index].Cells[36].Value.ToString(),
441
                               ProdRemarks = ws.Rows[p.Index].Cells[37].Value == null ? string.Empty : ws.Rows[p.Index].Cells[37].Value.ToString(),
442
                               ClientReviewer = ws.Rows[p.Index].Cells[38].Value == null ? string.Empty : ws.Rows[p.Index].Cells[38].Value.ToString(),
443
                               ClientIsResult = ws.Rows[p.Index].Cells[39].Value == null ? string.Empty : ws.Rows[p.Index].Cells[39].Value.ToString(),
444
                               ClientRemarks = ws.Rows[p.Index].Cells[40].Value == null ? string.Empty : ws.Rows[p.Index].Cells[40].Value.ToString(),
445
                               DTIsGateWay = ws.Rows[p.Index].Cells[41].Value == null ? string.Empty : ws.Rows[p.Index].Cells[41].Value.ToString(),
446
                               DTIsImport = ws.Rows[p.Index].Cells[42].Value == null ? string.Empty : ws.Rows[p.Index].Cells[42].Value.ToString(),
447
                               DTIsRegSystem = ws.Rows[p.Index].Cells[43].Value == null ? string.Empty : ws.Rows[p.Index].Cells[43].Value.ToString(),
448
                               DTRemarks = ws.Rows[p.Index].Cells[44].Value == null ? string.Empty : ws.Rows[p.Index].Cells[44].Value.ToString()
449
                           }));
450

  
451

  
452
                    foreach (Documents appDoc in appendDocuments)
453
                    {
454
                        GridViewRowInfo rowInfo = this.radGridViewDocuments.Rows.AddNew();
455

  
456
                        foreach (FieldInfo fieldInfo in appDoc.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly))
457
                        {
458
                            if (fieldInfo.GetValue(appDoc) != null)
459
                            {
460
                                var cols = rowInfo.Cells.Where(x => fieldInfo.Name.Contains($"<{x.ColumnInfo.Name}>"));
461

  
462
                                if (cols.Any())
463
                                {
464
                                    cols.FirstOrDefault().Value = fieldInfo.GetValue(appDoc);
465
                                }
466
                            }
467
                        }
468
                    }
383 469
                }
384 470
            }
385 471
        }
......
462 548
                            templateWorksheet.Cells[rowIndex, 36].Value = doc.ProdIsResult;
463 549
                            templateWorksheet.Cells[rowIndex, 37].Value = doc.ProdRemarks;
464 550
                            templateWorksheet.Cells[rowIndex, 38].Value = doc.ClientReviewer;
465
                            templateWorksheet.Cells[rowIndex, 39].Value = doc.ClientIsResult ;
551
                            templateWorksheet.Cells[rowIndex, 39].Value = doc.ClientIsResult;
466 552
                            templateWorksheet.Cells[rowIndex, 40].Value = doc.ClientRemarks;
467 553
                            templateWorksheet.Cells[rowIndex, 41].Value = doc.DTIsGateWay;
468 554
                            templateWorksheet.Cells[rowIndex, 42].Value = doc.DTIsImport;
......
488 574
            this.documents.Where(x => !this.orgDocuments.Any(y => y.Equals(x)))
489 575
                          .ToList().ForEach(x => setDocuments.Add(x));
490 576

  
491
            this.orgDocuments.Where(x => this.documents.Any(y => y.Equals(x) && !string.IsNullOrEmpty(y.DocID)))
492
                             .ToList()
493
                             .ForEach(x => delDocuments.Add(x));
577
            delDocuments.AddRange(this.orgDocuments.Except(this.documents, new DocumentsKeyComparer()));
578

  
579
            bool result = new DocumentController().SetDocumentData(setDocuments, delDocuments);
580

  
581
            if (result)
582
            {
583
                RadMessageBox.Show("Save is complete", Globals.Name, MessageBoxButtons.OK, RadMessageIcon.Info);
584
            }
494 585
        }
495 586

  
496 587
        #region ColumnGroup

내보내기 Unified diff

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