コード例 #1
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);
		}
コード例 #2
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);
		}
コード例 #3
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="panel"></param>
		/// <param name="items"></param>
		/// <param name="xOffset"></param>
		/// <param name="yOffset"></param>
		/// <param name="height"></param>
		/// <param name="widthFactor"></param>
		/// <returns></returns>
		public static CheckBox[] CreateCheckBoxControls(
			Panel panel, ControlTagItem[] items, int xOffset, int yOffset, int height, int widthFactor)
		{
			Rectangle rect = panel.DisplayRectangle;

			int numOfCheckBoxes = items.Length;

			int w = GetMaxItemLableLength(items)*widthFactor;
			int colSize = (rect.Width - xOffset*2)/w;
			if (colSize == 0) 
			{
				colSize = 1;
			}

			xOffset = (rect.Width - w*colSize)/2;
			if (xOffset < 0) 
			{
				xOffset = 10;
			}
			CheckBox[] controls = new CheckBox[numOfCheckBoxes];
			
			for (int i = 0; i < numOfCheckBoxes; i++) 
			{
				int row = i / colSize;
				int col = i % colSize;
				CheckBox checkBox = new System.Windows.Forms.CheckBox();
				checkBox.Width = w;
				checkBox.Location = new Point(xOffset + col*w, yOffset + row*height);
				checkBox.Name = items[i].Tag.ToString();
				checkBox.TabIndex = i;
				checkBox.Height = height;
				checkBox.Text = items[i].Text;
				controls[i] = checkBox;
			}

			panel.Controls.AddRange(controls);

			return controls;
		}
コード例 #4
0
        static int GetMaxItemLableLength(ControlTagItem[] items)
        {
            int max = 0;
            int len = 0;
            for (int i = 0; i < items.Length; i++)
            {
                len = items[0].Text.Length;
                if (max < len)
                {
                    max = len;
                }
            }

            return max;
        }
コード例 #5
0
ファイル: FormMain.cs プロジェクト: fudder/cs493
        //get shippingToLocations controlTag
        private ControlTagItem[] getItemShipToLocationControlTags()
        {
            ShippingLocationDetailsTypeCollection shippingLocationCol =CategoryFeatureManager.GetShippingServices(apiContext).ShippingLocationDetails;
            ControlTagItem[] shippingLocations=null;

            if (shippingLocationCol!=null)
            {
                shippingLocations=new ControlTagItem[shippingLocationCol.Count];
                int index=0;

                foreach (ShippingLocationDetailsType shippingLocation in shippingLocationCol)
                {
                    shippingLocations[index]=new ControlTagItem(shippingLocation.ShippingLocation,shippingLocation.ShippingLocation);
                    index++;
                }
            }
            else
            {
                this.txtError.Text+="\nshippingToLocations data is empty!";
            }

            return shippingLocations;
        }
コード例 #6
0
ファイル: FormMain.cs プロジェクト: fudder/cs493
        //populate all shipping service to array
        private ControlTagItem[] populateToControlTag(ArrayList list)
        {
            if(list==null)
                return null;

            ControlTagItem[] controlTagItemArr=new ControlTagItem[list.Count];
            int index=0;
            foreach(object item in list)
            {
                controlTagItemArr[index++]=new ControlTagItem(item.ToString(),item.ToString());
            }

            return controlTagItemArr;
        }
コード例 #7
0
ファイル: FormMain.cs プロジェクト: fudder/cs493
        /*private void InitShippingInsuranceOptions()
        {
            ControlTagItem[] insuranceOptions = ShippingServiceHelper.GetInstance().GetInsuranceOptionControlTagItems(SiteCodeType.US);
            this.cbxShippingInsurance.Items.AddRange(insuranceOptions);
            this.cbxShippingInsurance.SelectedIndex = 0;
        }*/
        private void InitShippingPackageOptions()
        {
            ControlTagItem[] packageSize = ShippingServiceHelper.GetInstance().GetShippingPackSizeControlTagItems(SiteCodeType.US);
            this.cbxPackageSize.Items.AddRange(packageSize);
            this.cbxPackageSize.SelectedIndex = 0;

            ControlTagItem[] units = new ControlTagItem[] {
                                                              new ControlTagItem("English", "pounds"), new ControlTagItem("Metric", "Kilograms")
                                                          };
            this.cbxWeightMeasurement.Items.AddRange(units);
            this.cbxWeightMeasurement.SelectedIndex = 0;
        }
コード例 #8
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);
		}
コード例 #9
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);
		}
コード例 #10
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);
		}
コード例 #11
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);
		}
コード例 #12
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);
		}
コード例 #13
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="items"></param>
		public void SetCheckBoxControls(ControlTagItem[] items)
		{
			Rectangle rect = this.DisplayRectangle;
			this.panel = new Panel();
			this.panel.Size = new System.Drawing.Size(rect.Width, rect.Height);
			this.Controls.Add(panel);
			this.checkBoxes = CheckBoxControlBuilder.CreateCheckBoxControls(this.panel, items, this.xOffset, this.yOffset, this.height, this.widthFactor);
		}
コード例 #14
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="options"></param>
 public void SetComboBoxOptions(ControlTagItem[] options)
 {
     this.cmbBox.Items.AddRange(options);
 }