Пример #1
0
        private void InitIntlShippingServiceOptions()
        {
            ShippingServiceCodeType[] options =
                new ShippingServiceCodeType[] {
                ShippingServiceCodeType.StandardInternational,
                ShippingServiceCodeType.ExpeditedInternational,
                ShippingServiceCodeType.USPSGlobalExpress,
                ShippingServiceCodeType.USPSGlobalPriority,
                ShippingServiceCodeType.USPSEconomyParcel,
                ShippingServiceCodeType.USPSEconomyLetter,
                ShippingServiceCodeType.USPSAirmailLetter,
                ShippingServiceCodeType.USPSAirmailParcel,
                ShippingServiceCodeType.UPSWorldWideExpressPlus,
                ShippingServiceCodeType.UPSWorldWideExpress,
                ShippingServiceCodeType.UPSWorldWideExpedited,
                ShippingServiceCodeType.UPSStandardToCanada,
                ShippingServiceCodeType.OtherInternational
            };

            int len = options.Length;

            ControlTagItem[] items = new ControlTagItem[len];
            for (int i = 0; i < len; i++)
            {
                items[i] = new ControlTagItem(options[i].ToString(), options[i]);
            }
            this.htIntlShippingServiceControlTagItems.Add(SiteCodeType.US, items);
        }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        public void InitShipToLocations()
        {
            ControlTagItem[] items =
                new ControlTagItem[] { new ControlTagItem("Worldwide", "Worldwide"),
                                       new ControlTagItem("Americas", "Americas"),
                                       new ControlTagItem("Europe", "Europe"),
                                       new ControlTagItem("Asia", "Asia"),
                                       new ControlTagItem("Canada", "CA"),
                                       new ControlTagItem("United Kingdom", "GB"),
                                       new ControlTagItem("Australia", "AU"),
                                       new ControlTagItem("Mexico", "MX"),
                                       new ControlTagItem("Germany", "DE"),
                                       new ControlTagItem("Japan", "JP"),
                                       new ControlTagItem("Will Not Ship", "None") };

            this.htItemShipToLocationControlTagItems.Add(SiteCodeType.US, items);

            items =
                new ControlTagItem[] { new ControlTagItem("Worldwide", "Worldwide"),
                                       new ControlTagItem("Americas", "Americas"),
                                       new ControlTagItem("Europe", "Europe"),
                                       new ControlTagItem("Asia", "Asia"),
                                       new ControlTagItem("Canada", "CA"),
                                       new ControlTagItem("United Kingdom", "GB"),
                                       new ControlTagItem("Australia", "AU"),
                                       new ControlTagItem("Mexico", "MX"),
                                       new ControlTagItem("Germany", "DE"),
                                       new ControlTagItem("Japan", "JP") };

            this.htServiceShipToLocationControlTagItems.Add(SiteCodeType.US, items);
        }
Пример #3
0
        private void InitShippingServiceOptions()
        {
            ShippingServiceCodeType[] options =
                new ShippingServiceCodeType[] {
                ShippingServiceCodeType.UPSGround,
                ShippingServiceCodeType.UPS3rdDay,
                ShippingServiceCodeType.UPS2ndDay,
                ShippingServiceCodeType.UPSNextDay,
                ShippingServiceCodeType.USPSPriority,
                ShippingServiceCodeType.USPSParcel,
                ShippingServiceCodeType.USPSMedia,
                ShippingServiceCodeType.USPSFirstClass,
                ShippingServiceCodeType.ShippingMethodStandard,
                ShippingServiceCodeType.ShippingMethodExpress,
                ShippingServiceCodeType.USPSExpressMail,
                ShippingServiceCodeType.UPSNextDayAir,
                ShippingServiceCodeType.UPS2DayAirAM,
                ShippingServiceCodeType.LocalDelivery,
                ShippingServiceCodeType.Other
            };

            int len = options.Length;

            ControlTagItem[] items = new ControlTagItem[len];
            for (int i = 0; i < len; i++)
            {
                items[i] = new ControlTagItem(options[i].ToString(), options[i]);
            }
            this.htFlatRateShippingServiceControlTagItems.Add(SiteCodeType.US, items);
            this.htCalcRateShippingServiceControlTagItems.Add(SiteCodeType.US, items);
        }
Пример #4
0
 private void InitPaymentMethods()
 {
     ControlTagItem[] items = new ControlTagItem[] {
         new ControlTagItem("Money Order or Cashier's Check", BuyerPaymentMethodCodeType.MOCC),
         new ControlTagItem("Personal Check", BuyerPaymentMethodCodeType.PersonalCheck),
         new ControlTagItem("Visa or Master Card", BuyerPaymentMethodCodeType.VisaMC),
         new ControlTagItem("American Express", BuyerPaymentMethodCodeType.AmEx),
         new ControlTagItem("Discover Card", BuyerPaymentMethodCodeType.Discover),
         new ControlTagItem("Payment Option See Description", BuyerPaymentMethodCodeType.PaymentSeeDescription),
         new ControlTagItem("PayPal", BuyerPaymentMethodCodeType.PayPal)
     };
     this.htPaymentMethods.Add(SiteCodeType.US, items);
 }
