Beispiel #1
0
        protected override string RenderView()
        {
            var slug = Request.Params["slug"];

            var menuModel = new CategoryMenuViewModel
            {
                ShowCategoryCounts = Convert.ToBoolean(Settings["ShowCategoryCount"]),
                ShowProductCounts  = Convert.ToBoolean(Settings["ShowProductCount"]),
                Title              = Convert.ToString(Settings["Title"]),
                CategoryMenuMode   = Convert.ToString(Settings["CategoryMenuMode"]),
                ShowHomeLink       = Convert.ToBoolean(Settings["HomeLink"]),
                MaximumDepth       = Convert.ToInt32(Settings["MaximumDepth"]),
                ChildrenOfCategory = Convert.ToString(Settings["ChildrenOfCategory"])
            };

            foreach (
                var bvin in
                Convert.ToString(Settings["SelectedCategories"])
                .Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries))
            {
                if (!menuModel.SelectedCategories.Contains(bvin))
                {
                    menuModel.SelectedCategories.Add(bvin);
                }
            }
            return(MvcRenderingEngine.Render("CategoryMenu", "Index", new { model = menuModel, slug }));
        }
Beispiel #2
0
        protected override string RenderView()
        {
            var isConcreteItemModule = false;
            var slug = (string)Settings["Slug"];

            if (!string.IsNullOrEmpty(slug))
            {
                isConcreteItemModule = true;
            }

            if (string.IsNullOrEmpty(slug))
            {
                slug = Request.Params["slug"];
            }

            var productPageSizeSetting = Convert.ToString(Settings["ProductPageSize"]);
            var productPageSize        = 0;

            if (!int.TryParse(productPageSizeSetting, out productPageSize))
            {
                productPageSize = DefaultProductPageSize;
            }

            RegisterKOScripts();
            RegisterViewScript("Pager.js");
            RegisterViewScript("Category.js");
            return(MvcRenderingEngine.Render("Category", "Index", new
            {
                slug,
                isConcreteItemModule,
                productPageSize,
                preContentColumnId = Convert.ToString(Settings["DefaultPreContentColumnId"]),
                postContentColumnId = Convert.ToString(Settings["DefaultPostContentColumnId"])
            }));
        }
Beispiel #3
0
        protected override string RenderView()
        {
            var searchSettings = new SearchModuleSettings(ModuleId);

            return(MvcRenderingEngine.Render("Search", "Index",
                                             new { viewName = searchSettings.View, pageSize = searchSettings.PageSize }));
        }
        protected override string RenderView()
        {
            RegisterKOScripts();
            RegisterUnobtrusiveValidateScripts();
            RegisterViewScript("AffiliateRegistration.js");

            return(MvcRenderingEngine.Render("AffiliateRegistration", "Index"));
        }
Beispiel #5
0
        protected override string RenderView()
        {
            var action = "Index";

            if (!string.IsNullOrEmpty(Request.QueryString["action"]))
            {
                action = Request.QueryString["action"];
            }
            return(MvcRenderingEngine.Render("WishList", action, new { area = "Account" }));
        }
        protected override string RenderView()
        {
            var viewName = Convert.ToString(Settings["View"]);

            if (!string.IsNullOrEmpty(viewName))
            {
                return(MvcRenderingEngine.Render("Cart", "Index"));
            }
            return(MvcRenderingEngine.Render("Cart", "Index", "MiniCart", new { MiniCart = true }));
        }
Beispiel #7
0
        protected override string RenderView()
        {
            RegisterKOScripts();
            RegisterUnobtrusiveValidateScripts();
            RegisterScript("jquery.zclip.min.js");
            RegisterViewScript("Pager.js");
            RegisterViewScript("AffiliateDashboard.js");

            return(MvcRenderingEngine.Render("AffiliateDashboard", "Index"));
        }
        protected override string RenderView()
        {
            var moduleSettings = new ContentBlocksModuleSettings(ModuleId);

            if (!string.IsNullOrEmpty(moduleSettings.ContentBlockId))
            {
                return(MvcRenderingEngine.Render("ContentColumn", "Index", new { id = moduleSettings.ContentBlockId }));
            }

            return(string.Empty);
        }
