/// <summary>
 /// Dependent type names of this entity
 /// </summary>
 public void DeleteChildren(DatabaseEntities dbContext)
 {
     foreach (var x in GrantAllocations.ToList())
     {
         x.DeleteFull(dbContext);
     }
 }
Example #2
0
        /// <summary>
        /// Active Dependent type names of this object
        /// </summary>
        public List <string> DependentObjectNames()
        {
            var dependentObjects = new List <string>();

            if (GrantAllocations.Any())
            {
                dependentObjects.Add(typeof(GrantAllocation).Name);
            }

            if (GrantModificationFileResources.Any())
            {
                dependentObjects.Add(typeof(GrantModificationFileResource).Name);
            }

            if (GrantModificationGrantModificationPurposes.Any())
            {
                dependentObjects.Add(typeof(GrantModificationGrantModificationPurpose).Name);
            }

            if (GrantModificationNoteInternals.Any())
            {
                dependentObjects.Add(typeof(GrantModificationNoteInternal).Name);
            }
            return(dependentObjects.Distinct().ToList());
        }
        /// <summary>
        /// Active Dependent type names of this object
        /// </summary>
        public List <string> DependentObjectNames()
        {
            var dependentObjects = new List <string>();

            if (Agreements.Any())
            {
                dependentObjects.Add(typeof(Agreement).Name);
            }

            if (FocusAreas.Any())
            {
                dependentObjects.Add(typeof(FocusArea).Name);
            }

            if (GrantAllocations.Any())
            {
                dependentObjects.Add(typeof(GrantAllocation).Name);
            }

            if (PersonStewardRegions.Any())
            {
                dependentObjects.Add(typeof(PersonStewardRegion).Name);
            }

            if (ProjectRegions.Any())
            {
                dependentObjects.Add(typeof(ProjectRegion).Name);
            }

            if (ProjectRegionUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectRegionUpdate).Name);
            }
            return(dependentObjects.Distinct().ToList());
        }
        /// <summary>
        /// Dependent type names of this entity
        /// </summary>
        public void DeleteChildren(DatabaseEntities dbContext)
        {
            foreach (var x in Agreements.ToList())
            {
                x.DeleteFull(dbContext);
            }

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

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

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

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

            foreach (var x in ProjectRegionUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }
        }
        /// <summary>
        /// Active Dependent type names of this object
        /// </summary>
        public List <string> DependentObjectNames()
        {
            var dependentObjects = new List <string>();

            if (GrantAllocations.Any())
            {
                dependentObjects.Add(typeof(GrantAllocation).Name);
            }
            return(dependentObjects.Distinct().ToList());
        }
        /// <summary>
        /// Active Dependent type names of this object
        /// </summary>
        public List <string> DependentObjectNames()
        {
            var dependentObjects = new List <string>();

            if (Agreements.Any())
            {
                dependentObjects.Add(typeof(Agreement).Name);
            }

            if (GisUploadSourceOrganizationsWhereYouAreTheDefaultLeadImplementerOrganization.Any())
            {
                dependentObjects.Add(typeof(GisUploadSourceOrganization).Name);
            }

            if (Grants.Any())
            {
                dependentObjects.Add(typeof(Grant).Name);
            }

            if (GrantAllocations.Any())
            {
                dependentObjects.Add(typeof(GrantAllocation).Name);
            }

            if (OrganizationBoundaryStagings.Any())
            {
                dependentObjects.Add(typeof(OrganizationBoundaryStaging).Name);
            }

            if (People.Any())
            {
                dependentObjects.Add(typeof(Person).Name);
            }

            if (PersonStewardOrganizations.Any())
            {
                dependentObjects.Add(typeof(PersonStewardOrganization).Name);
            }

            if (Programs.Any())
            {
                dependentObjects.Add(typeof(Program).Name);
            }

            if (ProjectOrganizations.Any())
            {
                dependentObjects.Add(typeof(ProjectOrganization).Name);
            }

            if (ProjectOrganizationUpdates.Any())
            {
                dependentObjects.Add(typeof(ProjectOrganizationUpdate).Name);
            }
            return(dependentObjects.Distinct().ToList());
        }
        /// <summary>
        /// Dependent type names of this entity
        /// </summary>
        public void DeleteChildren(DatabaseEntities dbContext)
        {
            foreach (var x in Agreements.ToList())
            {
                x.DeleteFull(dbContext);
            }

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

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

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

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

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

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

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

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

            foreach (var x in ProjectOrganizationUpdates.ToList())
            {
                x.DeleteFull(dbContext);
            }
        }
        public void DeleteFullAndChildless(DatabaseEntities dbContext)
        {
            foreach (var x in GrantModificationFileResources.ToList())
            {
                x.DeleteFullAndChildless(dbContext);
            }

            foreach (var x in GrantAllocations.ToList())
            {
                x.DeleteFullAndChildless(dbContext);
            }

            DeleteChildren(dbContext);
            Delete(dbContext);
        }
Example #9
0
        /// <summary>
        /// Dependent type names of this entity
        /// </summary>
        public void DeleteChildren(DatabaseEntities dbContext)
        {
            foreach (var x in GrantAllocations.ToList())
            {
                x.DeleteFull(dbContext);
            }

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

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

            foreach (var x in GrantModificationNoteInternals.ToList())
            {
                x.DeleteFull(dbContext);
            }
        }
 /// <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(GrantAllocations.Any());
 }
 /// <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(Agreements.Any() || FocusAreas.Any() || GrantAllocations.Any() || PersonStewardRegions.Any() || ProjectRegions.Any() || ProjectRegionUpdates.Any());
 }
 /// <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(Agreements.Any() || GisUploadSourceOrganizationsWhereYouAreTheDefaultLeadImplementerOrganization.Any() || Grants.Any() || GrantAllocations.Any() || OrganizationBoundaryStagings.Any() || People.Any() || PersonStewardOrganizations.Any() || Programs.Any() || ProjectOrganizations.Any() || ProjectOrganizationUpdates.Any());
 }
Example #13
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(GrantAllocations.Any() || GrantModificationFileResources.Any() || GrantModificationGrantModificationPurposes.Any() || GrantModificationNoteInternals.Any());
 }