示例#1
0
 public static void Validate_transaction_date(DateTime txDate, bool force,
                                              Action onValid, Action <string> onInvalid)
 {
     if (txDate > TimeProvider.Now())
     {
         onInvalid("Cannot execute transactions in the future!");
     }
     else if (!force && (txDate.Year < TimeProvider.Now().Year || txDate.Month < TimeProvider.Now().Month))
     {
         onInvalid("Cannot execute transactions before current month. Use -force to override.");
     }
     else
     {
         onValid();
     }
 }