프로젝트

일반

사용자정보

개정판 057ca09a

ID057ca09abe10b16f05ab0cedc9b4dc4a2101e323
상위 567a90cc
하위 8eca8767

김태성이(가) 약 2년 전에 추가함

issue #0000 gembox import 수정

Change-Id: I58fe5f76876c99e6a71554d5365b3b39b0bcad8a

차이점 보기:

ID2.Manager/ID2.Manager.Common/Helpers/GemboxHelper.cs
1
using GemBox.Spreadsheet;
2
using System;
3
using System.Collections.Generic;
4
using System.Linq;
5
using System.Text;
6
using System.Threading.Tasks;
7

  
8
namespace ID2.Manager.Common.Helpers
9
{
10
    public static class GemboxHelper
11
    {
12
        public static bool IsNumber(this ExcelCell cell)
13
        {
14
            if(cell.ValueType == CellValueType.Int)
15
            {
16
                return true;
17
            }
18
            else
19
            {
20
                return false;
21
            }
22
        }
23

  
24
        public static bool IsString(this ExcelCell cell)
25
        {
26
            if (cell.ValueType == CellValueType.String)
27
            {
28
                return true;
29
            }
30
            else
31
            {
32
                return false;
33
            }
34
        }
35

  
36
        public static bool IsDateTime(this ExcelCell cell)
37
        {
38
            if (cell.ValueType == CellValueType.DateTime)
39
            {
40
                return true;
41
            }
42
            else
43
            {
44
                return false;
45
            }
46
        }
47

  
48

  
49
        public static bool IsNullOrEmpty(this ExcelCell cell)
50
        {
51
            if(cell.IsString())
52
                return string.IsNullOrEmpty(cell.StringValue);
53
            else
54
                return cell.Value == null;
55

  
56
        }
57
    }
58
}
ID2.Manager/ID2.Manager.Common/Helpers/ID2Excel.cs
1
using ID2.Manager.Data.Models;
2
using System;
3
using System.Collections.Generic;
4
using System.Linq;
5
using System.Text;
6
using System.Threading.Tasks;
7
using GemBox.Spreadsheet;
8
using ID2.Manager.Controller.Controllers;
9

  
10
namespace ID2.Manager.Common.Helpers
11
{
12
    public class ID2Excel :IDisposable
13
    {
14
        private List<UserInfo> UserlList = new List<UserInfo>();
15

  
16

  
17
        public void Dispose()
18
        {
19
            
20
        }
21

  
22
        public ID2Excel()
23
        {
24
            UserlList = new UserController().GetAllUserInfo().ToList();
25
        }
26

  
27
        private UserInfo GetUser(string user)
28
        {
29
            UserInfo userInfo = UserlList.Where(x => x.ID.Equals(user)).FirstOrDefault();
30
            if (userInfo != null) return userInfo;
31

  
32
            userInfo = UserlList.Where(x => x.Name.Equals(user)).FirstOrDefault();
33
            if (userInfo != null) return userInfo;
34

  
35
            return userInfo ?? new UserInfo();
36
        }
37

  
38
        public ImportResult GemboxImport(string fileName)
39
        {
40
            ImportResult result = new ImportResult();
41

  
42
            StringBuilder sbErrMsg = new StringBuilder();
43

  
44
            try
45
            {
46
                var exFile = ExcelFile.Load(fileName);
47
                var ws = exFile.Worksheets[0];
48

  
49
                int rowCount = ws.Rows.Count;
50
                int columnCount = ws.CalculateMaxUsedColumns();
51
                int exRow = 8;
52

  
53
                #region Excel 유효성검사
54

  
55
                //Excel 포멧체크
56
                if (rowCount < 10 || columnCount != 45)
57
                {
58
                    result.Error = "Please, check the excel.";
59
                    return result;
60
                }
61

  
62
                #region 엑셀 필수값 체크(도면 : 이름,담당자, 난이도, Typical)
63
                ws.Rows.SelectMany(row => row.AllocatedCells)
64
                       .Where(col => col.Column.Index > 5 && col.Column.Index < 10 && col.Row.Index > exRow && col.Value == null)
65
                       .ToList()
66
                       .ForEach(p => sbErrMsg.Append(", " + p.Column.Name + p.Row.Name));
67

  
68
                if (sbErrMsg.Length > 0)
69
                {
70
                    string errMsg = sbErrMsg.ToString().Substring(2);
71
                    if (errMsg.Length > 100)
72
                    {
73
                        errMsg = $"{errMsg.Substring(0, 100)}...";
74
                    }
75

  
76
                    result.Error = $"Please, check null value in excel.\n{errMsg}";
77
                    return result;
78
                }
79
                #endregion
80

  
81
                #region 엑셀 도명명 중복 값 체크
82
                ws.Rows.SelectMany(row => row.AllocatedCells)
83
                                             .Where(col => col.Column.Index == 6 && col.Row.Index > exRow)
84
                                             .GroupBy(g => g.Row.Index)
85
                                             .Select(p => new
86
                                             {
87
                                                 rowIndex = p.Key,
88
                                                 docNo = p.Select(x => x.Value.ToString()).FirstOrDefault()
89
                                             })
90
                                             .GroupBy(g => g.docNo)
91
                                             .Where(p => p.Count() > 1)
92
                                             .Select(p => p.Select(x => (x.rowIndex + 1).ToString())
93
                                                                                        .Aggregate((x, y) => x.ToString() + "," + y.ToString())
94
                                                                                        .ToString())
95
                                             .ToList().ForEach(p => sbErrMsg.Append("\n" + p.ToString()));
96
                if (sbErrMsg.Length > 0)
97
                {
98
                    sbErrMsg.Insert(0, "\n중복 된 도면명 Excel row : ");
99
                    string errMsg = sbErrMsg.ToString();
100
                    if (errMsg.Length > 100)
101
                    {
102
                        errMsg = $"{errMsg.Substring(0, 100)}...";
103
                    }
104

  
105
                    result.Error = $"Please, check the duplicate value in excel.\n{errMsg}";
106
                    return result;
107
                }
108
                #endregion
109

  
110
                #endregion
111

  
112
                result.documents = new List<Documents>();
113

  
114
                ws.Rows.Where(row => row.Index > exRow)
115
                       .ToList()
116
                       .ForEach(p =>
117
                       {
118
                           try
119
                           {
120
                               result.documents.Add(new Documents()
121
                               {
122
                                   //UID = string.Empty,
123
                                   //Type = this.radTextBoxInsulationType.Text,
124
                                   //TempFrom = ws.Rows[exRow].Cells[p.Column.Index].IsNullOrEmpty() ? 0 : Convert.ToSingle(ws.Rows[exRow].Cells[p.Column.Index].Value),
125
                                   //TempTo = ws.Rows[exRow + 2].Cells[p.Column.Index].IsNullOrEmpty() ? 0 : Convert.ToSingle(ws.Rows[exRow + 2].Cells[p.Column.Index].Value),
126
                                   //NPS = ws.Rows[p.Row.Index].Cells[0].IsNullOrEmpty() ? 0 : Convert.ToSingle(ws.Rows[p.Row.Index].Cells[0].Value),
127
                                   //Thickness = p.IsNullOrEmpty() ? 0 : Convert.ToSingle(p.Value)
128

  
129
                                   RefProjectCode = ws.Rows[p.Index].Cells[5].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
130
                                   DocumentNo = ws.Rows[p.Index].Cells[6].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[6].Value.ToString(),
131
                                   PersonInCharge = ws.Rows[p.Index].Cells[7].IsNullOrEmpty() ? string.Empty : this.GetUser(ws.Rows[p.Index].Cells[7].Value.ToString()).ID,
132
                                   JobLevel = ws.Rows[p.Index].Cells[8].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[8].Value.ToString(),
133
                                   IsTypical = ws.Rows[p.Index].Cells[9].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[9].Value.ToString(),
134
                                   RevisonNo = ws.Rows[p.Index].Cells[10].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[10].Value.ToString(),
135
                                   ToIsDiscussion = ws.Rows[p.Index].Cells[11].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[11].Value.ToString(),
136
                                   ToRemarks = ws.Rows[p.Index].Cells[12].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[12].Value.ToString(),
137
                                   ToCreator = ws.Rows[p.Index].Cells[13].IsNullOrEmpty() ? string.Empty : this.GetUser(ws.Rows[p.Index].Cells[13].Value.ToString()).ID,
138
                                   //ToCapture = ws.Rows[p.Index].Cells[5].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
139
                                   //ToIsMarkup = ws.Rows[p.Index].Cells[5].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
140
                                   FrReviewStatus = ws.Rows[p.Index].Cells[16].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[16].Value.ToString(),
141
                                   FrRemarks = ws.Rows[p.Index].Cells[17].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[17].Value.ToString(),
142
                                   FrCreator = ws.Rows[p.Index].Cells[18].IsNullOrEmpty() ? string.Empty : this.GetUser(ws.Rows[p.Index].Cells[18].Value.ToString()).ID,
143
                                   //FrCapture = ws.Rows[p.Index].Cells[5].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
144
                                   //FrIsMarkup = ws.Rows[p.Index].Cells[5].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
145
                                   IsID2Work = ws.Rows[p.Index].Cells[21].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[21].Value.ToString(),
146
                                   //ID2Connection = ws.Rows[p.Index].Cells[5].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
147
                                   ID2StartDate = ws.Rows[p.Index].Cells[23].IsNullOrEmpty() ? (DateTime?)null : Convert.ToDateTime(ws.Rows[p.Index].Cells[23].Value?.ToString()),
148
                                   ID2EndDate = ws.Rows[p.Index].Cells[24].IsNullOrEmpty() ? (DateTime?)null : Convert.ToDateTime(ws.Rows[p.Index].Cells[24].Value?.ToString()),
149
                                   //ID2JobTime = ws.Rows[p.Index].Cells[5].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
150
                                   ID2Status = ws.Rows[p.Index].Cells[26].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[26].Value.ToString(),
151
                                   ID2Issues = ws.Rows[p.Index].Cells[27].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[27].Value.ToString(),
152
                                   //AVEVAConnection = ws.Rows[p.Index].Cells[5].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[5].Value.ToString(),
153
                                   AVEVAConvertDate = ws.Rows[p.Index].Cells[29].IsNullOrEmpty() ? (DateTime?)null : Convert.ToDateTime(ws.Rows[p.Index].Cells[29].Value.ToString()),
154
                                   AVEVAReviewDate = ws.Rows[p.Index].Cells[30].IsNullOrEmpty() ? (DateTime?)null : Convert.ToDateTime(ws.Rows[p.Index].Cells[30].Value.ToString()),
155
                                   AVEVAStatus = ws.Rows[p.Index].Cells[31].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[31].Value.ToString(),
156
                                   AVEVAIssues = ws.Rows[p.Index].Cells[32].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[32].Value.ToString(),
157
                                   ProdReviewer = ws.Rows[p.Index].Cells[35].IsNullOrEmpty() ? string.Empty : this.GetUser(ws.Rows[p.Index].Cells[35].Value.ToString()).ID,
158
                                   ProdIsResult = ws.Rows[p.Index].Cells[36].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[36].Value.ToString(),
159
                                   ProdRemarks = ws.Rows[p.Index].Cells[37].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[37].Value.ToString(),
160
                                   ClientReviewer = ws.Rows[p.Index].Cells[38].IsNullOrEmpty() ? string.Empty : this.GetUser(ws.Rows[p.Index].Cells[38].Value.ToString()).ID,
161
                                   ClientIsResult = ws.Rows[p.Index].Cells[39].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[39].Value.ToString(),
162
                                   ClientRemarks = ws.Rows[p.Index].Cells[40].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[40].Value.ToString(),
163
                                   DTIsGateWay = ws.Rows[p.Index].Cells[41].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[41].Value.ToString(),
164
                                   DTIsImport = ws.Rows[p.Index].Cells[42].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[42].Value.ToString(),
165
                                   DTIsRegSystem = ws.Rows[p.Index].Cells[43].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[43].Value.ToString(),
166
                                   DTRemarks = ws.Rows[p.Index].Cells[44].IsNullOrEmpty() ? string.Empty : ws.Rows[p.Index].Cells[44].Value.ToString()
167
                               });
168
                            }
169
                           catch (Exception ex)
170
                           {
171
                               throw new Exception($"Excel Import Row :{p.Index} Error.",ex);
172
                           }
173
                       });
174

  
175
            }
176
            catch (Exception)
177
            {
178
                throw;
179
            }
180

  
181
            return result;
182
        }
183
    }
184
}
ID2.Manager/ID2.Manager.Common/Helpers/ImportResult.cs
1
using ID2.Manager.Data.Models;
2
using System;
3
using System.Collections.Generic;
4
using System.Linq;
5
using System.Text;
6
using System.Threading.Tasks;
7

  
8
namespace ID2.Manager.Common.Helpers
9
{
10
    public class ImportResult
11
    {
12
        public string Error { get; set; }
13
        public List<Documents> documents { get; set; }
14
    }
15
}
ID2.Manager/ID2.Manager.Common/ID2.Manager.Common.csproj
63 63
  </ItemGroup>
