public static IEnumerable <Address> GetCustomerAddresses(int customerID) { UserIdentity ident = null; try { ident = Identity.Current; } catch { } //null-safe for tests return(ExigoDAL.GetCustomerAddresses(customerID, (ident != null ? (customerID == ident.CustomerID) : false))); }
public void Initialize(int customerID) { var addresses = ExigoDAL.GetCustomerAddresses(customerID); this.MainAddress = addresses.Where(c => c.AddressType == AddressType.Main).FirstOrDefault() as Address; this.MailingAddress = addresses.Where(c => c.AddressType == AddressType.Mailing).FirstOrDefault() as Address; this.OtherAddress = addresses.Where(c => c.AddressType == AddressType.Other).FirstOrDefault() as Address; }