C# 클래스 CardShop.Service.DiscountService

DiscountService class will handle all service type requests
상속: IDiscountService
파일 보기 프로젝트 열기: egreene/PracticeGDVP 1 사용 예제들

공개 메소드들

메소드 설명
CreateCoupon ( UserDiscount coupon ) : UserDiscount

Create and submit coupon

DiscountService ( ) : System

No-Args constructor, creates new CouponUtility();

GetAllUsers ( ) : List

GetAllUsers gets a list of all the Users

GetCoupon ( int userId, String discountCode, bool &isSuccess, String &error ) : UserDiscount

Get Coupon by userId and discountCode returns null if no UserDiscount is found Using outs to return additional error information Also checks for expiration and redemption status

GetCouponList ( UserDiscount coupon ) : List

Returns a matching UserDiscount from the database

GetInstance ( ) : IDiscountService
RedeemCoupon ( UserDiscount coupon, bool &isSuccess ) : UserDiscount

Mark Inputted coupon as redeemed.

ValidateCoupon ( List couponList, bool &isSuccess, String &error ) : UserDiscount

Checks coupon to see if it is valid

getCouponListByUserIdAndCouponCode ( int userId, String discountCode ) : List

메소드 상세

CreateCoupon() 공개 메소드

Create and submit coupon
public CreateCoupon ( UserDiscount coupon ) : UserDiscount
coupon CardShop.Models.UserDiscount Coupon without code
리턴 CardShop.Models.UserDiscount

DiscountService() 공개 메소드

No-Args constructor, creates new CouponUtility();
public DiscountService ( ) : System
리턴 System

GetAllUsers() 공개 메소드

GetAllUsers gets a list of all the Users
public GetAllUsers ( ) : List
리턴 List

GetCoupon() 공개 메소드

Get Coupon by userId and discountCode returns null if no UserDiscount is found Using outs to return additional error information Also checks for expiration and redemption status
public GetCoupon ( int userId, String discountCode, bool &isSuccess, String &error ) : UserDiscount
userId int
discountCode String
isSuccess bool
error String
리턴 CardShop.Models.UserDiscount

GetCouponList() 공개 메소드

Returns a matching UserDiscount from the database
public GetCouponList ( UserDiscount coupon ) : List
coupon CardShop.Models.UserDiscount
리턴 List

GetInstance() 공개 정적인 메소드

public static GetInstance ( ) : IDiscountService
리턴 IDiscountService

RedeemCoupon() 공개 메소드

Mark Inputted coupon as redeemed.
public RedeemCoupon ( UserDiscount coupon, bool &isSuccess ) : UserDiscount
coupon CardShop.Models.UserDiscount
isSuccess bool
리턴 CardShop.Models.UserDiscount

ValidateCoupon() 공개 메소드

Checks coupon to see if it is valid
public ValidateCoupon ( List couponList, bool &isSuccess, String &error ) : UserDiscount
couponList List
isSuccess bool
error String
리턴 CardShop.Models.UserDiscount

getCouponListByUserIdAndCouponCode() 공개 메소드

public getCouponListByUserIdAndCouponCode ( int userId, String discountCode ) : List
userId int
discountCode String
리턴 List