示例#1
0
        protected void BindGrid()
        {
            var manufacturers = ManufacturerManager.GetAllManufacturers();

            gvManufacturers.DataSource = manufacturers;
            gvManufacturers.DataBind();
        }
示例#2
0
        private List <ProductManufacturerMappingHelperClass> GetProductManufacturerMappings(List <ProductManufacturer> ExistingProductManufacturerCollection)
        {
            var manufacturerCollection = ManufacturerManager.GetAllManufacturers();
            List <ProductManufacturerMappingHelperClass> result = new List <ProductManufacturerMappingHelperClass>();

            for (int i = 0; i < manufacturerCollection.Count; i++)
            {
                Manufacturer        manufacturer = manufacturerCollection[i];
                ProductManufacturer existingProductManufacturer = null;
                if (ExistingProductManufacturerCollection != null)
                {
                    existingProductManufacturer = ExistingProductManufacturerCollection.FindProductManufacturer(this.ProductId, manufacturer.ManufacturerId);
                }
                ProductManufacturerMappingHelperClass pmm = new ProductManufacturerMappingHelperClass();
                if (existingProductManufacturer != null)
                {
                    pmm.ProductManufacturerId = existingProductManufacturer.ProductManufacturerId;
                    pmm.IsMapped     = true;
                    pmm.IsFeatured   = existingProductManufacturer.IsFeaturedProduct;
                    pmm.DisplayOrder = existingProductManufacturer.DisplayOrder;
                }
                else
                {
                    pmm.DisplayOrder = 1;
                }
                pmm.ManufacturerId   = manufacturer.ManufacturerId;
                pmm.ManufacturerInfo = manufacturer.Name;

                MapState(manufacturer.ManufacturerId, pmm);

                result.Add(pmm);
            }

            return(result);
        }
示例#3
0
        protected void BindData()
        {
            try
            {
                StringBuilder sb = new StringBuilder();
                if (SettingManager.GetSettingValueBoolean("Sitemap.IncludeCategories", true))
                {
                    sb.Append("<li>");
                    sb.AppendFormat("<span>{0}</span>", GetLocaleResourceString("Sitemap.Categories"));
                    sb.Append("<ul>");
                    WriteCategories(sb, CategoryManager.GetAllCategories(0));
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }
                if (SettingManager.GetSettingValueBoolean("Sitemap.IncludeManufacturers", true))
                {
                    sb.Append("<li>");
                    sb.AppendFormat("<span>{0}</span>", GetLocaleResourceString("Sitemap.Manufacturers"));
                    sb.Append("<ul>");
                    WriteManufacturers(sb, ManufacturerManager.GetAllManufacturers());
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }
                if (SettingManager.GetSettingValueBoolean("Sitemap.IncludeProducts", true))
                {
                    sb.Append("<li>");
                    sb.AppendFormat("<span>{0}</span>", GetLocaleResourceString("Sitemap.Products"));
                    sb.Append("<ul>");
                    WriteProducts(sb, ProductManager.GetAllProducts());
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }
                if (SettingManager.GetSettingValueBoolean("Sitemap.IncludeTopics", true))
                {
                    sb.Append("<li>");
                    sb.AppendFormat("<span>{0}</span>", GetLocaleResourceString("Sitemap.Topics"));
                    sb.Append("<ul>");
                    WriteTopics(sb, TopicManager.GetAllTopics());
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }
                string otherPages = SettingManager.GetSettingValue("Sitemap.OtherPages");
                if (!String.IsNullOrEmpty(otherPages))
                {
                    sb.Append("<li>");
                    sb.AppendFormat("<span>{0}</span>", GetLocaleResourceString("Sitemap.OtherPages"));
                    sb.Append("<ul>");
                    WriteOtherPages(sb, otherPages.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));
                    sb.Append("</ul>");
                    sb.Append("</li>");
                }

                lSitemapContent.Text = sb.ToString();
            }
            catch (Exception ex)
            {
                lSitemapContent.Text = ex.Message;
                LogManager.InsertLog(LogTypeEnum.CommonError, ex.Message, ex);
            }
        }
示例#4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     SEOHelper.RenderTitle(this, GetLocaleResourceString("PageTitle.Manufactures"), true);
     if (!IsPostBack)
     {
         dlManufacturers.DataSource = ManufacturerManager.GetAllManufacturers();
         dlManufacturers.DataBind();
     }
 }
        private void WriteManufacturers()
        {
            ManufacturerCollection manufacturers = ManufacturerManager.GetAllManufacturers(false);

            foreach (Manufacturer manufacturer in manufacturers)
            {
                string          url             = SEOHelper.GetManufacturerURL(manufacturer);
                UpdateFrequency updateFrequency = UpdateFrequency.weekly;
                DateTime        updateTime      = manufacturer.UpdatedOn;
                WriteUrlLocation(url, updateFrequency, updateTime);
            }
        }
示例#6
0
        private void WriteManufacturers()
        {
            var manufacturers = ManufacturerManager.GetAllManufacturers(false);

            foreach (var manufacturer in manufacturers)
            {
                var url             = SEOHelper.GetManufacturerUrl(manufacturer);
                var updateFrequency = UpdateFrequency.Weekly;
                var updateTime      = manufacturer.UpdatedOn;
                WriteUrlLocation(url, updateFrequency, updateTime);
            }
        }
