private void BtnReviseCheckoutStatus_Click(object sender, System.EventArgs e)
        {
            try
            {
                TxtStatus.Text = "";

                ReviseCheckoutStatusCall apicall = new ReviseCheckoutStatusCall(Context);

                apicall.PaymentMethodUsed = (BuyerPaymentMethodCodeType)Enum.Parse(typeof(BuyerPaymentMethodCodeType), CboPaymentMethod.SelectedItem.ToString());
                if (TxtAmountPaid.Text != String.Empty)
                {
                    apicall.AmountPaid            = new AmountType();
                    apicall.AmountPaid.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                    apicall.AmountPaid.Value      = Convert.ToDouble(TxtAmountPaid.Text);
                }

                apicall.ShippingService = CboShipSvc.SelectedItem.ToString();

                if (OptItem.Checked)
                {
                    apicall.ReviseCheckoutStatus(TxtItemId.Text, TxtTransactionId.Text, (CompleteStatusCodeType)Enum.Parse(typeof(CompleteStatusCodeType), CboCheckoutStatus.SelectedItem.ToString()));
                }
                else
                {
                    apicall.ReviseCheckoutStatus(TxtOrderId.Text, (CompleteStatusCodeType)Enum.Parse(typeof(CompleteStatusCodeType), CboCheckoutStatus.SelectedItem.ToString()));
                }
                TxtStatus.Text = apicall.ApiResponse.Ack.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        private ItemType FillItem()
        {
            ItemType item = new ItemType();

            item.ItemID = TxtOriginalId.Text;

            item.ListingDuration = CboDuration.SelectedItem.ToString();


            if (TxtBuyItNowPrice.Text.Length > 0)
            {
                item.BuyItNowPrice            = new AmountType();
                item.BuyItNowPrice.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                item.BuyItNowPrice.Value      = Double.Parse(this.TxtBuyItNowPrice.Text, NumberStyles.Currency);
            }

            return(item);
        }
        private ItemType FillItem(RecommendationEngineCodeType engine)
        {
            ItemType item = new ItemType();

            if (TxtTitle.Text.Length > 0)
            {
                item.Title = TxtTitle.Text;
            }

            CurrencyCodeType currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);

            item.Currency = currencyID;
            if (TxtStartPrice.Text.Length > 0)
            {
                item.StartPrice            = new AmountType();
                item.StartPrice.Value      = Convert.ToDouble(TxtStartPrice.Text);
                item.StartPrice.currencyID = currencyID;
            }

            if (TxtReservePrice.Text.Length > 0)
            {
                item.ReservePrice            = new AmountType();
                item.ReservePrice.Value      = Convert.ToDouble(TxtReservePrice.Text);
                item.ReservePrice.currencyID = currencyID;
            }
            ;

            if (TxtBuyItNowPrice.Text.Length > 0)
            {
                item.BuyItNowPrice            = new AmountType();
                item.BuyItNowPrice.Value      = Convert.ToDouble(TxtBuyItNowPrice.Text);
                item.BuyItNowPrice.currencyID = currencyID;
            }

            if (TxtPrimaryCategory.Text.Length > 0)
            {
                item.PrimaryCategory            = new CategoryType();
                item.PrimaryCategory.CategoryID = TxtPrimaryCategory.Text;
            }

            if (TxtSecondaryCategory.Text.Length > 0)
            {
                item.SecondaryCategory            = new CategoryType();
                item.SecondaryCategory.CategoryID = TxtSecondaryCategory.Text;
            }

            if (TxtItemID.Visible)
            {
                item.ItemID = TxtItemID.Text;
            }
            if (engine == RecommendationEngineCodeType.ProductPricing)
            {
                string s = TxtExternalProductID.Text;
                if (s.Length > 0)
                {
                    ProductListingDetailsType pld = new ProductListingDetailsType();
                    pld.ProductID = s;
                    item.ProductListingDetails = pld;
                }
            }

            return(item);
        }
예제 #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
        private void BtnRespondToBestOffer_Click(object sender, System.EventArgs e)
        {
            try
            {
                if (TxtBestOfferID.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Please input best offer id!");
                    return;
                }

                if (TxtItemID.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Please input item id!");
                    return;
                }


                TxtStatus.Text = "";
                RespondToBestOfferCall apicall = new RespondToBestOfferCall(Context);

                StringCollection BestOfferIDList = new StringCollection();
                BestOfferIDList.Add(TxtBestOfferID.Text);
                string cboActionChoice = CboAction.SelectedItem.ToString();
                if (cboActionChoice == "Counter")
                {
                    if (txtCounterOfferPrice.Text.Trim().Length == 0)
                    {
                        MessageBox.Show("Please counter offer price!");
                        return;
                    }

                    if (txtCounterOfferQuantity.Text.Trim().Length == 0)
                    {
                        MessageBox.Show("Please input counter offer quanity!");
                        return;
                    }

                    AmountType CounterOfferPrice = new AmountType();
                    CounterOfferPrice.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                    CounterOfferPrice.Value      = Convert.ToDouble(txtCounterOfferPrice.Text);
                    int quantity = Convert.ToInt32(txtCounterOfferQuantity.Text);
                    apicall.RespondToBestOffer(TxtItemID.Text,
                                               BestOfferIDList,
                                               (BestOfferActionCodeType)Enum.Parse(typeof(BestOfferActionCodeType),
                                                                                   CboAction.SelectedItem.ToString()),
                                               TxtSellerResponse.Text,
                                               CounterOfferPrice,
                                               quantity);
                }
                else
                {
                    apicall.RespondToBestOffer(TxtItemID.Text,
                                               BestOfferIDList,
                                               (BestOfferActionCodeType)Enum.Parse(typeof(BestOfferActionCodeType),
                                                                                   CboAction.SelectedItem.ToString()),
                                               TxtSellerResponse.Text);
                }
                TxtStatus.Text = apicall.ApiResponse.Ack.ToString();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #6
0
        private ItemType FillItem()
        {
            BtnGetItem.Visible = false;

            ItemType item = new ItemType();

            // Set UP Defaults
            item.Currency = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
            item.Country  = SiteUtility.GetCountryCodeType(Context.Site);

            item.PaymentMethods = new BuyerPaymentMethodCodeTypeCollection();
            item.PaymentMethods.AddRange(new BuyerPaymentMethodCodeType[] { BuyerPaymentMethodCodeType.PayPal });
            item.RegionID = "0";

            // Set specified values from the form
            item.Title       = this.TxtTitle.Text;
            item.Description = this.TxtDescription.Text;

            item.Quantity = Int32.Parse(TxtQuantity.Text, NumberStyles.None);
            item.Location = TxtLocation.Text;

            item.ListingDuration = CboDuration.SelectedItem.ToString();


            item.PrimaryCategory            = new CategoryType();
            item.PrimaryCategory.CategoryID = this.TxtCategory.Text;;
            if (TxtStartPrice.Text.Length > 0)
            {
                item.StartPrice            = new AmountType();
                item.StartPrice.currencyID = item.Currency;
                item.StartPrice.Value      = Convert.ToDouble(this.TxtStartPrice.Text);
            }

            if (TxtReservePrice.Visible && TxtReservePrice.Text.Length > 0)
            {
                item.ReservePrice            = new AmountType();
                item.ReservePrice.currencyID = item.Currency;
                item.ReservePrice.Value      = Convert.ToDouble(this.TxtReservePrice.Text);
            }
            if (TxtBuyItNowPrice.Visible && TxtBuyItNowPrice.Text.Length > 0)
            {
                item.BuyItNowPrice            = new AmountType();
                item.BuyItNowPrice.currencyID = item.Currency;
                item.BuyItNowPrice.Value      = Convert.ToDouble(this.TxtBuyItNowPrice.Text);
            }

            ListingEnhancementsCodeTypeCollection enhancements = new ListingEnhancementsCodeTypeCollection();

            if (this.ChkBoldTitle.Checked)
            {
                enhancements.Add(ListingEnhancementsCodeType.BoldTitle);
            }
            if (this.ChkHighLight.Checked)
            {
                enhancements.Add(ListingEnhancementsCodeType.Highlight);
            }

            if (enhancements.Count > 0)
            {
                item.ListingEnhancement = enhancements;
            }

            item.ListingType = (ListingTypeCodeType)Enum.Parse(typeof(ListingTypeCodeType), CboListType.SelectedItem.ToString());

            if (ChkEnableBestOffer.Visible)
            {
                item.BestOfferDetails = new BestOfferDetailsType();
                item.BestOfferDetails.BestOfferEnabled = ChkEnableBestOffer.Checked;
            }

            if (TxtCategory2.Text.Length > 0)
            {
                item.SecondaryCategory            = new CategoryType();
                item.SecondaryCategory.CategoryID = TxtCategory2.Text;
            }

            if (TxtPayPalEmailAddress.Text.Length > 0)
            {
                item.PayPalEmailAddress = TxtPayPalEmailAddress.Text;
            }

            if (TxtApplicationData.Text.Length > 0)
            {
                item.ApplicationData = TxtApplicationData.Text;
            }

            int condition = ((ComboxItem)CboCondition.SelectedItem).Value;

            item.ConditionID = condition;

            //add shipping information
            item.ShippingDetails = getShippingDetails();
            //add handling time
            item.DispatchTimeMax = 1;
            //add policy
            item.ReturnPolicy = GetPolicyForUS();

            return(item);
        }
예제 #7
0
        private void BtnReviseItem_Click(object sender, System.EventArgs e)
        {
            try
            {
                TxtItemId.Text     = "";
                TxtListingFee.Text = "";
                BtnGetItem.Visible = false;

                // Populate the Item
                ItemType item = new ItemType();
                item.ItemID = TxtReviseItemId.Text;

                CurrencyCodeType currencyCode = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);


                if (TxtTitle.Text.Length > 0)
                {
                    item.Title = this.TxtTitle.Text;
                }

                if (TxtDescription.Text.Length > 0)
                {
                    item.Description = this.TxtDescription.Text;
                }

                if (CboDuration.SelectedIndex != -1)
                {
                    item.ListingDuration = CboDuration.SelectedItem.ToString();
                }

                if (TxtStartPrice.Text.Length > 0)
                {
                    item.StartPrice            = new AmountType();
                    item.StartPrice.currencyID = currencyCode;
                    item.StartPrice.Value      = Double.Parse(this.TxtStartPrice.Text, NumberStyles.Currency);
                }
                if (TxtReservePrice.Text.Length > 0)
                {
                    item.ReservePrice            = new AmountType();
                    item.ReservePrice.currencyID = currencyCode;
                    item.ReservePrice.Value      = Double.Parse(this.TxtReservePrice.Text, NumberStyles.Currency);
                }
                if (TxtBuyItNowPrice.Text.Length > 0)
                {
                    item.BuyItNowPrice            = new AmountType();
                    item.BuyItNowPrice.currencyID = currencyCode;
                    item.BuyItNowPrice.Value      = Double.Parse(this.TxtBuyItNowPrice.Text, NumberStyles.Currency);
                }

                if (CboEnableBestOffer.SelectedIndex != -1)
                {
                    item.BestOfferDetails = new BestOfferDetailsType();
                    item.BestOfferDetails.BestOfferEnabled = Boolean.Parse(CboEnableBestOffer.SelectedItem.ToString());
                }

                StringCollection deletedFields = new StringCollection();

                if (ChkPayPalEmailAddress.Checked)
                {
                    deletedFields.Add("Item.payPalEmailAddress");
                }

                if (ChkApplicationData.Checked)
                {
                    deletedFields.Add("Item.applicationData");
                }

                ReviseItemCall apicall = new ReviseItemCall(Context);
                if (ListPictures.Items.Count > 0)
                {
                    apicall.PictureFileList          = new StringCollection();
                    item.PictureDetails              = new PictureDetailsType();
                    item.PictureDetails.PhotoDisplay = (PhotoDisplayCodeType)Enum.Parse(typeof(PhotoDisplayCodeType), CboPicDisplay.SelectedItem.ToString());
                }

                foreach (string pic in ListPictures.Items)
                {
                    apicall.PictureFileList.Add(pic);
                }
                apicall.DeletedFieldList = deletedFields;

                apicall.ReviseItem(item, deletedFields, false);
                TxtItemId.Text = item.ItemID;

                FeeTypeCollection fees = apicall.FeeList;

                BtnGetItem.Visible = true;

                foreach (FeeType fee in fees)
                {
                    if (fee.Name == "ListingFee")
                    {
                        TxtListingFee.Text = fee.Fee.Value.ToString();
                        break;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #8
0
        private void BtnAddOrder_Click(object sender, System.EventArgs e)
        {
            try
            {
                TxtOrderId.Text = "";

                AddOrderCall apicall = new AddOrderCall(Context);


                OrderType order = new OrderType();
                order.TransactionArray = new TransactionTypeCollection();
                order.ShippingDetails  = new ShippingDetailsType();
                order.PaymentMethods   = new BuyerPaymentMethodCodeTypeCollection();

                TransactionType tr1 = new TransactionType();
                tr1.Item          = new ItemType();
                tr1.Item.ItemID   = TxtItemIdOne.Text;
                tr1.TransactionID = TxtTransactionIdOne.Text;
                order.TransactionArray.Add(tr1);

                TransactionType tr2 = new TransactionType();
                tr2.Item          = new ItemType();
                tr2.Item.ItemID   = TxtItemIdTwo.Text;
                tr2.TransactionID = TxtTransactionIdTwo.Text;
                order.TransactionArray.Add(tr2);

                order.ShippingDetails.PaymentInstructions = TxtPaymentInstructions.Text;
                ShippingServiceOptionsType shpopt = new ShippingServiceOptionsType();
                shpopt.ShippingService         = CboShipSvc.SelectedItem.ToString();
                shpopt.ShippingServicePriority = 1;

                order.ShippingDetails.ShippingServiceOptions = new ShippingServiceOptionsTypeCollection();
                shpopt.ShippingServiceCost            = new AmountType();
                shpopt.ShippingServiceCost.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);

                if (TxtShipCost.Text.Length > 0)
                {
                    shpopt.ShippingServiceCost.Value = Convert.ToDouble(TxtShipCost.Text);
                }
                order.ShippingDetails.ShippingServiceOptions.Add(shpopt);

                order.Total            = new AmountType();
                order.Total.currencyID = CurrencyUtility.GetDefaultCurrencyCodeType(Context.Site);
                if (TxtTotal.Text.Length > 0)
                {
                    order.Total.Value = Convert.ToDouble(TxtTotal.Text);
                }
                order.CreatingUserRole = (TradingRoleCodeType)Enum.Parse(typeof(TradingRoleCodeType), CboRole.SelectedItem.ToString());

                order.PaymentMethods.AddRange(new BuyerPaymentMethodCodeType[] { BuyerPaymentMethodCodeType.PaymentSeeDescription });

                string orderid = apicall.AddOrder(order);


                TxtOrderId.Text = orderid;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }