예제 #1
0
        public ActionResult Index()
        {
            try
            {
                var model = this.ResolveModel();
                string message;

                var parameters = new System.Collections.Generic.Dictionary<string, object>();

                if (!model.CanProcessRequest(parameters, out message))
                {
                    return this.PartialView("_Warning", message);
                }

                var viewModel = model.CreateViewModel();
                var detailTemplateName = this.detailTemplateNamePrefix + this.TemplateName;

                return this.View(detailTemplateName, viewModel);
            }
            catch (Exception ex)
            {
                if (UCommerceUIModule.TryHandleSystemError(ex, out ActionResult actionResult))
                {
                    return actionResult;
                }
                else
                {
                    throw;
                }
            }
        }
        public ActionResult StoreNavigation(Guid categoryPageId)
        {
            CategoryNavigationViewModel categoryNavigationViewModel = null;

            this.CategoryPageId = categoryPageId;
            try
            {
                var    model = this.ResolveModel();
                string message;

                var parameters = new System.Collections.Generic.Dictionary <string, object>();

                if (!model.CanProcessRequest(parameters, out message))
                {
                    return(this.PartialView("_Warning", message));
                }

                categoryNavigationViewModel = model.CreateViewModel();
                return(View(categoryNavigationViewModel));
            }
            catch (Exception ex)
            {
                if (UCommerceUIModule.TryHandleSystemError(ex, out ActionResult actionResult))
                {
                    return(actionResult);
                }
                else
                {
                    throw;
                }
            }
        }
예제 #3
0
        public ActionResult Index()
        {
            ProductListViewModel viewModel;

            try
            {
                var    productModel = this.ResolveModel();
                string message;
                var    parameters = new System.Collections.Generic.Dictionary <string, object>();

                if (!productModel.CanProcessRequest(parameters, out message))
                {
                    return(this.PartialView("_Warning", message));
                }

                viewModel = productModel.CreateListViewModel();
                var templateName = listTemplateNamePrefix + this.ListTemplateName;

                return(this.View(templateName, viewModel));
            }
            catch (Exception ex)
            {
                if (UCommerceUIModule.TryHandleSystemError(ex, out ActionResult actionResult))
                {
                    return(actionResult);
                }
                else
                {
                    throw;
                }
            }
        }
예제 #4
0
 private static void Bootstrapper_Initialized(object sender, ExecutedEventArgs e)
 {
     if (e.CommandName == "RegisterRoutes")
     {
         UCommerceUIModule.Register();
         UCommerceUIModule.InitializeContainer();
     }
 }
        private static void Bootstrapper_Bootstrapped(object sender, EventArgs e)
        {
            UCommerceUIModule.RegisterControllerFactory();

            EventHub.Raise(new WindsorContainerInitializedEvent
            {
                Container = UCommerceUIModule.Container
            });

            //Custom resources
            Res.RegisterResource <UcommerceResources>();

            ObjectFactory.Container.RegisterType <PageEditorRouteHandler, UCommerceMvcPageEditorRouteHandler>();
            ObjectFactory.Container.RegisterType <TemplateEditorRouteHandler, UCommerceMvcTemplateEditorRouteHandler>();
        }
예제 #6
0
        private static void Bootstrapper_Bootstrapped(object sender, EventArgs e)
        {
            UCommerceUIModule.RegisterControllerFactory();

            EventHub.Raise(new WindsorContainerInitializedEvent
            {
                Container = UCommerceUIModule.Container
            });

            BundleConfig.RegisterBundles(BundleTable.Bundles);
            BundleTable.VirtualPathProvider = HostingEnvironment.VirtualPathProvider;
            BundleTable.EnableOptimizations = true;

            ObjectFactory.Container.RegisterType <PageEditorRouteHandler, UCommerceMvcPageEditorRouteHandler>();
            ObjectFactory.Container.RegisterType <TemplateEditorRouteHandler, UCommerceMvcTemplateEditorRouteHandler>();
        }