private void timer1_Tick(object sender, EventArgs e) { string pesquisa = comboSetor.Text; comboSetor.Items.Clear(); if (pesquisa.Length > 0) { resS = Departamento.ConverteObject(CRUD.SelecionarTabela("departamento", Departamento.Campos(), "Nome LIKE '%" + pesquisa + "%'", "LIMIT 15")); foreach (Departamento f in resS) { comboSetor.Items.Add(f.nome); } } timer1.Enabled = false; }
private void btnPesquisar_Click(object sender, EventArgs e) { string psq = txtSetor.Text; if (psq.Length > 2) { resSetor = Departamento.ConverteObject(CRUD.SelecionarTabela("departamento", Departamento.Campos(), "Nome LIKE '" + psq + "'", "ASC")); if (resSetor.Count() > 0) { regAtual = resSetor.First(); pos = 0; MostraDados(); if (resSetor.Count() > 1) { AtivaNavegador(); } } } }