64 64
  <ItemGroup>
65 65
    <Compile Include="Globals.cs" />
66
    <Compile Include="Helpers\GemboxHelper.cs" />
67
    <Compile Include="Helpers\ID2Excel.cs" />
68
    <Compile Include="Helpers\ImportResult.cs" />
66 69
    <Compile Include="Informations.cs" />
67 70
    <Compile Include="Properties\AssemblyInfo.cs" />
68 71
  </ItemGroup>
72
  <ItemGroup />
69 73
  <ItemGroup>
70
    <Folder Include="Helpers\" />
71
  </ItemGroup>
72
  <ItemGroup>
74
    <PackageReference Include="GemBox.Spreadsheet">
75
      <Version>47.0.1268</Version>
76
    </PackageReference>
73 77
    <PackageReference Include="Newtonsoft.Json">
74 78
      <Version>13.0.3</Version>
75 79
    </PackageReference>
......
78 82
    </PackageReference>
79 83
  </ItemGroup>
80 84
  <ItemGroup>
85
    <ProjectReference Include="..\ID2.Manager.Controller\ID2.Manager.Controller.csproj">
86
      <Project>{83DACC10-43B1-4E38-ABEF-E5EF9492A82D}</Project>
87
      <Name>ID2.Manager.Controller</Name>
