Esempio n. 1
0
        public static string ConvertToString(object objValue)
        {
            string result = "";

            if (!CommonAPI.IsNullValue(objValue))
            {
                result = objValue.ToString();
            }
            return(result);
        }
Esempio n. 2
0
        public static int ConvertToInt(object objValue)
        {
            int result = 0;

            if (!CommonAPI.IsNullValue(objValue))
            {
                int.TryParse(objValue.ToString(), out result);
            }
            return(result);
        }
Esempio n. 3
0
        /// <summary>
        /// Converts to double.
        /// </summary>
        /// <param name="objValue">The object value.</param>
        /// <returns>System.Double.</returns>
        public static double ConvertToDouble(object objValue)
        {
            double result = -1.0;

            if (!CommonAPI.IsNullValue(objValue))
            {
                double.TryParse(objValue.ToString(), out result);
            }
            return(result);
        }