zoukankan      html  css  js  c++  java
  • winform time.AddMinutes 时间相加

      最近修改代码,要求过滤掉重复的确认。 判断条件是(收费标记&&超时时间)

    代码是这样的

     1  TempRecordTableAdapter tempAda = new TempRecordTableAdapter();
     3             try
     4             {    
     6                 DataSet1.TempRecordDataTable dt1 = tempAda.GetChaFlagAndTime(licNum);
     7                 if ( dt1.Count > 0)
     8                 {
     9                     string fg = dt1[0]["ChargedFlag"].ToString();
    10                     DateTime time = DateTime.Parse(dt1[0]["ChargeTime"].ToString());
    11                    
    12                     //判断收费标记 && 没有超时
    13                     if (fg == "1" && time.AddMinutes(int.Parse(QRCodeHelp.parkTimeOut)) >= DateTime.Now)
    14                     {
    15                         this.DialogResult = DialogResult.Cancel;
    16                         return;
    17                     }
    18                 }
    19             }
    20             catch (Exception ex)
    21             {
    22                 MessageBox.Show("网络故障,请稍后");
    23                 QRCodeHelp.WriteLog(ex, ex.Message, "查询缴费记录出错!");
    24             }
    time.AddMinutes(int.Parse(QRCodeHelp.parkTimeOut)) >= DateTime.Now; 这个时间就是(确认的时间加上超时的时间大于等于当前时间)
    time.AddMinutes//时间相加。
  • 相关阅读:
    qsort
    strcmp
    LotteryDrawing
    retire or not retire ? is a question.
    alloc && afree
    strlen
    c point
    c point ccccc
    MySQL MGR源码分析2
    MySQL MGR实现分析
  • 原文地址:https://www.cnblogs.com/tuhong/p/6489695.html
Copyright © 2011-2022 走看看