private void btnQuery_Click(object sender, EventArgs e) { switch (cmbQuery.SelectedIndex) { case 0: //全部 AdministratorTaskBindingSource.DataSource = AdministratorTaskService.GetAll(); break; case 1: //按任务编号查询 AdministratorTaskBindingSource.DataSource = AdministratorTaskService.Get(txtQuery.Text); break; case 2: //按工作人员姓名查询 AdministratorTaskBindingSource.DataSource = AdministratorTaskService.QueryTaskByServerName(txtQuery.Text); break; case 3: //按工作人员ID查询 AdministratorTaskBindingSource.DataSource = AdministratorTaskService.QueryTaskByServerID(txtQuery.Text); break; } AdministratorTaskBindingSource.ResetBindings(true); }
public void QueryAll() { AdministratorTaskBindingSource.DataSource = AdministratorTaskService.GetAll(); AdministratorTaskBindingSource.ResetBindings(false); }