From 3c4959339c2507aea45632380635f8ad861ee06a Mon Sep 17 00:00:00 2001 From: lhiven Date: Sat, 17 Aug 2024 17:07:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=95=8C=E9=9D=A2=E6=97=A5=E6=9C=9F=E5=92=8CSN?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8D=E8=83=BD=E5=90=8C=E6=97=B6=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E7=9A=84=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Rs.DeweyTester/Data/DataRecords.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Rs.DeweyTester/Data/DataRecords.cs b/Rs.DeweyTester/Data/DataRecords.cs index d6623da..9ce0af7 100644 --- a/Rs.DeweyTester/Data/DataRecords.cs +++ b/Rs.DeweyTester/Data/DataRecords.cs @@ -1,4 +1,5 @@ -using System; +using Rs.MotionPlat.Commom; +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -29,6 +30,11 @@ namespace Rs.MotionPlat.Data private void btnSearch_Click(object sender, EventArgs e) { string querySql = "select * from records where 1=1"; + if(!dateTimePicker1.Checked && string.IsNullOrEmpty(txtSn.Text)) + { + Msgbox.ShowTipDialog(EButtonType.Ok, "Date or Sn cannot be empty at the same time"); + return; + } if(dateTimePicker1.Checked) { querySql += $" and (PlaceTime > '{dateTimePicker1.Value.Date.AddMilliseconds(1)}' and PlaceTime < '{dateTimePicker1.Value.Date.AddDays(1).AddMilliseconds(-1)}')";