protected virtual EnterWasteCodesViewModel MapCodes(WasteCodeDataAndNotificationData source, CodeType codeType)
 {
     return new EnterWasteCodesViewModel
     {
         IsNotApplicable = source.NotApplicableCodes.Any(nac => nac == codeType),
         SelectedWasteCodes =
             source.NotificationWasteCodeData[codeType].Where(wc => wc.Id != Guid.Empty).Select(wc => wc.Id).ToList(),
         WasteCodes = mapper.Map(source.LookupWasteCodeData[codeType])
     };
 }
Exemple #2
0
 protected bool CodeBeenRemoved(BaseWasteCodeViewModel model, WasteCodeDataAndNotificationData existingData)
 {
     foreach (var code in existingData.NotificationWasteCodeData[this.codeType])
     {
         if (model.EnterWasteCodesViewModel.SelectedWasteCodes.Count(p => p == code.Id) == 0)
         {
             return(true);
         }
     }
     return(false);
 }