示例#1
0
        private void CategoriaToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmConsultaCategoria f = new frmConsultaCategoria();

            f.ShowDialog();
            f.Dispose();
        }
示例#2
0
        private void BtnLocalizar_Click(object sender, EventArgs e)
        {
            frmConsultaCategoria f = new frmConsultaCategoria();

            f.ShowDialog();
            if (f.codigo != 0)
            {
                DALConexao      cx           = new DALConexao(DadosDaConexao.stringDeConexao);
                DAOCategoria    dAOCategoria = new DAOCategoria(cx);
                ModeloCategoria modelo       = dAOCategoria.carregaModeloCategoria(f.codigo);
                txtCodigo.Text = modelo.cat_cod.ToString();
                txtNome.Text   = modelo.cat_nome;
                alteraBotoes(3);
            }
            else
            {
                this.limparTela();
                this.alteraBotoes(1);
            }
            f.Dispose();
        }