예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
파일: Fix.cs 프로젝트: dovanduy/Library
        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);
        }