コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public virtual ICollection GetShippingServiceOptions()
        {
            ShippingServiceOptionsTypeCollection ssos = new ShippingServiceOptionsTypeCollection();

            int row = this.Items.Count;
            int col = this.Items[0].SubItems.Count;

            int cnt = 0;

            for (int i = 0; i < row; i++)
            {
                ListViewItem lvi = this.Items[i];
                //ShippingService
                string text = lvi.SubItems[0].Text;
                if (text.Length > 0)
                {
                    if (!text.Equals("NotSelected"))
                    {
                        cnt++;
                        ShippingServiceOptionsType sso = new ShippingServiceOptionsType();
                        sso.ShippingService         = text;
                        sso.ShippingServicePriority = cnt;
                        ssos.Add(sso);
                        if (col > 1)
                        {
                            // ShippingServiceCost
                            text = lvi.SubItems[1].Text;
                            if (text.Length > 0)
                            {
                                sso.ShippingServiceCost = CurrencyUtility.GetAmountType(text);
                            }
                            // ShippingServiceAdditioanlCost
                            text = lvi.SubItems[2].Text;
                            if (text.Length > 0)
                            {
                                sso.ShippingServiceAdditionalCost = CurrencyUtility.GetAmountType(text);
                            }
                        }
                    }
                }
            }
            return(ssos);
        }
コード例 #2
0
ファイル: eBayWrapper.cs プロジェクト: madhurjain/eBayLister
        private ShippingDetailsType getShippingDetails()
        {
            ShippingDetailsType sd = new ShippingDetailsType();
            AmountType          at = new AmountType();

            sd.PaymentInstructions = eBayLister.UserSettings.Default.paymentInstructions;
            sd.ShippingType        = ShippingTypeCodeType.Flat;

            ShippingServiceOptionsType st1 = new ShippingServiceOptionsType();

            st1.ShippingService = ShippingServiceCodeType.IN_Express.ToString();

            at            = new AmountType();
            at.currencyID = CurrencyCodeType.INR;
            at.Value      = Convert.ToDouble(eBayLister.UserSettings.Default.shippingCost) *
                            Convert.ToDouble(eBayLister.UserSettings.Default.ConversionRate);
            st1.ShippingServiceCost = at;
            ShippingServiceOptionsTypeCollection serviceOptions = new ShippingServiceOptionsTypeCollection();

            serviceOptions.Add(st1);
            sd.ShippingServiceOptions = serviceOptions;
            return(sd);
        }
