Esempio n. 1
0
 private void WrapLocalizedLabel(Domain.WebResource entity)
 {
     /*
      * var labels = _localizedLabelService.Query(n => n.Where(f => f.LanguageId == _appContext.CurrentUser.UserSettings.LanguageId && f.ObjectId == entity.WebResourceId));
      * entity.Name = _localizedLabelService.GetLabelText(labels, entity.WebResourceId, "LocalizedName", entity.Name);
      * entity.Description = _localizedLabelService.GetLabelText(labels, entity.WebResourceId, "Description", entity.Description);
      */
 }
Esempio n. 2
0
        public bool Update(Domain.WebResource entity)
        {
            var flag = _webResourceRepository.Update(entity);

            if (flag)
            {
                //localization
                _localizedLabelService.Update(entity.Name.IfEmpty(""), "LocalizedName", entity.WebResourceId, _appContext.BaseLanguage);
                _localizedLabelService.Update(entity.Description.IfEmpty(""), "Description", entity.WebResourceId, _appContext.BaseLanguage);
                _cacheService.SetEntity(entity);
            }
            return(flag);
        }
Esempio n. 3
0
        public bool Create(Domain.WebResource entity)
        {
            var solutionid = entity.SolutionId;                     //当前解决方案

            entity.SolutionId = SolutionDefaults.DefaultSolutionId; //组件属于默认解决方案
            var result = true;

            using (UnitOfWork.Build(_webResourceRepository.DbContext))
            {
                result = _webResourceRepository.Create(entity);
                //solution component
                _solutionComponentService.Create(solutionid, entity.WebResourceId, WebResourceDefaults.ModuleName);
                //本地化标签
                _localizedLabelService.Append(entity.SolutionId, entity.Name.IfEmpty(""), WebResourceDefaults.ModuleName, "LocalizedName", entity.WebResourceId)
                .Append(entity.SolutionId, entity.Description.IfEmpty(""), WebResourceDefaults.ModuleName, "Description", entity.WebResourceId)
                .Save();
                _cacheService.SetEntity(entity);
            }
            return(result);
        }
Esempio n. 4
0
 public static string BuildKey(Domain.WebResource entity)
 {
     return("");
 }