private void BtnBuscaSetor_Click(object sender, EventArgs e) { GridSetores.DataSource = null; var TabelaSetores = Cadastro.BuscaSetor(TextNomeSetor.Text); GridSetores.DataSource = TabelaSetores; }
private void BtnBuscaSetorEditar_Click(object sender, EventArgs e) { var TabelaSetores = CadastroSetor.BuscaSetor(TextPesquisaSetorEditar.Text); if (TabelaSetores.Rows.Count == 0) { MetroMessageBox.Show(this, "Sua busca não encontrou nenhum resultado", "Sucesso !", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { DataGridSetorEditar.DataSource = TabelaSetores; } }