C# Class Nop.Services.Catalog.CategoryService

Category service
Inheritance: ICategoryService
显示文件 Open project: emilianionascu/NopCommerce

Public Methods

Method Description
CategoryService ( ICacheManager cacheManager, IRepository categoryRepository, IRepository productCategoryRepository, IRepository productRepository, IRepository aclRepository, IWorkContext workContext, IEventPublisher eventPublisher ) : System

Ctor

DeleteCategory ( Category category ) : void

Delete category

DeleteProductCategory ( Nop.Core.Domain.Catalog.ProductCategory productCategory ) : void

Deletes a product category mapping

GetAllCategories ( string categoryName = "", int pageIndex, int pageSize = int.MaxValue, bool showHidden = false ) : IPagedList

Gets all categories

GetAllCategoriesByParentCategoryId ( int parentCategoryId, bool showHidden = false ) : IList

Gets all categories filtered by parent category identifier

GetAllCategoriesDisplayedOnHomePage ( ) : IList

Gets all categories displayed on the home page

GetCategoryById ( int categoryId ) : Category

Gets a category

GetProductCategoriesByCategoryId ( int categoryId, int pageIndex, int pageSize, bool showHidden = false ) : IPagedList

Gets product category mapping collection

GetProductCategoriesByProductId ( int productId, bool showHidden = false ) : IList

Gets a product category mapping collection

GetProductCategoryById ( int productCategoryId ) : Nop.Core.Domain.Catalog.ProductCategory

Gets a product category mapping

GetTotalNumberOfFeaturedProducts ( int categoryId ) : int

Get a total number of featured products by category identifier

InsertCategory ( Category category ) : void

Inserts category

InsertProductCategory ( Nop.Core.Domain.Catalog.ProductCategory productCategory ) : void

Inserts a product category mapping

UpdateCategory ( Category category ) : void

Updates the category

UpdateHasDiscountsApplied ( Category category ) : void

Update HasDiscountsApplied property (used for performance optimization)

UpdateProductCategory ( ProductCategory productCategory ) : void

Updates the product category mapping

Method Details

CategoryService() public method

Ctor
public CategoryService ( ICacheManager cacheManager, IRepository categoryRepository, IRepository productCategoryRepository, IRepository productRepository, IRepository aclRepository, IWorkContext workContext, IEventPublisher eventPublisher ) : System
cacheManager ICacheManager Cache manager
categoryRepository IRepository Category repository
productCategoryRepository IRepository ProductCategory repository
productRepository IRepository Product repository
aclRepository IRepository ACL record repository
workContext IWorkContext Work context
eventPublisher IEventPublisher Event publisher
return System

DeleteCategory() public method

Delete category
public DeleteCategory ( Category category ) : void
category Nop.Core.Domain.Catalog.Category Category
return void

DeleteProductCategory() public method

Deletes a product category mapping
public DeleteProductCategory ( Nop.Core.Domain.Catalog.ProductCategory productCategory ) : void
productCategory Nop.Core.Domain.Catalog.ProductCategory Product category
return void

GetAllCategories() public method

Gets all categories
public GetAllCategories ( string categoryName = "", int pageIndex, int pageSize = int.MaxValue, bool showHidden = false ) : IPagedList
categoryName string Category name
pageIndex int Page index
pageSize int Page size
showHidden bool A value indicating whether to show hidden records
return IPagedList

GetAllCategoriesByParentCategoryId() public method

Gets all categories filtered by parent category identifier
public GetAllCategoriesByParentCategoryId ( int parentCategoryId, bool showHidden = false ) : IList
parentCategoryId int Parent category identifier
showHidden bool A value indicating whether to show hidden records
return IList

GetAllCategoriesDisplayedOnHomePage() public method

Gets all categories displayed on the home page
public GetAllCategoriesDisplayedOnHomePage ( ) : IList
return IList

GetCategoryById() public method

Gets a category
public GetCategoryById ( int categoryId ) : Category
categoryId int Category identifier
return Nop.Core.Domain.Catalog.Category

GetProductCategoriesByCategoryId() public method

Gets product category mapping collection
public GetProductCategoriesByCategoryId ( int categoryId, int pageIndex, int pageSize, bool showHidden = false ) : IPagedList
categoryId int Category identifier
pageIndex int Page index
pageSize int Page size
showHidden bool A value indicating whether to show hidden records
return IPagedList

GetProductCategoriesByProductId() public method

Gets a product category mapping collection
public GetProductCategoriesByProductId ( int productId, bool showHidden = false ) : IList
productId int Product identifier
showHidden bool A value indicating whether to show hidden records
return IList

GetProductCategoryById() public method

Gets a product category mapping
public GetProductCategoryById ( int productCategoryId ) : Nop.Core.Domain.Catalog.ProductCategory
productCategoryId int Product category mapping identifier
return Nop.Core.Domain.Catalog.ProductCategory

GetTotalNumberOfFeaturedProducts() public method

Get a total number of featured products by category identifier
public GetTotalNumberOfFeaturedProducts ( int categoryId ) : int
categoryId int Category identifier
return int

InsertCategory() public method

Inserts category
public InsertCategory ( Category category ) : void
category Nop.Core.Domain.Catalog.Category Category
return void

InsertProductCategory() public method

Inserts a product category mapping
public InsertProductCategory ( Nop.Core.Domain.Catalog.ProductCategory productCategory ) : void
productCategory Nop.Core.Domain.Catalog.ProductCategory >Product category mapping
return void

UpdateCategory() public method

Updates the category
public UpdateCategory ( Category category ) : void
category Category Category
return void

UpdateHasDiscountsApplied() public method

Update HasDiscountsApplied property (used for performance optimization)
public UpdateHasDiscountsApplied ( Category category ) : void
category Category Category
return void

UpdateProductCategory() public method

Updates the product category mapping
public UpdateProductCategory ( ProductCategory productCategory ) : void
productCategory ProductCategory >Product category mapping
return void