Ejemplo n.º 1
0
Archivo: Null.cs Proyecto: dangtq72/ATT
        public static string GetNullStringValue(Type objType)
        {
            string functionReturnValue = "";

            if ((objType != null))
            {
                if (objType == typeof(int))
                {
                    functionReturnValue = NullInteger.ToString();
                }
                else if (objType == typeof(float))
                {
                    functionReturnValue = NullInteger.ToString();
                }
                else if (objType == typeof(double))
                {
                    functionReturnValue = NullInteger.ToString();
                }
                else if (objType == typeof(decimal))
                {
                    functionReturnValue = NullInteger.ToString();
                }
                else if (objType == typeof(System.DateTime))
                {
                    functionReturnValue = NullDate.ToString();
                }
                else if (objType == typeof(string))
                {
                    functionReturnValue = NullString;
                }
                else if (objType == typeof(bool))
                {
                    functionReturnValue = NullBoolean.ToString();
                }
                else if (objType == typeof(Guid))
                {
                    functionReturnValue = NullGuid.ToString();
                }
                else
                {
                    throw new NullReferenceException();
                }
            }
            else
            {
                // assume string
                functionReturnValue = NullString;
            }
            return(functionReturnValue);
        }