コード例 #1
0
        /// <summary>
        /// 返回指定实体已贴入的标签项
        /// </summary>
        /// <typeparam name="T">实体类型</typeparam>
        /// <param name="entity">贴入标签的实体,需要指定ID属性</param>
        /// <param name="tagGroupInfo">查询条件,需要指定ID或GroupCode或GroupName属性</param>
        /// <param name="displayLevel">标签类型</param>
        /// <returns>已贴入实体的标签项</returns>
        public List <SYSTag> GetTagApplyInfos <T>(T entity, SYSTagGroup tagGroupInfo, int?displayLevel) where T : Entity, new()
        {
            long targetID       = this.tagTargetBO[entity.Property.TableAttribute.TableName].ID.Value;
            long targetObjectID = ALConvert.ToLong0(entity.Property.GetValue(entity.Property.TableAttribute.PrimaryKey));
            long?tagGroupID     = tagGroupBO.GetIDByTagGroup(tagGroupInfo);

            return(this.FindBySpecification(tagApplyBO.GetTagsByTargetIDAndTargetObjectID(targetID, targetObjectID, null, tagGroupID, displayLevel)
                                            .ToList <SYSTag>()));
        }
コード例 #2
0
        /// <summary>
        /// 删除已贴入实体的标签
        /// </summary>
        /// <typeparam name="T">实体类型</typeparam>
        /// <param name="entity">要取消贴入标签的实体,需要指定ID属性</param>
        /// <param name="tagGroupInfo">查询条件,需要指定ID或GroupCode或GroupName属性</param>
        /// <returns></returns>
        public ITag UnApply <T>(T entity, SYSTagGroup tagGroupInfo) where T : Entity, new()
        {
            long?tagGroupID = tagGroupBO.GetIDByTagGroup(tagGroupInfo);

            tagApplyBO.DeleteByCompanyIDAndTagGroupID(
                tagTargetBO[entity.Property.TableAttribute.TableName].ID.Value,
                ALConvert.ToLong0(entity.Property.GetValue("ID")),
                tagGroupID.Value);
            return(this);
        }
コード例 #3
0
 public static SYSTagNodeDTO Parse(SYSTagGroup tagInfo)
 {
     return(new SYSTagNodeDTO
     {
         ID = tagInfo.ID,
         NodeType = EnumSYSTagNodeType.TagGroup,
         ParentID = null,
         ParentNodeType = EnumSYSTagNodeType.TagGroup,
         Name = tagInfo.GroupName,
         Code = tagInfo.GroupCode,
         //Value = tagInfo.GroupValue,
         //IsBuiltIn = tagInfo.IsBuiltIn,
         //DisplayLevel = null,
         Sequence = tagInfo.Sequence,
         Remark = tagInfo.Remark,
         DataSource = tagInfo
     });
 }
コード例 #4
0
 /// <summary>
 /// 保存指定的标签组
 /// </summary>
 /// <param name="tagGroupInfo"></param>
 public void Save(SYSTagGroup tagGroupInfo)
 {
     (tagGroupInfo.ID.HasValue ? (Func <SYSTagGroup, bool>)tagGroupBO.Modify : tagGroupBO.Add)(tagGroupInfo);
 }
コード例 #5
0
 /// <summary>
 /// 返回指定实体已贴入的标签项
 /// </summary>
 /// <typeparam name="T">实体类型</typeparam>
 /// <param name="entity">贴入标签的实体,需要指定ID属性</param>
 /// <param name="tagGroupInfo">查询条件,需要指定ID或GroupCode或GroupName属性</param>
 /// <param name="displayLevel">标签类型</param>
 /// <returns>已贴入实体的标签项</returns>
 public List <SYSTag> GetTagApplyInfos <T>(T entity, SYSTagGroup tagGroupInfo, EnumSYSTagDisplayLevel?displayLevel) where T : Entity, new()
 {
     return(GetTagApplyInfos(entity, tagGroupInfo, (int?)displayLevel));
 }