示例#1
0
        protected override void OnLoad(EventArgs e)
        {
            if (!IsPostBack)
            {
                LocalResourceInfo resource = Controller.GetLocalResource(PortalId, "PRODUCTLISTHEADER");
                if (resource == null)
                {
                    resource = new LocalResourceInfo()
                    {
                        LocalResourceToken = "PRODUCTLISTHEADER", PortalId = PortalId
                    };
                    ProductListHeaderId = Controller.NewLocalResource(resource);
                }
                else
                {
                    ProductListHeaderId = resource.LocalResourceId;
                }
                List <ILanguageEditorInfo> dbLangs = new List <ILanguageEditorInfo>();
                foreach (LocalResourceLangInfo lang in Controller.GetLocalResourceLangs(ProductListHeaderId))
                {
                    dbLangs.Add(lang);
                }
                lngHeaderText.Langs = dbLangs;

                resource = Controller.GetLocalResource(PortalId, "PRODUCTLISTFOOTER");
                if (resource == null)
                {
                    resource = new LocalResourceInfo()
                    {
                        LocalResourceToken = "PRODUCTLISTFOOTER", PortalId = PortalId
                    };
                    ProductListFooterId = Controller.NewLocalResource(resource);
                }
                else
                {
                    ProductListFooterId = resource.LocalResourceId;
                }
                dbLangs = new List <ILanguageEditorInfo>();
                foreach (LocalResourceLangInfo lang in Controller.GetLocalResourceLangs(ProductListFooterId))
                {
                    dbLangs.Add(lang);
                }
                lngFooterText.Langs = dbLangs;

                resource = Controller.GetLocalResource(PortalId, "PRODUCTLISTEMPTY");
                if (resource == null)
                {
                    resource = new LocalResourceInfo()
                    {
                        LocalResourceToken = "PRODUCTLISTEMPTY", PortalId = PortalId
                    };
                    ProductListEmptyId = Controller.NewLocalResource(resource);
                }
                else
                {
                    ProductListEmptyId = resource.LocalResourceId;
                }
                dbLangs = new List <ILanguageEditorInfo>();
                foreach (LocalResourceLangInfo lang in Controller.GetLocalResourceLangs(ProductListEmptyId))
                {
                    dbLangs.Add(lang);
                }
                lngEmptyList.Langs = dbLangs;
            }
            base.OnLoad(e);
            tplTemplate.CreateImageCallback = CreateThumbHtml;
        }