Esempio n. 1
0
 /// <summary>
 /// 构造函数。
 /// </summary>
 /// <param name="fieldName">字段名称。</param>
 /// <param name="fieldValue">字段值。</param>
 public DBField(string fieldName, DateTime fieldValue, DatetimeType type, bool withQuote)
 {
     this.FieldName = fieldName;
     if (type == DatetimeType.Date)
     {
         this.FieldValue = fieldValue.ToString("yyyy-MM-dd");
     }
     else if (type == DatetimeType.Time)
     {
         this.FieldValue = fieldValue.ToString("yyyy-MM-dd HH:mm:ss");
     }
     else if (type == DatetimeType.LongTime)
     {
         this.FieldValue = fieldValue.ToString("yyyy-MM-dd HH:mm:ss.fff");
     }
     this.WithQuote = withQuote;
 }
Esempio n. 2
0
 /// <summary>
 /// 构造函数。
 /// </summary>
 /// <param name="fieldName">字段名称。</param>
 /// <param name="fieldValue">字段值。</param>
 public DBField(string fieldName, DateTime fieldValue, DatetimeType type)
     : this(fieldName, fieldValue, type, true)
 {
 }
 /// <param name="out"> Defaults to <c>false</c>. </param>
 public static bool TryGetIsOptional(this DatetimeType @this, out bool @out) => TryGetMeta(@this, NapBuiltInMeta.IsOptional, out @out, false);
 public static bool TryGetDefault(this DatetimeType @this, [NotNullWhen(true)] out DateTime? @out) => TryGetMeta(@this, NapBuiltInMeta.Default, out @out);
 /// <param name="out"> Defaults to <c>true</c>. </param>
 public static bool TryGetMaxIsInclusive(this DatetimeType @this, out bool @out) => TryGetMeta(@this, NapBuiltInMeta.MaxIsInclusive, out @out, true);
 public static bool TryGetForbiddenValues(this DatetimeType @this, out IReadOnlyCollection <DateTime> @out) => TryGetMeta(@this, NapBuiltInMeta.ForbiddenValues, out @out, ImmutableList <DateTime> .Empty);