Пример #1
0
        public override void SetContactData(IContactDataCollection previousContactData)
        {
            var allContacts = previousContactData.GetContactData();
            var main = allContacts.FirstOrDefault(c => c.Id == "MainContact") as MainContactModel;
            var billing = allContacts.FirstOrDefault(c => c.Id == "BillingContact") as BillingContactModel;
            var whois = allContacts.FirstOrDefault(c => c.Id == "WhoisContact") as WhoisContactModel;

            // Email is required so if it is present the form has been filled in.

            if (main != null && !string.IsNullOrEmpty(main.Email))
            {
                this.MainContact = main;
            }

            if (billing != null && !string.IsNullOrEmpty(billing.Email))
            {
                this.BillingContact = billing;
                this.OtherBillingContact = true;
            }

            if (whois != null && !string.IsNullOrEmpty(whois.Email))
            {
                this.WhoisContact = whois;
                this.OtherWhoisContact = true;
            }
        }
        public override void SetContactData(IContactDataCollection previousContactData)
        {
            var allContacts      = previousContactData.GetContactData();
            var main             = allContacts.FirstOrDefault(c => c.Id == "MainContact") as MainContactModel;
            var billing          = allContacts.FirstOrDefault(c => c.Id == "BillingContact") as BillingContactModel;
            var whois            = allContacts.FirstOrDefault(c => c.Id == "WhoisContact") as WhoisContactModel;
            var existingCustomer = allContacts.FirstOrDefault(c => c.Id == "ExistingCustomerContact") as ExistingCustomerContactData;

            // Email is required so if it is present the form has been filled in.

            if (main != null && !string.IsNullOrEmpty(main.Email))
            {
                this.MainContact = main;
            }

            if (billing != null && !string.IsNullOrEmpty(billing.Email))
            {
                this.BillingContact      = billing;
                this.OtherBillingContact = true;
            }

            if (whois != null && !string.IsNullOrEmpty(whois.Email))
            {
                this.WhoisContact      = whois;
                this.OtherWhoisContact = true;
            }

            if (existingCustomer != null && !string.IsNullOrEmpty(existingCustomer.Username))
            {
                this.ExistingCustomerContact = existingCustomer;
            }
        }
Пример #3
0
        /// <summary>
        /// OrderContext constructor
        /// </summary>
        /// <param name="cart">Collected cart data</param>
        /// <param name="contactDataCollection">Collected contact data</param>
        /// <param name="paymentData">Collected payment data</param>
        /// <param name="extraData">Any unspecified extra data</param>
        public OrderContext(Cart cart, IContactDataCollection contactDataCollection, PaymentData paymentData, IEnumerable<object> extraData)
        {
            if (cart == null)
            {
                throw new ArgumentNullException("cart");
            }

            if (contactDataCollection == null)
            {
                throw new ArgumentNullException("contactDataCollection");
            }

            if (paymentData == null)
            {
                throw new ArgumentNullException("paymentData");
            }

            this.cart = cart;
            this.contactData = contactDataCollection.GetContactData();
            this.paymentData = paymentData;
            this.extraData = extraData;
        }
Пример #4
0
        /// <summary>
        /// OrderContext constructor
        /// </summary>
        /// <param name="cart">Collected cart data</param>
        /// <param name="contactDataCollection">Collected contact data</param>
        /// <param name="paymentData">Collected payment data</param>
        /// <param name="extraData">Any unspecified extra data</param>
        public OrderContext(Cart cart, IContactDataCollection contactDataCollection, PaymentData paymentData, IEnumerable <object> extraData)
        {
            if (cart == null)
            {
                throw new ArgumentNullException("cart");
            }

            if (contactDataCollection == null)
            {
                throw new ArgumentNullException("contactDataCollection");
            }

            if (paymentData == null)
            {
                throw new ArgumentNullException("paymentData");
            }

            this.cart        = cart;
            this.contactData = contactDataCollection.GetContactData();
            this.paymentData = paymentData;
            this.extraData   = extraData;
        }