public static DE.IAddress AddNewShippingAddress(DE.ICustomer customer) { DE.IAddress address = null; address = GetNewAddressDefaults(customer); using (frmNewShippingAddress dlg = new frmNewShippingAddress(customer, address)) { InternalApplication.ApplicationFramework.POSShowForm(dlg); if (dlg.DialogResult == DialogResult.OK) { address = dlg.Address; } } return(address); }
/// <summary> /// Invoke the 'Add Shipping Address' dialog to edit an existing address /// </summary> /// <param name="addressRecId">address rec id</param> /// <param name="existingCustomer">customer that this address is to be associated with</param> internal static DE.IAddress EditShippingAddress(long addressRecId, DE.ICustomer existingCustomer) { DM.CustomerDataManager customerDataManager = new DM.CustomerDataManager( ApplicationSettings.Database.LocalConnection, ApplicationSettings.Database.DATAAREAID); DE.IAddress address = customerDataManager.GetAddress(addressRecId); using (frmNewShippingAddress dlg = new frmNewShippingAddress(existingCustomer, address)) { InternalApplication.ApplicationFramework.POSShowForm(dlg); if (dlg.DialogResult == DialogResult.OK) { address = dlg.Address; } } return(address); }