private void populateReturnPolicy() { this.controller.ShowPleaseWaitDialog(); GeteBayDetailsResponseType ebayDetails = controller.SiteFacade.GetEbayDetails(); this.controller.HidePleaseWaitDialog(); if (ebayDetails == null) { this.returnPolicyGroupBox.Enabled = false; return; } ReturnsAcceptedDetailsTypeCollection returnsAcceptedCol = ebayDetails.ReturnPolicyDetails.ReturnsAccepted; RefundDetailsTypeCollection refundCol = ebayDetails.ReturnPolicyDetails.Refund; ReturnsWithinDetailsTypeCollection returnsWithinCol = ebayDetails.ReturnPolicyDetails.ReturnsWithin; ShippingCostPaidByDetailsTypeCollection costPaidByCol = ebayDetails.ReturnPolicyDetails.ShippingCostPaidBy; if (returnsAcceptedCol != null && returnsAcceptedCol.Count > 0) { this.returnAcceptedComboBox.Items.Clear(); foreach (ReturnsAcceptedDetailsType accept in returnsAcceptedCol) { ListItem item = new ListItem(); item.Name = accept.Description; item.Value = accept.ReturnsAcceptedOption; returnAcceptedComboBox.Items.Add(item); returnAcceptedComboBox.SelectedIndex = 0; } } else { this.returnAcceptedLabel.Enabled = false; this.returnAcceptedComboBox.Enabled = false; } if (refundCol != null && refundCol.Count > 0) { this.refundTypeComboBox.Items.Clear(); foreach (RefundDetailsType refund in refundCol) { ListItem item = new ListItem(); item.Name = refund.Description; item.Value = refund.RefundOption; refundTypeComboBox.Items.Add(item); refundTypeComboBox.SelectedIndex = 0; } } else { this.refundTypeLabel.Enabled = false; this.refundTypeComboBox.Enabled = false; } if (returnsWithinCol != null && returnsWithinCol.Count > 0) { this.returnWithinComboBox.Items.Clear(); foreach (ReturnsWithinDetailsType within in returnsWithinCol) { ListItem item = new ListItem(); item.Name = within.Description; item.Value = within.ReturnsWithinOption; returnWithinComboBox.Items.Add(item); returnWithinComboBox.SelectedIndex = 0; } } else { this.ReturnWithinLabel.Enabled = false; this.returnWithinComboBox.Enabled = false; } if (costPaidByCol != null && costPaidByCol.Count > 0) { this.shippingCostPaidByComboBox.Items.Clear(); foreach (ShippingCostPaidByDetailsType cost in costPaidByCol) { ListItem item = new ListItem(); item.Name = cost.Description; item.Value = cost.ShippingCostPaidByOption; shippingCostPaidByComboBox.Items.Add(item); shippingCostPaidByComboBox.SelectedIndex = 0; } } else { this.shippingCostPaidByLabel.Enabled = false; this.shippingCostPaidByComboBox.Enabled = false; } }
//populate listing types list private void populateListingTypeComboBox() { ICollection listingTypes = this.controller.CategoryFacade.ListingType2DurationMap.Keys; this.listingTypeComboBox.Items.Clear(); foreach (string listingType in listingTypes) { ListItem item = new ListItem(listingType, listingType); this.listingTypeComboBox.Items.Add(item); } if (this.listingTypeComboBox.Items.Count > 0) { this.listingTypeComboBox.SelectedIndex = 0; } }
//populate shipping service list private void populateShippingServiceComboBox() { this.shippingServiceComboBox.Items.Clear(); GeteBayDetailsResponseType eBayDetails = this.controller.SiteFacade.GetEbayDetails(); if (eBayDetails != null) { if (this.controller.ApiContext.Site == SiteCodeType.eBayMotors) { ListItem item = new ListItem(); item.Name = "None"; item.Value = "None"; this.shippingServiceComboBox.Items.Add(item); } ShippingServiceDetailsTypeCollection shippingDetails = eBayDetails.ShippingServiceDetails; if (shippingDetails != null) { foreach (ShippingServiceDetailsType shippingDetail in shippingDetails) { if (shippingDetail.ServiceType.Contains(ShippingTypeCodeType.Flat) && shippingDetail.ShippingServiceID < 5000) { ListItem item = new ListItem(); item.Name = shippingDetail.Description; item.Value = shippingDetail.ShippingService.ToString(); this.shippingServiceComboBox.Items.Add(item); } } } if (this.shippingServiceComboBox.Items.Count > 0) { this.shippingServiceComboBox.SelectedIndex = 0; } } }
//populate listing duration list private void populateListingDurationComboBox() { Hashtable listingType2DurationMap = this.controller.CategoryFacade.ListingType2DurationMap; string listingType = (this.listingTypeComboBox.SelectedItem as ListItem).Value; StringCollection durations = (StringCollection)listingType2DurationMap[listingType]; this.durationComboBox.Items.Clear(); foreach (string duration in durations) { ListItem item = new ListItem(duration, duration); durationComboBox.Items.Add(item); } if (this.durationComboBox.Items.Count > 0) { this.durationComboBox.SelectedIndex = 0; } }