コード例 #1
0
ファイル: Person.Binding.cs プロジェクト: sitkatech/neptune
        /// <summary>
        /// Active Dependent type names of this object
        /// </summary>
        public List <string> DependentObjectNames()
        {
            var dependentObjects = new List <string>();

            if (AuditLogs.Any())
            {
                dependentObjects.Add(typeof(AuditLog).Name);
            }

            if (DelineationsWhereYouAreTheVerifiedByPerson.Any())
            {
                dependentObjects.Add(typeof(Delineation).Name);
            }

            if (DelineationStagingsWhereYouAreTheUploadedByPerson.Any())
            {
                dependentObjects.Add(typeof(DelineationStaging).Name);
            }

            if (FieldVisitsWhereYouAreThePerformedByPerson.Any())
            {
                dependentObjects.Add(typeof(FieldVisit).Name);
            }

            if (FileResourcesWhereYouAreTheCreatePerson.Any())
            {
                dependentObjects.Add(typeof(FileResource).Name);
            }

            if (LandUseBlockStagingsWhereYouAreTheUploadedByPerson.Any())
            {
                dependentObjects.Add(typeof(LandUseBlockStaging).Name);
            }

            if (Notifications.Any())
            {
                dependentObjects.Add(typeof(Notification).Name);
            }

            if (OnlandVisualTrashAssessmentsWhereYouAreTheCreatedByPerson.Any())
            {
                dependentObjects.Add(typeof(OnlandVisualTrashAssessment).Name);
            }

            if (OrganizationsWhereYouAreThePrimaryContactPerson.Any())
            {
                dependentObjects.Add(typeof(Organization).Name);
            }

            if (RegionalSubbasinRevisionRequestsWhereYouAreTheClosedByPerson.Any())
            {
                dependentObjects.Add(typeof(RegionalSubbasinRevisionRequest).Name);
            }

            if (RegionalSubbasinRevisionRequestsWhereYouAreTheRequestPerson.Any())
            {
                dependentObjects.Add(typeof(RegionalSubbasinRevisionRequest).Name);
            }

            if (StormwaterJurisdictionPeople.Any())
            {
                dependentObjects.Add(typeof(StormwaterJurisdictionPerson).Name);
            }

            if (SupportRequestLogsWhereYouAreTheRequestPerson.Any())
            {
                dependentObjects.Add(typeof(SupportRequestLog).Name);
            }

            if (TrashGeneratingUnitAdjustmentsWhereYouAreTheAdjustedByPerson.Any())
            {
                dependentObjects.Add(typeof(TrashGeneratingUnitAdjustment).Name);
            }

            if (TreatmentBMPsWhereYouAreTheInventoryVerifiedByPerson.Any())
            {
                dependentObjects.Add(typeof(TreatmentBMP).Name);
            }

            if (WaterQualityManagementPlanVerifiesWhereYouAreTheLastEditedByPerson.Any())
            {
                dependentObjects.Add(typeof(WaterQualityManagementPlanVerify).Name);
            }
            return(dependentObjects.Distinct().ToList());
        }
コード例 #2
0
ファイル: Person.Binding.cs プロジェクト: sitkatech/neptune
        /// <summary>
        /// Dependent type names of this entity
        /// </summary>
        public void DeleteChildren(DatabaseEntities dbContext)
        {
            foreach (var x in AuditLogs.ToList())
            {
                x.DeleteFull(dbContext);
            }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            foreach (var x in WaterQualityManagementPlanVerifiesWhereYouAreTheLastEditedByPerson.ToList())
            {
                x.DeleteFull(dbContext);
            }
        }
コード例 #3
0
ファイル: Person.Binding.cs プロジェクト: sitkatech/neptune
 /// <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(AuditLogs.Any() || DelineationsWhereYouAreTheVerifiedByPerson.Any() || DelineationStagingsWhereYouAreTheUploadedByPerson.Any() || FieldVisitsWhereYouAreThePerformedByPerson.Any() || FileResourcesWhereYouAreTheCreatePerson.Any() || LandUseBlockStagingsWhereYouAreTheUploadedByPerson.Any() || Notifications.Any() || OnlandVisualTrashAssessmentsWhereYouAreTheCreatedByPerson.Any() || OrganizationsWhereYouAreThePrimaryContactPerson.Any() || RegionalSubbasinRevisionRequestsWhereYouAreTheClosedByPerson.Any() || RegionalSubbasinRevisionRequestsWhereYouAreTheRequestPerson.Any() || StormwaterJurisdictionPeople.Any() || SupportRequestLogsWhereYouAreTheRequestPerson.Any() || TrashGeneratingUnitAdjustmentsWhereYouAreTheAdjustedByPerson.Any() || TreatmentBMPsWhereYouAreTheInventoryVerifiedByPerson.Any() || WaterQualityManagementPlanVerifiesWhereYouAreTheLastEditedByPerson.Any());
 }