public bool Create(Domain.SystemForm entity) { if (entity.FormType == (int)FormType.Main) { _formService.Init(entity); var attrIds = _formService.AttributeMetaDatas.Select(x => x.AttributeId).ToArray(); if (attrIds.NotEmpty()) { //依赖于字段 _dependencyService.Create(FormDefaults.ModuleName, entity.SystemFormId, AttributeDefaults.ModuleName, attrIds); } if (entity.IsCustomButton && entity.CustomButtons.IsNotEmpty()) { var buttonIds = new Guid[] { }.DeserializeFromJson(entity.CustomButtons); if (buttonIds.NotEmpty()) { //依赖于按钮 _dependencyService.Create(FormDefaults.ModuleName, entity.SystemFormId, RibbonButtonDefaults.ModuleName, buttonIds); } } //依赖于视图(单据体) var queryViewIds = entity.GetQueryViewIds(); if (queryViewIds.NotEmpty()) { _dependencyService.Create(FormDefaults.ModuleName, entity.SystemFormId, QueryViewDefaults.ModuleName, queryViewIds.ToArray()); } } return(true); }
public bool Create(Chart entity) { bool result = true; var chart = _chartBuilder.Build(_queryViewFinder.FindEntityDefaultView(entity.EntityId), entity); //依赖于字段 _dependencyService.Create(ChartDefaults.ModuleName, entity.ChartId, AttributeDefaults.ModuleName, chart.Attributes.Select(x => x.AttributeId).ToArray()); return(result); }
public bool Create(Domain.QueryView entity) { //依赖于字段 var queryExp = new QueryExpression().DeserializeFromJson(entity.FetchConfig); var requiredAttributes = _queryMetadataFinder.GetAttributes(queryExp); _dependencyService.Create(QueryViewDefaults.ModuleName, entity.QueryViewId, AttributeDefaults.ModuleName, requiredAttributes.Select(x => x.AttributeId).ToArray()); //依赖于按钮 if (entity.IsCustomButton && entity.CustomButtons.IsNotEmpty()) { var buttonIds = new Guid[] { }.DeserializeFromJson(entity.CustomButtons); if (buttonIds.NotEmpty()) { _dependencyService.Create(QueryViewDefaults.ModuleName, entity.QueryViewId, RibbonButtonDefaults.ModuleName, buttonIds); } } return(true); }
public bool Create(FilterRule entity) { bool result = true; var attributes = GetRequireds(entity); if (attributes.NotEmpty()) { result = _dependencyService.Create(FilterRuleDefaults.ModuleName, entity.FilterRuleId, AttributeDefaults.ModuleName, attributes.Select(s => s.AttributeId).ToArray()); } return(result); }
public bool Create(ProcessStage entity) { var result = true; using (UnitOfWork.Build(_processStageRepository.DbContext)) { result = _processStageRepository.Create(entity); //依赖于实体 _dependencyService.Create(WorkFlowDefaults.ModuleName, entity.WorkFlowId, EntityDefaults.ModuleName, entity.EntityId); //依赖于字段 var st = new List <ProcessStep>().DeserializeFromJson(entity.Steps); if (st.NotEmpty()) { var attrNames = st.Select(x => x.AttributeName).ToArray(); var attributes = _attributeFinder.FindByName(entity.EntityId, attrNames); var attrIds = attributes.Select(x => x.AttributeId).ToArray(); _dependencyService.Create(WorkFlowDefaults.ModuleName, entity.WorkFlowId, AttributeDefaults.ModuleName, attrIds); } } return(result); }
public bool Create(WorkFlowStep entity) { var result = true; using (UnitOfWork.Build(_workFlowStepRepository.DbContext)) { result = _workFlowStepRepository.Create(entity); //依赖于表单 if (!entity.FormId.Equals(Guid.Empty)) { _dependencyService.Create(WorkFlowDefaults.ModuleName, entity.WorkFlowId, FormDefaults.ModuleName, entity.FormId); } } return(result); }
public bool Create(Domain.Report entity) { entity.OrganizationId = _appContext.OrganizationId; var result = true; using (UnitOfWork.Build(_reportRepository.DbContext)) { result = _reportRepository.Create(entity); //solution component _solutionComponentService.Create(entity.SolutionId, entity.ReportId, ReportDefaults.ModuleName); //依赖于实体 _dependencyService.Create(ReportDefaults.ModuleName, entity.ReportId, EntityDefaults.ModuleName, entity.EntityId, entity.RelatedEntityId); //本地化标签 _localizedLabelService.Create(entity.SolutionId, entity.Name.IfEmpty(""), ReportDefaults.ModuleName, "LocalizedName", entity.ReportId, this._appContext.BaseLanguage); _localizedLabelService.Create(entity.SolutionId, entity.Description.IfEmpty(""), ReportDefaults.ModuleName, "Description", entity.ReportId, this._appContext.BaseLanguage); } return(result); }
public bool Create(EntityPlugin entity) { entity.SolutionId = SolutionDefaults.DefaultSolutionId;//组件属于默认解决方案 entity.CreatedBy = _appContext.GetFeature <ICurrentUser>().SystemUserId; entity.OrganizationId = _appContext.OrganizationId; var result = true; using (UnitOfWork.Build(_entityPluginRepository.DbContext)) { result = _entityPluginRepository.Create(entity); //solution component _solutionComponentService.Create(entity.SolutionId, entity.EntityPluginId, PluginDefaults.ModuleName); //依赖于实体 _dependencyService.Create(PluginDefaults.ModuleName, entity.EntityPluginId, EntityDefaults.ModuleName, entity.EntityId); //add to cache _cacheService.SetEntity(entity); } return(result); }
public bool Create(DuplicateRule entity) { //依赖于字段 return(_dependencyService.Create(DuplicateRuleDefaults.ModuleName, entity.DuplicateRuleId, AttributeDefaults.ModuleName, entity.Conditions.Select(x => x.AttributeId).ToArray())); }
public bool Create(Domain.WorkFlow entity) { //依赖于字段 return(_dependencyService.Create(WorkFlowDefaults.ModuleName, entity.WorkFlowId, EntityDefaults.ModuleName, entity.EntityId)); }
public bool Create(Domain.EntityMap entity) { //依赖于实体 return(_dependencyService.Create(DataMappingDefaults.ModuleName, entity.EntityMapId, EntityDefaults.ModuleName, entity.TargetEntityId)); }
public bool Create(Domain.SerialNumberRule entity) { //依赖于字段 return(_dependencyService.Create(SerialNumberRuleDefaults.ModuleName, entity.SerialNumberRuleId, AttributeDefaults.ModuleName, entity.AttributeId)); }