88
    </ProjectReference>
81 89
    <ProjectReference Include="..\ID2.Manager.Data\ID2.Manager.Data.csproj">
82 90
      <Project>{b17c0800-40f4-40e2-b5a6-d366d9c2e0f6}</Project>
83 91
      <Name>ID2.Manager.Data</Name>
ID2.Manager/ID2.Manager/Main.Designer.cs
431 431
            this.tableLayoutPanelCondition.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
432 432
            this.tableLayoutPanelCondition.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 85F));
433 433
            this.tableLayoutPanelCondition.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 25F));
434
            this.tableLayoutPanelCondition.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 70F));
434
            this.tableLayoutPanelCondition.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 74F));
435 435
            this.tableLayoutPanelCondition.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
436 436
            this.tableLayoutPanelCondition.Controls.Add(this.radDropDownListFrReviewStatus, 4, 1);
437 437
            this.tableLayoutPanelCondition.Controls.Add(this.radDropDownListToIsDiscussion, 2, 1);
......
476 476
            this.radDropDownListFrReviewStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
477 477
            this.radDropDownListFrReviewStatus.DropDownAnimationEnabled = true;
478 478
            this.radDropDownListFrReviewStatus.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
479
            this.radDropDownListFrReviewStatus.Location = new System.Drawing.Point(346, 32);