コード例 #3
0
        private void BtnSendInvoice_Click(object sender, System.EventArgs e)
        {
            try
            {
                SendInvoiceCall apicall = new SendInvoiceCall(Context);

                TxtStatus.Text = "";
                string ItemID        = TxtItemId.Text;
                string TransactionID = TxtTransactionId.Text;

                ShippingServiceOptionsType ShippingServiceOption = new ShippingServiceOptionsType();

                ShippingServiceOption.ShippingInsuranceCost            = new AmountType();
                ShippingServiceOption.ShippingInsuranceCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                ShippingServiceOption.ShippingInsuranceCost.Value      = Convert.ToDouble(TxtShippingInsuranceCost.Text);

                ShippingServiceOption.ShippingService = CboShippingService.SelectedItem.ToString();

                ShippingServiceOption.ShippingServiceCost            = new AmountType();
                ShippingServiceOption.ShippingServiceCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                ShippingServiceOption.ShippingServiceCost.Value      = Convert.ToDouble(TxtShippingServiceCost.Text);


                ShippingServiceOption.ShippingServiceAdditionalCost = new AmountType();

                ShippingServiceOption.ShippingServiceAdditionalCost.Value      = Convert.ToDouble(TxtShippingServiceAdditionalCost.Text);
                ShippingServiceOption.ShippingServiceAdditionalCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                ShippingServiceOption.ShippingServicePriority = Int32.Parse(TxtShippingServicePriority.Text);

                //SaleTaxType related
                apicall.SalesTax = new SalesTaxType();
                apicall.SalesTax.SalesTaxPercent       = (float)Convert.ToDouble(TxtSalesTaxPercent.Text);
                apicall.SalesTax.SalesTaxState         = TxtSalesTaxState.Text;
                apicall.SalesTax.ShippingIncludedInTax = ChkShippingIncludedInTax.Checked;

                apicall.SalesTax.SalesTaxAmount            = new AmountType();
                apicall.SalesTax.SalesTaxAmount.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                apicall.SalesTax.SalesTaxAmount.Value      = Convert.ToDouble(TxtSalesTaxAmount.Text);


                apicall.InsuranceOption = (InsuranceOptionCodeType)Enum.Parse(typeof(InsuranceOptionCodeType), CboInsuranceOption.SelectedItem.ToString());

                apicall.InsuranceFee            = new AmountType();
                apicall.InsuranceFee.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                apicall.InsuranceFee.Value      = Convert.ToDouble(TxtInsuranceFee.Text);

                apicall.PaymentMethodsList = new BuyerPaymentMethodCodeTypeCollection();
                apicall.PaymentMethodsList.Add((BuyerPaymentMethodCodeType)Enum.Parse(typeof(BuyerPaymentMethodCodeType), CboPaymentMethod.SelectedItem.ToString()));

                apicall.PayPalEmailAddress   = TxtPayPalEmailAddress.Text;
                apicall.CheckoutInstructions = TxtCheckoutInstructions.Text;
                apicall.EmailCopyToSeller    = ChkEmailCopyToSeller.Checked;

                ShippingServiceOptionsTypeCollection ShippingServiceOptionsList = new ShippingServiceOptionsTypeCollection();
                ShippingServiceOptionsList.Add(ShippingServiceOption);

                apicall.SendInvoice(ItemID, TransactionID, ShippingServiceOptionsList);
                TxtStatus.Text = apicall.ApiResponse.Ack.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
コード例 #4
0
		private void BtnSendInvoice_Click(object sender, System.EventArgs e)
		{
			try
			{
				SendInvoiceCall apicall = new SendInvoiceCall(Context);

				TxtStatus.Text = "";
				string ItemID = TxtItemId.Text;
				string TransactionID = TxtTransactionId.Text;

				ShippingServiceOptionsType ShippingServiceOption = new ShippingServiceOptionsType();
				
				ShippingServiceOption.ShippingInsuranceCost = new AmountType();
				ShippingServiceOption.ShippingInsuranceCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
				ShippingServiceOption.ShippingInsuranceCost.Value = Convert.ToDouble(TxtShippingInsuranceCost.Text);
					
				ShippingServiceOption.ShippingService = CboShippingService.SelectedItem.ToString();

				ShippingServiceOption.ShippingServiceCost = new AmountType();
				ShippingServiceOption.ShippingServiceCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
				ShippingServiceOption.ShippingServiceCost.Value=Convert.ToDouble(TxtShippingServiceCost.Text);

				
				ShippingServiceOption.ShippingServiceAdditionalCost = new AmountType();

				ShippingServiceOption.ShippingServiceAdditionalCost.Value=Convert.ToDouble(TxtShippingServiceAdditionalCost.Text);
				ShippingServiceOption.ShippingServiceAdditionalCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
				ShippingServiceOption.ShippingServicePriority = Int32.Parse(TxtShippingServicePriority.Text);

				//SaleTaxType related
				apicall.SalesTax = new SalesTaxType();
				apicall.SalesTax.SalesTaxPercent = (float)Convert.ToDouble(TxtSalesTaxPercent.Text);
				apicall.SalesTax.SalesTaxState = TxtSalesTaxState.Text;
				apicall.SalesTax.ShippingIncludedInTax = ChkShippingIncludedInTax.Checked;

				apicall.SalesTax.SalesTaxAmount = new AmountType();
				apicall.SalesTax.SalesTaxAmount.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
				apicall.SalesTax.SalesTaxAmount.Value = Convert.ToDouble(TxtSalesTaxAmount.Text);
				
        
				apicall.InsuranceOption = (InsuranceOptionCodeType)Enum.Parse(typeof(InsuranceOptionCodeType), CboInsuranceOption.SelectedItem.ToString());
				
				apicall.InsuranceFee = new AmountType();
				apicall.InsuranceFee.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
				apicall.InsuranceFee.Value = Convert.ToDouble(TxtInsuranceFee.Text);

				apicall.PaymentMethodsList = new BuyerPaymentMethodCodeTypeCollection();
				apicall.PaymentMethodsList.Add((BuyerPaymentMethodCodeType)Enum.Parse(typeof(BuyerPaymentMethodCodeType), CboPaymentMethod.SelectedItem.ToString()));
				
				apicall.PayPalEmailAddress = TxtPayPalEmailAddress.Text;
				apicall.CheckoutInstructions = TxtCheckoutInstructions.Text;
				apicall.EmailCopyToSeller = ChkEmailCopyToSeller.Checked;

				ShippingServiceOptionsTypeCollection ShippingServiceOptionsList= new ShippingServiceOptionsTypeCollection();
				ShippingServiceOptionsList.Add(ShippingServiceOption);

				apicall.SendInvoice(ItemID, TransactionID, ShippingServiceOptionsList);
				TxtStatus.Text = apicall.ApiResponse.Ack.ToString();
			}
			catch(Exception ex)
			{
				MessageBox.Show(ex.Message);
			}
		}
コード例 #5
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public virtual ICollection GetShippingServiceOptions()
        {
            ShippingServiceOptionsTypeCollection ssos = new ShippingServiceOptionsTypeCollection();

            int row = this.Items.Count;
            int col = this.Items[0].SubItems.Count;

            int cnt = 0;
            for (int i = 0; i < row; i++)
            {
                ListViewItem lvi = this.Items[i];
                //ShippingService
                string text = lvi.SubItems[0].Text;
                if (text.Length > 0)
                {
                    if (!text.Equals("NotSelected"))
                    {
                        cnt++;
                        ShippingServiceOptionsType sso = new ShippingServiceOptionsType();
                        sso.ShippingService = text;
                        sso.ShippingServicePriority = cnt;
                        ssos.Add(sso);
                        if (col > 1)
                        {
                            // ShippingServiceCost
                            text = lvi.SubItems[1].Text;
                            if (text.Length > 0)
                            {
                                sso.ShippingServiceCost = CurrencyUtility.GetAmountType(text);
                            }
                            // ShippingServiceAdditioanlCost
                            text = lvi.SubItems[2].Text;
                            if (text.Length > 0)
                            {
                                sso.ShippingServiceAdditionalCost = CurrencyUtility.GetAmountType(text);
                            }
                        }
                    }
                }
            }
            return ssos;
        }
コード例 #6
0
ファイル: eBayWrapper.cs プロジェクト: madhurjain/eBayLister
        private ShippingDetailsType getShippingDetails()
        {
            ShippingDetailsType sd = new ShippingDetailsType();
            AmountType at = new AmountType();
            sd.PaymentInstructions = eBayLister.UserSettings.Default.paymentInstructions;
            sd.ShippingType = ShippingTypeCodeType.Flat;

            ShippingServiceOptionsType st1 = new ShippingServiceOptionsType();
            st1.ShippingService = ShippingServiceCodeType.IN_Express.ToString();

            at = new AmountType();
            at.currencyID = CurrencyCodeType.INR;
            at.Value = Convert.ToDouble(eBayLister.UserSettings.Default.shippingCost) *
                                        Convert.ToDouble(eBayLister.UserSettings.Default.ConversionRate);
            st1.ShippingServiceCost = at;
            ShippingServiceOptionsTypeCollection serviceOptions = new ShippingServiceOptionsTypeCollection();
            serviceOptions.Add(st1);
            sd.ShippingServiceOptions = serviceOptions;
            return sd;
        }