Before I go too far, does this look right?
This is mostly to have a "central" place that hold a "hierarchical/structured" errors message.
public static class ValidationError
{
static ValidationError()
{
Prefix = "VE";
Notice = new _Notice();
Exporter = new _Exporter();
Importer = new _Importer();
Shipping = new _Shipping();
//few others one
}
public static string Prefix { get; private set; }
public static _Notice Notice { get; private set; }
public class _Notice
{
public _Notice()
{
Prefix = ValidationError.Prefix + "NO";
MustHaveOneTreatmentOption = Prefix + "001";
}
public string Prefix { get; private set; }
public string MustHaveOneTreatmentOption { get; private set; }
}
public static _Exporter Exporter { get; private set; }
public class _Exporter
{
public _Exporter()
{
Prefix = ValidationError.Prefix + "EX";
Mailing = new Address(Prefix, "MA");
Physical = new Address(Prefix, "PH");
}
public string Prefix { get; private set; }
public Address Mailing { get; private set; }
public Address Physical { get; private set; }
}
public static _Importer Importer { get; private set; }
public class _Importer
{
public _Importer()
{
Prefix = ValidationError.Prefix + "IM";
}
public string Prefix { get; private set; }
}
public static _Shipping Shipping { get; private set; }
public class _Shipping
{
public _Shipping()
{
Prefix = ValidationError.Prefix + "SH";
}
public string Prefix { get; private set; }
}
public class Address
{
public Address(string _Prefix, string _Suffix)
{
Prefix = _Prefix + _Suffix + "AD";
}
public string Prefix { get; private set; }
}
}