Example #1
0
        /// <summary>
        /// Initializes the specified customer id.
        /// </summary>
        /// <param name="CustomerId">The customer id.</param>
        private void Initialize(Guid CustomerId)
        {
            this["OrderGroupId"] = 0;
            this.CustomerId      = CustomerId;

            this.InstanceId      = Guid.NewGuid();
            this.AddressId       = String.Empty;
            this.BillingCurrency = String.Empty;
            this.CustomerName    = String.Empty;
            this.Name            = String.Empty;
            this.ShippingTotal   = 0;
            this.Status          = String.Empty;
            this.SubTotal        = 0;
            this.TaxTotal        = 0;
            this.Total           = 0;
            this.HandlingTotal   = 0;
            this.ApplicationId   = OrderConfiguration.Instance.ApplicationId;

            // Initialize Collections
            _OrderForms     = new OrderFormCollection(this);
            _OrderAddresses = new OrderAddressCollection(this);
        }
Example #2
0
        /// <summary>
        /// Initializes the object with data from the specified order group.
        /// </summary>
        /// <param name="orderGroup">The order group.</param>
        internal virtual void Initialize(OrderGroup orderGroup)
        {
            _OrderForms     = orderGroup.OrderForms;
            _OrderAddresses = orderGroup.OrderAddresses;

            this.SetParent(this);

            // Copy all the fields
            this.AddressId       = orderGroup.AddressId;
            this.AffiliateId     = orderGroup.AffiliateId;
            this.ApplicationId   = orderGroup.ApplicationId;
            this.BillingCurrency = orderGroup.BillingCurrency;
            this.CustomerId      = orderGroup.CustomerId;
            this.CustomerName    = orderGroup.CustomerName;
            this.HandlingTotal   = orderGroup.HandlingTotal;
            // this must be unique, so use the one generated this.InstanceId = orderGroup.InstanceId;
            this.Name          = orderGroup.Name;
            this.ProviderId    = orderGroup.ProviderId;
            this.ShippingTotal = orderGroup.ShippingTotal;
            this.Status        = orderGroup.Status;
            this.SubTotal      = orderGroup.SubTotal;
            this.TaxTotal      = orderGroup.TaxTotal;
            this.Total         = orderGroup.Total;
        }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrderGroup"/> class.
 /// </summary>
 /// <param name="info">The info.</param>
 /// <param name="context">The context.</param>
 protected OrderGroup(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     Logger          = LogManager.GetLogger(GetType());
     _OrderForms     = (OrderFormCollection)info.GetValue("OrderForms", typeof(OrderFormCollection));
     _OrderAddresses = (OrderAddressCollection)info.GetValue("OrderAddresses", typeof(OrderAddressCollection));
 }