Ejemplo n.º 1
0
        public async Task <IActionResult> SetCompanyId(int CompanyId)
        {
            if (!await _companyuser_repo.ChangeUserCompanyAsync(User.GetUserId(), CompanyId, User))
            {
                return(BadRequest());
            }
            var user = await _userManager.FindByIdAsync(User.GetUserId());

            if (user == null)
            {
                return(BadRequest());
            }
            await _signInManager.RefreshSignInAsync(user);

            return(new EmptyResult());//RedirectToAction("Index", "Home");
        }