private List<OrderCouponDTO> TranslateCoupons(data.bvc_Order o) { List<OrderCouponDTO> result = new List<OrderCouponDTO>(); foreach (data.bvc_OrderCoupon oldCoupon in o.bvc_OrderCoupon) { OrderCouponDTO c = new OrderCouponDTO(); c.CouponCode = oldCoupon.CouponCode ?? string.Empty; c.IsUsed = true; c.OrderBvin = o.ID.ToString() ?? string.Empty; result.Add(c); } return result; }
private List<OrderCouponDTO> TranslateCoupons(string orderBvin) { List<OrderCouponDTO> result = new List<OrderCouponDTO>(); data.BV53Entities db = new data.BV53Entities(EFConnString(settings.SourceConnectionString())); var old = db.bvc_OrderCoupon.Where(y => y.OrderBvin == orderBvin); if (old == null) return result; foreach (data.bvc_OrderCoupon oldCoupon in old) { OrderCouponDTO c = new OrderCouponDTO(); c.CouponCode = oldCoupon.CouponCode ?? string.Empty; c.IsUsed = true; c.OrderBvin = orderBvin ?? string.Empty; result.Add(c); } return result; }