Example #1
0
        public ProjectUpdateBatch GetLatestApprovedUpdateBatch()
        {
            var projectUpdateBatches = ProjectUpdateBatches
                                       .Where(x => x.ProjectUpdateState == ProjectUpdateState.Approved).ToList();

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