479
            this.radDropDownListFrReviewStatus.Location = new System.Drawing.Point(345, 32);
480 480
            this.radDropDownListFrReviewStatus.Name = "radDropDownListFrReviewStatus";
481
            this.radDropDownListFrReviewStatus.Size = new System.Drawing.Size(112, 20);
481
            this.radDropDownListFrReviewStatus.Size = new System.Drawing.Size(111, 20);
482 482
            this.radDropDownListFrReviewStatus.TabIndex = 18;
483 483
            // 
484 484
            // radDropDownListToIsDiscussion
......
488 488
            this.radDropDownListToIsDiscussion.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
489 489
            this.radDropDownListToIsDiscussion.Location = new System.Drawing.Point(141, 32);
490 490
            this.radDropDownListToIsDiscussion.Name = "radDropDownListToIsDiscussion";
491
            this.radDropDownListToIsDiscussion.Size = new System.Drawing.Size(112, 20);
491
            this.radDropDownListToIsDiscussion.Size = new System.Drawing.Size(111, 20);
492 492
            this.radDropDownListToIsDiscussion.TabIndex = 17;
493 493
            // 
494 494
            // radLabelFrReviewStatus
495 495
            // 
496 496
            this.radLabelFrReviewStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
497 497
            this.radLabelFrReviewStatus.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
