コード例 #1
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <JsonResponse> Remove(EntityRequest input)
        {
            input.InitModifyRequest();
            var resJson = await _applicationEnginee.TryTransactionAsync(async() =>
            {
                await _employeeMenuAppService.RemoveAsync(input);
            });

            return(resJson);
        }
コード例 #2
0
        /// <summary>
        /// 删除菜单
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task <JsonResponse> RemoveMenu(EntityRequest input)
        {
            var orgMenuIds = await _organizationMenuAppService.GetIdsByMenuIdsAsync(input.Ids);

            var roleMenuIds = await _roleMenuAppService.GetIdsByMenuIdsAsync(input.Ids);

            var empMenuIds = await _employeeMenuAppService.GetIdsByMenuIdsAsync(input.Ids);

            var resJson = await _applicationEnginee.TryTransactionAsync(async() =>
            {
                await _menuAppService.RemoveAsync(input);
                await _organizationMenuAppService.RemoveAsync(new EntityRequest()
                {
                    Ids            = orgMenuIds,
                    ModifyDate     = DateTime.Now,
                    ModifyUserId   = input.ModifyUserId,
                    ModifyUserName = input.ModifyUserName
                });
                await _roleMenuAppService.RemoveAsync(new EntityRequest()
                {
                    Ids            = roleMenuIds,
                    ModifyDate     = DateTime.Now,
                    ModifyUserId   = input.ModifyUserId,
                    ModifyUserName = input.ModifyUserName
                });
                await _employeeMenuAppService.RemoveAsync(new EntityRequest()
                {
                    Ids            = empMenuIds,
                    ModifyDate     = DateTime.Now,
                    ModifyUserId   = input.ModifyUserId,
                    ModifyUserName = input.ModifyUserName
                });
            });

            return(resJson);
        }