Ejemplo n.º 1
0
        public void DisplayItemSpecifics(NameRecommendationTypeCollection col)
        {
            webBrowser.Document.OpenNew(true);

            AddHtmlHeaders();

            System.Text.StringBuilder str = new System.Text.StringBuilder();
            str.Append("</td></tr>");
            GetItemSpecificsHtml(ref str, col);
            webBrowser.Document.Write(str.ToString());

            AddHtmlTails();
        }
Ejemplo n.º 2
0
        public void DisplayItemSpecifics(NameRecommendationTypeCollection col)
        {
            webBrowser.Document.OpenNew(true);

            AddHtmlHeaders();

            System.Text.StringBuilder str = new System.Text.StringBuilder();
            str.Append("</td></tr>");
            GetItemSpecificsHtml(ref str, col);
            webBrowser.Document.Write(str.ToString());

            AddHtmlTails();
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                ListItem selectedItem = this.categoryListBox.SelectedItem as ListItem;
                if (selectedItem == null)
                {
                    MessageBox.Show("Please select a category first!");
                    return;
                }

                this.Hide();

                this.controller.ShowPleaseWaitDialog();

                this.controller.InitCategoryFacade(selectedItem.Value);


                //for category with both attributes and item specifics enabled,
                //we only use item specifics
                if (this.controller.CategoryFacade.ItemSpecificEnabled == ItemSpecificsEnabledCodeType.Enabled)
                {
                    NameRecommendationTypeCollection itemSpecifics = this.controller.CategoryFacade.NameRecommendationsTypes;

                    ItemSpecificsForm itemSpecificsForm = controller.FormTable[AttributesController.ITEM_SPECIFICS_FORM] as ItemSpecificsForm;

                    itemSpecificsForm.DisplayItemSpecifics(itemSpecifics);

                    itemSpecificsForm.Show();
                    itemSpecificsForm.BringToFront();

                    this.controller.HidePleaseWaitDialog();

                    return;
                }

                ReturnPolicyForm returnPolicyForm = controller.FormTable[AttributesController.RETURN_POLICY_FORM] as ReturnPolicyForm;

                returnPolicyForm.InitializeReturnPolicy();

                returnPolicyForm.Show();
                returnPolicyForm.BringToFront();

                this.controller.HidePleaseWaitDialog();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 4
0
        private void GetItemSpecificsHtml(ref System.Text.StringBuilder str, NameRecommendationTypeCollection col)
        {
            str.Append("<tr><td>");
            //CustomItemSpecificGroup div
            str.Append("<span>");
            str.Append("<div id=\"CustomItemSpecificGroup\">");

            GeteBayRecommendedItemSpecificsHtml(ref str, col);

            str.Append("</div>");
            str.Append("</span>");
            //NewCustomItemSpecific div
            str.Append("<span>");
            str.Append("<div id=\"NewCustomItemSpecific\">");
            str.Append("</div>");
            str.Append("</span>");
            //SuggestedSectionLyr div
            str.Append("<span>");
            str.Append("<div id=\"tray\" style=\"visibility: visible;\">");
            str.Append("<div id=\"Addmore\">");
            str.Append("<b>Add more Specifics</b>");
            str.Append("</div>");
            str.Append("<div id=\"msg\" style=\"display: none; visibility: hidden;\"> If you want to add another item specific, please remove one of the existing specifics and add a new one. </div>");
            str.Append("<div id=\"SuggestedSectionLyr\" style=\"padding-top: 10px; visibility: visible;\">");
            str.Append("</div>");
            str.Append("</div>");
            str.Append("</span>");
            //AddCustomLnk tip
            str.Append("<span>");
            str.Append("<div>");
            str.Append("<span id=\"AddCustomLnk\" onclick=\"addNewSpecific();\">");
            str.Append("<a href=\"javascript:void(0);\">");
            str.Append("<img src=\"http://pics.qa.ebaystatic.com/aw/pics/buttons/btnOptionAdd.gif\" hspace=\"1\" border=\"0\" align=\"absmiddle\" />");
            str.Append("</a>");
            str.Append("<a href=\"javascript:void(0);\"><b>Add a custom detail</b></a>");
            str.Append("</span>");
            str.Append("</div>");
            str.Append("</span>");
            str.Append("</td></tr>");
        }
Ejemplo n.º 5
0
        private void SyncNameRecommendationTypes()
        {
            GetCategorySpecificsCall api = new GetCategorySpecificsCall(this.apiContext);

            DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] { DetailLevelCodeType.ReturnAll };
            api.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels);
            eBay.Service.Core.Soap.StringCollection strCol = new eBay.Service.Core.Soap.StringCollection();
            strCol.Add(this.CategoryID);
            api.CategoryIDList = strCol;
            api.Execute();

            NameRecommendationTypeCollection nameRecommendationTypes = null;

            if ((api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning) &&
                api.ApiResponse.Recommendations != null &&
                api.ApiResponse.Recommendations.Count > 0)
            {
                nameRecommendationTypes = api.ApiResponse.Recommendations[0].NameRecommendation;
            }

            this.nameRecommendationTypes = nameRecommendationTypes;
        }
