nklbala

Hi

I have used GetBasketAsDataset() method to which returns a Basket as dataset. Is there any way to convert this Dataset into a Basket Object

something like this..

DataSet dsBasket = OrderContext.GetBasketAsDataset();

Bakset myBasket = (Basket)dsBasket;

Please advise.



Re: Commerce Server 2007 How to convert Dataset into Basket?

Jeff Lynch - MVP

I'm a little confused. The OrderContext class found in the Microsoft.CommerceServer.Runtime.Orders namespace doesn't contain a GetBasketAsDataSet method. This method is found in the BasketManager class found in the Microsoft.CommerceServer.Orders namespace. This method is also found in the OrdersWebService.

Can you explain a little more about what you're trying to accomplish and where you are running this code (external application or in your site code)

Jeff Lynch

MVP Windows Server System - Commerce Server

http://codebetter.com/blogs/jeff.lynch






Re: Commerce Server 2007 How to convert Dataset into Basket?

Max Akbar - MSFT

He is using the Mangement APIs, no there is no method to take a DataSet and transform it to an OrderForm (as far as I know). You can create your own XSLT to do that. You would transform the Basket DataSet into an XML OrderGroup then pass this XML to the OrderGroup to create the object.

Good luck,

-Max






Re: Commerce Server 2007 How to convert Dataset into Basket?

Bristin

HI:

Speaking of GetBasketAsDataset(), can someone share code for a webservice call to retrieve the dataset.

Thanks,

Tom





Re: Commerce Server 2007 How to convert Dataset into Basket?

Max Akbar

Here is how you can do it by using a site name:

Code Snippet

OrderSiteAgent ordersAgent = new OrderSiteAgent("CSharpSite");
OrderManagementContext orderManagementContext = OrderManagementContext.Create(ordersAgent);

DataSet = orderManagementContext.BasketManager.GetBasketAsDataSet(orderGroupID);

-Max






Re: Commerce Server 2007 How to convert Dataset into Basket?

Bristin

Thanks Max. Just what I was looking for.

Tom





Re: Commerce Server 2007 How to convert Dataset into Basket?

André Carrilho

I can't find any definition of the OrderServiceAgent and OrderManagementContext classes in my OrdersWebService...

I'm using CS 2007

I appreciate any help :-)

Cheers






Re: Commerce Server 2007 How to convert Dataset into Basket?

Max Akbar

Not sure what you mean about definition

-Max