Commerce Server General - Paging Max Akbar...

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > February 2004 > Paging Max Akbar...





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 Paging Max Akbar...
Ryan Ross

2004-02-16, 6:35 am

Aright, I must be doing something very, very wrong.

Could you show me how to declare and initialize a CatalogManager object?


Max Akbar

2004-02-16, 3:34 pm

Hi Ryan,

I have some code in my GotDotNET
http://www.gotdotnet.com/Community/...a0-b7f284a8c113
site but here is how I do it (I hope you mean the PIA CatalogManager).

private const string CATALOG_CON_STRING_RESOURCE = "connstr_db_Catalog";
private const string CATLOG_RESOURCE_KEY = "Product Catalog";

private void CatalogInit()
{
dbconStr =
(string)CommerceContext.Current. Resources[CATLOG_RESOURCE_KEY][CATALOG_C
ON_S
TRING_RESOURCE];

// initialize the catalog manager
ICatalogManager3 catMgr = new CatalogManagerClass();
catMgr.Initialize(dbconStr, true, null);
}

Regards,
-Max

"Ryan Ross" <ryanr@nni.com> wrote in message
news:10328vhtd67mb25@corp.supernews.com...
> Aright, I must be doing something very, very wrong.
>
> Could you show me how to declare and initialize a CatalogManager object?
>
>



Ryan Ross

2004-02-17, 9:35 am

Huh. Thanks.



"Max Akbar" <maximum2000@hotmail.com> wrote in message
news:OIWwYHR9DHA.3012@TK2MSFTNGP09.phx.gbl...
> Hi Ryan,
>
> I have some code in my GotDotNET
>

http://www.gotdotnet.com/Community/...a0-b7f284a8c113
> site but here is how I do it (I hope you mean the PIA CatalogManager).
>
> private const string CATALOG_CON_STRING_RESOURCE = "connstr_db_Catalog";
> private const string CATLOG_RESOURCE_KEY = "Product Catalog";
>
> private void CatalogInit()
> {
> dbconStr =
>

(string)CommerceContext.Current. Resources[CATLOG_RESOURCE_KEY][CATALOG_C
ON_S
> TRING_RESOURCE];
>
> // initialize the catalog manager
> ICatalogManager3 catMgr = new CatalogManagerClass();
> catMgr.Initialize(dbconStr, true, null);
> }
>
> Regards,
> -Max
>
> "Ryan Ross" <ryanr@nni.com> wrote in message
> news:10328vhtd67mb25@corp.supernews.com...
>
>



Ryan Ross

2004-02-23, 12:34 pm

Aright, I give up.

When I check for DisplayOnSite = 1, I do not see anything on the site (the
properties that are supposed to display).
When I check for DisplayOnSite = 0 (the hidden properties), those hidden
properties do display.

Here's the code snippet (yes, it is a mess):

' /*Get the properties in the catalog system*/

Dim properties As ReadOnlyStringCollection

properties = productCatalog.PropertyNames

Dim PropertyName As String

Dim x As Integer

Dim prodinfo As New DataTable

Dim prodvalue As String

Dim prodrow As DataRow

Dim prodview As DataView

Dim Display As Integer

Dim Blank As String

Blank = ""



prodinfo.Columns.Add(New DataColumn("PropertyName", GetType(String)))

prodinfo.Columns.Add(New DataColumn("PropertyValue", GetType(String)))

'/* For each property get the property attributes.*/

For x = 0 To properties.Count - 1

PropertyName = properties(x).ToString

Dim ds As New DataSet

Dim myDA As System.Data.OleDb.OleDbDataAdapter = New
System.Data.OleDb.OleDbDataAdapter

myDA.Fill(ds, CatalogManager.GetPropertyAttributes(PropertyName), "MyTable")

'/* Check if the DisplayOnSite attribute for that property is set to true
and if so add it to the cache.*/

Display = CType(ds.Tables(0).Rows(0).Item("DisplayOnSite"), Integer)

If Display = 1 Then

prodvalue = GetFieldValue(productProperties, PropertyName)



prodrow = prodinfo.NewRow

