Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.DescriptionTextBox.Attributes.Add("onkeydown", "textCounter(this,500);");
            this.DescriptionTextBox.Attributes.Add("onkeyup", "textCounter(this,500);");

            if (!this.Page.IsPostBack)
            {
                this.lblNeedCategories.Text = "You must add a category before placing an ad. If you are a Marketplace Administrator</br> you can do that <a href=\"/marketplace/admin/Categories.aspx\">here.</a>";

                bool flag = CommerceCommon.HasMarketplaceCategories();
                this.phHasCategories.Visible = flag;
                this.phNoCategories.Visible  = !flag;
                foreach (ProductTypeItem item in CommerceCommon.GetProductTypeItemList())
                {
                    this.rblProductTypes.Items.Add(new ListItem(item.ProductTypeDescription, item.ProductTypeID.ToString()));
                }
                foreach (PurchaseTypeItem item2 in CommerceCommon.GetPurchaseTypeItemList())
                {
                    this.rblPurchaseTypes.Items.Add(new ListItem(item2.PurchaseTypeDescription, item2.PurchaseTypeID.ToString()));
                }
                this.rblPurchaseTypes.Items.FindByValue("1").Selected = true;
                if (CommerceCommon.IsSueetiePackageDistributor())
                {
                    this.rblProductTypes.Items.Add(new ListItem("Sueetie Package", "5"));
                }
                this.rblProductTypes.Items.FindByValue("1").Selected = true;
                this.PostAdWizard.MoveTo(this.PostAdWizard.WizardSteps[0]);
            }
            Button button = (Button)this.PostAdWizard.FindControl("StartNavigationTemplateContainerID$StartNextButton");

            button.Visible = false;
        }
Example #2
0
        protected void AdFormView_OnDataBound(object sender, EventArgs e)
        {
            var dataItem = (SueetieProduct)this.AdFormView.DataItem;

            // Status Type
            var statusTypes = this.AdFormView.FindControl("ddStatusTypes") as DropDownList;

            foreach (ProductStatusType type in Enum.GetValues(typeof(ProductStatusType)))
            {
                statusTypes.Items.Add(new ListItem(Enum.GetName(typeof(ProductStatusType), type), type.ToString("D")));
            }

            statusTypes.Items.FindByValue(dataItem.StatusTypeID.ToString()).Selected = true;

            // Product Types
            var productTypes = this.AdFormView.FindControl("rblProductTypes") as RadioButtonList;

            foreach (var item in CommerceCommon.GetProductTypeItemList())
            {
                productTypes.Items.Add(new ListItem(item.ProductTypeDescription, item.ProductTypeID.ToString()));
            }

            if (CommerceCommon.IsSueetiePackageDistributor())
            {
                productTypes.Items.Add(new ListItem("Sueetie Package", "5"));
            }

            productTypes.Items.FindByValue(dataItem.ProductTypeID.ToString()).Selected = true;

            // Purchase Types
            var purchaseTypes = this.AdFormView.FindControl("ddPurchaseTypes") as DropDownList;

            foreach (var item2 in CommerceCommon.GetPurchaseTypeItemList())
            {
                purchaseTypes.Items.Add(new ListItem(item2.PurchaseTypeDescription, item2.PurchaseTypeID.ToString()));
            }

            purchaseTypes.Items.FindByValue(dataItem.PurchaseTypeID.ToString()).Selected = true;
        }