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); }
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); }