Ejemplo n.º 1
0
 private void CopyOrderVcModel(OrderVcModel to, MOrder_Order from, IApplicationLocale locale)
 {
     to.OrderId              = from.OrderId;
     to.OrderNumber          = from.OrderNumber;
     to.ItemSubtotal         = from.ItemSubtotalAmount;
     to.Shipping             = from.ShippingAmount;
     to.Discount             = from.DiscountAmount;
     to.TaxableAmount        = from.TaxableAmount;
     to.SalesTaxPercent      = from.SalesTaxPercent;
     to.SalesTax             = from.SalesTaxAmount;
     to.Total                = from.TotalAmount;
     to.OrderStatus          = from.OrderStatus.ToString();
     to.StatusDateTime       = locale.GetLocalTimeFromUtc(from.UpdateDateTimeUtc);
     to.SubmissionDateTime   = locale.GetLocalTimeFromUtc(from.SubmissionDateTimeUtc);
     to.ShippingName         = from.ShippingAddress.Name;
     to.ShippingAddressLines =
         FormatAddress(
             from.ShippingAddress.AddressLine1,
             from.ShippingAddress.AddressLine2,
             from.ShippingAddress.City,
             from.ShippingAddress.StateCode,
             from.ShippingAddress.PostalCode,
             from.ShippingAddress.CountryCode);
     to.Items = CreateOrderItemVcModels(from.OrderItems);
 }
Ejemplo n.º 2
0
        public OrderVcModel CreateOrderVcModel(MOrder_Order from, IApplicationLocale locale)
        {
            var to = new OrderVcModel();

            CopyOrderVcModel(to, from, locale);
            return(to);
        }