Commerce Server General - can somebody translate this code to C#??

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > August 2004 > can somebody translate this code to C#??





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author can somebody translate this code to C#??
Jorge

2004-08-10, 2:51 am

Private Function GetCategoryByDefinition(ByVal product_id, ByVal
category_definiton_name As String, ByVal CatalogWebServiceUrl, ByVal
catalog_name) As String

'initialize the catalog
Dim cat_item As CatalogItemsDataSet.CatalogItem

Dim csa As New CatalogServiceAgent(CatalogWebServiceUrl
)

Dim ctxt As CatalogContext = CatalogContext.Create(csa, New
ConsoleDebugContext(DebugMode.Checked))

Dim obj_catalog as ProductCatalog = ctxt.GetCatalog("store")

'get the product from the product_id
Dim obj_product as Product = obj_catalog.GetProduct(product_id)

'get the categories associated with the product
Dim categories As CatalogItemsDataSet.CatalogItemsDataTable =
obj_product.ParentCategories.CatalogItems

'loop through the categories to find the value of the category that
matches the category defition you'd like to find out if the product
belongs to.
For Each cat_item In categories

Try

'FNull tests for IsDbNull and returns an empty string,
otherwise returns value
If (FNull(cat_item.DefinitionName) = category_def) Then

Return cat_item.CategoryName

Exit Function

End If

Catch

End Try

Next


Thanks!!!


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com