public StorePromotionController(ICardRepository cardRepo, IGroupCardService groupData, IStoreCouponsRepository storecouponRepo, IStorePromotionRepository storeproRepo) { _cardRepo = cardRepo; _groupData = groupData; _storecouponRepo = storecouponRepo; _storeproRepo = storeproRepo; }
public static string CreateCode(int proId) { var code = string.Concat(string.Format("9{0}{1}", proId.ToString().Length, proId) , DateTime.UtcNow.Ticks.ToString().Reverse().Take(8) .Aggregate(new StringBuilder(), (s, e) => s.Append(e), s => s.ToString()) .PadRight(8, '0')); IStoreCouponsRepository couponData = ServiceLocator.Current.Resolve <IStoreCouponsRepository>(); var existingCodes = couponData.Get(c => c.Code == code && c.StorePromotionId == proId).Count(); if (existingCodes > 0) { code = string.Concat(code, (existingCodes + 1).ToString()); } return(code); }
public StorePromotionCouponController(ICardRepository cardRepo, IGroupCardService groupData, IStoreCouponsRepository storecouponRepo, IStorePromotionRepository storeproRepo, IPointRepository pointRepo, IStorePromotionScopeRepository storeproscopeRepo, ICouponLogRepository couponlogRepo) { _cardRepo = cardRepo; _groupData = groupData; _storecouponRepo = storecouponRepo; _storeproRepo = storeproRepo; _pointRepo = pointRepo; _storeproscopeRepo = storeproscopeRepo; _couponlogRepo = couponlogRepo; }
public StoreCouponReportController(IStoreCouponsRepository storecouponRepo) { _storecouponRepo = storecouponRepo; }