Пример #5
0
        public ICollection <string> this[ControlTagItem item]
        {
            get
            {
                ICollection <string> value;
                if (!_items.TryGetValue(item, out value))
                {
                    value = new Collection <string>();
                    _items.Add(item, value);
                }

                return(value);
            }
        }
Пример #6
0
        private void InitInsuranceOptions()
        {
            InsuranceOptionCodeType[] options =
                new InsuranceOptionCodeType[] {
                InsuranceOptionCodeType.Optional,
                InsuranceOptionCodeType.IncludedInShippingHandling,
                InsuranceOptionCodeType.NotOffered,
                InsuranceOptionCodeType.Required
            };

            int len = options.Length;

            ControlTagItem[] items = new ControlTagItem[len];
            for (int i = 0; i < len; i++)
            {
                items[i] = new ControlTagItem(options[i].ToString(), options[i]);
            }
            this.htInsuranceOptionControlTagItems.Add(SiteCodeType.US, items);
        }
Пример #7
0
        private void InitPackageSizeOptions()
        {
            ShippingPackageCodeType[] options = new ShippingPackageCodeType[]
            {
                ShippingPackageCodeType.None,
                ShippingPackageCodeType.LargeEnvelope,
                ShippingPackageCodeType.Letter,
                ShippingPackageCodeType.PackageThickEnvelope,
                ShippingPackageCodeType.UPSLetter,
                ShippingPackageCodeType.USPSFlatRateEnvelope,
                ShippingPackageCodeType.USPSLargePack,
                ShippingPackageCodeType.VeryLargePack
            };
            int len = options.Length;

            ControlTagItem[] items = new ControlTagItem[len];
            for (int i = 0; i < len; i++)
            {
                items[i] = new ControlTagItem(options[i].ToString(), options[i]);
            }

            this.htShippingPackageSizeControlTagItems.Add(SiteCodeType.US, items);
        }
Пример #8
0
        private void InitSalesTaxStateOptions()
        {
            string [] options = new string[] {
                "No Sales Tax", "No Sales Tax",
                "Alabama", "AL",
                "Alaska", "AK",
                "Arizona", "AZ",
                "Arkansas", "AR",
                "California", "CA",
                "Colorado", "CO",
                "Connecticut", "CT",
                "Delaware", "DE",
                "Dist Columbia", "DC",
                "Florida", "FL",
                "Georgia", "GA",
                "Hawaii", "HI",
                "Idaho", "ID",
                "Illinois", "IL",
                "Indiana", "IN",
                "Iowa", "IA",
                "Kansas", "KS",
                "Kentucky", "KY",
                "Louisiana", "LA",
                "Maine", "ME",
                "Maryland", "MD",
                "Massachusetts", "MA",
                "Michigan", "MI",
                "Minnesota", "MN",
                "Mississippi", "MS",
                "Missouri", "MO",
                "Montana", "NT",
                "Nebraska", "NE",
                "Nevada", "NV",
                "New Hampshire", "NH",
                "New Jersey", "NJ",
                "New Mexico", "NM",
                "New York", "NY",
                "North Carolina", "NC",
                "North Dakota", "ND",
                "Ohio", "OH",
                "Oklahoma", "OK",
                "Oregon", "OR",
                "Pennsylvania", "PA",
                "Rhode Island", "RI",
                "South Carolina", "SC",
                "South Dakota", "SD",
                "Tennessee", "TN",
                "Texas", "TX",
                "Utah", "UT",
                "Vermont", "VT",
                "Virginia", "VA",
                "Washington", "WA",
                "West Virginia", "WV",
                "Wisconsin", "WI",
                "Wyoming", "WY"
            };
            int len = options.Length / 2;

            ControlTagItem[] items = new ControlTagItem[len];
            for (int i = 0; i < len; i++)
            {
                items[i] = new ControlTagItem(options[i * 2], options[i * 2 + 1]);
            }
            this.htStateControlTagItems.Add(SiteCodeType.US, items);
        }
Пример #9
0
        public static string GetClasses(ControlTagHelperOptions options, string classes, ControlTagItem item)
        {
            if (classes == null && !options.Classes[item].Any())
            {
                return(string.Empty);
            }

            if (classes == null)
            {
                return(string.Join(" ", options.Classes[item]));
            }

            if (!options.Classes[item].Any())
            {
                return(classes);
            }

            return(string.Join(" ", classes
                               .Split(' ')
                               .Union(options.Classes[item])
                               .Distinct()));
        }