public ActionResult Details(TrackModel trackModel ) { // если контекст успел обновиться, получаем новые треки trackModel.Tracks = documentService.GetTracksByQrDoc(trackModel.qrDoc); { return PartialView("Details", trackModel); } }
public TrackModel GetTracks(BaseQrDoc doc) { TrackModel tracks = new TrackModel(); tracks.qrDoc = doc; int docId = GetDocumentId(doc); bool isManager = new UserService().IsManager(doc.ActionUser.id); tracks.Tracks = Entities.Tracks.Where(tr => tr.docId == docId).OrderBy(doct => doct.statDate).Select(tra => new TrackExtend { Track = tra, AllowAction = (doc.ActionUser.id == tra.userId) || isManager }).ToList(); return tracks; }