forked from nicocrm/IntacctClient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIntacctError.cs
34 lines (30 loc) · 1.07 KB
/
IntacctError.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
using System.Diagnostics;
using System.Xml.Linq;
namespace Intacct
{
[DebuggerDisplay("{Number}: {Description2}")]
public class IntacctError
{
public string Number { get; private set; }
public string Description { get; private set; }
public string Description2 { get; private set; }
public string Source { get; private set; }
public string Correction { get; private set; }
internal IntacctError() {}
internal static IntacctError FromXml(XElement errorElement)
{
return new IntacctError
{
Number = errorElement.Element("errorno")?.Value,
Description = errorElement.Element("description")?.Value,
Description2 = errorElement.Element("description2")?.Value,
Source = errorElement.Element("source")?.Value,
Correction = errorElement.Element("correction")?.Value
};
}
public override string ToString()
{
return $"[ Number: {Number ?? "--"}, Description: {Description ?? "--"}, Description2: {Description2 ?? "--"}, Source: {Source ?? "--"}, Correction: {Correction ?? "--"} ]";
}
}
}