コード例 #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 (MaintenanceRecords.Any())
            {
                dependentObjects.Add(typeof(MaintenanceRecord).Name);
            }

            if (MaintenanceRecordObservations.Any())
            {
                dependentObjects.Add(typeof(MaintenanceRecordObservation).Name);
            }

            if (QuickBMPs.Any())
            {
                dependentObjects.Add(typeof(QuickBMP).Name);
            }

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

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

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

            if (TreatmentBMPObservations.Any())
            {
                dependentObjects.Add(typeof(TreatmentBMPObservation).Name);
            }

            if (TreatmentBMPTypeAssessmentObservationTypes.Any())
            {
                dependentObjects.Add(typeof(TreatmentBMPTypeAssessmentObservationType).Name);
            }

            if (TreatmentBMPTypeCustomAttributeTypes.Any())
            {
                dependentObjects.Add(typeof(TreatmentBMPTypeCustomAttributeType).Name);
            }
            return(dependentObjects.Distinct().ToList());
        }
コード例 #2
0
        /// <summary>
        /// Dependent type names of this entity
        /// </summary>
        public void DeleteChildren(DatabaseEntities dbContext)
        {
            foreach (var x in CustomAttributes.ToList())
            {
                x.DeleteFull(dbContext);
            }

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

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

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

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

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

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

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

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

            foreach (var x in TreatmentBMPTypeCustomAttributeTypes.ToList())
            {
                x.DeleteFull(dbContext);
            }
        }
        /// <summary>
        /// Dependent type names of this entity
        /// </summary>
        public void DeleteChildren(DatabaseEntities dbContext)
        {
            foreach (var x in TreatmentBMPBenchmarkAndThresholds.ToList())
            {
                x.DeleteFull(dbContext);
            }

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

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

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

            if (TreatmentBMPObservations.Any())
            {
                dependentObjects.Add(typeof(TreatmentBMPObservation).Name);
            }

            if (TreatmentBMPTypeAssessmentObservationTypes.Any())
            {
                dependentObjects.Add(typeof(TreatmentBMPTypeAssessmentObservationType).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(CustomAttributes.Any() || MaintenanceRecords.Any() || MaintenanceRecordObservations.Any() || QuickBMPs.Any() || TreatmentBMPs.Any() || TreatmentBMPAssessments.Any() || TreatmentBMPBenchmarkAndThresholds.Any() || TreatmentBMPObservations.Any() || TreatmentBMPTypeAssessmentObservationTypes.Any() || TreatmentBMPTypeCustomAttributeTypes.Any());
 }
コード例 #6
0
 public List <TreatmentBMPTypeAssessmentObservationType> GetObservationTypesForAssessment()
 {
     return(TreatmentBMPTypeAssessmentObservationTypes.SortByOrderThenName().ToList());
 }
コード例 #7
0
 public List <TreatmentBMPAssessmentObservationType> GetObservationTypes()
 {
     return(TreatmentBMPTypeAssessmentObservationTypes.SortByOrderThenName().Select(x => x.TreatmentBMPAssessmentObservationType).ToList());
 }
 /// <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(TreatmentBMPBenchmarkAndThresholds.Any() || TreatmentBMPObservations.Any() || TreatmentBMPTypeAssessmentObservationTypes.Any());
 }