1
レコードをinsetingながら、私はnopcommerce 1.9を使用していますし、割引を作成する際に、私は次のコード使用Excelのインポート
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のクーポンコードを持つことができます。
このソリューションでは、エンティティフレームワークがあります。そして、私たちは私がループの各レコードに持ってway.stillこの中にこのような状況に対処する方法を発見し、このフォーマット
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)
あなたはおそらく問題が何であるかを明確にすることができますか? – Pynner
私はcouponcode = dataをexcelから変更して、このコードを何度も失う必要があります – rahularyansharma