Esempio n. 1
0
 private void InitListViewModel(RoleItemsViewModel viewModel, RoleItems list)
 {
     foreach (var item in viewModel.Items)
     {
         InitBaseItemViewModel(item);
     }
 }
Esempio n. 2
0
 public void SetRoleItems(IEnumerable <IdentityRole> roles)
 {
     foreach (var role in roles)
     {
         RoleItems.Add(new SelectListItem()
         {
             Value = role.Id.ToString(),
             Text  = role.Name
         });
     }
 }
Esempio n. 3
0
        public ActionResult List(RoleFilterViewModel filterViewModel)
        {
            InitRoleFilterViewModel(ref filterViewModel, true);
            var                filter    = Mapper.Map <RoleFilter>(filterViewModel);
            RoleItems          list      = _roleRepository.GetRoleItems(UserContext.User.Id, UserContext.User.OrganizationId, filter);
            RoleItemsViewModel viewModel = Mapper.Map <RoleItemsViewModel>(list);

            viewModel.Filter = filterViewModel;
            InitListViewModel(viewModel, list);

            return(View(Mvc.View.Role.List, viewModel));
        }
Esempio n. 4
0
        protected override async Task OnInitializedAsync()
        {
            await base.OnInitializedAsync();

            var result = await Http.GetFromJsonAsync <PagedResultDto <UserDto> >("/api/base/user");

            var roles = await GetRoleListAsync();

            Items = result.Items;
            foreach (var role in roles)
            {
                RoleItems.Add(new SelectedItem
                {
                    Text  = role.Name,
                    Value = role.Name
                });
            }
        }