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

            if (CustomAttributes.Any())
            {
                dependentObjects.Add(typeof(CustomAttribute).Name);
            }

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

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

            if (FundingEvents.Any())
            {
                dependentObjects.Add(typeof(FundingEvent).Name);
            }

            if (MaintenanceRecords.Any())
            {
                dependentObjects.Add(typeof(MaintenanceRecord).Name);
            }

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

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

            if (TreatmentBMPAssessments.Any())
            {
                dependentObjects.Add(typeof(TreatmentBMPAssessment).Name);
            }

            if (TreatmentBMPBenchmarkAndThresholds.Any())
            {
                dependentObjects.Add(typeof(TreatmentBMPBenchmarkAndThreshold).Name);
            }

            if (TreatmentBMPDocuments.Any())
            {
                dependentObjects.Add(typeof(TreatmentBMPDocument).Name);
            }

            if (TreatmentBMPImages.Any())
            {
                dependentObjects.Add(typeof(TreatmentBMPImage).Name);
            }

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

            if (TreatmentBMPModelingAttributesWhereYouAreTheUpstreamTreatmentBMP.Any())
            {
                dependentObjects.Add(typeof(TreatmentBMPModelingAttribute).Name);
            }

            if (WaterQualityManagementPlanVerifyTreatmentBMPs.Any())
            {
                dependentObjects.Add(typeof(WaterQualityManagementPlanVerifyTreatmentBMP).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(CustomAttributes.Any() || (Delineation != null) || FieldVisits.Any() || FundingEvents.Any() || MaintenanceRecords.Any() || RegionalSubbasinRevisionRequests.Any() || TreatmentBMPsWhereYouAreTheUpstreamBMP.Any() || TreatmentBMPAssessments.Any() || TreatmentBMPBenchmarkAndThresholds.Any() || TreatmentBMPDocuments.Any() || TreatmentBMPImages.Any() || (TreatmentBMPModelingAttribute != null) || TreatmentBMPModelingAttributesWhereYouAreTheUpstreamTreatmentBMP.Any() || WaterQualityManagementPlanVerifyTreatmentBMPs.Any());
 }