Пример #1
0
        /// <summary>
        /// Active Dependent type names of this object
        /// </summary>
        public List <string> DependentObjectNames()
        {
            var dependentObjects = new List <string>();

            if (ProjectFundingSourceExpenditures.Any())
            {
                dependentObjects.Add(typeof(ProjectFundingSourceExpenditure).Name);
            }

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

            if (ProjectNoFundingSourceIdentifieds.Any())
            {
                dependentObjects.Add(typeof(ProjectNoFundingSourceIdentified).Name);
            }

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

            if (ProjectRelevantCostTypes.Any())
            {
                dependentObjects.Add(typeof(ProjectRelevantCostType).Name);
            }

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

            if (BudgetObjectCodesWhereYouAreTheOverrideCostType.Any())
            {
                dependentObjects.Add(typeof(BudgetObjectCode).Name);
            }

            if (BudgetObjectCodeGroups.Any())
            {
                dependentObjects.Add(typeof(BudgetObjectCodeGroup).Name);
            }

            if (ProjectFundingSourceBudgets.Any())
            {
                dependentObjects.Add(typeof(ProjectFundingSourceBudget).Name);
            }

            if (ProjectFundingSourceBudgetUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectFundingSourceBudgetUpdate).Name);
            }
            return(dependentObjects.Distinct().ToList());
        }
Пример #2
0
        /// <summary>
        /// Dependent type names of this entity
        /// </summary>
        public void DeleteChildren(DatabaseEntities dbContext)
        {
            foreach (var x in ProjectFundingSourceExpenditures.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectFundingSourceExpenditureUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectNoFundingSourceIdentifieds.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectNoFundingSourceIdentifiedUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectRelevantCostTypes.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectRelevantCostTypeUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in BudgetObjectCodesWhereYouAreTheOverrideCostType.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in BudgetObjectCodeGroups.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectFundingSourceBudgets.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectFundingSourceBudgetUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }
        }
Пример #3
0
        /// <summary>
        /// Dependent type names of this entity
        /// </summary>
        public void DeleteChildren(DatabaseEntities dbContext)
        {
            foreach (var x in PerformanceMeasureActualUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in PerformanceMeasureExpectedUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectAttachmentUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectClassificationUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectContactUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectCustomAttributeUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectExemptReportingYearUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectExternalLinkUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectFundingSourceExpenditureUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectGeospatialAreaTypeNoteUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectGeospatialAreaUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectImageUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectLocationStagingUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectLocationUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectNoFundingSourceIdentifiedUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectNoteUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectOrganizationUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectRelevantCostTypeUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectUpdateHistories.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in TechnicalAssistanceRequestUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }

            foreach (var x in ProjectFundingSourceBudgetUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }
        }
Пример #4
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());
        }
Пример #5
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());
 }
Пример #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(ProjectFundingSourceExpenditures.Any() || ProjectFundingSourceExpenditureUpdates.Any() || ProjectNoFundingSourceIdentifieds.Any() || ProjectNoFundingSourceIdentifiedUpdates.Any() || ProjectRelevantCostTypes.Any() || ProjectRelevantCostTypeUpdates.Any() || BudgetObjectCodesWhereYouAreTheOverrideCostType.Any() || BudgetObjectCodeGroups.Any() || ProjectFundingSourceBudgets.Any() || ProjectFundingSourceBudgetUpdates.Any());
 }