110,536
社区成员
发帖
与我相关
我的任务
分享
//
// LogTimeBegin
//
this.LogTimeBegin.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.LogTimeBegin.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.LogTimeBegin.Location = new System.Drawing.Point(110, 15);
this.LogTimeBegin.Name = "LogTimeBegin";
this.LogTimeBegin.Size = new System.Drawing.Size(163, 21);
this.LogTimeBegin.TabIndex = 14;
//
// LogTimeEnd
//
this.LogTimeEnd.CustomFormat = "yyyy-MM-dd HH:mm:ss";
this.LogTimeEnd.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.LogTimeEnd.Location = new System.Drawing.Point(296, 15);
this.LogTimeEnd.Name = "LogTimeEnd";
this.LogTimeEnd.Size = new System.Drawing.Size(158, 21);
this.LogTimeEnd.TabIndex = 15;
/// <summary>
/// 用户自定义时间格式
/// </summary>
public enum DateTimeCustomFormat
{
/// <summary>
/// 长类型时间格式 yyyy/MM/dd HH:mm:ss
/// </summary>
Long = 0,
/// <summary>
/// 短类型时间格式 yyyy/MM/dd
/// </summary>
Short = 1,
/// <summary>
/// 没有"秒"时间格式 yyyy/MM/dd HH:MM
/// </summary>
NoSecond = 2
}
private void TimeQuest_Load(object sender, EventArgs e)
{
init();
}
private void init()
{
DateTime dtNow = DateTime.Now;
this.LogTimeBegin.Checked = true;
this.LogTimeBegin.Value = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, dtNow.Hour, 0, 0);
this.LogTimeBegin.Checked = false;
this.LogTimeEnd.Checked = true;
this.LogTimeEnd.Value = new DateTime(dtNow.Year, dtNow.Month, dtNow.Day, dtNow.Hour, 59, 59);
this.LogTimeEnd.Checked = false;
this.cardId.Text = "";
this.carId.Text = "";
this.expId.Text = "";
this.checkBox1.Checked = false;
System.Diagnostics.Debug.WriteLine(this.LogTimeBegin.Value);
System.Diagnostics.Debug.WriteLine(this.LogTimeEnd.Value);
}