/// <summary> /// 判断是否过天 /// </summary> private bool CheckDate() { //如果记录的天数已经过了,清空并重新记录。 if (KeyData_Today.todayData.Date != DateTime.Now.ToString("yyyy-MM-dd")) { //先更新总数据和每日数据 KeyData_Total.UpdateData(); KeyData_DailyData.UpdateData(); //保存并重置当天数据 KeyData_Today.ResetCount(); //保存数据 KeyData_Today.SaveKeyData(); KeyData_Total.SaveKeyData(); KeyData_DailyData.SaveKeyData(); return(true); } return(false); }
/// <summary> /// 格式化数据 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void uiSymbolButton_clear_Click(object sender, EventArgs e) { List <string> items = new List <string> { "仅格式化计数数据", "格式化所有数据(包括坐标)" }; int select = -1; if (this.ShowSelectDialog(ref select, items)) { if (select == 0)//仅格式化计数数据 { KeyData_DailyData.Reset(); KeyData_Today.ResetCount(); KeyData_Total.ResetCount(); } else if (select == 1)//格式化所有 { KeyData_DailyData.Reset(); KeyData_Today.Reset(); KeyData_Total.Reset(); } } }