コード例 #1
0
 public static bool?DBBoolean(object valor, bool IsNullable)
 {
     if (!IsNullable)
     {
         return(new bool?(SqlDataTypes.DBBoolean(valor)));
     }
     if (valor != null && valor != DBNull.Value)
     {
         return(new bool?(Convert.ToBoolean(valor)));
     }
     return(new bool?());
 }
コード例 #2
0
 public static Decimal?DBDecimal(object valor, bool IsNullable)
 {
     if (!IsNullable)
     {
         return(new Decimal?((Decimal)SqlDataTypes.DBInt32(valor)));
     }
     if (valor != null && valor != DBNull.Value)
     {
         return(new Decimal?(Convert.ToDecimal(valor)));
     }
     return(new Decimal?());
 }
コード例 #3
0
 public static DateTime?DBDateTime(object valor, bool IsNullable)
 {
     if (!IsNullable)
     {
         return(new DateTime?(SqlDataTypes.DBDateTime(valor)));
     }
     if (valor != null && valor != DBNull.Value)
     {
         return(new DateTime?(Convert.ToDateTime(valor)));
     }
     return(new DateTime?());
 }
コード例 #4
0
 public static int?DBInt32(object valor, bool IsNullable)
 {
     if (!IsNullable)
     {
         return(new int?(SqlDataTypes.DBInt32(valor)));
     }
     if (valor != null && valor != DBNull.Value)
     {
         return(new int?(Convert.ToInt32(valor)));
     }
     return(new int?());
 }