예제 #1
0
        private async Task AddAsync()
        {
            try
            {
                if (!Users.Any(x => x.Checked))
                {
                    WarningMessage = "Please select at least one user.";
                    return;
                }

                await LdapService.AddUsersAsync(Users.Where(x => x.Checked).ToList(), CreateAccounts, CreateGroups);

                await ToastService.ShowToastAsync("Employee imported.", ToastType.Success);

                //await HubContext.Clients.AllExcept(ConnectionId).SendAsync(RefreshPage.Employees);
                await ModalDialogService.CloseAsync();
            }
            catch (Exception ex)
            {
                Logger.LogError(ex.Message);
                await ToastService.ShowToastAsync(ex.Message, ToastType.Error);

                await ModalDialogService.CancelAsync();
            }
        }