public static AddressType GetTelecommunicationNumberType(FinancialEntities context) { AddressType telecommunicationNumberType = new AddressType(); telecommunicationNumberType = context.AddressTypes.SingleOrDefault(entity => entity.Name == AddressTypeEnums.TelecommunicationNumber); InitialDatabaseValueChecker.ThrowIfNull<AddressType>(telecommunicationNumberType); return telecommunicationNumberType; }
public static AddressType GetPostalAddressType(FinancialEntities context) { AddressType postalAddressType = new AddressType(); postalAddressType = context.AddressTypes.SingleOrDefault(entity => entity.Name == AddressTypeEnums.PostalAddress); InitialDatabaseValueChecker.ThrowIfNull<AddressType>(postalAddressType); return postalAddressType; }
public static Address AddAddress(Party party, AddressType addressType, DateTime today) { Address address = new Address(); address.Party = party; address.AddressType = addressType; address.EffectiveDate = today; return address; }
//New Address protected Address CreateAddress(Party Party, AddressType AddressType, DateTime Today) { Address NewAddress = new Address(); NewAddress.Party = Party; NewAddress.AddressType = AddressType; NewAddress.EffectiveDate = Today; NewAddress.EndDate = null; ObjectContext.Addresses.AddObject(NewAddress); return NewAddress; }