private void BindData()
        {
            Product product = ProductManager.GetProductByID(this.ProductID);

            if (product != null)
            {
                this.txtName.Text             = product.Name;
                this.txtShortDescription.Text = product.ShortDescription;
                this.txtFullDescription.Value = product.FullDescription;
                this.txtAdminComment.Text     = product.AdminComment;
                CommonHelper.SelectListItem(this.ddlProductType, product.ProductTypeID);
                CommonHelper.SelectListItem(this.ddlTemplate, product.TemplateID);
                this.cbShowOnHomePage.Checked = product.ShowOnHomePage;

                this.cbAllowCustomerReviews.Checked = product.AllowCustomerReviews;
                this.cbAllowCustomerRatings.Checked = product.AllowCustomerRatings;
                this.cbPublished.Checked            = product.Published;

                ProductReviewCollection productReviews = product.ProductReviews;
                if (productReviews.Count > 0)
                {
                    hlViewReviews.Visible     = true;
                    hlViewReviews.Text        = string.Format(GetLocaleResourceString("Admin.ProductInfo.AllowCustomerReviewsView"), productReviews.Count);
                    hlViewReviews.NavigateUrl = CommonHelper.GetStoreAdminLocation() + "ProductReviews.aspx?ProductID=" + product.ProductID.ToString();
                }
                else
                {
                    hlViewReviews.Visible = false;
                }
            }
        }
Пример #2
0
        protected void BindData()
        {
            ProductReviewCollection productReviewCollection = null;

            if (this.ProductID > 0)
            {
                productReviewCollection = ProductManager.GetProductReviewByProductID(ProductID);
            }
            else
            {
                productReviewCollection = ProductManager.GetAllProductReviews();
            }
            lvProductReviews.DataSource = productReviewCollection;
            lvProductReviews.DataBind();
        }
        protected void BindData()
        {
            Product product = ProductManager.GetProductByID(ProductID);

            if (product != null && product.AllowCustomerReviews)
            {
                pnlReviews.Visible = true;
                ProductReviewCollection productReviews = product.ProductReviews;
                if (productReviews.Count > 0)
                {
                    rptrProductReviews.DataSource = productReviews;
                    rptrProductReviews.DataBind();
                }
            }
            else
            {
                this.Visible = false;
            }
        }
Пример #4
0
    bool ReviewExists()
    {
        string userName = Utility.GetUserName();

        //see if there is a review for this user and product
        ProductReviewCollection revs = ProductController.GetByProductAndAuthor(productID, userName);

        bool bOut = false;

        if (revs.Count > 0)
        {
            pnlReview.Visible   = false;
            pnlFinished.Visible = false;
            pnlReviewed.Visible = true;

            bOut = true;
        }
        return(bOut);
    }
Пример #5
0
        private void BindData()
        {
            Product product = ProductManager.GetProductById(this.ProductId, 0);

            if (this.HasLocalizableContent)
            {
                var languages = this.GetLocalizableLanguagesSupported();
                rptrLanguageTabs.DataSource = languages;
                rptrLanguageTabs.DataBind();
                rptrLanguageDivs.DataSource = languages;
                rptrLanguageDivs.DataBind();
            }

            if (product != null)
            {
                this.txtName.Text               = product.Name;
                this.txtShortDescription.Text   = product.ShortDescription;
                this.txtFullDescription.Content = product.FullDescription;
                this.txtAdminComment.Text       = product.AdminComment;
                CommonHelper.SelectListItem(this.ddlProductType, product.ProductTypeId);
                CommonHelper.SelectListItem(this.ddlTemplate, product.TemplateId);
                this.cbShowOnHomePage.Checked = product.ShowOnHomePage;

                this.cbAllowCustomerReviews.Checked = product.AllowCustomerReviews;
                this.cbAllowCustomerRatings.Checked = product.AllowCustomerRatings;
                this.cbPublished.Checked            = product.Published;

                ProductReviewCollection productReviews = product.ProductReviews;
                if (productReviews.Count > 0)
                {
                    hlViewReviews.Visible     = true;
                    hlViewReviews.Text        = string.Format(GetLocaleResourceString("Admin.ProductInfo.AllowCustomerReviewsView"), productReviews.Count);
                    hlViewReviews.NavigateUrl = CommonHelper.GetStoreAdminLocation() + "ProductReviews.aspx?ProductID=" + product.ProductId.ToString();
                }
                else
                {
                    hlViewReviews.Visible = false;
                }

                this.txtProductTags.Text = GenerateListOfProductTagss(ProductManager.GetAllProductTags(product.ProductId, string.Empty));
            }
        }
Пример #6
0
        private static ProductReviewCollection DBMapping(DBProductReviewCollection dbCollection)
        {
            if (dbCollection == null)
                return null;

            ProductReviewCollection collection = new ProductReviewCollection();
            foreach (DBProductReview dbItem in dbCollection)
            {
                ProductReview item = DBMapping(dbItem);
                collection.Add(item);
            }

            return collection;
        }