private void categoriaToolStripMenuItem1_Click(object sender, EventArgs e) { using (frmPesquisarCategoria pesquisar = new frmPesquisarCategoria()) { pesquisar.ShowDialog(); } }
private void btnLocalizar_Click(object sender, EventArgs e) { using (frmPesquisarCategoria pesquisar = new frmPesquisarCategoria()) { pesquisar.ShowDialog(); if (pesquisar.codigo != 0) { ModeloCategoria modeloCategoria = QueryDB.CarregaCategoria(pesquisar.codigo); txtCodigo.Text = Convert.ToString(modeloCategoria.CatCod); txtNome.Text = modeloCategoria.CatNome; this.AlteraBotoes(Convert.ToInt32(OperacaoFormulario.Alterar_Excluir_Cancelar)); } else { this.LimparDadosDaTela(); this.AlteraBotoes(Convert.ToInt32(OperacaoFormulario.Inserir_Localizar)); } } }