Exemple #1
0
 /// <summary>删除账号
 /// </summary>
 public void Handle(ICommandContext context, ChangeAccount command)
 {
     _lockService.ExecuteInLock(typeof(Account).Name, () =>
     {
         context.Get <Account>(command.AggregateRootId).Change(command.UseFlag);
         _accountService.DeleteAccountIndex(command.AggregateRootId);
     });
 }
Exemple #2
0
        public async Task <ActionResult> Delete(string accountId)
        {
            var command = new ChangeAccount(accountId, (int)UseFlag.Disabled);
            var result  = await ExecuteCommandAsync(command);

            if (!result.IsSuccess())
            {
                ModelState.AddModelError(string.Empty, result.GetErrorMessage());
                return(View("Index"));
            }
            return(RedirectToAction("Index"));
        }
Exemple #3
0
        public async Task <ActionResult> DeleteAccount(string code)
        {
            var account = _accountQueryService.FindByCode(code);

            if (account == null)
            {
                return(Json(new { Success = false, Message = "账号不存在" }));
            }
            var command = new ChangeAccount(account.AccountId, (int)UseFlag.Disabled);
            var result  = await ExecuteCommandAsync(command);

            if (!result.IsSuccess())
            {
                return(Json(new { Success = false, Message = result.GetErrorMessage() }));
            }
            return(Json(new { Success = true, Message = "删除成功" }));
        }
Exemple #4
0
        public async Task <ActionResult> DeleteWebApp(string webAppKey)
        {
            var webAppInfoDto = _webAppQueryService.FindByKey(webAppKey);

            if (webAppInfoDto == null)
            {
                return(Json(new { Success = false, Message = "该系统不存在" }));
            }
            var command = new ChangeAccount(webAppInfoDto.WebAppId, (int)UseFlag.Disabled);
            var result  = await ExecuteCommandAsync(command);

            if (!result.IsSuccess())
            {
                return(Json(new { Success = false, Message = result.GetErrorMessage() }));
            }
            return(Json(new { Success = true, Message = "删除成功" }));
        }
Exemple #5
0
 /// <summary>删除账号
 /// </summary>
 public void Handle(ICommandContext context, ChangeAccount command)
 {
     context.Get <Account>(command.AggregateRootId).Change(command.UseFlag);
 }