Beispiel #9
0
        protected override string RenderView()
        {
            RegisterViewScript("EstimateShipping.js");

            var viewName = Convert.ToString(Settings["View"]);

            if (!string.IsNullOrEmpty(viewName))
            {
                return(MvcRenderingEngine.Render("Cart", "Index"));
            }
            return(null);
        }
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try
            {
                if (HccApp.CurrentStore == null)
                {
                    throw new StoreNotFoundException();
                }

                InitializeScriptManager();
                RegisterScriptVariables();

                MvcRenderingEngine = new MvcRenderingEngine(ModuleContext);

                // Register css
                RegisterStyleSheet(HccApp.ViewsVirtualPath + "/views.css");

                // Register scripts
                RegisterScript("hcc.core.js", 1);
                RegisterScript("hcc.views.js", 2);

                JavaScript.RequestRegistration(CommonJs.DnnPlugins);

                var panel = new Panel();

                using (MiniProfiler.Current.Step(ModuleConfiguration.DesktopModule.FriendlyName))
                {
                    var view = RenderView();

                    var literal = new LiteralControl(view);

                    panel.CssClass          = "hcMvcView";
                    literal.EnableViewState = false;

                    panel.Controls.Add(literal);
                }
                Controls.Add(panel);
            }
            catch (StoreNotFoundException)
            {
                var control = LoadControl("~/DesktopModules/Hotcakes/Core/Controls/StoreNotFound.ascx");

                Controls.Clear();
                Controls.Add(control);
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
Beispiel #11
0
        protected override string RenderView()
        {
            var action = "Index";

            if (!string.IsNullOrEmpty(Request.QueryString["action"]))
            {
                action = Request.QueryString["action"];
            }

            var viewName = (string)Settings["PayPalView"];

            return(MvcRenderingEngine.Render("PayPalExpressCheckout", action, viewName));
        }
Beispiel #12
0
        protected override string RenderView()
        {
            var action = "Index";

            if (!string.IsNullOrEmpty(Request.QueryString["action"]))
            {
                action = Request.QueryString["action"];
            }

            if (action == "edit")
            {
                RegisterViewScript("AddressBook.js");
                RegisterUnobtrusiveValidateScripts();
            }

            return(MvcRenderingEngine.Render("AddressBook", action, new { area = "Account" }));
        }
        protected override string RenderView()
        {
            var gridColumns = Convert.ToInt32(Settings["GridColumns"]);
            Dictionary <int, string> productBvins = null;

            try
            {
                var productSettingsString = Convert.ToString(Settings["ProductList"]);
                productBvins = JsonConvert.DeserializeObject <Dictionary <int, string> >(productSettingsString) ??
                               new Dictionary <int, string>();
            }
            catch
            {
                productBvins = new Dictionary <int, string>();
            }

            return(MvcRenderingEngine.Render("ProductGrid", "Index",
                                             new { productsList = productBvins, maxColumns = gridColumns }));
        }
Beispiel #14
0
        protected override string RenderView()
        {
            if (!string.IsNullOrEmpty(Request.QueryString["action"]))
            {
                _action = Request.QueryString["action"];
            }

            _action = _action.ToLower();
            if (_action == "index" || _action == "paymenterror")
            {
                RegisterViewScript("Checkout.js");
            }
            if (_action == "receipt")
            {
                RegisterViewScript("Receipt.js");
            }

            return(MvcRenderingEngine.Render("Checkout", _action));
        }
        protected override string RenderView()
        {
            var action = "Index";

            if (!string.IsNullOrEmpty(Request.QueryString["action"]))
            {
                action = Request.QueryString["action"];
            }

            var methodId      = CurrentOrder.CustomProperties["MethodId"].Value;
            var paymentMethod = PaymentMethods.Find(methodId);
            var controller    = paymentMethod.MethodName + "Checkout";

            if (paymentMethod.MethodId == PaymentMethods.PaypalExpressId)
            {
                return(MvcRenderingEngine.Render(controller, action, (string)Settings["PayPalView"]));
            }

            return(MvcRenderingEngine.Render(controller, action));
        }
        protected override string RenderView()
        {
            var slug = Request.Params["slug"];

            if (!string.IsNullOrEmpty(slug))
            {
                return(MvcRenderingEngine.Render("ProductReviews", "Index", new { slug }));
            }
            if (!TabPermissionController.CanManagePage())
            {
                if (PortalSettings.HomeTabId != Null.NullInteger)
                {
                    if (PortalSettings.HomeTabId != PortalSettings.ActiveTab.TabID)
                    {
                        Response.Redirect(Globals.NavigateURL(PortalSettings.HomeTabId));
                    }
                }
            }
            return(string.Empty);
        }
Beispiel #17
0
        protected override string RenderView()
        {
            var action = "Index";

            if (!string.IsNullOrEmpty(Request.QueryString["action"]))
            {
                action = Request.QueryString["action"];
            }

            if (action.ToLower() == "details")
            {
                RegisterKOScripts();
                RegisterUnobtrusiveValidateScripts();
                RegisterViewScript("EditBilling.js", 0);
                RegisterViewScript("AddressBook.js", 1);
            }

            RegisterViewScript("OrderHistory.js");

            return(MvcRenderingEngine.Render("OrderHistory", action, new { area = "Account" }));
        }
Beispiel #18
0
        protected override string RenderView()
        {
            // Remove plupload.js as it's not used (erwin)
            // ------------------------------------------
            //RegisterScript("plupload/plupload.full.js");
            //RegisterScript("plupload/FileUpload.js");
            RegisterUnobtrusiveValidateScripts();
            RegisterViewScript("Products.js");

            var isConcreteItemModule = false;
            var slug = (string)Settings["Slug"];

            if (!string.IsNullOrEmpty(slug))
            {
                isConcreteItemModule = true;
            }

            if (string.IsNullOrEmpty(slug))
            {
                slug = Request.Params["slug"];
            }

            if (!string.IsNullOrEmpty(slug))
            {
                return(MvcRenderingEngine.Render("Products", "Index", new { slug, isConcreteItemModule }));
            }
            if (!TabPermissionController.CanManagePage())
            {
                if (PortalSettings.HomeTabId != Null.NullInteger)
                {
                    if (PortalSettings.HomeTabId != PortalSettings.ActiveTab.TabID)
                    {
                        Response.Redirect(Globals.NavigateURL(PortalSettings.HomeTabId));
                    }
                }
            }
            return(string.Empty);
        }
Beispiel #19
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try
            {
                if (HccApp.CurrentStore == null)
                {
                    throw new StoreNotFoundException();
                }

                MvcRenderingEngine = new MvcRenderingEngine(null);

                var view = RenderView();

                var panel   = new Panel();
                var literal = new LiteralControl(view);

                panel.CssClass          = "hcMvcView hcSkinObject";
                literal.EnableViewState = false;

                panel.Controls.Add(literal);
                Controls.Add(panel);
            }
            catch (StoreNotFoundException)
            {
                var control = LoadControl("~/DesktopModules/Hotcakes/Core/Controls/StoreNotFound.ascx");

                Controls.Clear();
                Controls.Add(control);
            }
            catch (Exception ex)
            {
                Exceptions.ProcessModuleLoadException(this, ex);
            }
        }
 protected override string RenderView()
 {
     return(MvcRenderingEngine.Render("TopWeeklySellers", "Index", null));
 }
Beispiel #21
0
 protected override string RenderView()
 {
     return(MvcRenderingEngine.Render("Top10Products", "Index", null));
 }
Beispiel #22
0
 protected override string RenderView()
 {
     return(MvcRenderingEngine.Render("LastProductsViewed", "Index"));
 }
        protected override string RenderView()
        {
            var viewName = Convert.ToString(Settings["View"]);

            return(MvcRenderingEngine.Render("Search", "SearchInput", new { viewName }));
        }
Beispiel #24
0
 protected override string RenderView()
 {
     return(MvcRenderingEngine.Render("FeaturedProducts", "Index", new { area = "ContentBlocks" }));
 }
 protected override string RenderView()
 {
     return(MvcRenderingEngine.Render("Search", "SearchInput", ViewName));
 }