498
            this.radLabelFrReviewStatus.Location = new System.Drawing.Point(260, 34);
498
            this.radLabelFrReviewStatus.Location = new System.Drawing.Point(259, 34);
499 499
            this.radLabelFrReviewStatus.Name = "radLabelFrReviewStatus";
500 500
            this.radLabelFrReviewStatus.Size = new System.Drawing.Size(59, 17);
501 501
            this.radLabelFrReviewStatus.TabIndex = 7;
......
525 525
            // 
526 526
            this.radLabelAVEVAStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
527 527
            this.radLabelAVEVAStatus.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
528
            this.radLabelAVEVAStatus.Location = new System.Drawing.Point(260, 62);
528
            this.radLabelAVEVAStatus.Location = new System.Drawing.Point(259, 62);
529 529
            this.radLabelAVEVAStatus.Name = "radLabelAVEVAStatus";
530 530
            this.radLabelAVEVAStatus.Size = new System.Drawing.Size(86, 17);
531 531
            this.radLabelAVEVAStatus.TabIndex = 8;
......
535 535
            // 
536 536
            this.radLabelIsID2Work.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
537 537
            this.radLabelIsID2Work.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
538
            this.radLabelIsID2Work.Location = new System.Drawing.Point(465, 34);
538
            this.radLabelIsID2Work.Location = new System.Drawing.Point(463, 34);
539 539
            this.radLabelIsID2Work.Name = "radLabelIsID2Work";
540 540
            this.radLabelIsID2Work.Size = new System.Drawing.Size(80, 17);
541 541
            this.radLabelIsID2Work.TabIndex = 6;
......
545 545
            // 
546 546
            this.radLabelJobLevel.Anchor = System.Windows.Forms.AnchorStyles.Left;
547 547
            this.radLabelJobLevel.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
548
            this.radLabelJobLevel.Location = new System.Drawing.Point(465, 6);
548
            this.radLabelJobLevel.Location = new System.Drawing.Point(463, 6);
549 549
            this.radLabelJobLevel.Name = "radLabelJobLevel";
550 550
            this.radLabelJobLevel.Size = new System.Drawing.Size(47, 17);
551 551
            this.radLabelJobLevel.TabIndex = 7;
......
596 596
            this.radButtonSearch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)));
597 597
            this.radButtonSearch.Cursor = System.Windows.Forms.Cursors.Hand;
598 598
            this.radButtonSearch.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
599
            this.radButtonSearch.Location = new System.Drawing.Point(881, 4);
599
            this.radButtonSearch.Location = new System.Drawing.Point(879, 4);
600 600
            this.radButtonSearch.Name = "radButtonSearch";
601 601
            this.tableLayoutPanelCondition.SetRowSpan(this.radButtonSearch, 4);
602 602
            this.radButtonSearch.Size = new System.Drawing.Size(54, 106);
......
610 610
            this.radDropDownListProject.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
611 611
            this.radDropDownListProject.Location = new System.Drawing.Point(141, 4);
612 612
            this.radDropDownListProject.Name = "radDropDownListProject";
613
            this.radDropDownListProject.Size = new System.Drawing.Size(112, 20);
