Inheritance: System.Entity
Beispiel #1
0
        public void SetCodesNotApplicable(CodeType codeType)
        {
            var currentCodes = GetWasteCodes(codeType).ToArray();

            foreach (var code in currentCodes)
            {
                WasteCodeInfoCollection.Remove(code);
            }

            WasteCodeInfoCollection.Add(WasteCodeInfo.CreateNotApplicableCodeInfo(codeType));
        }
        public void SetBaselOecdCode(WasteCodeInfo wasteCodeInfo)
        {
            if (wasteCodeInfo.CodeType != CodeType.Basel && wasteCodeInfo.CodeType != CodeType.Oecd)
            {
                throw new InvalidOperationException(string.Format("This method can only set Basel or OECD codes for this notification {0}", Id));
            }

            var baselOecdCode = BaselOecdCode;
            if (baselOecdCode != null)
            {
                WasteCodeInfoCollection.Remove(baselOecdCode);
            }

            WasteCodeInfoCollection.Add(wasteCodeInfo);
        }
        private void SetCode(WasteCodeInfo code, CodeType codeType)
        {
            if (code.CodeType != codeType)
            {
                throw new InvalidOperationException(string.Format("This method can only set {0} code for this notification {1}", codeType, Id));
            }

            var existingCode = GetWasteCodes(codeType).SingleOrDefault();
            if (existingCode != null)
            {
                WasteCodeInfoCollection.Remove(existingCode);
            }

            WasteCodeInfoCollection.Add(code);
        }
Beispiel #4
0
        public void SetBaselOecdCode(WasteCodeInfo wasteCodeInfo)
        {
            if (wasteCodeInfo.CodeType != CodeType.Basel && wasteCodeInfo.CodeType != CodeType.Oecd)
            {
                throw new InvalidOperationException(string.Format("This method can only set Basel or OECD codes for this notification {0}", Id));
            }

            var baselOecdCode = BaselOecdCode;

            if (baselOecdCode != null)
            {
                WasteCodeInfoCollection.Remove(baselOecdCode);
            }

            WasteCodeInfoCollection.Add(wasteCodeInfo);
        }
Beispiel #5
0
        private void SetCode(WasteCodeInfo code, CodeType codeType)
        {
            if (code.CodeType != codeType)
            {
                throw new InvalidOperationException(string.Format("This method can only set {0} code for this notification {1}", codeType, Id));
            }

            var existingCode = GetWasteCodes(codeType).SingleOrDefault();

            if (existingCode != null)
            {
                WasteCodeInfoCollection.Remove(existingCode);
            }

            WasteCodeInfoCollection.Add(code);
        }
Beispiel #6
0
 public void SetOtherCode(WasteCodeInfo wasteCodeInfo)
 {
     SetCode(wasteCodeInfo, CodeType.OtherCode);
 }
Beispiel #7
0
 public void SetImportCode(WasteCodeInfo wasteCodeInfo)
 {
     SetCode(wasteCodeInfo, CodeType.ImportCode);
 }
Beispiel #8
0
 public void SetCustomsCode(WasteCodeInfo customsCode)
 {
     SetCode(customsCode, CodeType.CustomsCode);
 }
 public void SetOtherCode(WasteCodeInfo wasteCodeInfo)
 {
     SetCode(wasteCodeInfo, CodeType.OtherCode);
 }
 public void SetImportCode(WasteCodeInfo wasteCodeInfo)
 {
     SetCode(wasteCodeInfo, CodeType.ImportCode);
 }
 public void SetCustomsCode(WasteCodeInfo customsCode)
 {
     SetCode(customsCode, CodeType.CustomsCode);
 }