private bool IsCodeTypeNotApplicable(bool isCodeTypeCompleted, WasteCodeData[] codesOfType)
 {
     return isCodeTypeCompleted
                && codesOfType != null
                && codesOfType.Any()
                && codesOfType.First().IsNotApplicable;
 }
Exemplo n.º 2
0
        public BaselOecdCodeViewModel Map(WasteCodeDataAndNotificationData source)
        {
            WasteCodeData selectedCode = null;

            if (source.NotificationWasteCodeData[CodeType.Basel].Length > 0)
            {
                selectedCode = source.NotificationWasteCodeData[CodeType.Basel].Single();
            }
            else if (source.NotificationWasteCodeData[CodeType.Oecd].Length > 0)
            {
                selectedCode = source.NotificationWasteCodeData[CodeType.Oecd].Single();
            }

            var model = new BaselOecdCodeViewModel
            {
                WasteCodes = mapper.Map(source.LookupWasteCodeData.Values.SelectMany(x => x))
            };

            if (selectedCode != null)
            {
                model.SelectedCode = selectedCode.Id;
            }

            if (source.NotApplicableCodes.Any(ct => ct == CodeType.Oecd || ct == CodeType.Basel))
            {
                model.NotListed = true;
            }

            return(model);
        }
Exemplo n.º 3
0
 private string GetWasteCode(WasteCodeData wasteCode)
 {
     return((wasteCode == null) ? null : wasteCode.Code);
 }