/
COBieError.cs
80 lines (69 loc) · 2.45 KB
/
COBieError.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using System;
using System.Diagnostics;
namespace Xbim.COBie
{
[Serializable()]
[DebuggerDisplay("{SheetName}.{FieldName} : {ErrorDescription} - '{FieldValue}' [{Row},{Column}]")]
public class COBieError
{
// this will contain all the cells that are mandatory but not supplied and user needs to fill in
// as we need to generate spreadsheet even if there is missing mandatory data
public COBieError()
{
}
public COBieError(string sheetName, string fieldName, string errorDescription)
{
SheetName = sheetName;
FieldName = fieldName;
ErrorDescription = errorDescription;
}
public COBieError(string sheetName, string fieldName, string errorDescription, ErrorTypes errorType, ErrorLevels errorLevel, string initialRowHash, int column = 0, int row = 0)
{
SheetName = sheetName;
FieldName = fieldName;
ErrorDescription = errorDescription;
ErrorType = errorType;
Column = column;
Row = row;
InitialRowHash = initialRowHash;
ErrorLevel = errorLevel;
}
public COBieError(string fieldName, string errorDescription)
{
FieldName = fieldName;
ErrorDescription = errorDescription;
}
public string SheetName { get; private set; }
public string FieldName { get; private set; }
public string ErrorDescription { get; set; }
public ErrorTypes ErrorType { get; set; }
public ErrorLevels ErrorLevel { get; set; }
public string FieldValue { get; set; }
public int Column { get; set;}
public int Row { get; set ;}
public string InitialRowHash { get; private set; }
public enum ErrorTypes
{
Value_Out_of_Bounds,
AlphaNumeric_Value_Expected,
Email_Value_Expected,
ISODate_Value_Expected,
Numeric_Value_Expected,
Text_Value_Expected,
PrimaryKey_Violation,
Null_ForeignKey_Value,
ForeignKey_Violation,
PickList_Violation,
None
}
/// <summary>
/// Level of error
/// </summary>
public enum ErrorLevels
{
Error,
Warning,
None
}
}
}