예제 #1
0
 public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
 {
     if (ProjectExemptReportingYearUpdates != null && ProjectExemptReportingYearUpdates.Any(x => x.IsExempt) && string.IsNullOrWhiteSpace(Explanation))
     {
         yield return(new SitkaValidationResult <PerformanceMeasuresViewModel, string>(
                          FirmaValidationMessages.ExplanationNecessaryForProjectExemptYears, x => x.Explanation));
     }
 }
 public IEnumerable <ValidationResult> Validate(ValidationContext validationContext)
 {
     if (ProjectExemptReportingYearUpdates != null && ProjectExemptReportingYearUpdates.Any(x => x.IsExempt) && string.IsNullOrWhiteSpace(Explanation))
     {
         yield return(new SitkaValidationResult <ReportedPerformanceMeasuresViewModel, string>(
                          FirmaValidationMessages.ExplanationNecessaryForProjectExemptYears, x => x.Explanation));
     }
     if (!string.IsNullOrWhiteSpace(Explanation) && Explanation.Length > ProjectUpdateBatch.FieldLengths.PerformanceMeasureActualYearsExemptionExplanation)
     {
         yield return(new SitkaValidationResult <ReportedPerformanceMeasuresViewModel, string>(
                          FirmaValidationMessages.ExplanationForProjectExemptYearsExceedsMax(ProjectUpdateBatch.FieldLengths.PerformanceMeasureActualYearsExemptionExplanation), x => x.Explanation));
     }
 }
예제 #3
0
        /// <summary>
        /// Active Dependent type names of this object
        /// </summary>
        public List <string> DependentObjectNames()
        {
            var dependentObjects = new List <string>();

            if (PerformanceMeasureActualUpdates.Any())
            {
                dependentObjects.Add(typeof(PerformanceMeasureActualUpdate).Name);
            }

            if (PerformanceMeasureExpectedUpdates.Any())
            {
                dependentObjects.Add(typeof(PerformanceMeasureExpectedUpdate).Name);
            }

            if (ProjectAttachmentUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectAttachmentUpdate).Name);
            }

            if (ProjectClassificationUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectClassificationUpdate).Name);
            }

            if (ProjectContactUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectContactUpdate).Name);
            }

            if (ProjectCustomAttributeUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectCustomAttributeUpdate).Name);
            }

            if (ProjectExemptReportingYearUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectExemptReportingYearUpdate).Name);
            }

            if (ProjectExternalLinkUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectExternalLinkUpdate).Name);
            }

            if (ProjectFundingSourceExpenditureUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectFundingSourceExpenditureUpdate).Name);
            }

            if (ProjectGeospatialAreaTypeNoteUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectGeospatialAreaTypeNoteUpdate).Name);
            }

            if (ProjectGeospatialAreaUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectGeospatialAreaUpdate).Name);
            }

            if (ProjectImageUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectImageUpdate).Name);
            }

            if (ProjectLocationStagingUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectLocationStagingUpdate).Name);
            }

            if (ProjectLocationUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectLocationUpdate).Name);
            }

            if (ProjectNoFundingSourceIdentifiedUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectNoFundingSourceIdentifiedUpdate).Name);
            }

            if (ProjectNoteUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectNoteUpdate).Name);
            }

            if (ProjectOrganizationUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectOrganizationUpdate).Name);
            }

            if (ProjectRelevantCostTypeUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectRelevantCostTypeUpdate).Name);
            }

            if ((ProjectUpdate != null))
            {
                dependentObjects.Add(typeof(ProjectUpdate).Name);
            }

            if (ProjectUpdateHistories.Any())
            {
                dependentObjects.Add(typeof(ProjectUpdateHistory).Name);
            }

            if (TechnicalAssistanceRequestUpdates.Any())
            {
                dependentObjects.Add(typeof(TechnicalAssistanceRequestUpdate).Name);
            }

            if (ProjectFundingSourceBudgetUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectFundingSourceBudgetUpdate).Name);
            }
            return(dependentObjects.Distinct().ToList());
        }
