示例#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>
 /// 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());
 }