hytos / ID2.Manager / ID2.Manager.Common / Helpers / GemboxHelper.cs @ 2ade1e61
이력 | 보기 | 이력해설 | 다운로드 (1.24 KB)
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 |
} |