コード例 #1
0
        private async Task LoadUsersAndRoles()
        {
            try
            {
                var userList = await _userEndpoint.GetAll();

                Users = new BindingList <UserModel>(userList);
                var roles = await _userEndpoint.GetAllRoles();

                _allRoles = roles.Values.ToList();
            }
            catch (Exception ex)
            {
                dynamic settings = new ExpandoObject();
                settings.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                settings.ResizeMode            = ResizeMode.NoResize;
                settings.Title = "System Error";
                if (ex.Message.Equals("Unauthorized"))
                {
                    _status.UpdateMessage("Unauthorized Exception", "You do not have permission to interact with the sales form.");
                    await _window.ShowDialogAsync(_status, null, settings);
                }
                else
                {
                    _status.UpdateMessage("Fatal Exception", ex.Message);
                    await _window.ShowDialogAsync(_status, null, settings);
                }
                await TryCloseAsync();
            }
        }
コード例 #2
0
        private async Task LoadUsers()
        {
            var usersList = await _userEndpoint.GetAll();

            //bind users to screen
            Users = new BindingList <UserModel>(usersList);
        }
コード例 #3
0
        private async Task LoadUsers()
        {
            var userList = await _userEndpoint.GetAll();

            Users = new BindingList <UserModel>(userList);
        }