protected ModelReviewedListModel PrepareModelReviewedListModel(PagedList <FileVersion> models, int projectId) { ModelReviewedListModel model = new ModelReviewedListModel(); if (models.Count > 0) { var lastModelVersion = models.First().EngineeringFile.FileVersions.OrderByDescending(e => e.UpLoadeTime).First(); var roles = CurrentCustomer.GetCurrentRoles(0, lastModelVersion.EngineeringFile.Engineering); foreach (var node in models) { var query = new CommentService().GetCommentByRoleAndEngineeringFileId(roles.OrderBy(e => (int)e).FirstOrDefault(), node.Id); model.ModelReviewedList.Add(new ModelReviewedListModel.ModelReviewedModel() { UploadDescription = node.UploadDescription, ModelVersionId = node.Id, ModelVersionNo = node.VersionNo, UpdateTime = node.UpdateStateTime.ToString("yyyy-MM-dd HH:mm:ss"), CommnetCount = query.Count(), }); } } model.ProjectId = projectId; model.OrganizationType = CurrentCustomer.Organization.OrganizationType; return(model); }
public async Task <IActionResult> Comments([FromServices] CommentService commentService, int page = 1) { const int pageSize = 10; var comments = await commentService.GetCommentsAsync(pageSize, page); var list = new StaticPagedList <CommentDetailedItem>(comments, page, pageSize, commentService.Count()); return(View(list)); }