613
            this.radDropDownListProject.Size = new System.Drawing.Size(111, 20);
614 614
            this.radDropDownListProject.TabIndex = 7;
615 615
            // 
616 616
            // radLabelDocumentNo
617 617
            // 
618 618
            this.radLabelDocumentNo.Anchor = System.Windows.Forms.AnchorStyles.Left;
619 619
            this.radLabelDocumentNo.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
620
            this.radLabelDocumentNo.Location = new System.Drawing.Point(670, 6);
620
            this.radLabelDocumentNo.Location = new System.Drawing.Point(667, 6);
621 621
            this.radLabelDocumentNo.Name = "radLabelDocumentNo";
622 622
            this.radLabelDocumentNo.Size = new System.Drawing.Size(49, 17);
623 623
            this.radLabelDocumentNo.TabIndex = 6;
......
626 626
            // radTextBoxDocumentNo
627 627
            // 
628 628
            this.radTextBoxDocumentNo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
629
            this.radTextBoxDocumentNo.Location = new System.Drawing.Point(756, 4);
629
            this.radTextBoxDocumentNo.Location = new System.Drawing.Point(753, 4);
630 630
            this.radTextBoxDocumentNo.Name = "radTextBoxDocumentNo";
631
            this.radTextBoxDocumentNo.Size = new System.Drawing.Size(112, 20);
631
            this.radTextBoxDocumentNo.Size = new System.Drawing.Size(111, 20);
632 632
            this.radTextBoxDocumentNo.TabIndex = 8;
633 633
            // 
634 634
            // radLabelPersonInCharge
635 635
            // 
636 636
            this.radLabelPersonInCharge.Anchor = System.Windows.Forms.AnchorStyles.Left;
637 637
            this.radLabelPersonInCharge.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
638
            this.radLabelPersonInCharge.Location = new System.Drawing.Point(260, 6);
638
            this.radLabelPersonInCharge.Location = new System.Drawing.Point(259, 6);
639 639
            this.radLabelPersonInCharge.Name = "radLabelPersonInCharge";
640 640
            this.radLabelPersonInCharge.Size = new System.Drawing.Size(47, 17);
641 641
            this.radLabelPersonInCharge.TabIndex = 6;
......
646 646
            this.radDropDownListPersonInCharge.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
647 647
            this.radDropDownListPersonInCharge.DropDownAnimationEnabled = true;
648 648
            this.radDropDownListPersonInCharge.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
649
            this.radDropDownListPersonInCharge.Location = new System.Drawing.Point(346, 4);
649
            this.radDropDownListPersonInCharge.Location = new System.Drawing.Point(345, 4);
650 650
            this.radDropDownListPersonInCharge.Name = "radDropDownListPersonInCharge";
651
            this.radDropDownListPersonInCharge.Size = new System.Drawing.Size(112, 20);
651
            this.radDropDownListPersonInCharge.Size = new System.Drawing.Size(111, 20);
652 652
            this.radDropDownListPersonInCharge.TabIndex = 9;
653 653
            // 
654 654
            // radLabel1
......
666 666
            this.radDropDownListJobLevel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
667 667
            this.radDropDownListJobLevel.DropDownAnimationEnabled = true;
668 668
            this.radDropDownListJobLevel.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
669
            this.radDropDownListJobLevel.Location = new System.Drawing.Point(551, 4);
669
            this.radDropDownListJobLevel.Location = new System.Drawing.Point(549, 4);
670 670
            this.radDropDownListJobLevel.Name = "radDropDownListJobLevel";
671
            this.radDropDownListJobLevel.Size = new System.Drawing.Size(112, 20);
671
            this.radDropDownListJobLevel.Size = new System.Drawing.Size(111, 20);
672 672
            this.radDropDownListJobLevel.TabIndex = 11;
673 673
            // 
674 674
            // radLabelID2Status
......
685 685
            // 
686 686
            this.radLabel10.Anchor = System.Windows.Forms.AnchorStyles.Left;
687 687
            this.radLabel10.Font = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
688
            this.radLabel10.Location = new System.Drawing.Point(260, 90);
