private async Task OnDeleteUser(object obj) { DisplayError(string.Empty); if (!(obj is Models.User user)) { return; } var result = await _userManager.Delete(user); if (!result.IsSuccess) { DisplayError(l10n.Shared.Errors.InternalAppError); return; } UserList.Remove(user); }
private async void buttonDelete_Click(object sender, EventArgs e) { var withFiles = checkWithFiles.Checked; if (withFiles && DialogResult.Cancel == MessageBox.Show("Deleting all uploaded files...", "Warning", MessageBoxButtons.OKCancel)) { checkWithFiles.Checked = false; return; } var userInfo = getUserInfo(); await invoke($"Delete {userInfo.UserName}", async() => { await _users.Delete(userInfo, withFiles); }); checkWithFiles.Checked = false; }
public async Task RunMajorUseCasesWithDummyUser() { var config = new FConfig() { TcpPort = 0 }; var dummyUsers = new DummyUsers(); var fserver = new FServer(Logger.Null, config, dummyUsers); IUserManagement users = fserver; await users.Create(_goga); await users.Update(_goga); var all = await users.List(); Assert.That(all, Is.Not.Empty); var fclient = await FClient.New(config, new ClientInfo { ServerName = fserver.ServerName, Port = fserver.Port, UserName = "******", Password = "******" }); await fclient.Upload("f-config.goga.json", "f-config.json"); await fclient.Upload("NUnit3.TestAdapter.dll.goga", "NUnit3.TestAdapter.dll"); await fclient.Download("f-config.goga.json", "f-config.copy.json"); await fclient.Download("NUnit3.TestAdapter.dll.goga", "NUnit3.TestAdapter.dll.copy"); var list = await fclient.ListFiles(); Assert.That(list, Is.Not.Empty); await fclient.Delete("f-config.goga.json"); await users.Delete(_goga, false); }
public async Task <int> Handle(DeleteUserCommand request, CancellationToken cancellationToken) { return(await _userService.Delete(request.Id, cancellationToken)); }