示例#7
0
        protected void BindData()
        {
            ManufacturerCollection manufacturers = ManufacturerManager.GetAllManufacturers();

            if (manufacturers.Count > 0)
            {
                rptrManufacturers.DataSource = manufacturers;
                rptrManufacturers.DataBind();
            }
            else
            {
                this.Visible = false;
            }
        }
示例#8
0
        protected void FillDropDowns()
        {
            ParentCategory.EmptyItemText = GetLocaleResourceString("Admin.Common.All");
            ParentCategory.BindData();

            this.ddlManufacturer.Items.Clear();
            ListItem itemEmptyManufacturer = new ListItem(GetLocaleResourceString("Admin.Common.All"), "0");

            this.ddlManufacturer.Items.Add(itemEmptyManufacturer);
            var manufacturers = ManufacturerManager.GetAllManufacturers();

            foreach (Manufacturer manufacturer in manufacturers)
            {
                ListItem item2 = new ListItem(manufacturer.Name, manufacturer.ManufacturerId.ToString());
                this.ddlManufacturer.Items.Add(item2);
            }
        }
示例#9
0
 protected void btnExportXML_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         try
         {
             var    manufacturers = ManufacturerManager.GetAllManufacturers();
             string xml           = ExportManager.ExportManufacturersToXml(manufacturers);
             string fileName      = string.Format("manufacturers_{0}.xml", DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss"));
             CommonHelper.WriteResponseXml(xml, fileName);
         }
         catch (Exception exc)
         {
             ProcessException(exc);
         }
     }
 }
示例#10
0
        protected void BindManufacturers()
        {
            var manufacturers = ManufacturerManager.GetAllManufacturers();

            if (manufacturers.Count > 0)
            {
                this.ddlManufacturers.Items.Clear();
                this.ddlManufacturers.Items.Add(new ListItem(GetLocaleResourceString("Search.AllManufacturers"), "0"));

                foreach (var manufacturer in manufacturers)
                {
                    ListItem item2 = new ListItem(manufacturer.LocalizedName, manufacturer.ManufacturerId.ToString());
                    this.ddlManufacturers.Items.Add(item2);
                }
            }
            else
            {
                this.trManufacturers.Visible = false;
            }
        }
示例#11
0
        protected void BindData()
        {
            //topics
            var sitemapTopics = new List <SitemapTopic>();
            var topics        = TopicManager.GetAllTopics();

            topics = topics.FindAll(t => t.IncludeInSitemap);
            foreach (var topic in topics)
            {
                LocalizedTopic localizedTopic = TopicManager.GetLocalizedTopic(topic.TopicId, NopContext.Current.WorkingLanguage.LanguageId);
                if (localizedTopic != null && !String.IsNullOrEmpty(localizedTopic.Title))
                {
                    string topicURL  = SEOHelper.GetTopicUrl(localizedTopic.TopicId, localizedTopic.Title);
                    string topicName = localizedTopic.Title;

                    sitemapTopics.Add(new SitemapTopic()
                    {
                        Name = topicName, Url = topicURL
                    });
                }
            }

            //other pages
            string otherPages = SettingManager.GetSettingValue("Sitemap.OtherPages");

            if (!String.IsNullOrEmpty(otherPages))
            {
                string[] pages = otherPages.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                foreach (string page in pages)
                {
                    sitemapTopics.Add(new SitemapTopic()
                    {
                        Name = page, Url = string.Format("{0}{1}", CommonHelper.GetStoreLocation(), page.Trim())
                    });
                }
            }
            if (sitemapTopics.Count > 0)
            {
                dlTopics.DataSource = sitemapTopics;
                dlTopics.DataBind();
            }
            else
            {
                dlTopics.Visible = false;
            }

            //categories
            if (SettingManager.GetSettingValueBoolean("Sitemap.IncludeCategories", true))
            {
                //root categories only here
                var categories = CategoryManager.GetAllCategoriesByParentCategoryId(0);
                if (categories.Count > 0)
                {
                    dlCategories.DataSource = categories;
                    dlCategories.DataBind();
                }
                else
                {
                    dlCategories.Visible = false;
                }
            }
            else
            {
                dlCategories.Visible = false;
            }

            //manufacturers
            if (SettingManager.GetSettingValueBoolean("Sitemap.IncludeManufacturers", true))
            {
                var manufacturers = ManufacturerManager.GetAllManufacturers();
                if (manufacturers.Count > 0)
                {
                    dlManufacturers.DataSource = ManufacturerManager.GetAllManufacturers();
                    dlManufacturers.DataBind();
                }
                else
                {
                    dlManufacturers.Visible = false;
                }
            }
            else
            {
                dlManufacturers.Visible = false;
            }

            //products
            if (SettingManager.GetSettingValueBoolean("Sitemap.IncludeProducts", true))
            {
                var products = ProductManager.GetAllProducts();
                if (products.Count > 0)
                {
                    dlProducts.DataSource = products;
                    dlProducts.DataBind();
                }
                else
                {
                    dlProducts.Visible = false;
                }
            }
            else
            {
                dlProducts.Visible = false;
            }
        }