Beispiel #1
0
        /// <summary>
        /// Get data type for this species factor field condition.
        /// </summary>
        /// <param name="searchCriteria">Species fact field search criteria.</param>
        /// <returns>Data type for this species factor field condition.</returns>
        private static WebDataType GetDataType(this WebSpeciesFactFieldSearchCriteria searchCriteria)
        {
            WebFactorFieldType type;

            if (searchCriteria.FactorField.IsEnumField && searchCriteria.IsEnumAsString)
            {
                return(WebDataType.String);
            }
            else
            {
                type    = new WebFactorFieldType();
                type.Id = searchCriteria.FactorField.TypeId;
                return(type.GetDataType());
            }
        }
        /// <summary>
        /// Get data type given a factor field type.
        /// </summary>
        /// <param name='factorFieldType'>Factor field type.</param>
        /// <returns>Data type.</returns>
        public static WebDataType GetDataType(this WebFactorFieldType factorFieldType)
        {
            switch (factorFieldType.Id)
            {
            case 0:
                return(WebDataType.Boolean);

            case 1:
                return(WebDataType.Int32);

            case 2:
                return(WebDataType.String);

            case 3:
                return(WebDataType.Int32);

            case 4:
                return(WebDataType.Float64);

            default:
                throw new ApplicationException("Unknown factor field type, ID = " + factorFieldType.Id);
            }
        }