Ejemplo n.º 1
0
        private static PrimeDefinitionField Convert2ObjectPrimeDefinitionField(PrimeObjectDefintionField field)
        {
            var svcDefField = new PrimeDefinitionField();

            svcDefField.GeneralObjectDefinitionFiledType = field.GeneralObjectDefinitionFiledType;
            svcDefField.ObjectDefinitionFieldID          = field.GeneralObjectDefinitionFieldID;
            svcDefField.ObjectDefinitionFieldKey         = field.GeneralObjectDefinitionFieldKey;
            svcDefField.ObjectDefinitionFieldName        = field.GeneralObjectDefinitionFieldName;

            svcDefField.PrimeDataType = field.PrimeDataType;

            return(svcDefField);
        }
Ejemplo n.º 2
0
        private static PrimeObjectDefintionField ParsePrimeDefinitionField(PrimeDefinitionField f, PrimeObjectDefintionField field)
        {
            if (field == null)
            {
                field = new PrimeObjectDefintionField();
            }

            field.GeneralObjectDefinitionFieldKey  = f.ObjectDefinitionFieldKey;
            field.GeneralObjectDefinitionFieldName = f.ObjectDefinitionFieldName;
            field.GeneralObjectDefinitionFiledType = f.GeneralObjectDefinitionFiledType;
            field.PrimeDataType = f.PrimeDataType;

            return(field);
        }
Ejemplo n.º 3
0
        public static PrimeObjectField EntityPrimeField2ServicePrimeField(PrimeGeneralObjectField primeField)
        {
            PrimeObjectField pServiceField = new PrimeObjectField();

            pServiceField.ObjectFieldID = primeField.GeneralObjectFieldID;
            PrimeObjectDefintionField defineField = primeField.GeneralObjectDefinitionField as PrimeObjectDefintionField;

            //set the prime object data type.
            pServiceField.PrimeDataType = defineField.PrimeDataType;
            switch (defineField.PrimeDataType)
            {
            case PrimeFieldDataType.String:
                pServiceField.Value = primeField.StringValue;
                break;

            case PrimeFieldDataType.Binary:
                pServiceField.Value = primeField.BinaryValue;
                break;

            case PrimeFieldDataType.Integer:
                pServiceField.Value = primeField.IntegerValue;
                break;

            case PrimeFieldDataType.Long:
                pServiceField.Value = primeField.LongValue;
                break;

            case PrimeFieldDataType.Number:
                pServiceField.Value = primeField.NumberValue;
                break;

            case PrimeFieldDataType.Datetime:
                pServiceField.Value = primeField.DateTimeValue;
                break;

            default:
                throw new NotSupportedException("Can not convert type " + defineField.PrimeDataType.ToString());
            }

            return(pServiceField);
        }