Blank OrderAddress in PurchaseOrder
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Commerce Server > Commerce Server General > Blank OrderAddress in PurchaseOrder




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Blank OrderAddress in PurchaseOrder  
Craig Boland


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-17-05 10:52 PM

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 calling
Basket.Addresses.Add and Basket.SetBillingAddress methods, then populate the
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 SP3
,
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);






[ Post a follow-up to this message ]



    Re: Blank OrderAddress in PurchaseOrder  
Tomas Vera


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
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 ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:34 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register