NuSurvey.Web.Controllers.SurveyResponseController.Details C# (CSharp) Method

Details() private method

private Details ( int id, bool fromYourDetails = false ) : System.Web.Mvc.ActionResult
id int
fromYourDetails bool
return System.Web.Mvc.ActionResult
        public ActionResult Details(int id, bool fromYourDetails = false)
        {
            var surveyResponse = _surveyResponseRepository.GetNullableById(id);

            if (surveyResponse == null)
            {
                Message = "Survey Response Details Not Found.";
                return this.RedirectToAction<ErrorController>(a => a.Index());
                //return RedirectToAction("Index");
            }
            if (!CurrentUser.IsInRole(RoleNames.Admin) && surveyResponse.UserId.ToLower() != CurrentUser.Identity.Name.ToLower())
            {
                return this.RedirectToAction<ErrorController>(a => a.NotAuthorized());
            }

            var viewModel = SurveyReponseDetailViewModel.Create(Repository, surveyResponse);
            viewModel.FromYourDetails = fromYourDetails;

            return View(viewModel);
        }