Esempio n. 1
0
        private Dictionary <string, string> GetEdtFieldValues(StandardMapping mappingUnderTest)
        {
            if (mappingUnderTest.IsEmailField())
            {
                return(GetEmailFieldValues(_idxDocumentIds, mappingUnderTest.EdtName));
            }

            if (mappingUnderTest.EdtType == "MultiValueList")
            {
                var allFieldValues = EdtDocumentRepository.GetMultiValueFieldValues(_idxDocumentIds, _idxToEdtConversionService.MappedEdtDatabaseColumn);

                var combinedValues = allFieldValues.GroupBy(x => x.DocNumber)
                                     .Select(group => new
                {
                    DocNumber = group.Key,
                    Values    = group.Select(x => x.FieldValue).OrderBy(x => x)
                });

                var dictionaryValues = combinedValues.ToDictionary(x => (string)x.DocNumber, x => string.Join(";", x.Values));
                return(dictionaryValues);
            }
            else
            {
                return((_idxToEdtConversionService.MappedEdtDatabaseColumnType == ColumnType.Date) ? EdtDocumentRepository.GetDocumentDateField(_idxDocumentIds, _idxToEdtConversionService.MappedEdtDatabaseColumn)
                                                                    :   EdtDocumentRepository.GetDocumentField(_idxDocumentIds, _idxToEdtConversionService.MappedEdtDatabaseColumn));
            }
        }
        public IdxToEdtConversionService(StandardMapping standardMapping)
        {
            _standardMapping = standardMapping;

            if (!_standardMapping.IsEmailField())
            {
                _edtColumnDetails = GetEdtColumnDetailsFromDisplayName(standardMapping.EdtName);
            }
        }
Esempio n. 3
0
        private string GetIdxFieldValue(Framework.Models.IdxLoadFile.Document idxDocument, StandardMapping mappingUnderTest)
        {
            if (mappingUnderTest.EdtType != "MultiValueList" && !mappingUnderTest.IsEmailField())
            {
                return(idxDocument.AllFields.FirstOrDefault(x => x.Key.Equals(mappingUnderTest.IdxName))?.Value);
            }

            var allFieldValues = idxDocument.AllFields.Where(x => x.Key.Equals(mappingUnderTest.IdxName))
                                 .Select(x => x.Value)
                                 .OrderBy(x => x);

            return(string.Join(";", allFieldValues));
        }