Ejemplo n.º 6
0
        private void GeteBayRecommendedItemSpecificsHtml(ref System.Text.StringBuilder str, NameRecommendationTypeCollection col)
        {
            if (col == null)
            {
                return;
            }
            int suffix = 0;

            foreach (NameRecommendationType nrt in col)
            {
                str.Append(string.Format("<span id=\"SpecificLayer_{0}\" style=\"margin-top: 8px\">", suffix));
                str.Append("<div>");
                str.Append(string.Format("<div id=\"TagName_{0}\" style=\"margin-top: 10px\">", suffix));
                str.Append("<b>"); str.Append(nrt.Name); str.Append("</b>");
                str.Append("</div>");
                str.Append("<div>");
                str.Append(string.Format("<input type=\"text\" id=\"eBayItemSpecificName_{0}\" name=\"eBayItemSpecificName_{0}\" style=\"width:100px;height:21px;font-size:10pt;\">", suffix));
                str.Append("<span style=\"width:18px;border:0px solid red;\">");
                str.Append(string.Format("<select id=\"eBayItemSpecificValue_{0}\" name=\"eBayItemSpecificValue_{0}\" style=\"margin-left:-100px;width:118px; background-color:#FFEEEE;\" onchange=\"optionSelect(this.name,this.value);\">", suffix));
                str.Append("<option value=\" \">Enter Your Own</option>");

                //generate value
                foreach (ValueRecommendationType vrt in nrt.ValueRecommendation)
                {
                    str.Append(string.Format("<option value=\"{0}\">", vrt.Value));
                    str.Append(vrt.Value);
                    str.Append("</option>");
                }

                str.Append("</select>");
                str.Append("</span>");
                str.Append(string.Format("<a href=\"javascript:void(0);\" onclick=\"remove(this.id);return false;\" id=\"Remove_{0}\" class=\"navigation\">", suffix));
                str.Append("remove");
                str.Append("</a>");
                str.Append("</div>");
                str.Append(string.Format("<input type=\"hidden\" id=\"{2}{0}\" name=\"{2}{0}\" value=\"{1}\"></input>", suffix, nrt.Name, EBAY_CUSTOM_ITEM_SPECIFICS_NAME_CACHE));
                str.Append("</div>");
                str.Append("</span>");

                suffix++;
            }
        }
Ejemplo n.º 7
0
        private void SyncNameRecommendationTypes()
        {
            GetCategorySpecificsCall api = new GetCategorySpecificsCall(this.apiContext);
            DetailLevelCodeType[] detailLevels = new DetailLevelCodeType[] { DetailLevelCodeType.ReturnAll };
            api.DetailLevelList = new DetailLevelCodeTypeCollection(detailLevels);
            eBay.Service.Core.Soap.StringCollection strCol = new eBay.Service.Core.Soap.StringCollection();
            strCol.Add(this.CategoryID);
            api.CategoryIDList = strCol;
            api.Execute();

            NameRecommendationTypeCollection nameRecommendationTypes = null;
            if ((api.ApiResponse.Ack == AckCodeType.Success || api.ApiResponse.Ack == AckCodeType.Warning)
                    && api.ApiResponse.Recommendations != null
                    && api.ApiResponse.Recommendations.Count > 0)
            {
                nameRecommendationTypes = api.ApiResponse.Recommendations[0].NameRecommendation;
            }

            this.nameRecommendationTypes = nameRecommendationTypes;
        }
