private void btLocalizar_Click(object sender, EventArgs e)
        {
            frmConsultaSubcategoria f = new frmConsultaSubcategoria();
            f.ShowDialog();
            f.Dispose();

            if (f.codigo != 0)
            {
                DALConexao cx = new DALConexao(DadosConexao.StringDeConexao);
                BLLSubCategoria bll = new BLLSubCategoria(cx);
                ModeloSubCategoria modelo = bll.CarregaModeloSubCategoria(f.codigo);
                txtCodigo.Text = modelo.ScatCod.ToString();
                txtNome.Text = modelo.ScatNome;
                cbxCategoria.SelectedValue = modelo.CatCod;
                alteraBotoes(3);
            }
            else
            {
                this.LimpaTela();
                this.alteraBotoes(1);
            }
            f.Dispose();
        }
示例#2
0
 private void subCategoriaToolStripMenuItem1_Click(object sender, EventArgs e)
 {
     frmConsultaSubcategoria f = new frmConsultaSubcategoria();
     f.ShowDialog();
     f.Dispose();
 }