public override void FillField(BaseDataMap map, ref Item newItem, string importValue) { string checkBoxValue = "0"; if (!importValue.IsNullOrEmpty()) { importValue = importValue.Trim().ToLower(); } if (PositiveValuesList.Any() && NegativeValuesList.Any()) { if (PositiveValuesList.Select(x => x.Trim().ToLower()).Contains(importValue)) { checkBoxValue = "1"; } else if (NegativeValuesList.Select(x => x.Trim().ToLower()).Contains(importValue)) { checkBoxValue = "0"; } Field f = newItem.Fields[NewItemField]; //store the imported value as is Log("f", f.ToString()); if (f != null) { f.Value = checkBoxValue; } //Log("******************* end loop", "*********************"); //System.IO.File.WriteAllLines(FileLink,messages); } }
public override void FillField(IDataMap map, ref Item newItem, object importRow) { Field f = newItem.Fields[ToWhatField]; if (f == null) { return; } var importValue = string.Join(Delimiter, map.GetFieldValues(ExistingDataNames, importRow)); if (importValue.IsNullOrEmpty()) { f.Value = "0"; return; } bool b = PositiveValuesList.Contains(importValue); if (b || NegativeValuesList.Contains(importValue)) { f.Value = (b) ? "1" : "0"; } else { map.Logger.Log("Couldn't parse the boolean value", newItem.Paths.FullPath, LogType.FieldError, Name, importValue); } }