Ejemplo n.º 1
0
        public async Task <IActionResult> Add()
        {
            ViewData["Title"] = "Add Application User";
            UserViewModel model = new UserViewModel();

            ViewData["roles"] = _repoRole.GetAll(new RoleQuery()).Result.data.Roles.Where(x => x.IsEnabled == true).Select(x => new SelectListItem()
            {
                Value = x.RoleID.ToString(), Text = x.RoleName
            }).ToList();
            return(await Task.FromResult(PartialView("_Add", model)));
        }
Ejemplo n.º 2
0
        public IActionResult OnGet(int id)
        {
            Account = _accountRepo.GetById(id);
            Profile = _profileRepo.GetByAccountId(id);
            if (Account == null || Profile == null)
            {
                return(NotFound());
            }

            UserRoles      = _roleRepo.GetAllFormAccountId(id);
            AvailableRoles = _roleRepo.GetAll()
                             .Except(UserRoles)
                             .Select(r => new SelectListItem(r.Name, r.Id.ToString()));

            Input = new InputModel {
                DateOfBirth   = Profile.Birthday,
                FirstName     = Profile.FirstName,
                LastName      = Profile.LastName,
                PerferredName = Profile.PreferredName,
                Phone         = Profile.Phone,
                Email         = Account.EMail,
                Status        = Account.Status
            };
            return(Page());
        }
Ejemplo n.º 3
0
        public async Task <MSSResult> GetAll()
        {
            MSSResult mRet = new MSSResult();

            try
            {
                mRet.data = await _RoleRepo.GetAll();

                mRet.code = (int)ErrType.OK;
                return(mRet);
            }
            catch (Exception ex)
            {
                mRet.code = (int)ErrType.SystemErr;
                mRet.msg  = ex.Message;
                return(mRet);
            }
        }
Ejemplo n.º 4
0
        public async Task <ActionResult <IEnumerable <RoleDo> > > GetAllQuestionnaire()
        {
            var result = await _roleRepo.GetAll();

            return(new OkObjectResult(result));
        }
Ejemplo n.º 5
0
 public void OnGet()
 {
     Roles = _roleRepo.GetAll();
 }
Ejemplo n.º 6
0
 public List <RoleDTO> GetAll()
 {
     return(roleRepo.GetAll().Select(a => mapper.Map <RoleDTO>(a)).ToList());
 }