Beispiel #1
0
        private UserCreateEditViewModel GetCreateEditViewModel()
        {
            UserCreateEditViewModel viewModel = new UserCreateEditViewModel();

            viewModel.FillVendorsList(_vendorDataAccessor.Get());
            viewModel.FillRolesList(_roleDataAccessor.Get());

            return(viewModel);
        }
Beispiel #2
0
        private IActionResult CreateEditView(int userId)
        {
            User user = _userDataAccessor.Get(userId);

            UserCreateEditViewModel viewModel = new UserCreateEditViewModel
            {
                UserName = user.UserName,
                Roles    = user.UserRoles.Select(r => r.Role.Name).ToList(),
                VendorId = user.VendorId.GetValueOrDefault()
            };

            viewModel.FillVendorsList(_vendorDataAccessor.Get());
            viewModel.FillRolesList(_roleDataAccessor.Get());

            return(View("CreateEdit", viewModel));
        }