TypeSlowXDALFunctions

2017-02-21 22:52:26  访问(1400) 赞(0) 踩(0)

using System;
using System.Collections.Generic;
using System.Text;

using System.Reflection;

using System.Data;
using SlowX.DAL.Utils;

namespace SlowX.DAL.Functions
{
    /// <summary>
    /// 拼串SQL的语句全部写在这里
    /// </summary>
    public class TypeSlowXDALFunctions
    {


        /// <summary>
        /// typeof(UInt64)
        /// </summary>
        public readonly static Type typeUInt64 = typeof(UInt64);

        /// <summary>
        /// typeof(UInt32)
        /// </summary>
        public readonly static Type typeUInt32 = typeof(UInt32);


        /// <summary>
        /// typeof(UInt16)
        /// </summary>
        public readonly static Type typeUInt16 = typeof(UInt16);

        /// <summary>
        /// typeof(Int64)
        /// </summary>
        public readonly static Type typeInt64 = typeof(Int64);

        /// <summary>
        /// typeof(Int32)
        /// </summary>
        public readonly static Type typeInt32 = typeof(Int32);


        /// <summary>
        /// typeof(Int16)
        /// </summary>
        public readonly static Type typeInt16 = typeof(Int16);

        /// <summary>
        /// typeof(DateTime)
        /// </summary>
        public readonly static Type typeDateTime = typeof(DateTime);


        /// <summary>
        /// typeof(Double)
        /// </summary>
        public readonly static Type typeDouble = typeof(Double);

        /// <summary>
        /// typeof(DateTime?)
        /// </summary>
        public readonly static Type typeDateTimeNull = typeof(DateTime?);

        /// <summary>
        /// typeof(Boolean)
        /// </summary>
        public readonly static Type typeBoolean = typeof(Boolean);

        /// <summary>
        /// typeof(Decimal) 
        /// </summary>
        public readonly static Type typeDecimal = typeof(Decimal);


        /// <summary>
        /// typeof(Decimal) 
        /// </summary>
        public readonly static Type typeSingle = typeof(Single);


        /// <summary>
        /// typeof(String) 
        /// </summary>
        public readonly static Type typeString = typeof(String);


        /// <summary>
        /// typeof(string) 
        /// </summary>
        public readonly static Type typestring = typeof(string);

        /// <summary>
        /// typeof(long) 
        /// </summary>
        public readonly static Type typelong = typeof(long);

        /// <summary>
        /// typeof(long?) 
        /// </summary>
        public readonly static Type typelongNull = typeof(long?);

        /// <summary>
        /// typeof(int) 
        /// </summary>
        public readonly static Type typeint = typeof(int);

        /// <summary>
        /// typeof(int?) 
        /// </summary>
        public readonly static Type typeintNull = typeof(int?);


        /// <summary>
        /// typeof(float) 
        /// </summary>
        public readonly static Type typefloat = typeof(float);

        /// <summary>
        /// typeof(float?) 
        /// </summary>
        public readonly static Type typefloatNull = typeof(float?);

        /// <summary>
        /// typeof(double) 
        /// </summary>
        public readonly static Type typedouble = typeof(double);

        /// <summary>
        /// typeof(double?) 
        /// </summary>
        public readonly static Type typedoubleNull = typeof(double?);

        /// <summary>
        /// typeof(bool) 
        /// </summary>
        public readonly static Type typebool = typeof(bool);


        /// <summary>
        /// typeof(bool?) 
        /// </summary>
        public readonly static Type typeboolNull= typeof(bool?);


        /// <summary>
        /// typeof(System.Enum) 
        /// </summary>
        public readonly static Type typeEnum = typeof(System.Enum);

        /// <summary>
        /// 是否数字类型
        /// </summary>
        /// <param name="theValue"></param>
        /// <returns></returns>
        public static bool IsNumberType(Type theValue)
        {
            if (theValue == typeInt64
                || theValue == typeInt32
                || theValue == typeInt16
                || theValue == typeDecimal
                || theValue == typeDouble
                || theValue == typelong)
                return true;

            return false;
                

        }

        /// <summary>
        /// 是否时间类型
        /// </summary>
        /// <param name="theValue"></param>
        /// <returns></returns>
        public static bool IsDateTimeType(Type theValue)
        {
            if (theValue == typeDateTime
                || theValue == typeDateTimeNull)
                return true;

            return false;
        }
        
    }
}


标签:TypeSlowXDALFunctions 

上一条:

下一条:


 

相关评论

评论加载中……
 

发表评论

类型:
内容:
  (Alt+Enter)
 
  ┈全部┈  
 
(显示默认分类)