688
            this.radLabel10.Location = new System.Drawing.Point(259, 90);
689 689
            this.radLabel10.Name = "radLabel10";
690 690
            this.radLabel10.Size = new System.Drawing.Size(61, 17);
691 691
            this.radLabel10.TabIndex = 9;
......
696 696
            this.radDropDownListIsID2Work.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
697 697
            this.radDropDownListIsID2Work.DropDownAnimationEnabled = true;
698 698
            this.radDropDownListIsID2Work.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
699
            this.radDropDownListIsID2Work.Location = new System.Drawing.Point(551, 32);
699
            this.radDropDownListIsID2Work.Location = new System.Drawing.Point(549, 32);
700 700
            this.radDropDownListIsID2Work.Name = "radDropDownListIsID2Work";
701
            this.radDropDownListIsID2Work.Size = new System.Drawing.Size(112, 20);
701
            this.radDropDownListIsID2Work.Size = new System.Drawing.Size(111, 20);
702 702
            this.radDropDownListIsID2Work.TabIndex = 12;
703 703
            // 
704 704
            // radDropDownListID2Status
......
708 708
            this.radDropDownListID2Status.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
709 709
            this.radDropDownListID2Status.Location = new System.Drawing.Point(141, 60);
710 710
            this.radDropDownListID2Status.Name = "radDropDownListID2Status";
711
            this.radDropDownListID2Status.Size = new System.Drawing.Size(112, 20);
711
            this.radDropDownListID2Status.Size = new System.Drawing.Size(111, 20);
712 712
            this.radDropDownListID2Status.TabIndex = 13;
713 713
            // 
714 714
            // radDropDownListAVEVAStatus
......
716 716
            this.radDropDownListAVEVAStatus.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
717 717
            this.radDropDownListAVEVAStatus.DropDownAnimationEnabled = true;
718 718
            this.radDropDownListAVEVAStatus.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
719
            this.radDropDownListAVEVAStatus.Location = new System.Drawing.Point(346, 60);
719
            this.radDropDownListAVEVAStatus.Location = new System.Drawing.Point(345, 60);
720 720
            this.radDropDownListAVEVAStatus.Name = "radDropDownListAVEVAStatus";
721
            this.radDropDownListAVEVAStatus.Size = new System.Drawing.Size(112, 20);
721
            this.radDropDownListAVEVAStatus.Size = new System.Drawing.Size(111, 20);
722 722
            this.radDropDownListAVEVAStatus.TabIndex = 14;
723 723
            // 
724 724
            // radDropDownListProdIsResult
......
728 728
            this.radDropDownListProdIsResult.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
729 729
            this.radDropDownListProdIsResult.Location = new System.Drawing.Point(141, 89);
730 730
            this.radDropDownListProdIsResult.Name = "radDropDownListProdIsResult";
731
            this.radDropDownListProdIsResult.Size = new System.Drawing.Size(112, 20);
731
            this.radDropDownListProdIsResult.Size = new System.Drawing.Size(111, 20);
732 732
            this.radDropDownListProdIsResult.TabIndex = 15;
733 733
            // 
734 734
            // radDropDownListClientIsResult
......
736 736
            this.radDropDownListClientIsResult.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
737 737
            this.radDropDownListClientIsResult.DropDownAnimationEnabled = true;
738 738
            this.radDropDownListClientIsResult.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList;
739
            this.radDropDownListClientIsResult.Location = new System.Drawing.Point(346, 89);
739
            this.radDropDownListClientIsResult.Location = new System.Drawing.Point(345, 89);
740 740
            this.radDropDownListClientIsResult.Name = "radDropDownListClientIsResult";
741
            this.radDropDownListClientIsResult.Size = new System.Drawing.Size(112, 20);
741
            this.radDropDownListClientIsResult.Size = new System.Drawing.Size(111, 20);
742 742
            this.radDropDownListClientIsResult.TabIndex = 16;
743 743
            // 
744 744
            // tableLayoutPanelGroup
