C# Класс Nop.Services.Discounts.DiscountService

Discount service
Наследование: IDiscountService
Показать файл Открыть проект

Открытые методы

Метод Описание
DeleteDiscount ( Discount discount ) : void

Delete discount

DeleteDiscountRequirement ( DiscountRequirement discountRequirement ) : void

Delete discount requirement

DeleteDiscountUsageHistory ( Nop.Core.Domain.Discounts.DiscountUsageHistory discountUsageHistory ) : void

Delete discount usage history record

DiscountService ( ICacheManager cacheManager, IRepository discountRepository, IRepository discountRequirementRepository, IRepository discountUsageHistoryRepository, IPluginFinder pluginFinder, IEventPublisher eventPublisher ) : System

Ctor

GetAllDiscountUsageHistory ( int discountId, int customerId, int pageIndex, int pageSize ) : IPagedList

Gets all discount usage history records

GetAllDiscounts ( DiscountType discountType, string couponCode = "", bool showHidden = false ) : IList

Gets all discounts

GetDiscountByCouponCode ( string couponCode, bool showHidden = false ) : Discount

Get discount by coupon code

GetDiscountById ( int discountId ) : Discount

Gets a discount

GetDiscountUsageHistoryById ( int discountUsageHistoryId ) : Nop.Core.Domain.Discounts.DiscountUsageHistory

Gets a discount usage history record

InsertDiscount ( Discount discount ) : void

Inserts a discount

InsertDiscountUsageHistory ( Nop.Core.Domain.Discounts.DiscountUsageHistory discountUsageHistory ) : void

Insert discount usage history record

IsDiscountValid ( Discount discount, Customer customer ) : bool

Check discount requirements

IsDiscountValid ( Discount discount, Customer customer, string couponCodeToValidate ) : bool

Check discount requirements

LoadAllDiscountRequirementRules ( ) : IList

Load all discount requirement rules

LoadDiscountRequirementRuleBySystemName ( string systemName ) : IDiscountRequirementRule

Load discount requirement rule by system name

UpdateDiscount ( Discount discount ) : void

Updates the discount

UpdateDiscountUsageHistory ( Nop.Core.Domain.Discounts.DiscountUsageHistory discountUsageHistory ) : void

Update discount usage history record

Защищенные методы

Метод Описание
CheckDiscountLimitations ( Discount discount, Customer customer ) : bool

Checks discount limitation for customer

Описание методов

CheckDiscountLimitations() защищенный Метод

Checks discount limitation for customer
protected CheckDiscountLimitations ( Discount discount, Customer customer ) : bool
discount Nop.Core.Domain.Discounts.Discount Discount
customer Nop.Core.Domain.Customers.Customer Customer
Результат bool

DeleteDiscount() публичный Метод

Delete discount
public DeleteDiscount ( Discount discount ) : void
discount Nop.Core.Domain.Discounts.Discount Discount
Результат void

DeleteDiscountRequirement() публичный Метод

Delete discount requirement
public DeleteDiscountRequirement ( DiscountRequirement discountRequirement ) : void
discountRequirement Nop.Core.Domain.Discounts.DiscountRequirement Discount requirement
Результат void

DeleteDiscountUsageHistory() публичный Метод

Delete discount usage history record
public DeleteDiscountUsageHistory ( Nop.Core.Domain.Discounts.DiscountUsageHistory discountUsageHistory ) : void
discountUsageHistory Nop.Core.Domain.Discounts.DiscountUsageHistory Discount usage history record
Результат void

DiscountService() публичный Метод

Ctor
public DiscountService ( ICacheManager cacheManager, IRepository discountRepository, IRepository discountRequirementRepository, IRepository discountUsageHistoryRepository, IPluginFinder pluginFinder, IEventPublisher eventPublisher ) : System
cacheManager ICacheManager Cache manager
discountRepository IRepository Discount repository
discountRequirementRepository IRepository Discount requirement repository
discountUsageHistoryRepository IRepository Discount usage history repository
pluginFinder IPluginFinder Plugin finder
eventPublisher IEventPublisher Event published
Результат System

GetAllDiscountUsageHistory() публичный Метод

Gets all discount usage history records
public GetAllDiscountUsageHistory ( int discountId, int customerId, int pageIndex, int pageSize ) : IPagedList
discountId int Discount identifier
customerId int Customer identifier
pageIndex int Page index
pageSize int Page size
Результат IPagedList

GetAllDiscounts() публичный Метод

Gets all discounts
public GetAllDiscounts ( DiscountType discountType, string couponCode = "", bool showHidden = false ) : IList
discountType DiscountType Discount type; null to load all discount
couponCode string Coupon code to find (exactl match)
showHidden bool A value indicating whether to show hidden records
Результат IList

GetDiscountByCouponCode() публичный Метод

Get discount by coupon code
public GetDiscountByCouponCode ( string couponCode, bool showHidden = false ) : Discount
couponCode string Coupon code
showHidden bool A value indicating whether to show hidden records
Результат Nop.Core.Domain.Discounts.Discount

GetDiscountById() публичный Метод

Gets a discount
public GetDiscountById ( int discountId ) : Discount
discountId int Discount identifier
Результат Nop.Core.Domain.Discounts.Discount

GetDiscountUsageHistoryById() публичный Метод

Gets a discount usage history record
public GetDiscountUsageHistoryById ( int discountUsageHistoryId ) : Nop.Core.Domain.Discounts.DiscountUsageHistory
discountUsageHistoryId int Discount usage history record identifier
Результат Nop.Core.Domain.Discounts.DiscountUsageHistory

InsertDiscount() публичный Метод

Inserts a discount
public InsertDiscount ( Discount discount ) : void
discount Nop.Core.Domain.Discounts.Discount Discount
Результат void

InsertDiscountUsageHistory() публичный Метод

Insert discount usage history record
public InsertDiscountUsageHistory ( Nop.Core.Domain.Discounts.DiscountUsageHistory discountUsageHistory ) : void
discountUsageHistory Nop.Core.Domain.Discounts.DiscountUsageHistory Discount usage history record
Результат void

IsDiscountValid() публичный Метод

Check discount requirements
public IsDiscountValid ( Discount discount, Customer customer ) : bool
discount Nop.Core.Domain.Discounts.Discount Discount
customer Nop.Core.Domain.Customers.Customer Customer
Результат bool

IsDiscountValid() публичный Метод

Check discount requirements
public IsDiscountValid ( Discount discount, Customer customer, string couponCodeToValidate ) : bool
discount Nop.Core.Domain.Discounts.Discount Discount
customer Nop.Core.Domain.Customers.Customer Customer
couponCodeToValidate string Coupon code to validate
Результат bool

LoadAllDiscountRequirementRules() публичный Метод

Load all discount requirement rules
public LoadAllDiscountRequirementRules ( ) : IList
Результат IList

LoadDiscountRequirementRuleBySystemName() публичный Метод

Load discount requirement rule by system name
public LoadDiscountRequirementRuleBySystemName ( string systemName ) : IDiscountRequirementRule
systemName string System name
Результат IDiscountRequirementRule

UpdateDiscount() публичный Метод

Updates the discount
public UpdateDiscount ( Discount discount ) : void
discount Nop.Core.Domain.Discounts.Discount Discount
Результат void

UpdateDiscountUsageHistory() публичный Метод

Update discount usage history record
public UpdateDiscountUsageHistory ( Nop.Core.Domain.Discounts.DiscountUsageHistory discountUsageHistory ) : void
discountUsageHistory Nop.Core.Domain.Discounts.DiscountUsageHistory Discount usage history record
Результат void