public ActionResult View(int?id) { int traineeId = id.HasValue ? id.Value : CurrentUser.Id.Value; var profile = _profileProvider.GetProfileByTraineeId(traineeId); double traineeRaiting = _profileProvider.GetTraineeRating(traineeId); var profileViewModel = _profileMapper.ToProfileViewModel(profile, traineeRaiting); return(View(profileViewModel)); }
public ActionResult View(int id) { var profile = _profileProvider.GetProfileByTraineeId(id); var issues = _jiraProvider.GetIssuesByTraineeId(id); var issuesViewModel = new List <IssueViewModel>(); if (issues.Any()) { foreach (var issue in issues) { issuesViewModel.Add(new IssueViewModel { Key = issue.Key, Summary = issue.Summary, Status = issue.Status, IconUrl = issue.IconUrl, IssueType = issue.IssueType, OriginalEstimate = issue.OriginalEstimate, TimeSpent = issue.TimeSpent, ColorName = issue.ColorName }); } } var profileViewModel = _profileMapper.ToProfileViewModel(profile, _profileProvider.GetTraineeRating(id)); profileViewModel.Issues = issuesViewModel; ViewBag.TotalEstimatedTime = issuesViewModel.Sum(s => s.OriginalEstimate); ViewBag.TotalLoggedTime = issuesViewModel.Sum(s => s.TimeSpent); return(View(profileViewModel)); }
public ActionResult View(int id) { var profile = _profileProvider.GetProfileByTraineeId(id); var profileReviewViewModel = _profileMapper.ToProfileReviewViewModel( profile, _profileProvider.GetTraineeRating(id), _profileProvider.IsTraineeHavingMentorReview(id), _profileProvider.IsTraineeHavingScrumReview(id), _profileProvider.IsTraineeHavingTeamReview(id)); if (!profileReviewViewModel.HasReviews) { return(new HttpNotFoundResult()); } if (profileReviewViewModel.IsTraineeHavingTeamReview) { var grades = _traineeReviewProvider.GetTeamGradesOnTrainee(id); var abilities = _traineeReviewProvider.GetAbilities(); profileReviewViewModel.RenderingReview = _traineeReviewMapper .ToLinkedTeamReviewViewModel(abilities, grades); } else if (profileReviewViewModel.IsTraineeHavingMentorReview) { var review = _mentorReviewProvider.GetMentorReviewForTrainee(id); profileReviewViewModel.RenderingReview = _mentorReviewMapper .ToLinkedMentorReviewViewModel(review); } else if (profileReviewViewModel.IsTraineeHavingScrumReview) { var review = _scrumReviewProvider.GetReviewForTrainee(id); profileReviewViewModel.RenderingReview = _scrumMasterMapper.ReviewToLinkedViewModel(review); } return(View(profileReviewViewModel)); }