Reference new Business Logic folder

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 yıl önce
Hello Everyone,

I am creating a Photo Gallery in a NopCommerce project I am working on. I am duplicating the Categories front and backends to make the Photo Gallery. So in the Business Logic layer, I have duplicated the Categories folder to make the PhotoGalleries folder. I have then updated all of the file names and file contents to reflect to the PhotoGalleries info. I think somehow this new folder needs to be referenced somewhere, just not sure where. Here is the reason I am thinking this.

When I go to the PhotoGalleries.ascx file that I created in the Administration/Modules folder, I am trying to change this line <%# GetPhotoGalleryFullName((Category)Container.DataItem)%> to <%# GetPhotoGalleryFullName((PhotoGallery)Container.DataItem)%> When I remove 'Category' and start typing in 'PhotoGallery', the selection window that displays does not contain 'PhotoGallery.cs, PhotoGalleryCollection.cs, PhotoGalleryLocalized.cs, and ProductGalleryManager.cs', like it does for Category, if you start typing it in. This causes 'PhotoGallery' to be underlined in red, and gives the following information. The type or namespace name 'PhotoGallery' could not be found (are you missing a using directive or an assembly reference? Does anyone know how I can reference this folder, to fix this problem?

I appreciate any help that anyone can give me!

Thanks,
Paul
13 yıl önce
Has it been added to the inserts for the page your working on?
13 yıl önce
Hi bhiers,

Thanks for your reply. I am not sure what you mean by inserts. Can you please let me know.

Thanks!
13 yıl önce
At the top of the cs file there are using statements
Aka using using NopSolutions.NopCommerce.BusinessLogic;
You need to add your new folder there so you can reference the cs files directly.
13 yıl önce
I thought that might be what you were talking about. I do have that in there, so not sure why it still isn't working.

Thanks for your reply!
13 yıl önce
I accidently figured this out. : )

I was looking around in the web.config and noticed:
<add namespace="NopSolutions.NopCommerce.BusinessLogic.Categories"/> under <namespaces>,

<add name="SqlCategoryProvider" type="NopSolutions.NopCommerce.DataAccess.Categories.SqlCategoryProvider, Nop.DataAccess.SqlServer" connectionStringName="NopSqlConnection"/> under <nopDataProviders>,

and <section name="CategoryProvider" type="NopSolutions.NopCommerce.DataAccess.DBProviderSection, Nop.DataAccess" requirePermission="false"/> under <sectionGroup name="nopDataProviders">.

I copied those lines and replaced 'Categories' with 'PhotoGalleries', and 'Category' with 'PhotoGallery' in the copied lines, and it works great!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.