개정판 8eca8767
issue #0000 excel import 수정
Change-Id: I4c359f35e4506e2c5b0b21337d9f26ddd2e97059
ID2.Manager/ID2.Manager.Common/Helpers/ID2Excel.cs | ||
---|---|---|
7 | 7 |
using GemBox.Spreadsheet; |
8 | 8 |
using ID2.Manager.Controller.Controllers; |
9 | 9 |
|
10 |
|
|
10 | 11 |
namespace ID2.Manager.Common.Helpers |
11 | 12 |
{ |
12 | 13 |
public class ID2Excel :IDisposable |
... | ... | |
16 | 17 |
|
17 | 18 |
public void Dispose() |
18 | 19 |
{ |
19 |
|
|
20 |
try |
|
21 |
{ |
|
22 |
} |
|
23 |
catch (Exception) |
|
24 |
{ |
|
25 |
throw; |
|
26 |
} |
|
27 |
finally |
|
28 |
{ |
|
29 |
GC.Collect(2); |
|
30 |
GC.Collect(2); |
|
31 |
} |
|
20 | 32 |
} |
21 | 33 |
|
22 | 34 |
public ID2Excel() |
... | ... | |
35 | 47 |
return userInfo ?? new UserInfo(); |
36 | 48 |
} |
37 | 49 |
|
50 |
private string GetColumnName(int column) |
|
51 |
{ |
|
52 |
int dividend = column; |
|
53 |
string columnName = string.Empty; |
|
54 |
|
|
55 |
while (dividend > 0) |
|
56 |
{ |
|
57 |
int modulo = (dividend - 1) % 26; |
|
58 |
columnName = Convert.ToChar(65 + modulo) + columnName; |
|
59 |
dividend = (dividend - modulo) / 26; |
|
60 |
} |
|
61 |
|
|
62 |
return columnName; |
|
63 |
} |
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
public ImportResult ExcelDataImport(List<ExcelData> ExcelData) |
|
68 |
{ |
|
69 |
ImportResult result = new ImportResult(); |
|
70 |
|
|
71 |
StringBuilder sbErrMsg = new StringBuilder(); |
|
72 |
|
|
73 |
try |
|
74 |
{ |
|
75 |
int rowCount = ExcelData.Max(x=>x.ROW_INDEX); |
|
76 |
int columnCount = ExcelData.Max(x => x.COUMMN_INDEX); |
|
77 |
int exRow = 9; |
|
78 |
|
|
79 |
#region Excel 유효성검사 |
|
80 |
|
|
81 |
//Excel 포멧체크 |
|
82 |
if (rowCount < 10 || columnCount != 45) |
|
83 |
{ |
|
84 |
result.Error = "Please, check the excel."; |
|
85 |
return result; |
|
86 |
} |
|
87 |
|
|
88 |
#region 엑셀 필수값 체크(도면 : 이름,담당자, 난이도, Typical) |
|
89 |
ExcelData.Where(col => col.ROW_INDEX > exRow) |
|
90 |
.Where(col => col.COUMMN_INDEX > 5 && col.COUMMN_INDEX < 11 && col.ROW_INDEX > exRow && string.IsNullOrEmpty(col.VALUE)) |
|
91 |
.ToList() |
|
92 |
.ForEach(p => sbErrMsg.Append(", " + p.TopLeftCell)); |
|
93 |
|
|
94 |
if (sbErrMsg.Length > 0) |
|
95 |
{ |
|
96 |
string errMsg = sbErrMsg.ToString().Substring(2); |
|
97 |
if (errMsg.Length > 100) |
|
98 |
{ |
|
99 |
errMsg = $"{errMsg.Substring(0, 100)}..."; |
|
100 |
} |
|
101 |
|
|
102 |
result.Error = $"Please, check null value in excel.\n{errMsg}"; |
|
103 |
return result; |
|
104 |
} |
|
105 |
#endregion |
|
106 |
|
|
107 |
#region 엑셀 도명명 중복 값 체크 |
|
108 |
ExcelData.Where(col => col.COUMMN_INDEX == 7 && col.ROW_INDEX > exRow) |
|
109 |
.GroupBy(g => g.ROW_INDEX) |
|
110 |
.Select(p => new |
|
111 |
{ |
|
112 |
rowIndex = p.Key, |
|
113 |
docNo = p.Select(x => x.VALUE.ToString()).FirstOrDefault() |
|
114 |
}) |
|
115 |
.GroupBy(g => g.docNo) |
|
116 |
.Where(p => p.Count() > 1) |
|
117 |
.Select(p => p.Select(x => (x.rowIndex + 1).ToString()) |
|
118 |
.Aggregate((x, y) => x.ToString() + "," + y.ToString()) |
|
119 |
.ToString()) |
|
120 |
.ToList().ForEach(p => sbErrMsg.Append("\n" + p.ToString())); |
|
121 |
|
|
122 |
if (sbErrMsg.Length > 0) |
|
123 |
{ |
|
124 |
sbErrMsg.Insert(0, "\n중복 된 도면명 Excel row : "); |
|
125 |
string errMsg = sbErrMsg.ToString(); |
|
126 |
if (errMsg.Length > 100) |
|
127 |
{ |
|
128 |
errMsg = $"{errMsg.Substring(0, 100)}..."; |
|
129 |
} |
|
130 |
|
|
131 |
result.Error = $"Please, check the duplicate value in excel.\n{errMsg}"; |
|
132 |
return result; |
|
133 |
} |
|
134 |
#endregion |
|
135 |
|
|
136 |
#endregion |
|
137 |
|
|
138 |
result.documents = new List<Documents>(); |
|
139 |
|
|
140 |
foreach (var row in ExcelData.Where(row => row.ROW_INDEX > exRow).GroupBy(x => x.ROW_INDEX)) |
|
141 |
{ |
|
142 |
var document = new Documents(); |
|
143 |
|
|
144 |
foreach (var cell in row) |
|
145 |
{ |
|
146 |
var value = cell.VALUE.DefalutValue(); |
|
147 |
|
|
148 |
switch (cell.COUMMN_INDEX) |
|
149 |
{ |
|
150 |
case 6: |
|
151 |
document.RefProjectCode = value; |
|
152 |
break; |
|
153 |
case 7: |
|
154 |
document.DocumentNo = value; |
|
155 |
break; |
|
156 |
case 8: |
|
157 |
document.PersonInCharge = this.GetUser(value).ID; |
|
158 |
break; |
|
159 |
case 9: |
|
160 |
document.JobLevel = value; |
|
161 |
break; |
|
162 |
|
|
163 |
case 10: |
|
164 |
document.IsTypical = value; |
|
165 |
break; |
|
166 |
case 11: |
|
167 |
document.RevisonNo = value; |
|
168 |
break; |
|
169 |
case 12: |
|
170 |
document.ToIsDiscussion = value; |
|
171 |
break; |
|
172 |
case 13: |
|
173 |
document.ToRemarks = value; |
|
174 |
break; |
|
175 |
case 14: |
|
176 |
document.ToCreator = this.GetUser(value).ID; |
|
177 |
break; |
|
178 |
case 17: |
|
179 |
document.FrReviewStatus = value; |
|
180 |
break; |
|
181 |
case 18: |
|
182 |
document.FrRemarks = value; |
|
183 |
break; |
|
184 |
case 19: |
|
185 |
document.FrCreator = this.GetUser(value).ID; |
|
186 |
break; |
|
187 |
case 22: |
|
188 |
document.IsID2Work = value; |
|
189 |
break; |
|
190 |
case 24: |
|
191 |
document.ID2StartDate = string.IsNullOrEmpty(value) ? (DateTime?)null : Convert.ToDateTime(value); |
|
192 |
break; |
|
193 |
case 25: |
|
194 |
document.ID2EndDate = string.IsNullOrEmpty(value) ? (DateTime?)null : Convert.ToDateTime(value); |
|
195 |
break; |
|
196 |
case 27: |
|
197 |
document.ID2Status = value; |
|
198 |
break; |
|
199 |
case 28: |
|
200 |
document.ID2Issues = value; |
|
201 |
break; |
|
202 |
case 30: |
|
203 |
document.AVEVAConvertDate = string.IsNullOrEmpty(value) ? (DateTime?)null : Convert.ToDateTime(value); |
|
204 |
break; |
|
205 |
case 31: |
|
206 |
document.AVEVAReviewDate = string.IsNullOrEmpty(value) ? (DateTime?)null : Convert.ToDateTime(value); |
|
207 |
break; |
|
208 |
case 32: |
|
209 |
document.AVEVAStatus = value; |
|
210 |
break; |
|
211 |
case 33: |
|
212 |
document.AVEVAIssues = value; |
|
213 |
break; |
|
214 |
case 36: |
|
215 |
document.ProdReviewer = this.GetUser(value).ID; |
|
216 |
break; |
|
217 |
case 37: |
|
218 |
document.ProdIsResult = value; |
|
219 |
break; |
|
220 |
case 38: |
|
221 |
document.ProdRemarks = value; |
|
222 |
break; |
|
223 |
case 39: |
|
224 |
document.ClientReviewer = this.GetUser(value).ID; |
|
225 |
break; |
|
226 |
case 40: |
|
227 |
document.ClientIsResult = value; |
|
228 |
break; |
|
229 |
case 41: |
|
230 |
document.ClientRemarks = value; |
|
231 |
break; |
|
232 |
case 42: |
|
233 |
document.DTIsGateWay = value; |
|
234 |
break; |
|
235 |
case 43: |
|
236 |
document.DTIsImport = value; |
|
237 |
break; |
|
238 |
case 44: |
|
239 |
document.DTIsRegSystem = value; |
|
240 |
break; |
|
241 |
case 45: |
|
242 |
document.DTRemarks = value; |
|
243 |
break; |
|
244 |
} |
|
245 |
|
|
246 |
} |
|
247 |
|
|
248 |
result.documents.Add(document); |
|
249 |
} |
|
250 |
} |
|
251 |
catch (Exception) |
|
252 |
{ |
|
253 |
throw; |
|
254 |
} |
|
255 |
|
|
256 |
return result; |
|
257 |
} |
|
258 |
|
|
259 |
|
|
38 | 260 |
public ImportResult GemboxImport(string fileName) |
39 | 261 |
{ |
40 | 262 |
ImportResult result = new ImportResult(); |
ID2.Manager/ID2.Manager.Common/Helpers/StringHelper.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
|
|
7 |
namespace ID2.Manager.Common.Helpers |
|
8 |
{ |
|
9 |
public static class StringHelper |
|
10 |
{ |
|
11 |
public static string DefalutValue(this string value) |
|
12 |
{ |
|
13 |
if(string.IsNullOrEmpty(value)) |
|
14 |
{ |
|
15 |
return string.Empty; |
|
16 |
} |
|
17 |
else |
|
18 |
{ |
|
19 |
return value; |
|
20 |
} |
|
21 |
} |
|
22 |
} |
|
23 |
} |
ID2.Manager/ID2.Manager.Common/ID2.Manager.Common.csproj | ||
---|---|---|
66 | 66 |
<Compile Include="Helpers\GemboxHelper.cs" /> |
67 | 67 |
<Compile Include="Helpers\ID2Excel.cs" /> |
68 | 68 |
<Compile Include="Helpers\ImportResult.cs" /> |
69 |
<Compile Include="Helpers\StringHelper.cs" /> |
|
69 | 70 |
<Compile Include="Informations.cs" /> |
70 | 71 |
<Compile Include="Properties\AssemblyInfo.cs" /> |
71 | 72 |
</ItemGroup> |
ID2.Manager/ID2.Manager.Controller/Controllers/ExcelDataController.cs | ||
---|---|---|
1 |
using ID2.Manager.Dapper.Repository; |
|
2 |
using ID2.Manager.Data.Models; |
|
3 |
using System; |
|
4 |
using System.Collections.Generic; |
|
5 |
using System.Linq; |
|
6 |
using System.Text; |
|
7 |
using System.Threading.Tasks; |
|
8 |
|
|
9 |
namespace ID2.Manager.Controller.Controllers |
|
10 |
{ |
|
11 |
public class ExcelDataController : BaseController |
|
12 |
{ |
|
13 |
public IEnumerable<ExcelData> GetExcelData(string FileName, string WorksheetName) |
|
14 |
{ |
|
15 |
IEnumerable<ExcelData> result = null; |
|
16 |
|
|
17 |
using (ExcelDataRepository repository = new ExcelDataRepository(this._MSSQLCONNSTR)) |
|
18 |
{ |
|
19 |
result = repository.GetExcelData(FileName, WorksheetName); |
|
20 |
} |
|
21 |
|
|
22 |
return result; |
|
23 |
} |
|
24 |
|
|
25 |
public IEnumerable<ExcelDataInfo> GetExcelDataInfo() |
|
26 |
{ |
|
27 |
IEnumerable<ExcelDataInfo> result = null; |
|
28 |
|
|
29 |
using (ExcelDataRepository repository = new ExcelDataRepository(this._MSSQLCONNSTR)) |
|
30 |
{ |
|
31 |
result = repository.GetExcelDataInfo(); |
|
32 |
} |
|
33 |
|
|
34 |
return result; |
|
35 |
} |
|
36 |
} |
|
37 |
} |
ID2.Manager/ID2.Manager.Controller/ID2.Manager.Controller.csproj | ||
---|---|---|
62 | 62 |
<ItemGroup> |
63 | 63 |
<Compile Include="Controllers\BaseController.cs" /> |
64 | 64 |
<Compile Include="Controllers\DocumentController.cs" /> |
65 |
<Compile Include="Controllers\ExcelDataController.cs" /> |
|
65 | 66 |
<Compile Include="Controllers\FileController.cs" /> |
66 | 67 |
<Compile Include="Controllers\ID2Controller.cs" /> |
67 | 68 |
<Compile Include="Controllers\MarkusInfoController.cs" /> |
ID2.Manager/ID2.Manager.Dapper/ID2.Manager.Dapper.csproj | ||
---|---|---|
70 | 70 |
<Compile Include="Properties\AssemblyInfo.cs" /> |
71 | 71 |
<Compile Include="Repository\BaseRepository.cs" /> |
72 | 72 |
<Compile Include="Repository\DocumentRepository.cs" /> |
73 |
<Compile Include="Repository\ExcelDataRepository.cs" /> |
|
73 | 74 |
<Compile Include="Repository\FileRepository.cs" /> |
74 | 75 |
<Compile Include="Repository\ID2Repository.cs" /> |
75 | 76 |
<Compile Include="Repository\MarkusRepository.cs" /> |
ID2.Manager/ID2.Manager.Dapper/Repository/ExcelDataRepository.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
using Dapper; |
|
7 |
using ID2.Manager.Data.Models; |
|
8 |
|
|
9 |
namespace ID2.Manager.Dapper.Repository |
|
10 |
{ |
|
11 |
public class ExcelDataRepository : BaseRepository |
|
12 |
{ |
|
13 |
public ExcelDataRepository(string connectionStr) : base(connectionStr) { } |
|
14 |
|
|
15 |
public IEnumerable<ExcelData> GetExcelData(string FileName,string WorksheetName) |
|
16 |
{ |
|
17 |
try |
|
18 |
{ |
|
19 |
string query = $@"select * from dbo.ImportExcel where [FILE_NAME] = @FileName and WORKSHEET_NAME = @WorksheetName"; |
|
20 |
var dynamicParameters = new DynamicParameters(); |
|
21 |
dynamicParameters.Add("@FileName", FileName); |
|
22 |
dynamicParameters.Add("@WorksheetName", WorksheetName); |
|
23 |
|
|
24 |
return Query<ExcelData>(query, dynamicParameters); |
|
25 |
} |
|
26 |
catch (Exception ex) |
|
27 |
{ |
|
28 |
throw ex; |
|
29 |
} |
|
30 |
} |
|
31 |
|
|
32 |
public IEnumerable<ExcelDataInfo> GetExcelDataInfo() |
|
33 |
{ |
|
34 |
try |
|
35 |
{ |
|
36 |
string query = $@"select [FILE_NAME],WORKSHEET_NAME from dbo.ImportExcel group by [FILE_NAME],WORKSHEET_NAME"; |
|
37 |
|
|
38 |
return Query<ExcelDataInfo>(query); |
|
39 |
} |
|
40 |
catch (Exception ex) |
|
41 |
{ |
|
42 |
throw ex; |
|
43 |
} |
|
44 |
} |
|
45 |
} |
|
46 |
} |
ID2.Manager/ID2.Manager.Data/ID2.Manager.Data.csproj | ||
---|---|---|
61 | 61 |
<Reference Include="System.Xml" /> |
62 | 62 |
</ItemGroup> |
63 | 63 |
<ItemGroup> |
64 |
<Compile Include="Models\ExcelData.cs" /> |
|
65 |
<Compile Include="Models\ExcelDataInfo.cs" /> |
|
64 | 66 |
<Compile Include="Models\MarkupText.cs" /> |
65 | 67 |
<Compile Include="Models\Documents.cs" /> |
66 | 68 |
<Compile Include="Models\FileInfo.cs" /> |
ID2.Manager/ID2.Manager.Data/Models/ExcelData.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
|
|
7 |
namespace ID2.Manager.Data.Models |
|
8 |
{ |
|
9 |
public class ExcelData |
|
10 |
{ |
|
11 |
public string FILE_NAME { get; set; } |
|
12 |
public string WORKSHEET_NAME { get; set; } |
|
13 |
|
|
14 |
public int COUMMN_INDEX { get; set; } |
|
15 |
|
|
16 |
public int ROW_INDEX { get; set; } |
|
17 |
|
|
18 |
public string VALUE { get; set; } |
|
19 |
|
|
20 |
public string TopLeftCell { get; set; } |
|
21 |
|
|
22 |
public string OBJECT_TYPE { get; set; } |
|
23 |
} |
|
24 |
} |
ID2.Manager/ID2.Manager.Data/Models/ExcelDataInfo.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.ComponentModel; |
|
4 |
using System.Linq; |
|
5 |
using System.Text; |
|
6 |
using System.Threading.Tasks; |
|
7 |
|
|
8 |
namespace ID2.Manager.Data.Models |
|
9 |
{ |
|
10 |
public class ExcelDataInfo : INotifyPropertyChanged |
|
11 |
{ |
|
12 |
private string fILE_NAME; |
|
13 |
private string wORKSHEET_NAME; |
|
14 |
|
|
15 |
public string FILE_NAME { get => fILE_NAME; |
|
16 |
set { |
|
17 |
|
|
18 |
if (fILE_NAME != value) |
|
19 |
{ |
|
20 |
fILE_NAME = value; |
|
21 |
OnNotifyPropertyChanged("FILE_NAME"); |
|
22 |
OnNotifyPropertyChanged("FullName"); |
|
23 |
} |
|
24 |
} |
|
25 |
} |
|
26 |
public string WORKSHEET_NAME |
|
27 |
{ |
|
28 |
get => wORKSHEET_NAME; |
|
29 |
set |
|
30 |
{ |
|
31 |
|
|
32 |
if (wORKSHEET_NAME != value) |
|
33 |
{ |
|
34 |
wORKSHEET_NAME = value; |
|
35 |
OnNotifyPropertyChanged("WORKSHEET_NAME"); |
|
36 |
OnNotifyPropertyChanged("FullName"); |
|
37 |
} |
|
38 |
} |
|
39 |
} |
|
40 |
|
|
41 |
public string FullName |
|
42 |
{ |
|
43 |
get |
|
44 |
{ |
|
45 |
return $"{FILE_NAME} :{WORKSHEET_NAME}"; |
|
46 |
} |
|
47 |
} |
|
48 |
|
|
49 |
#region INotifyPropertyChanged Implementation |
|
50 |
|
|
51 |
public event PropertyChangedEventHandler PropertyChanged; |
|
52 |
|
|
53 |
private void OnNotifyPropertyChanged(string property) |
|
54 |
{ |
|
55 |
if (this.PropertyChanged != null) |
|
56 |
{ |
|
57 |
this.PropertyChanged(this, new PropertyChangedEventArgs(property)); |
|
58 |
} |
|
59 |
} |
|
60 |
|
|
61 |
#endregion |
|
62 |
} |
|
63 |
} |
ID2.Manager/ID2.Manager/Controls/DetailRowInfo.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
using Telerik.WinControls.UI; |
|
7 |
|
|
8 |
namespace ID2.Manager.Controls |
|
9 |
{ |
|
10 |
public class DetailRowInfo : GridViewRowInfo |
|
11 |
{ |
|
12 |
public DetailRowInfo(GridViewInfo viewInfo) : base(viewInfo) |
|
13 |
{ |
|
14 |
} |
|
15 |
|
|
16 |
public override Type RowElementType |
|
17 |
{ |
|
18 |
get |
|
19 |
{ |
|
20 |
return typeof(RowDetailViewRowElement); |
|
21 |
} |
|
22 |
} |
|
23 |
} |
|
24 |
} |
ID2.Manager/ID2.Manager/Controls/MarkupIconItem.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Threading.Tasks; |
|
6 |
|
|
7 |
namespace ID2.Manager.Controls |
|
8 |
{ |
|
9 |
public class MarkupIconItem |
|
10 |
{ |
|
11 |
|
|
12 |
} |
|
13 |
} |
ID2.Manager/ID2.Manager/Forms/SelectExcelData.Designer.cs | ||
---|---|---|
1 |
|
|
2 |
namespace ID2.Manager.Forms |
|
3 |
{ |
|
4 |
partial class SelectExcelData |
|
5 |
{ |
|
6 |
/// <summary> |
|
7 |
/// Required designer variable. |
|
8 |
/// </summary> |
|
9 |
private System.ComponentModel.IContainer components = null; |
|
10 |
|
|
11 |
/// <summary> |
|
12 |
/// Clean up any resources being used. |
|
13 |
/// </summary> |
|
14 |
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> |
|
15 |
protected override void Dispose(bool disposing) |
|
16 |
{ |
|
17 |
if (disposing && (components != null)) |
|
18 |
{ |
|
19 |
components.Dispose(); |
|
20 |
} |
|
21 |
base.Dispose(disposing); |
|
22 |
} |
|
23 |
|
|
24 |
#region Windows Form Designer generated code |
|
25 |
|
|
26 |
/// <summary> |
|
27 |
/// Required method for Designer support - do not modify |
|
28 |
/// the contents of this method with the code editor. |
|
29 |
/// </summary> |
|
30 |
private void InitializeComponent() |
|
31 |
{ |
|
32 |
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); |
|
33 |
this.drpSelectExcel = new Telerik.WinControls.UI.RadDropDownList(); |
|
34 |
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); |
|
35 |
this.btnCancel = new Telerik.WinControls.UI.RadButton(); |
|
36 |
this.btnOK = new Telerik.WinControls.UI.RadButton(); |
|
37 |
this.tableLayoutPanel1.SuspendLayout(); |
|
38 |
((System.ComponentModel.ISupportInitialize)(this.drpSelectExcel)).BeginInit(); |
|
39 |
this.tableLayoutPanel2.SuspendLayout(); |
|
40 |
((System.ComponentModel.ISupportInitialize)(this.btnCancel)).BeginInit(); |
|
41 |
((System.ComponentModel.ISupportInitialize)(this.btnOK)).BeginInit(); |
|
42 |
((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); |
|
43 |
this.SuspendLayout(); |
|
44 |
// |
|
45 |
// tableLayoutPanel1 |
|
46 |
// |
|
47 |
this.tableLayoutPanel1.ColumnCount = 1; |
|
48 |
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); |
|
49 |
this.tableLayoutPanel1.Controls.Add(this.drpSelectExcel, 0, 0); |
|
50 |
this.tableLayoutPanel1.Controls.Add(this.tableLayoutPanel2, 0, 1); |
|
51 |
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; |
|
52 |
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); |
|
53 |
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; |
|
54 |
this.tableLayoutPanel1.RowCount = 2; |
|
55 |
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); |
|
56 |
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 40F)); |
|
57 |
this.tableLayoutPanel1.Size = new System.Drawing.Size(392, 170); |
|
58 |
this.tableLayoutPanel1.TabIndex = 0; |
|
59 |
// |
|
60 |
// drpSelectExcel |
|
61 |
// |
|
62 |
this.drpSelectExcel.Dock = System.Windows.Forms.DockStyle.Top; |
|
63 |
this.drpSelectExcel.DropDownAnimationEnabled = true; |
|
64 |
this.drpSelectExcel.ItemHeight = 50; |
|
65 |
this.drpSelectExcel.Location = new System.Drawing.Point(3, 3); |
|
66 |
this.drpSelectExcel.Name = "drpSelectExcel"; |
|
67 |
this.drpSelectExcel.Size = new System.Drawing.Size(386, 20); |
|
68 |
this.drpSelectExcel.TabIndex = 0; |
|
69 |
// |
|
70 |
// tableLayoutPanel2 |
|
71 |
// |
|
72 |
this.tableLayoutPanel2.ColumnCount = 2; |
|
73 |
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); |
|
74 |
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); |
|
75 |
this.tableLayoutPanel2.Controls.Add(this.btnCancel, 1, 0); |
|
76 |
this.tableLayoutPanel2.Controls.Add(this.btnOK, 0, 0); |
|
77 |
this.tableLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; |
|
78 |
this.tableLayoutPanel2.Location = new System.Drawing.Point(3, 133); |
|
79 |
this.tableLayoutPanel2.Name = "tableLayoutPanel2"; |
|
80 |
this.tableLayoutPanel2.RowCount = 1; |
|
81 |
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); |
|
82 |
this.tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); |
|
83 |
this.tableLayoutPanel2.Size = new System.Drawing.Size(386, 34); |
|
84 |
this.tableLayoutPanel2.TabIndex = 1; |
|
85 |
// |
|
86 |
// btnCancel |
|
87 |
// |
|
88 |
this.btnCancel.Dock = System.Windows.Forms.DockStyle.Left; |
|
89 |
this.btnCancel.Location = new System.Drawing.Point(203, 3); |
|
90 |
this.btnCancel.Margin = new System.Windows.Forms.Padding(10, 3, 10, 3); |
|
91 |
this.btnCancel.Name = "btnCancel"; |
|
92 |
this.btnCancel.Size = new System.Drawing.Size(110, 28); |
|
93 |
this.btnCancel.TabIndex = 1; |
|
94 |
this.btnCancel.Text = "Cancel"; |
|
95 |
// |
|
96 |
// btnOK |
|
97 |
// |
|
98 |
this.btnOK.Dock = System.Windows.Forms.DockStyle.Right; |
|
99 |
this.btnOK.Location = new System.Drawing.Point(73, 3); |
|
100 |
this.btnOK.Margin = new System.Windows.Forms.Padding(10, 3, 10, 3); |
|
101 |
this.btnOK.Name = "btnOK"; |
|
102 |
this.btnOK.Size = new System.Drawing.Size(110, 28); |
|
103 |
this.btnOK.TabIndex = 0; |
|
104 |
this.btnOK.Text = "Ok"; |
|
105 |
// |
|
106 |
// SelectExcelData |
|
107 |
// |
|
108 |
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); |
|
109 |
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; |
|
110 |
this.ClientSize = new System.Drawing.Size(392, 170); |
|
111 |
this.Controls.Add(this.tableLayoutPanel1); |
|
112 |
this.Name = "SelectExcelData"; |
|
113 |
this.Text = "SelectExcelData"; |
|
114 |
this.Load += new System.EventHandler(this.SelectExcelData_Load); |
|
115 |
this.tableLayoutPanel1.ResumeLayout(false); |
|
116 |
this.tableLayoutPanel1.PerformLayout(); |
|
117 |
((System.ComponentModel.ISupportInitialize)(this.drpSelectExcel)).EndInit(); |
|
118 |
this.tableLayoutPanel2.ResumeLayout(false); |
|
119 |
((System.ComponentModel.ISupportInitialize)(this.btnCancel)).EndInit(); |
|
120 |
((System.ComponentModel.ISupportInitialize)(this.btnOK)).EndInit(); |
|
121 |
((System.ComponentModel.ISupportInitialize)(this)).EndInit(); |
|
122 |
this.ResumeLayout(false); |
|
123 |
|
|
124 |
} |
|
125 |
|
|
126 |
#endregion |
|
127 |
|
|
128 |
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; |
|
129 |
private Telerik.WinControls.UI.RadDropDownList drpSelectExcel; |
|
130 |
private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; |
|
131 |
private Telerik.WinControls.UI.RadButton btnCancel; |
|
132 |
private Telerik.WinControls.UI.RadButton btnOK; |
|
133 |
} |
|
134 |
} |
ID2.Manager/ID2.Manager/Forms/SelectExcelData.cs | ||
---|---|---|
1 |
using ID2.Manager.Common; |
|
2 |
using ID2.Manager.Controller.Controllers; |
|
3 |
using ID2.Manager.Data.Models; |
|
4 |
using System; |
|
5 |
using System.Collections.Generic; |
|
6 |
using System.ComponentModel; |
|
7 |
using System.Data; |
|
8 |
using System.Drawing; |
|
9 |
using System.Linq; |
|
10 |
using System.Text; |
|
11 |
using System.Threading.Tasks; |
|
12 |
using System.Windows.Forms; |
|
13 |
using Telerik.WinControls; |
|
14 |
using Telerik.WinControls.Layouts; |
|
15 |
using Telerik.WinControls.UI; |
|
16 |
|
|
17 |
namespace ID2.Manager.Forms |
|
18 |
{ |
|
19 |
public partial class SelectExcelData : RadForm |
|
20 |
{ |
|
21 |
readonly Informations informations = Informations.Instance; |
|
22 |
|
|
23 |
|
|
24 |
/// <summary> |
|
25 |
/// 선택된 엑셀 파일에 대한 데이터 |
|
26 |
/// </summary> |
|
27 |
public List<ExcelData> SelectItems = new List<ExcelData>(); |
|
28 |
|
|
29 |
/// <summary> |
|
30 |
/// 선택된 엑셀 파일 |
|
31 |
/// </summary> |
|
32 |
public ExcelDataInfo SelectInfo = null; |
|
33 |
|
|
34 |
public SelectExcelData() |
|
35 |
{ |
|
36 |
InitializeComponent(); |
|
37 |
|
|
38 |
this.FormBorderStyle = FormBorderStyle.FixedDialog; |
|
39 |
|
|
40 |
btnOK.Click += BtnOK_Click; |
|
41 |
btnCancel.Click += BtnCancel_Click; |
|
42 |
|
|
43 |
drpSelectExcel.ItemDataBinding += DrpSelectExcel_ItemDataBinding; |
|
44 |
drpSelectExcel.CreatingVisualListItem += new CreatingVisualListItemEventHandler(DrpSelectExcel_CreatingVisualListItem); |
|
45 |
drpSelectExcel.DropDownSizingMode = SizingMode.UpDownAndRightBottom; |
|
46 |
drpSelectExcel.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList; |
|
47 |
drpSelectExcel.DropDownAnimationEnabled = false; |
|
48 |
} |
|
49 |
|
|
50 |
private void BtnCancel_Click(object sender, EventArgs e) |
|
51 |
{ |
|
52 |
this.SelectItems = new List<ExcelData>(); |
|
53 |
this.DialogResult = DialogResult.Cancel; |
|
54 |
this.Close(); |
|
55 |
} |
|
56 |
|
|
57 |
private void BtnOK_Click(object sender, EventArgs e) |
|
58 |
{ |
|
59 |
if (drpSelectExcel.SelectedItem != null) |
|
60 |
{ |
|
61 |
this.SelectInfo = drpSelectExcel.SelectedItem.DataBoundItem as ExcelDataInfo; |
|
62 |
|
|
63 |
SelectItems = new ExcelDataController().GetExcelData(this.SelectInfo.FILE_NAME, this.SelectInfo.WORKSHEET_NAME).ToList(); |
|
64 |
this.DialogResult = DialogResult.OK; |
|
65 |
this.Close(); |
|
66 |
} |
|
67 |
else |
|
68 |
{ |
|
69 |
MessageBox.Show("선택된 Sheet가 없습니다."); |
|
70 |
} |
|
71 |
|
|
72 |
} |
|
73 |
|
|
74 |
private void DrpSelectExcel_CreatingVisualListItem(object sender, CreatingVisualListItemEventArgs args) |
|
75 |
{ |
|
76 |
args.VisualItem = new ExcelVisualItem(); |
|
77 |
} |
|
78 |
|
|
79 |
private void DrpSelectExcel_ItemDataBinding(object sender, ListItemDataBindingEventArgs args) |
|
80 |
{ |
|
81 |
args.NewItem = new ExcelDataItem(); |
|
82 |
} |
|
83 |
|
|
84 |
private void SelectExcelData_Load(object sender, EventArgs e) |
|
85 |
{ |
|
86 |
var info = new ExcelDataController().GetExcelDataInfo(); |
|
87 |
drpSelectExcel.DisplayMember = "FullName"; |
|
88 |
drpSelectExcel.ValueMember = "FullName"; |
|
89 |
|
|
90 |
drpSelectExcel.DataSource = info; |
|
91 |
drpSelectExcel.AutoSizeItems = true; |
|
92 |
drpSelectExcel.SelectedIndex = -1; |
|
93 |
|
|
94 |
drpSelectExcel.ShowDropDown(); |
|
95 |
} |
|
96 |
} |
|
97 |
|
|
98 |
public class ExcelDataItem : RadListDataItem |
|
99 |
{ |
|
100 |
public static readonly RadProperty FileNameProperty = RadProperty.Register("FileName", typeof(string), typeof(ExcelDataItem), new RadElementPropertyMetadata("")); |
|
101 |
|
|
102 |
public static readonly RadProperty SheetNameProperty = RadProperty.Register("SheetName", typeof(string), typeof(ExcelDataItem), new RadElementPropertyMetadata("")); |
|
103 |
|
|
104 |
public string FileName |
|
105 |
{ |
|
106 |
get |
|
107 |
{ |
|
108 |
return (string)this.GetValue(ExcelDataItem.FileNameProperty); |
|
109 |
} |
|
110 |
set |
|
111 |
{ |
|
112 |
this.SetValue(ExcelDataItem.FileNameProperty, value); |
|
113 |
} |
|
114 |
} |
|
115 |
|
|
116 |
public string SheetName |
|
117 |
{ |
|
118 |
get |
|
119 |
{ |
|
120 |
return (string)this.GetValue(ExcelDataItem.SheetNameProperty); |
|
121 |
} |
|
122 |
set |
|
123 |
{ |
|
124 |
this.SetValue(ExcelDataItem.SheetNameProperty, value); |
|
125 |
} |
|
126 |
} |
|
127 |
|
|
128 |
private void item_PropertyChanged(object sender, PropertyChangedEventArgs e) |
|
129 |
{ |
|
130 |
if (e.PropertyName == "FileName") |
|
131 |
{ |
|
132 |
this.FileName = (this.DataBoundItem as ExcelDataInfo).FILE_NAME; |
|
133 |
} |
|
134 |
|
|
135 |
if (e.PropertyName == "SheetName") |
|
136 |
{ |
|
137 |
this.SheetName = (this.DataBoundItem as ExcelDataInfo).WORKSHEET_NAME; |
|
138 |
} |
|
139 |
} |
|
140 |
protected override void SetDataBoundItem(bool dataBinding, object value) |
|
141 |
{ |
|
142 |
base.SetDataBoundItem(dataBinding, value); |
|
143 |
if (value is INotifyPropertyChanged) |
|
144 |
{ |
|
145 |
INotifyPropertyChanged item = value as INotifyPropertyChanged; |
|
146 |
item.PropertyChanged += item_PropertyChanged; |
|
147 |
} |
|
148 |
} |
|
149 |
|
|
150 |
|
|
151 |
|
|
152 |
} |
|
153 |
public class ExcelVisualItem : RadListVisualItem |
|
154 |
{ |
|
155 |
#region Fields |
|
156 |
|
|
157 |
private LightVisualElement lbFileName = new LightVisualElement(); |
|
158 |
private LightVisualElement lbSheetName = new LightVisualElement(); |
|
159 |
|
|
160 |
#endregion |
|
161 |
|
|
162 |
#region Initialization |
|
163 |
|
|
164 |
static ExcelVisualItem() |
|
165 |
{ |
|
166 |
RadListVisualItem.SynchronizationProperties.Add(ExcelDataItem.FileNameProperty); |
|
167 |
RadListVisualItem.SynchronizationProperties.Add(ExcelDataItem.SheetNameProperty); |
|
168 |
|
|
169 |
} |
|
170 |
|
|
171 |
#endregion |
|
172 |
|
|
173 |
#region Overrides |
|
174 |
|
|
175 |
protected override Type ThemeEffectiveType |
|
176 |
{ |
|
177 |
get |
|
178 |
{ |
|
179 |
return typeof(RadListVisualItem); |
|
180 |
} |
|
181 |
} |
|
182 |
|
|
183 |
protected override void CreateChildElements() |
|
184 |
{ |
|
185 |
base.CreateChildElements(); |
|
186 |
|
|
187 |
this.lbFileName.StretchHorizontally = true; |
|
188 |
this.lbFileName.DrawImage = false; |
|
189 |
this.lbFileName.DrawText = true; |
|
190 |
this.lbFileName.TextAlignment = ContentAlignment.MiddleLeft; |
|
191 |
|
|
192 |
this.lbSheetName.StretchHorizontally = true; |
|
193 |
this.lbSheetName.DrawImage = false; |
|
194 |
this.lbSheetName.DrawText = true; |
|
195 |
this.lbSheetName.TextAlignment = ContentAlignment.MiddleLeft; |
|
196 |
|
|
197 |
StackLayoutPanel stack = new StackLayoutPanel(); |
|
198 |
stack.Orientation = Orientation.Vertical; |
|
199 |
stack.Children.Add(lbFileName); |
|
200 |
stack.Children.Add(lbSheetName); |
|
201 |
|
|
202 |
this.Children.Add(stack); |
|
203 |
} |
|
204 |
|
|
205 |
protected override void PropertySynchronized(RadProperty property) |
|
206 |
{ |
|
207 |
ExcelDataInfo dataItem = (ExcelDataInfo)this.Data.DataBoundItem; |
|
208 |
|
|
209 |
this.Text = ""; |
|
210 |
|
|
211 |
if (property == ExcelDataItem.FileNameProperty) |
|
212 |
{ |
|
213 |
this.lbFileName.Text = dataItem.FILE_NAME; |
|
214 |
} |
|
215 |
|
|
216 |
if (property == ExcelDataItem.SheetNameProperty) |
|
217 |
{ |
|
218 |
this.lbSheetName.Text =$" - {dataItem.WORKSHEET_NAME}"; |
|
219 |
} |
|
220 |
} |
|
221 |
|
|
222 |
#endregion |
|
223 |
} |
|
224 |
|
|
225 |
} |
ID2.Manager/ID2.Manager/Forms/SelectExcelData.resx | ||
---|---|---|
1 |
<?xml version="1.0" encoding="utf-8"?> |
|
2 |
<root> |
|
3 |
<!-- |
|
4 |
Microsoft ResX Schema |
|
5 |
|
|
6 |
Version 2.0 |
|
7 |
|
|
8 |
The primary goals of this format is to allow a simple XML format |
|
9 |
that is mostly human readable. The generation and parsing of the |
|
10 |
various data types are done through the TypeConverter classes |
|
11 |
associated with the data types. |
|
12 |
|
|
13 |
Example: |
|
14 |
|
|
15 |
... ado.net/XML headers & schema ... |
|
16 |
<resheader name="resmimetype">text/microsoft-resx</resheader> |
|
17 |
<resheader name="version">2.0</resheader> |
|
18 |
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> |
|
19 |
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> |
|
20 |
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> |
|
21 |
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> |
|
22 |
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> |
|
23 |
<value>[base64 mime encoded serialized .NET Framework object]</value> |
|
24 |
</data> |
|
25 |
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> |
|
26 |
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> |
|
27 |
<comment>This is a comment</comment> |
|
28 |
</data> |
|
29 |
|
|
30 |
There are any number of "resheader" rows that contain simple |
|
31 |
name/value pairs. |
|
32 |
|
|
33 |
Each data row contains a name, and value. The row also contains a |
|
34 |
type or mimetype. Type corresponds to a .NET class that support |
|
35 |
text/value conversion through the TypeConverter architecture. |
|
36 |
Classes that don't support this are serialized and stored with the |
|
37 |
mimetype set. |
|
38 |
|
|
39 |
The mimetype is used for serialized objects, and tells the |
|
40 |
ResXResourceReader how to depersist the object. This is currently not |
|
41 |
extensible. For a given mimetype the value must be set accordingly: |
|
42 |
|
|
43 |
Note - application/x-microsoft.net.object.binary.base64 is the format |
|
44 |
that the ResXResourceWriter will generate, however the reader can |
|
45 |
read any of the formats listed below. |
|
46 |
|
|
47 |
mimetype: application/x-microsoft.net.object.binary.base64 |
|
48 |
value : The object must be serialized with |
|
49 |
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter |
|
50 |
: and then encoded with base64 encoding. |
|
51 |
|
|
52 |
mimetype: application/x-microsoft.net.object.soap.base64 |
|
53 |
value : The object must be serialized with |
|
54 |
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter |
|
55 |
: and then encoded with base64 encoding. |
|
56 |
|
|
57 |
mimetype: application/x-microsoft.net.object.bytearray.base64 |
|
58 |
value : The object must be serialized into a byte array |
|
59 |
: using a System.ComponentModel.TypeConverter |
|
60 |
: and then encoded with base64 encoding. |
|
61 |
--> |
|
62 |
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> |
|
63 |
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> |
|
64 |
<xsd:element name="root" msdata:IsDataSet="true"> |
|
65 |
<xsd:complexType> |
|
66 |
<xsd:choice maxOccurs="unbounded"> |
|
67 |
<xsd:element name="metadata"> |
|
68 |
<xsd:complexType> |
|
69 |
<xsd:sequence> |
|
70 |
<xsd:element name="value" type="xsd:string" minOccurs="0" /> |
|
71 |
</xsd:sequence> |
|
72 |
<xsd:attribute name="name" use="required" type="xsd:string" /> |
|
73 |
<xsd:attribute name="type" type="xsd:string" /> |
|
74 |
<xsd:attribute name="mimetype" type="xsd:string" /> |
|
75 |
<xsd:attribute ref="xml:space" /> |
|
76 |
</xsd:complexType> |
|
77 |
</xsd:element> |
|
78 |
<xsd:element name="assembly"> |
|
79 |
<xsd:complexType> |
|
80 |
<xsd:attribute name="alias" type="xsd:string" /> |
|
81 |
<xsd:attribute name="name" type="xsd:string" /> |
|
82 |
</xsd:complexType> |
|
83 |
</xsd:element> |
|
84 |
<xsd:element name="data"> |
|
85 |
<xsd:complexType> |
|
86 |
<xsd:sequence> |
|
87 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
88 |
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> |
|
89 |
</xsd:sequence> |
|
90 |
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> |
|
91 |
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> |
|
92 |
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> |
|
93 |
<xsd:attribute ref="xml:space" /> |
|
94 |
</xsd:complexType> |
|
95 |
</xsd:element> |
|
96 |
<xsd:element name="resheader"> |
|
97 |
<xsd:complexType> |
|
98 |
<xsd:sequence> |
|
99 |
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> |
|
100 |
</xsd:sequence> |
|
101 |
<xsd:attribute name="name" type="xsd:string" use="required" /> |
|
102 |
</xsd:complexType> |
|
103 |
</xsd:element> |
|
104 |
</xsd:choice> |
|
105 |
</xsd:complexType> |
|
106 |
</xsd:element> |
|
107 |
</xsd:schema> |
|
108 |
<resheader name="resmimetype"> |
|
109 |
<value>text/microsoft-resx</value> |
|
110 |
</resheader> |
|
111 |
<resheader name="version"> |
|
112 |
<value>2.0</value> |
|
113 |
</resheader> |
|
114 |
<resheader name="reader"> |
|
115 |
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
116 |
</resheader> |
|
117 |
<resheader name="writer"> |
|
118 |
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> |
|
119 |
</resheader> |
|
120 |
</root> |
ID2.Manager/ID2.Manager/ID2.Manager.csproj | ||
---|---|---|
122 | 122 |
<Compile Include="Forms\Login.Designer.cs"> |
123 | 123 |
<DependentUpon>Login.cs</DependentUpon> |
124 | 124 |
</Compile> |
125 |
<Compile Include="Forms\SelectExcelData.cs"> |
|
126 |
<SubType>Form</SubType> |
|
127 |
</Compile> |
|
128 |
<Compile Include="Forms\SelectExcelData.Designer.cs"> |
|
129 |
<DependentUpon>SelectExcelData.cs</DependentUpon> |
|
130 |
</Compile> |
|
125 | 131 |
<Compile Include="Forms\SetupProject.cs"> |
126 | 132 |
<SubType>Form</SubType> |
127 | 133 |
</Compile> |
... | ... | |
167 | 173 |
<EmbeddedResource Include="Forms\Login.resx"> |
168 | 174 |
<DependentUpon>Login.cs</DependentUpon> |
169 | 175 |
</EmbeddedResource> |
176 |
<EmbeddedResource Include="Forms\SelectExcelData.resx"> |
|
177 |
<DependentUpon>SelectExcelData.cs</DependentUpon> |
|
178 |
</EmbeddedResource> |
|
170 | 179 |
<EmbeddedResource Include="Forms\SetupProject.resx"> |
171 | 180 |
<DependentUpon>SetupProject.cs</DependentUpon> |
172 | 181 |
</EmbeddedResource> |
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, 74F));
|
|
434 |
this.tableLayoutPanelCondition.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 86F));
|
|
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(345, 32);
|
|
479 |
this.radDropDownListFrReviewStatus.Location = new System.Drawing.Point(342, 32);
|
|
480 | 480 |
this.radDropDownListFrReviewStatus.Name = "radDropDownListFrReviewStatus"; |
481 |
this.radDropDownListFrReviewStatus.Size = new System.Drawing.Size(111, 20);
|
|
481 |
this.radDropDownListFrReviewStatus.Size = new System.Drawing.Size(108, 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(111, 20);
|
|
491 |
this.radDropDownListToIsDiscussion.Size = new System.Drawing.Size(108, 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(259, 34);
|
|
498 |
this.radLabelFrReviewStatus.Location = new System.Drawing.Point(256, 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(259, 62);
|
|
528 |
this.radLabelAVEVAStatus.Location = new System.Drawing.Point(256, 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(463, 34);
|
|
538 |
this.radLabelIsID2Work.Location = new System.Drawing.Point(457, 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(463, 6);
|
|
548 |
this.radLabelJobLevel.Location = new System.Drawing.Point(457, 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(879, 4);
|
|
599 |
this.radButtonSearch.Location = new System.Drawing.Point(873, 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(111, 20);
|
|
613 |
this.radDropDownListProject.Size = new System.Drawing.Size(108, 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(667, 6);
|
|
620 |
this.radLabelDocumentNo.Location = new System.Drawing.Point(658, 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(753, 4);
|
|
629 |
this.radTextBoxDocumentNo.Location = new System.Drawing.Point(744, 4);
|
|
630 | 630 |
this.radTextBoxDocumentNo.Name = "radTextBoxDocumentNo"; |
631 |
this.radTextBoxDocumentNo.Size = new System.Drawing.Size(111, 20);
|
|
631 |
this.radTextBoxDocumentNo.Size = new System.Drawing.Size(108, 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(259, 6);
|
|
638 |
this.radLabelPersonInCharge.Location = new System.Drawing.Point(256, 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(345, 4);
|
|
649 |
this.radDropDownListPersonInCharge.Location = new System.Drawing.Point(342, 4);
|
|
650 | 650 |
this.radDropDownListPersonInCharge.Name = "radDropDownListPersonInCharge"; |
651 |
this.radDropDownListPersonInCharge.Size = new System.Drawing.Size(111, 20);
|
|
651 |
this.radDropDownListPersonInCharge.Size = new System.Drawing.Size(108, 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(549, 4);
|
|
669 |
this.radDropDownListJobLevel.Location = new System.Drawing.Point(543, 4);
|
|
670 | 670 |
this.radDropDownListJobLevel.Name = "radDropDownListJobLevel"; |
671 |
this.radDropDownListJobLevel.Size = new System.Drawing.Size(111, 20);
|
|
671 |
this.radDropDownListJobLevel.Size = new System.Drawing.Size(108, 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(259, 90);
|
|
688 |
this.radLabel10.Location = new System.Drawing.Point(256, 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(549, 32);
|
|
699 |
this.radDropDownListIsID2Work.Location = new System.Drawing.Point(543, 32);
|
|
700 | 700 |
this.radDropDownListIsID2Work.Name = "radDropDownListIsID2Work"; |
701 |
this.radDropDownListIsID2Work.Size = new System.Drawing.Size(111, 20);
|
|
701 |
this.radDropDownListIsID2Work.Size = new System.Drawing.Size(108, 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(111, 20);
|
|
711 |
this.radDropDownListID2Status.Size = new System.Drawing.Size(108, 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(345, 60);
|
|
719 |
this.radDropDownListAVEVAStatus.Location = new System.Drawing.Point(342, 60);
|
|
720 | 720 |
this.radDropDownListAVEVAStatus.Name = "radDropDownListAVEVAStatus"; |
721 |
this.radDropDownListAVEVAStatus.Size = new System.Drawing.Size(111, 20);
|
|
721 |
this.radDropDownListAVEVAStatus.Size = new System.Drawing.Size(108, 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(111, 20);
|
|
731 |
this.radDropDownListProdIsResult.Size = new System.Drawing.Size(108, 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(345, 89);
|
|
739 |
this.radDropDownListClientIsResult.Location = new System.Drawing.Point(342, 89);
|
|
740 | 740 |
this.radDropDownListClientIsResult.Name = "radDropDownListClientIsResult"; |
741 |
this.radDropDownListClientIsResult.Size = new System.Drawing.Size(111, 20);
|
|
741 |
this.radDropDownListClientIsResult.Size = new System.Drawing.Size(108, 20);
|
|
742 | 742 |
this.radDropDownListClientIsResult.TabIndex = 16; |
743 | 743 |
// |
744 | 744 |
// tableLayoutPanelGroup |
ID2.Manager/ID2.Manager/Main.cs | ||
---|---|---|
1026 | 1026 |
|
1027 | 1027 |
return prjInfo ?? new ProjectInfo(); |
1028 | 1028 |
} |
1029 |
|
|
1029 | 1030 |
private void RadButtonElementExcelImport_Click(object sender, EventArgs e) |
1030 | 1031 |
{ |
1032 |
var form = new Forms.SelectExcelData(); |
|
1033 |
|
|
1034 |
var dialogResult = form.ShowDialog(); |
|
1035 |
|
|
1036 |
if (dialogResult == DialogResult.OK) |
|
1037 |
{ |
|
1038 |
using (ID2Excel excel = new ID2Excel()) |
|
1039 |
{ |
|
1040 |
var result = excel.ExcelDataImport(form.SelectItems); |
|
1041 |
|
|
1042 |
if (result.Error != null) |
|
1043 |
{ |
|
1044 |
|
|
1045 |
RadMessageBox.Show(result.Error, "Information", MessageBoxButtons.OK, RadMessageIcon.Info); |
|
1046 |
} |
|
1047 |
else |
|
1048 |
{ |
|
1049 |
this.documents.AddRange(result.documents); |
|
1050 |
if (this.orgDocuments == null) this.orgDocuments = new List<Documents>(); |
|
1051 |
this.DocumentListBinding(); |
|
1052 |
} |
|
1053 |
|
|
1054 |
} |
|
1055 |
} |
|
1056 |
} |
|
1057 |
|
|
1058 |
private void RadButtonElementExcelImport_Click_gembox(object sender, EventArgs e) |
|
1059 |
{ |
|
1031 | 1060 |
using (OpenFileDialog ofd = new OpenFileDialog() |
1032 | 1061 |
{ |
1033 | 1062 |
Filter = "Excel files (*.xlsx)|*.xlsx", |
내보내기 Unified diff