Пример #1
0
        private void FormatFieldValue(Field field, string value, ref FieldValue fieldDbValue)
        {
            switch (field.ExactType)
            {
            case FieldExactTypes.Numeric:
                fieldDbValue.Value = MultistepActionHelper.NumericCultureFormat(value, _importSettings.Culture, "en-US");
                break;

            case FieldExactTypes.Date:
                fieldDbValue.Value = MultistepActionHelper.DateCultureFormat(value, _importSettings.Culture, "en-US");
                break;

            case FieldExactTypes.Time:
                fieldDbValue.Value = MultistepActionHelper.DateCultureFormat(value, _importSettings.Culture, "en-US");
                break;

            case FieldExactTypes.DateTime:
                fieldDbValue.Value = MultistepActionHelper.DateCultureFormat(value, _importSettings.Culture, "en-US");
                break;

            case FieldExactTypes.O2MRelation:
                fieldDbValue.Value = MultistepActionHelper.O2MFormat(value);
                break;

            case FieldExactTypes.M2MRelation:
                fieldDbValue.NewRelatedItems = MultistepActionHelper.M2MFormat(value).ToArray();
                fieldDbValue.Value           = field.LinkId?.ToString();
                break;

            case FieldExactTypes.M2ORelation:
                break;

            default:
                fieldDbValue.Value = value;
                break;
            }
        }