Example #1
0
 public void HandleEvent(EntityDeletingEventData <Tag> eventData)
 {
     if (AsyncHelper.RunSync(() => _memberTagRepository.CountAsync(t => t.TagId == eventData.Entity.Id)) > 0)
     {
         throw new AbpProjectNameBusinessException(ErrorCode.DeleteTagFailAsMemberTagInUse);
     }
 }
Example #2
0
 /// <summary>
 /// 删除前
 /// </summary>
 /// <param name="eventData"></param>
 public void HandleEvent(EntityDeletingEventData <SysSetting> eventData)
 {
     //删除数据,此处改变数据 持久化数据
     EntityEventProcessDataList.Add(new EntityEventProcessData {
         DataDate = DateTime.Now, DataContent = "删除前"
     });
 }
        public async Task HandleEventAsync(EntityDeletingEventData <User> eventData)
        {
            await _defaultQueryRepository.HardDeleteAsync(
                e => e.UserId == eventData.Entity.Id);

            await _acHistoryRepository.DeleteAsync(
                e => e.UserId == eventData.Entity.Id);
        }
Example #4
0
        public void HandleEvent(EntityDeletingEventData <Part> eventData)
        {
            var entity          = eventData.Entity;
            var materialRequire = MaterialRequireManager.GetAll().Where(o => o.RequireSource == "BOM" && o.RequireSourceId == entity.Id && o.ProjectId == entity.ProjectId).FirstOrDefault();

            if (materialRequire != null)
            {
                var isdo = "";
                isdo += materialRequire.IsBuyed?"已采购,":"";
                isdo += materialRequire.IsReceived ? "已入库,":"";
                isdo += materialRequire.IsUsed ? "已领用,":"";
                // isdo += materialRequire.IsQuoted ? "已询价,":"";
                if (string.IsNullOrEmpty(isdo))
                {
                    throw new UserFriendlyException("该BOM基础物资已进入流程,无法删除:" + isdo);
                }
            }
        }
Example #5
0
 public async Task HandleEventAsync(EntityDeletingEventData <Asset> eventData)
 {
     await Task.CompletedTask;
 }