prodrow("PropertyName") = PropertyName

prodrow("PropertyValue") = prodvalue

prodinfo.Rows.Add(prodrow)

'/* Add property to a cache which can be used to display the properties.*/

End If

ds.Clear()

ds.Dispose()

myDA.Dispose()

Next

This is inserted into ProductDetails.aspx.vb, with the appropriate hooks.
Any ideas why it is doing that? I cannot think of any Property or Value of
those Properties that cannot be converted into a string...




"Ryan Ross" <ryanr@nni.com> wrote in message
news:10355o6rtkcgj5d@corp.supernews.com...
> Huh. Thanks.
>
>
>
> "Max Akbar" <maximum2000@hotmail.com> wrote in message
> news:OIWwYHR9DHA.3012@TK2MSFTNGP09.phx.gbl...
>

http://www.gotdotnet.com/Community/...a0-b7f284a8c113
>

(string)CommerceContext.Current. Resources[CATLOG_RESOURCE_KEY][CATALOG_C
ON_S
object?[color=blue]
>
>



Ryan Ross

2004-02-24, 8:37 am

Hmm. SQL Query Analyzer returns 1 for DisplayOnSite, but the code
returns -1...

Well, it's fixed now.


"Ryan Ross" <ryanr@nni.com> wrote in message
news:103lbr5tf926353@corp.supernews.com...
> Aright, I give up.
>
> When I check for DisplayOnSite = 1, I do not see anything on the site (the
> properties that are supposed to display).
> When I check for DisplayOnSite = 0 (the hidden properties), those hidden
> properties do display.
>
> Here's the code snippet (yes, it is a mess):
>
> ' /*Get the properties in the catalog system*/
>
> Dim properties As ReadOnlyStringCollection
>
> properties = productCatalog.PropertyNames
>
> Dim PropertyName As String
>
> Dim x As Integer
>
> Dim prodinfo As New DataTable
>
> Dim prodvalue As String
>
> Dim prodrow As DataRow
>
> Dim prodview As DataView
>
> Dim Display As Integer
>
> Dim Blank As String
>
> Blank = ""
>
>
>
> prodinfo.Columns.Add(New DataColumn("PropertyName", GetType(String)))
>
> prodinfo.Columns.Add(New DataColumn("PropertyValue", GetType(String)))
>
> '/* For each property get the property attributes.*/
>
> For x = 0 To properties.Count - 1
>
> PropertyName = properties(x).ToString
>
> Dim ds As New DataSet
>
> Dim myDA As System.Data.OleDb.OleDbDataAdapter = New
> System.Data.OleDb.OleDbDataAdapter
>
> myDA.Fill(ds, CatalogManager.GetPropertyAttributes(PropertyName),

"MyTable")
>
> '/* Check if the DisplayOnSite attribute for that property is set to true
> and if so add it to the cache.*/
>
> Display = CType(ds.Tables(0).Rows(0).Item("DisplayOnSite"), Integer)
>
> If Display = 1 Then
>
> prodvalue = GetFieldValue(productProperties, PropertyName)
>
>
>
> prodrow = prodinfo.NewRow
>
> prodrow("PropertyName") = PropertyName
>
> prodrow("PropertyValue") = prodvalue
>
> prodinfo.Rows.Add(prodrow)
>
> '/* Add property to a cache which can be used to display the properties.*/
>
> End If
>
> ds.Clear()
>
> ds.Dispose()
>
> myDA.Dispose()
>
> Next
>
> This is inserted into ProductDetails.aspx.vb, with the appropriate hooks.
> Any ideas why it is doing that? I cannot think of any Property or Value of
> those Properties that cannot be converted into a string...
>
>
>
>
> "Ryan Ross" <ryanr@nni.com> wrote in message
> news:10355o6rtkcgj5d@corp.supernews.com...
>

http://www.gotdotnet.com/Community/...a0-b7f284a8c113
"connstr_db_Catalog";[color=blue]
>

(string)CommerceContext.Current. Resources[CATLOG_RESOURCE_KEY][CATALOG_C
ON_S
> object?
>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com