public ActionResult Details(int id) { Frameworx framework = _frameworxProjectService.FrameworkDetail(id); var userId = _commonDbService.FindUserIdFromEmail(User.Identity.Name); FrameworxViewModel frameworxViewModel = new FrameworxViewModel() { Name = framework.Category.Name, Title = framework.Title, HtmlDescription = framework.HtmlDescription, SourceCodeLink = framework.SourceCodeLink, Likes = framework.Likes.Count, IsLiked = framework.Likes.Any(l => l.UserId == userId), OwnerId = framework.OwnerId, Credits = string.Join(",", framework.Credits.Select(c => c.Name).ToList()) }; frameworxViewModel.Credits = string.IsNullOrWhiteSpace(frameworxViewModel.Credits) ? string.Empty : frameworxViewModel.Credits + "."; if (frameworxViewModel.IsLiked) { frameworxViewModel.LikeId = framework.Likes.FirstOrDefault(l => l.UserId == userId).Id; } return(View(frameworxViewModel)); }
public ActionResult OpenFeedbackForm(FrameworxViewModel frameworxViewModel) { FrameworxFeedbackViewModel frameworxFeedbackViewModel = new FrameworxFeedbackViewModel(); frameworxFeedbackViewModel.UserEmail = User.Identity.Name; frameworxFeedbackViewModel.UserName = _commonDbService.FindDisplayNameFromEmail(frameworxFeedbackViewModel.UserEmail); frameworxFeedbackViewModel.FrameworxId = frameworxViewModel.id; frameworxFeedbackViewModel.FeedBackFor = string.IsNullOrWhiteSpace(frameworxViewModel.Title) ? Constants.InformationNotAvailableText : frameworxViewModel.Title; return(PartialView("_FeedbackForm", frameworxFeedbackViewModel)); }