private void tm_Update_Tick(object sender, EventArgs e) { DateTime time = DateTime.Now; const string format = "ddd MMM d HH:mm yyyy"; lbl_DateTime.Text = time.ToString(format); int hour = time.Hour; if (hour >= 0 && hour < 9) { _timeRange = 0; } else if (hour >= 9 && hour < 17) { _timeRange = 1; } else if (hour >= 17 && hour < 21) { _timeRange = 2; } else if (hour >= 21 && hour < 24) { _timeRange = 3; } if (_oldTimeRange == 3 && _timeRange == 0) { Application.Restart(); } _oldTimeRange = _timeRange; saveCount++; if (saveCount >= 600000) { ExcelDoc.WriteDoc(); saveCount = 0; } }
private void btn_Save_Click(object sender, EventArgs e) { ExcelDoc.WriteDoc(); lbl_NextTicket.Font = new Font(lbl_NextTicket.Font.Name, int.Parse(txt_size.Text)); }
public static void OnProcessExit(object sender, EventArgs e) { ExcelDoc.WriteDoc(); }