private static void addNewAddress(ProductChild pc, Person ownerPerson, AddressBiz addressBiz, AddressMain addressToSave) { pc.ShipFromAddressId = addressToSave.Id; if (addressToSave.ProductChilds.IsNull()) { addressToSave.ProductChilds = new List <ProductChild>(); } addressToSave.ProductChilds.Add(pc); ownerPerson.Addresses.Add(addressToSave); addressToSave.PersonId = ownerPerson.Id; addressBiz.Create(addressToSave); }
private void addNewAddress(ICommonWithId entity, Person person, AddressBiz addressBiz, AddressMain addressToSave) { ProductChild pc = entity as ProductChild; pc.IsNullThrowException(); pc.ShipFromAddressId = addressToSave.Id; if (addressToSave.ProductChilds.IsNull()) { addressToSave.ProductChilds = new List <ProductChild>(); } addressToSave.ProductChilds.Add(pc); person.Addresses.Add(addressToSave); addressToSave.PersonId = person.Id; addressBiz.Create(addressToSave); }
private void createAndAssignNew_ShipToAddress(BuySellDoc buySellDoc) { AddressMain addressToSave = AddressBiz.Factory() as AddressMain; addressToSave.LoadFor(buySellDoc.AddressShipToComplex); addressToSave.Name = addressToSave.MakeUniqueName(); if (addressToSave.BuySellDocs.IsNull()) { addressToSave.BuySellDocs = new List <BuySellDoc>(); } addressToSave.BuySellDocs.Add(buySellDoc); addressToSave.PersonId = buySellDoc.Customer.PersonId; buySellDoc.Customer.Person.Addresses.Add(addressToSave); buySellDoc.AddressShipToId = addressToSave.Id; AddressBiz.Create(addressToSave); }