public virtual PointRedemption RedeemPoint(IList <Merchandise> merchandises, string remark = @"") { if (!IsInActiveMembership) { throw new ApplicationException(@"Customer is not in active membership"); } var totalPointNeeded = merchandises.Sum(x => x.PointCost); if (totalPointNeeded > _membership.Point) { throw new ApplicationException(@"Not enough points, " + totalPointNeeded + @" needed"); } var pointRedemption = new PointRedemption(this, remark); foreach (var merchandise in merchandises) { pointRedemption.AddRedemptionItem(merchandise, 1); _membership.UsePoint(merchandise.PointCost); } return(pointRedemption); }
public virtual PointRedemption RedeemPoint(IList<Merchandise> merchandises, string remark = @"") { if (!IsInActiveMembership) { throw new ApplicationException(@"Customer is not in active membership"); } var totalPointNeeded = merchandises.Sum(x => x.PointCost); if (totalPointNeeded > _membership.Point) { throw new ApplicationException(@"Not enough points, " + totalPointNeeded + @" needed"); } var pointRedemption = new PointRedemption(this, remark); foreach (var merchandise in merchandises) { pointRedemption.AddRedemptionItem(merchandise, 1); _membership.UsePoint(merchandise.PointCost); } return pointRedemption; }