示例#1
0
        public CartDetailModel CreateCartDetailModel(UOrder_Order from)
        {
            var to = new CartDetailModel();

            Copy(to, from);
            return(to);
        }
示例#2
0
 private void Copy(CartDetailModel to, UOrder_Order from)
 {
     to.OrderId              = from.MOrder.OrderId;
     to.OrderNumber          = from.MOrder.OrderNumber;
     to.Items                = CreateCartDetailItemModels(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();
     to.ShippingName         = from.MOrder.ShippingAddress.Name;
     to.ShippingAddressLines =
         FormatAddress(
             from.MOrder.ShippingAddress.AddressLine1,
             from.MOrder.ShippingAddress.AddressLine2,
             from.MOrder.ShippingAddress.City,
             from.MOrder.ShippingAddress.StateCode,
             from.MOrder.ShippingAddress.PostalCode,
             from.MOrder.ShippingAddress.CountryCode);
 }