Inheritance: System.Entity
 private void ClearWasteAdditionalInformation()
 {
     if (WasteType != null && WasteType.WasteAdditionalInformation != null)
     {
         WasteType.ClearWasteAdditionalInformation();
     }
 }
 private void ClearWasteCompositions()
 {
     if (WasteType != null && WasteType.WasteCompositions != null)
     {
         WasteType.ClearWasteCompositions();
     }
 }
 public void SetWasteAdditionalInformation(IList <WasteAdditionalInformation> wasteType)
 {
     if (WasteType == null)
     {
         throw new InvalidOperationException(string.Format("Waste type does not exist on notification: {0}", Id));
     }
     ClearWasteAdditionalInformation();
     WasteType.SetWasteAdditionalInformation(wasteType);
 }
        public void SetWasteType(WasteType wasteType)
        {
            if (WasteType == null)
            {
                WasteType = wasteType;
                return;
            }

            if (WasteType.ChemicalCompositionType == wasteType.ChemicalCompositionType)
            {
                UpdateSameChemicalCompositionType(wasteType);
            }
            else 
            {
                ClearAllWasteData();
                WasteType = wasteType;
            }
        }
        public void SetWasteType(WasteType wasteType)
        {
            if (WasteType == null)
            {
                WasteType = wasteType;
                return;
            }

            if (WasteType.ChemicalCompositionType == wasteType.ChemicalCompositionType)
            {
                UpdateSameChemicalCompositionType(wasteType);
            }
            else
            {
                ClearAllWasteData();
                WasteType = wasteType;
            }
        }
        private void UpdateSameChemicalCompositionType(WasteType wasteType)
        {
            if (wasteType.ChemicalCompositionType == ChemicalComposition.Other)
            {
                WasteType.ChemicalCompositionName = wasteType.ChemicalCompositionName;
            }

            if (wasteType.ChemicalCompositionType == ChemicalComposition.RDF || wasteType.ChemicalCompositionType == ChemicalComposition.SRF)
            {
                ClearWasteAdditionalInformation();
                WasteType.SetWasteAdditionalInformation(wasteType.WasteAdditionalInformation.ToList());
            }

            if (wasteType.ChemicalCompositionType == ChemicalComposition.Wood)
            {
                ClearWasteAdditionalInformation();
                WasteType.SetWasteAdditionalInformation(wasteType.WasteAdditionalInformation.ToList());
                WasteType.WoodTypeDescription = wasteType.WoodTypeDescription;
            }
        }
        private void UpdateSameChemicalCompositionType(WasteType wasteType)
        {
            if (wasteType.ChemicalCompositionType == ChemicalComposition.Other)
            {
                WasteType.ChemicalCompositionName = wasteType.ChemicalCompositionName;
            }

            if (wasteType.ChemicalCompositionType == ChemicalComposition.RDF || wasteType.ChemicalCompositionType == ChemicalComposition.SRF)
            {
                ClearWasteAdditionalInformation();
                WasteType.SetWasteAdditionalInformation(wasteType.WasteAdditionalInformation.ToList());
            }

            if (wasteType.ChemicalCompositionType == ChemicalComposition.Wood)
            {
                ClearWasteAdditionalInformation();
                WasteType.SetWasteAdditionalInformation(wasteType.WasteAdditionalInformation.ToList());
                WasteType.WoodTypeDescription = wasteType.WoodTypeDescription;
            }
        }