Пример #1
0
 public static byte[] GetBytes(DateTime?dtVal)
 {
     if (dtVal.HasValue)
     {
         List <byte> arrRet = new List <byte> {
             NOTNULL
         };
         arrRet.AddRange(BitConverterExtension.GetBytes((DateTime)dtVal));
         return(arrRet.ToArray());
     }
     else
     {
         List <byte> arrRet = new List <byte> {
             ISNULL
         };
         arrRet.AddRange(BitConverterExtension.GetBytes(DateTime.UtcNow));
         return(arrRet.ToArray());
     }
 }
Пример #2
0
 public static byte[] GetBytes(decimal?decVal)
 {
     if (decVal.HasValue)
     {
         List <byte> arrRet = new List <byte> {
             NOTNULL
         };
         arrRet.AddRange(BitConverterExtension.GetBytes((decimal)decVal));
         return(arrRet.ToArray());
     }
     else
     {
         List <byte> arrRet = new List <byte> {
             ISNULL
         };
         arrRet.AddRange(BitConverterExtension.GetBytes((decimal)0));
         return(arrRet.ToArray());
     }
 }