예제 #4
0
 /// <summary>
 /// Does this object have any dependent objects? (If it does have dependent objects, these would need to be deleted before this object could be deleted.)
 /// </summary>
 /// <returns></returns>
 public bool HasDependentObjects()
 {
     return(PerformanceMeasureActualUpdates.Any() || PerformanceMeasureExpectedUpdates.Any() || ProjectAttachmentUpdates.Any() || ProjectClassificationUpdates.Any() || ProjectContactUpdates.Any() || ProjectCustomAttributeUpdates.Any() || ProjectExemptReportingYearUpdates.Any() || ProjectExternalLinkUpdates.Any() || ProjectFundingSourceExpenditureUpdates.Any() || ProjectGeospatialAreaTypeNoteUpdates.Any() || ProjectGeospatialAreaUpdates.Any() || ProjectImageUpdates.Any() || ProjectLocationStagingUpdates.Any() || ProjectLocationUpdates.Any() || ProjectNoFundingSourceIdentifiedUpdates.Any() || ProjectNoteUpdates.Any() || ProjectOrganizationUpdates.Any() || ProjectRelevantCostTypeUpdates.Any() || (ProjectUpdate != null) || ProjectUpdateHistories.Any() || TechnicalAssistanceRequestUpdates.Any() || ProjectFundingSourceBudgetUpdates.Any());
 }
예제 #5
0
        /// <summary>
        /// Active Dependent type names of this object
        /// </summary>
        public List <string> DependentObjectNames()
        {
            var dependentObjects = new List <string>();

            if (PerformanceMeasureActualUpdates.Any())
            {
                dependentObjects.Add(typeof(PerformanceMeasureActualUpdate).Name);
            }

            if (ProjectCustomAttributeUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectCustomAttributeUpdate).Name);
            }

            if (ProjectDocumentUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectDocumentUpdate).Name);
            }

            if (ProjectExemptReportingYearUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectExemptReportingYearUpdate).Name);
            }

            if (ProjectExternalLinkUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectExternalLinkUpdate).Name);
            }

            if (ProjectFundingSourceUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectFundingSourceUpdate).Name);
            }

            if (ProjectGrantAllocationExpenditureUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectGrantAllocationExpenditureUpdate).Name);
            }

            if (ProjectGrantAllocationRequestUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectGrantAllocationRequestUpdate).Name);
            }

            if (ProjectImageUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectImageUpdate).Name);
            }

            if (ProjectLocationStagingUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectLocationStagingUpdate).Name);
            }

            if (ProjectLocationUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectLocationUpdate).Name);
            }

            if (ProjectNoteUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectNoteUpdate).Name);
            }

            if (ProjectOrganizationUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectOrganizationUpdate).Name);
            }

            if (ProjectPersonUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectPersonUpdate).Name);
            }

            if (ProjectPriorityLandscapeUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectPriorityLandscapeUpdate).Name);
            }

            if (ProjectRegionUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectRegionUpdate).Name);
            }

            if ((ProjectUpdate != null))
            {
                dependentObjects.Add(typeof(ProjectUpdate).Name);
            }

            if (ProjectUpdateHistories.Any())
            {
                dependentObjects.Add(typeof(ProjectUpdateHistory).Name);
            }
            return(dependentObjects.Distinct().ToList());
        }
예제 #6
0
 /// <summary>
 /// Does this object have any dependent objects? (If it does have dependent objects, these would need to be deleted before this object could be deleted.)
 /// </summary>
 /// <returns></returns>
 public bool HasDependentObjects()
 {
     return(PerformanceMeasureActualUpdates.Any() || ProjectCustomAttributeUpdates.Any() || ProjectDocumentUpdates.Any() || ProjectExemptReportingYearUpdates.Any() || ProjectExternalLinkUpdates.Any() || ProjectFundingSourceUpdates.Any() || ProjectGrantAllocationExpenditureUpdates.Any() || ProjectGrantAllocationRequestUpdates.Any() || ProjectImageUpdates.Any() || ProjectLocationStagingUpdates.Any() || ProjectLocationUpdates.Any() || ProjectNoteUpdates.Any() || ProjectOrganizationUpdates.Any() || ProjectPersonUpdates.Any() || ProjectPriorityLandscapeUpdates.Any() || ProjectRegionUpdates.Any() || (ProjectUpdate != null) || ProjectUpdateHistories.Any());
 }