Ejemplo n.º 8
0
        private void GetItemSpecificsHtml(ref System.Text.StringBuilder str, NameRecommendationTypeCollection col)
        {
            str.Append("<tr><td>");
            //CustomItemSpecificGroup div
            str.Append("<span>");
            str.Append("<div id=\"CustomItemSpecificGroup\">");

            GeteBayRecommendedItemSpecificsHtml(ref str, col);

            str.Append("</div>");
            str.Append("</span>");
            //NewCustomItemSpecific div
            str.Append("<span>");
            str.Append("<div id=\"NewCustomItemSpecific\">");
            str.Append("</div>");
            str.Append("</span>");
            //SuggestedSectionLyr div
            str.Append("<span>");
            str.Append("<div id=\"tray\" style=\"visibility: visible;\">");
            str.Append("<div id=\"Addmore\">");
            str.Append("<b>Add more Specifics</b>");
            str.Append("</div>");
            str.Append("<div id=\"msg\" style=\"display: none; visibility: hidden;\"> If you want to add another item specific, please remove one of the existing specifics and add a new one. </div>");
            str.Append("<div id=\"SuggestedSectionLyr\" style=\"padding-top: 10px; visibility: visible;\">");
            str.Append("</div>");
            str.Append("</div>");
            str.Append("</span>");
            //AddCustomLnk tip
            str.Append("<span>");
            str.Append("<div>");
            str.Append("<span id=\"AddCustomLnk\" onclick=\"addNewSpecific();\">");
            str.Append("<a href=\"javascript:void(0);\">");
            str.Append("<img src=\"http://pics.qa.ebaystatic.com/aw/pics/buttons/btnOptionAdd.gif\" hspace=\"1\" border=\"0\" align=\"absmiddle\" />");
            str.Append("</a>");
            str.Append("<a href=\"javascript:void(0);\"><b>Add a custom detail</b></a>");
            str.Append("</span>");
            str.Append("</div>");
            str.Append("</span>");
            str.Append("</td></tr>");
        }
Ejemplo n.º 9
0
        private void GeteBayRecommendedItemSpecificsHtml(ref System.Text.StringBuilder str, NameRecommendationTypeCollection col)
        {
            if (col == null) return;
            int suffix = 0;

            foreach (NameRecommendationType nrt in col)
            {
                str.Append(string.Format("<span id=\"SpecificLayer_{0}\" style=\"margin-top: 8px\">", suffix));
                str.Append("<div>");
                str.Append(string.Format("<div id=\"TagName_{0}\" style=\"margin-top: 10px\">", suffix));
                str.Append("<b>"); str.Append(nrt.Name); str.Append("</b>");
                str.Append("</div>");
                str.Append("<div>");
                str.Append(string.Format("<input type=\"text\" id=\"eBayItemSpecificName_{0}\" name=\"eBayItemSpecificName_{0}\" style=\"width:100px;height:21px;font-size:10pt;\">", suffix));
                str.Append("<span style=\"width:18px;border:0px solid red;\">");
                str.Append(string.Format("<select id=\"eBayItemSpecificValue_{0}\" name=\"eBayItemSpecificValue_{0}\" style=\"margin-left:-100px;width:118px; background-color:#FFEEEE;\" onchange=\"optionSelect(this.name,this.value);\">", suffix));
                str.Append("<option value=\" \">Enter Your Own</option>");

                //generate value
                foreach (ValueRecommendationType vrt in nrt.ValueRecommendation)
                {
                    str.Append(string.Format("<option value=\"{0}\">", vrt.Value));
                    str.Append(vrt.Value);
                    str.Append("</option>");
                }

                str.Append("</select>");
                str.Append("</span>");
                str.Append(string.Format("<a href=\"javascript:void(0);\" onclick=\"remove(this.id);return false;\" id=\"Remove_{0}\" class=\"navigation\">", suffix));
                str.Append("remove");
                str.Append("</a>");
                str.Append("</div>");
                str.Append(string.Format("<input type=\"hidden\" id=\"{2}{0}\" name=\"{2}{0}\" value=\"{1}\"></input>", suffix, nrt.Name, EBAY_CUSTOM_ITEM_SPECIFICS_NAME_CACHE));
                str.Append("</div>");
                str.Append("</span>");

                suffix++;
            }
        }