//夜审 private void clearTool_Click(object sender, EventArgs e) { bool hasto = true; DateTime now = GeneralClass.Now; var cnt = db.ClearTable.FirstOrDefault(x => x.clearTime.Date == now.Date); if (cnt != null) { ClearOptionsForm clearOptionsForm = new ClearOptionsForm(cnt.clearTime); if (clearOptionsForm.ShowDialog() == DialogResult.OK) { db.ClearTable.DeleteOnSubmit(cnt); db.SubmitChanges(); } else hasto = false; } if (!hasto) return; var seats = db.Seat.Where(x => x.status == 3); foreach (Seat seat in seats) { BathClass.reset_seat(seat); } ClearTable ct = new ClearTable(); ct.clearTime = GeneralClass.Now; db.ClearTable.InsertOnSubmit(ct); db.SubmitChanges(); }
//夜审并且备份数据库,并且发送夜审短信 private void clearTool_Click(object sender, EventArgs e) { bool hasCleared = false; DateTime now = GeneralClass.Now; var ct = db.ClearTable.FirstOrDefault(x => x.clearTime.Date == now.Date); if (ct != null) { hasCleared = true; ClearOptionsForm clearOptionsForm = new ClearOptionsForm(ct.clearTime); if (clearOptionsForm.ShowDialog() != DialogResult.OK) { return; } } var seats = db.Seat.Where(x => x.status == 3); foreach (Seat seat in seats) { BathClass.reset_seat(seat); } if (!hasCleared) { ct = new ClearTable(); } ct.clearTime = GeneralClass.Now; if (!hasCleared) { db.ClearTable.InsertOnSubmit(ct); } db.SubmitChanges(); Thread td = new Thread(new ThreadStart(send_sms_thread)); td.Start(); backUp(); }
//夜审并且备份数据库,并且发送夜审短信 private void clearTool_Click(object sender, EventArgs e) { bool hasCleared = false; DateTime now = GeneralClass.Now; var ct = db.ClearTable.FirstOrDefault(x => x.clearTime.Date == now.Date); if (ct != null) { hasCleared = true; ClearOptionsForm clearOptionsForm = new ClearOptionsForm(ct.clearTime); if (clearOptionsForm.ShowDialog() != DialogResult.OK) return; } var seats = db.Seat.Where(x => x.status == 3); foreach (Seat seat in seats) { BathClass.reset_seat(seat); } if (!hasCleared) ct = new ClearTable(); ct.clearTime = GeneralClass.Now; if (!hasCleared) db.ClearTable.InsertOnSubmit(ct); db.SubmitChanges(); Thread td = new Thread(new ThreadStart(send_sms_thread)); td.Start(); backUp(); }