コード例 #1
0
        public ActionResult AuthorizeUser(User user)
        {
            int userId = empReview.CheckForValidUser(user);
            var ratingExistForEmployee = empReview.RatingExistsForEmployee(userId);

            if (userId == 0)
            {
                ViewBag.showSignOutButton = false;
                ViewBag.userNotFound      = "User not found";
                return(View("Index"));
            }
            else if (ratingExistForEmployee && userId > 0)
            {
                FormsAuthentication.SetAuthCookie(userId.ToString(), false);
                //return Redirect(FormsAuthentication.GetRedirectUrl(userId.ToString(), false));
                return(RedirectToAction("DisplayDeveloperAndTechnicalSkill", "EmployeeDeveloperTechnicalSkill", new { userId = userId }));
            }
            else
            {
                FormsAuthentication.SetAuthCookie(userId.ToString(), false);
                return(RedirectToAction("Index", "EmployeeDeveloperTechnicalSkill", new { hdnCount = 0, userId = userId }));
            }
        }