Beispiel #1
0
        protected override void OnInit(System.EventArgs e)
        {
            base.OnInit(e);

            DataModel.DataModel.Initialize();

            string controlPath = GetCustomControlToLoad();

            if (!string.IsNullOrEmpty(controlPath))
            {
                StoreModuleBase module = (StoreModuleBase)LoadControl(controlPath);
                if (module != null)
                {
                    // load the control into the placeholder
                    module.ModuleConfiguration = ModuleConfiguration;
                    module.ID = System.IO.Path.GetFileNameWithoutExtension(controlPath);

                    plhUserControl.Controls.Add(module);

                    //--- Site Credit Check
                    //bool showSiteCredit = module.StoreContext.CurrentStore.GetSettingBool(StoreSettingNames.DisplaySiteCredit).GetValueOrDefault(true);
                    //if(showSiteCredit)
                    //{
                    //    string resxFile = string.Format("/DesktopModules/{0}/App_GlobalResources/Global.resx", ModuleConfiguration.FolderName);
                    //    string siteCreditHtml = DotNetNuke.Services.Localization.Localization.GetString("SiteCredit", resxFile);
                    //    plhUserControl.Controls.Add(new LiteralControl(siteCreditHtml));
                    //}
                }
            }
            else
            {
                throw new ModuleLoadException("Empty 'controlPath' variable, Unknown View Control for DNNspot Store");
            }
        }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            string controlPath = GetCustomControlToLoad();

            if (!string.IsNullOrEmpty(controlPath))
            {
                StoreModuleBase module = (StoreModuleBase)LoadControl(controlPath);
                if (module != null)
                {
                    // load the control into the placeholder
                    module.ModuleConfiguration = ModuleConfiguration;
                    module.ID = System.IO.Path.GetFileNameWithoutExtension(controlPath);

                    plhView.Controls.Add(module);
                }
            }
            else
            {
                throw new ModuleLoadException("Unknown View Control for DNNspot Store MyOrders");
            }
        }