public override IEnumerable <DynamicNode> GetDynamicNodeCollection(ISiteMapNode node) { IShopActionService actionService = DependencyResolver.Current.GetService <IShopActionService>(); var nodes = new List <DynamicNode>(); try { var actions = actionService.GetActions(); foreach (var action in actions) { DynamicNode dynamicNode = new DynamicNode(); // ключ должен быть уникальным для каждой ноды dynamicNode.Key = "action_" + action.HeartId; dynamicNode.RouteValues.Add("relativeUrl", action.RelativeUrl); dynamicNode.Route = typeof(Action).FullName; dynamicNode.Title = action.Title; dynamicNode.Protocol = "*"; dynamicNode.Attributes.Add("visibility", "MvcSiteMapProvider.Web.Mvc.XmlSiteMapResult"); nodes.Add(dynamicNode); } } catch (Exception e) { // если возникают косяки, не добавляем ничего в сайтмеп } return(nodes); }
public ShopController(ISessionValueProviderService sessionService, IShopService shopService, ISearchService searchService, IShopClientService clientService, IShopActionService shopActionService, IShopCategoryService shopCategoryService, IShopManufacturerService shopManufacturerService, IPrincipalResolver principalResolver, IHeartService heartService, IShopOrderService shopOrderService, IShopPickupPointService pickupPointService) { _sessionService = sessionService; _shopService = shopService; _searchService = searchService; _clientService = clientService; _shopActionService = shopActionService; _shopCategoryService = shopCategoryService; _shopManufacturerService = shopManufacturerService; _principalResolver = principalResolver; _heartService = heartService; _shopOrderService = shopOrderService; _pickupPointService = pickupPointService; var service = DependencyResolver.Current.GetService <IShopSettingsService>(); try { var settings = service.GetShopSettings(); _shopUrl = String.IsNullOrEmpty(settings.ShopUrl) ? "catalog" : settings.ShopUrl; } catch { _shopUrl = "catalog"; } }
public ShopCategoryService(ISettingsService settingsService, IShopActionService shopActionService, IHeartService heartService) { InitCache("ShopCategoryService"); _settingsService = settingsService; _shopActionService = shopActionService; _heartService = heartService; }
public ShopService(ILogService logService, IShopActionService shopActionService, IShopCategoryService shopCategoryService, IShopSpecService shopSpecService, IShopCompatiblesService shopCompatiblesService, IShopPackService shopPackService, IShopManufacturerService shopManufacturerService, IHeartService heartService, IShopGoodsReviewService goodsReviewService, ISearchService searchService) { _logService = logService; _shopActionService = shopActionService; _shopCategoryService = shopCategoryService; _shopSpecService = shopSpecService; _shopCompatiblesService = shopCompatiblesService; _shopPackService = shopPackService; _shopManufacturerService = shopManufacturerService; _heartService = heartService; _goodsReviewService = goodsReviewService; _searchService = searchService; InitCache("ShopService"); // Reindex(); // GenerateRelativeUrls(); }
internal static dynamic ForShopAction(int id) { UrlHelper helper = new UrlHelper(HttpContext.Current.Request.RequestContext); List <BreadCrumb> result = new List <BreadCrumb>(); result.Add(new BreadCrumb() { Title = "Акции", Url = helper.Action("GetPage", "Page", new { relativeUrl = "Акции" }), IsLast = false }); IShopActionService shopActionService = DependencyResolver.Current.GetService <IShopActionService>(); var action = shopActionService.GetAction(id); result.Add(new BreadCrumb() { Title = action.Name, Url = helper.Action("Action", "Shop", new { id = id }), IsLast = true }); return(result); }
public ActionApiController(IShopActionService shopActionService) { _shopActionService = shopActionService; }