Пример #1
0
        /// <summary>
        /// 删除标签与内容项的关联
        /// </summary>
        /// <param name="itemInTagId">内容项与标签关联Id</param>
        public void DeleteTagFromItem(long itemInTagId)
        {
            ItemInTag itemInTag = itemInTagRepository.Get(itemInTagId);

            EventBus <ItemInTag> .Instance().OnBefore(itemInTag, new CommonEventArgs(EventOperationType.Instance().Delete()));

            itemInTagRepository.Delete(itemInTag);
            EventBus <ItemInTag> .Instance().OnAfter(itemInTag, new CommonEventArgs(EventOperationType.Instance().Delete()));
        }
Пример #2
0
 private void DeleteItemInTags(ItemInTag sender, CommonEventArgs eventArgs)
 {
     if (sender.TenantTypeId == TenantTypeIds.Instance().Group())
     {
         long groupId = sender.ItemId;
         if (groupSearcher == null)
         {
             groupSearcher = (GroupSearcher)SearcherFactory.GetSearcher(GroupSearcher.CODE);
         }
         groupSearcher.Update(groupService.Get(groupId));
     }
 }
Пример #3
0
 private void DeleteItemInTags(ItemInTag sender, CommonEventArgs eventArgs)
 {
     if (sender.TenantTypeId == TenantTypeIds.Instance().User())
     {
         long userId = sender.ItemId;
         if (userSearcher == null)
         {
             userSearcher = (UserSearcher)SearcherFactory.GetSearcher(UserSearcher.CODE);
         }
         userSearcher.Update(userService.GetFullUser(userId));
     }
 }
Пример #4
0
        /// <summary>
        /// 删除标签与内容项的关联
        /// </summary>
        /// <param name="itemInTagId">内容项与标签关联Id</param>
        public void DeleteTagFromItem(long itemInTagId)
        {
            ItemInTag itemInTag = itemInTagRepository.Get(itemInTagId);

            EventBus <ItemInTag> .Instance().OnBefore(itemInTag, new CommonEventArgs(EventOperationType.Instance().Delete()));

            TagInOwner tagInOwner = tagInOwnerReposiory.Get(itemInTag.TagInOwnerId);

            if (tagInOwner != null && tagInOwner.ItemCount <= 1)
            {
                tagInOwnerReposiory.Delete(tagInOwner);
            }
            itemInTagRepository.Delete(itemInTag);

            EventBus <ItemInTag> .Instance().OnAfter(itemInTag, new CommonEventArgs(EventOperationType.Instance().Delete()));
        }
Пример #5
0
 /// <summary>
 /// 新建实体时使用
 /// </summary>
 public static ItemInTag New()
 {
     ItemInTag tagInTag = new ItemInTag();
     return tagInTag;
 }
Пример #6
0
 private void DeleteItemInTags(ItemInTag sender, CommonEventArgs eventArgs)
 {
     if (sender.TenantTypeId == TenantTypeIds.Instance().ContentItem())
     {
         long barThreadId = sender.ItemId;
         if (cmsSearcher == null)
         {
             cmsSearcher = (CmsSearcher)SearcherFactory.GetSearcher(CmsSearcher.CODE);
         }
         cmsSearcher.Update(contentItemService.Get(barThreadId));
     }
 }
 private void DeleteItemInTags(ItemInTag sender, CommonEventArgs eventArgs)
 {
     if (sender.TenantTypeId == TenantTypeIds.Instance().BarThread())
     {
         long barThreadId = sender.ItemId;
         if (barSearcher == null)
         {
             barSearcher = (BarSearcher)SearcherFactory.GetSearcher(BarSearcher.CODE);
         }
         barSearcher.UpdateBarThread(barThreadService.Get(barThreadId));
     }
 }
Пример #8
0
        /// <summary>
        /// 新建实体时使用
        /// </summary>
        public static ItemInTag New()
        {
            ItemInTag tagInTag = new ItemInTag();

            return(tagInTag);
        }
 private void DeleteItemInTags(ItemInTag sender, CommonEventArgs eventArgs)
 {
     if (sender.TenantTypeId == TenantTypeIds.Instance().Journals())
     {
         long barThreadId = sender.ItemId;
         if (journalSearcher == null)
         {
             journalSearcher = (JournalSearcher)SearcherFactory.GetSearcher(JournalSearcher.CODE);
         }
         journalSearcher.Update(journalService.Get(barThreadId));
     }
 }