ID2.Manager/ID2.Manager/Main.cs
27 27

  
28 28
using Newtonsoft.Json;
29 29
using System.Diagnostics;
30
using ID2.Manager.Common.Helpers;
30 31

  
31 32
namespace ID2.Manager
32 33
{
......
1025 1026

  
1026 1027
            return prjInfo ?? new ProjectInfo();
1027 1028
        }
1028

  
1029 1029
        private void RadButtonElementExcelImport_Click(object sender, EventArgs e)
1030 1030
        {
1031 1031
            using (OpenFileDialog ofd = new OpenFileDialog()
......
1040 1040
                    //Error Message
1041 1041
                    StringBuilder sbErrMsg = new StringBuilder();
1042 1042

  
1043
                    using(ID2Excel excel = new ID2Excel())
1044
                    {
1045
                       var result = excel.GemboxImport(ofd.FileName);
1046

  
1047
                        if(result.Error != null)
1048
                        {
1049

  
1050
                            RadMessageBox.Show(result.Error, "Information", MessageBoxButtons.OK, RadMessageIcon.Info);
1051
                        }
1052
                        else
1053
                        {
1054
                            this.documents.AddRange(result.documents);
1055
                            if (this.orgDocuments == null) this.orgDocuments = new List<Documents>();
1056
                            this.DocumentListBinding();
1057
                        }
1058

  
1059
                    }
1060

  
1061

  
1062
                    //foreach (Documents appDoc in appendDocuments)
1063
                    //{
1064
                    //    GridViewRowInfo rowInfo = this.radGridViewDocuments.Rows.AddNew();
1065

  
1066
                    //    foreach (FieldInfo fieldInfo in appDoc.GetType().GetFields(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.DeclaredOnly))
1067
                    //    {
1068
                    //        if (fieldInfo.GetValue(appDoc) != null)
1069
                    //        {
1070
                    //            var cols = rowInfo.Cells.Where(x => fieldInfo.Name.Contains($"<{x.ColumnInfo.Name}>"));
1071

  
1072
                    //            if (cols.Any())
1073
                    //            {
1074
                    //                cols.FirstOrDefault().Value = fieldInfo.GetValue(appDoc);
1075
                    //            }
1076
                    //        }
1077
                    //    }
1078
                    //}
1079
                }
1080
            }
1081
        }
1082

  
1083
        private void RadButtonElementExcelImport_Click_old(object sender, EventArgs e)
1084
        {
1085
            using (OpenFileDialog ofd = new OpenFileDialog()
1086
            {
1087
                Filter = "Excel files (*.xlsx)|*.xlsx",
1088
                Title = "Open an Excel File",
1089
                RestoreDirectory = true
1090
            })
1091
            {
1092
                if (ofd.ShowDialog() == DialogResult.OK)
1093
                {
1094
                    //Error Message
1095
                    StringBuilder sbErrMsg = new StringBuilder();
1096

  
1043 1097
                    var exFile = ExcelFile.Load(ofd.FileName);
1044 1098
                    var ws = exFile.Worksheets[0];
1045 1099

  
ID2.Manager/ID2.Manager/Program.cs
25 25
        static void Main()
26 26
        {
27 27
            logger = LogManager.GetLogger(typeof(Program));
28

  
29
            Application.ThreadException += Application_ThreadException;
28 30
            devDept.LicenseManager.Unlock(typeof(devDept.Eyeshot.Workspace), "US22-CKTU9-RX12F-3SF6-R1X9");
29 31
            SpreadsheetInfo.SetLicense(Properties.Settings.Default.GemBoxLicense);
30 32

  
31 33
            Application.EnableVisualStyles();
32 34
            Application.SetCompatibleTextRenderingDefault(false);
33
     
35
            
34 36
            using (Login frm = new Login())
35 37
            {
36 38
                if (frm.ShowDialog() == DialogResult.OK)
......
39 41
                }
40 42
            }
41 43
        }
44

  
45
        private static void Application_ThreadException(object sender, System.Threading.ThreadExceptionEventArgs e)
46
        {
47
            logger.Error("Application Exception.", e.Exception);
48
        }
42 49
    }
43 50
}

내보내기 Unified diff

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