public CartEditModel CreateCartEditModel(UOrder_Order from) { var to = new CartEditModel(); Copy(to, from); return(to); }
private void Copy(CartEditModel to, UOrder_Order from) { to.OrderId = from.MOrder.OrderId; to.OrderNumber = from.MOrder.OrderNumber; to.Items = CreateCartEditItemModels(from.MOrder.OrderItems); to.ItemSubtotalAmount = from.MOrder.ItemSubtotalAmount; to.DiscountAmount = from.MOrder.DiscountAmount; to.ShippingAmount = from.MOrder.ShippingAmount; to.TaxableSubtotal = to.ItemSubtotalAmount - to.DiscountAmount + to.ShippingAmount; to.SalesTaxPercent = from.MOrder.SalesTaxPercent; to.SalesTaxAmount = from.MOrder.SalesTaxAmount; to.TotalAmount = from.MOrder.TotalAmount; to.SubmissionDateTime = Locale.GetLocalTimeFromUtc(from.MOrder.SubmissionDateTimeUtc); to.OrderStatus = from.MOrder.OrderStatus.ToString(); }