ShippingMethod GetOrderShippingMethod(Commerce.Data.SqlRepository.ShippingMethod method, SqlRepository.Order order) { ShippingMethod result = null; Decimal orderWeight = order.OrderItems.Sum(x => x.Product.WeightInPounds); if (method != null) { result = new ShippingMethod(); result.ID = method.ShippingMethodID; result.Carrier = method.Carrier; result.EstimatedDelivery = method.EstimatedDelivery; result.RatePerPound = method.RatePerPound; result.ServiceName = method.ServiceName; result.Cost = method.BaseRate + (method.RatePerPound * orderWeight); } return(result); }
partial void InsertShippingMethod(ShippingMethod instance);
partial void UpdateShippingMethod(ShippingMethod instance);
partial void DeleteShippingMethod(ShippingMethod instance);