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)}')";