예제 #1
0
 public DiyGroupController(IPermissionService permissionService,
     IDiyService branchService, 
     ILanguageService languageService, 
     ILocalizationService localizationService, 
     IStoreMappingService storeMappingService, 
     ILocalizedEntityService localizedEntityService, 
     IStoreService storeService,
     IPictureService pictureService, 
     IUrlRecordService urlRecordService, 
     ICustomerActivityService customerActivityService, 
     IWorkContext workContext,
     ICacheManager cacheManager, 
     DiySettings diySettings, 
     IWebHelper webHelper)
 {
     _permissionService = permissionService;
     _diyService = branchService;
     _languageService = languageService;
     _localizationService = localizationService;
     _storeMappingService = storeMappingService;
     _localizedEntityService = localizedEntityService;
     _storeService = storeService;
     _pictureService = pictureService;
     _urlRecordService = urlRecordService;
     _customerActivityService = customerActivityService;
     _workContext = workContext;
     _cacheManager = cacheManager;
     _diySettings = diySettings;
     _webHelper = webHelper;
 }
예제 #2
0
        public static string GetFormattedBreadCrumb(this DiyGroup group,
            IDiyService diyService,
            string separator = ">>")
        {
            if (group == null)
                throw new ArgumentNullException("group");

            string result = string.Empty;

            //used to prevent circular references
            var alreadyProcessedDiyGroupIds = new List<int>() { };

            while (group != null &&  //not null
                !group.Deleted &&  //not deleted
                !alreadyProcessedDiyGroupIds.Contains(group.Id)) //prevent circular references
            {
                if (String.IsNullOrEmpty(result))
                {
                    result = group.Name;
                }
                else
                {
                    result = string.Format("{0} {1} {2}", group.Name, separator, result);
                }

                alreadyProcessedDiyGroupIds.Add(group.Id);

                group = diyService.GetDiyGroupById(group.ParentGroupId);

            }
            return result;
        }
예제 #3
0
        public static IList<DiyGroup> GetDiyGroupBreadCrumb(this DiyGroup diyGroup,
            IDiyService diyService,
            bool showHidden = false)
        {
            if (diyGroup == null)
                throw new ArgumentNullException("diyGroup");

            var result = new List<DiyGroup>();

            //used to prevent circular references
            var alreadyProcessedDiyGroupIds = new List<int>() { };

            while (diyGroup != null && //not null
                !diyGroup.Deleted && //not deleted
                !alreadyProcessedDiyGroupIds.Contains(diyGroup.Id)) //prevent circular references
            {
                result.Add(diyGroup);

                alreadyProcessedDiyGroupIds.Add(diyGroup.Id);

                diyGroup = diyService.GetDiyGroupById(diyGroup.ParentGroupId);
            }
            result.Reverse();
            return result;
        }
 public DiyProjectReadController(IDiyService diyService,
     IPictureService pictureService,
     DiySettings diySettings)
 {
     _diyService = diyService;
     _pictureService = pictureService;
     _diySettings = diySettings;
 }
예제 #5
0
 public DiyProjectController(IPermissionService permissionService,
     IDiyService diyService, 
     ILanguageService languageService, 
     ILocalizationService localizationService, 
     ILocalizedEntityService localizedEntityService, 
     IPictureService pictureService, 
     IUrlRecordService urlRecordService, 
     ICustomerActivityService customerActivityService, IDateTimeHelper dateTimeHelper)
 {
     _permissionService = permissionService;
     _diyService = diyService;
     _languageService = languageService;
     _localizationService = localizationService;
     _localizedEntityService = localizedEntityService;
     _pictureService = pictureService;
     _urlRecordService = urlRecordService;
     _customerActivityService = customerActivityService;
     _dateTimeHelper = dateTimeHelper;
 }