private void btnSearch_Click(object sender, EventArgs e) { //var sql = "select id,name,age,sex,tests,date,time from test where id "; var en = new DoctorTestEntity(); var re = new DoctorTestRepo(); en.Id = txtId.Text; en.Name = txtName.Text; en.Date = dtpDate.Value.ToString("yyyy-MM-dd"); re.Search(en, mgvTest); }
public void Search(DoctorTestEntity en, MetroGrid grid) { var sql = "select id,name,age,sex,tests,date,time from test where id = '" + en.Id + "' or name = '" + en.Name + "' or date = '" + en.Date + "'"; DataAccess.PopulateGridView(grid, sql); }