04-18-05 10:51 PM
I don't think that this is a CS error.
It seems logical that calling "Add" will create and add a copy of the
address to the basket.
If it simply copies over a "pointer" to your address, your could
delete the address and corrupt the basket.
-tomas vera
On Sun, 17 Apr 2005 13:51:16 -0700, Craig Boland
<CraigBoland@discussions.microsoft.com> wrote:
>I've come across an issue with CS2002 SP2 whereby creating an OrderAddress
>and adding it to a Basket results in the OrderAddress having empty data.
>
>If I create an new OrderAddress instance, assign it to the Basket by callin
g
>Basket.Addresses.Add and Basket.SetBillingAddress methods, then populate th
e
>address (FirstName, LastName, etc.), the address will be blank in the
>PurchaseOrder (from Basket.SaveAsOrder method). However, if I populate the
>address _before_ assigning it to the Basket, the address will be correct in
>the PurchaseOrder. Below are examples of this issue. I've yet to install SP
3,
>so this may have been fixed.
>
>// Results in blank address
>OrderAddress billAddr = new OrderAddress("default", Guid.NewGuid.ToString()
);
>myBasket.Addresses.Add(billAddr);
>myBasket.SetBillingAddress(billAddr.ID);
>billAddr.FirstName = "Joe";
>
>// Results in correct address
>OrderAddress billAddr = new OrderAddress("default", Guid.NewGuid.ToString()
);
>billAddr.FirstName = "Joe";
>myBasket.Addresses.Add(billAddr);
>myBasket.SetBillingAddress(billAddr.ID);
/*-------------------------------
* Tomas Vera
* tomas (at) sbcglobal (dot) net
*-------------------------------
*/
[ Post a follow-up to this message ]
|