Пример #1
0
        public ProjectUpdateBatch GetLatestApprovedUpdateBatch()
        {
            var projectUpdateBatches = ProjectUpdateBatches
                                       .Where(x => x.ProjectUpdateState == ProjectUpdateState.Approved).ToList();

            return(projectUpdateBatches.Any() ? projectUpdateBatches.MaxBy(x => x.LastUpdateDate) : null);
        }
Пример #2
0
 public bool HasSubmittedOrApprovedUpdateBatchChangingProjectToCompleted()
 {
     return(ProjectUpdateBatches
            .Where(x => x.ProjectUpdateState == ProjectUpdateState.Approved ||
                   x.ProjectUpdateState == ProjectUpdateState.Submitted)
            .Any(x => x.ProjectUpdate?.ProjectStage == ProjectStage.Completed));
 }