public async Task <string> GETCURRENTUSER(string userId)
            {
                var objUser = await _coreRepository.GETUSERBYUSERID(userId);

                if (objUser != null)
                {
                    return(objUser.USER_ROLE);
                }
                else
                {
                    return(string.Empty);
                }
            }
示例#2
0
        public UserViewModel GetCurrentUser()
        {
            if (!string.IsNullOrEmpty(Thread.CurrentPrincipal.Identity.Name) && Thread.CurrentPrincipal.Identity.IsAuthenticated)
            {
                if (_userViewModel == null || string.IsNullOrEmpty(_userViewModel.USER_ID) || string.IsNullOrEmpty(_userViewModel.USER_ROLE))
                {
                    try
                    {
                        _userViewModel = Task.Run(async() => await _coreRepository.GETUSERBYUSERID(Thread.CurrentPrincipal.Identity.Name)).Result;
                    }
                    catch (System.Exception ex)
                    {
                        //Task.Run(async () => await ExceptionRefiner.LogError(ex));
                    }
                }
            }

            return(_userViewModel);
        }
示例#3
0
        public async Task <UserViewModel> GETUSERBYUSERID(string userId)
        {
            var coreRepo = await _coreRepository.GETUSERBYUSERID(userId);

            return(coreRepo);
        }