public static string GetShortCode(this IPurchaseOrder po) { //may be null if no account is specified yet var acct = po.GetAccount(); return((acct == null) ? string.Empty : acct.ShortCode); }