私はnopcommerce 1.9を使用しており、割引を作成する際に次のコードがあります
discount = new Discount()
{
DiscountTypeId = (int)discountType,
DiscountRequirementId = (int)discountRequirement,
RequirementSpentAmount = requirementSpentAmount,
RequirementBillingCountryIs = requirementBillingCountryIs,
RequirementShippingCountryIs = requirementShippingCountryIs,
DiscountLimitationId = (int)discountLimitation,
LimitationTimes = limitationTimes,
Name = name,
UsePercentage = usePercentage,
DiscountPercentage = discountPercentage,
DiscountAmount = discountAmount,
StartDate = discountStartDate,
EndDate = discountEndDate,
RequiresCouponCode = requiresCouponCode,
CouponCode = couponCode
};
this.DiscountService.InsertDiscount(discount);
今私の仕事は、'CouponCode = couponCode'
クライアントが割引を保存するときにアップロードした Excel シート列からこのクーポン コードを置き換える必要があることです。
この Excel シートには 50000 個のクーポン コードを含めることができるため、各クーポンには同じ割引情報が含まれます。
このソリューションには、エンティティ フレームワークがあります。データをこの形式で保存する必要があります
D1 10% C1(coupon code from excel sheet)
D1 10% C2(coupon code from excel sheet)
D1 10% C3(coupon code from excel sheet)
D1 10% C4(coupon code from excel sheet)
D1 10% C5(coupon code from excel sheet)
D1 10% C6(coupon code from excel sheet)
D1 10% C7(coupon code from excel sheet)