Пример #1
0
        private void btLocalizar_Click(object sender, EventArgs e)
        {
            //Alterna imagens dos botões
            btLocalizar.ImageIndex = 3;

            frmConsultaSubCategoria frmSubCCateg = new frmConsultaSubCategoria();

            frmSubCCateg.ShowDialog();
            if (frmSubCCateg.codigo != 0)
            {
                DALConexao         cx     = new DALConexao(DadosDaConexao.StringDeConexao);
                DLLSubCategoria    dll    = new DLLSubCategoria(cx);
                ModeloSubCategoria modelo = dll.CarregaModeloSubCategoria(frmSubCCateg.codigo);
                txtSCatCod.Text        = modelo.ScatCod.ToString();
                txtNome.Text           = modelo.ScatNome;
                txtSCatData.Text       = modelo.ScatData;
                cbCatCod.SelectedValue = Convert.ToString(modelo.CatCod);
                label1.Visible         = true;
                this.alteraBotoes(3);
                closeCadSubCategoria = 3;
            }
            else
            {
                this.LimpaTela();
                this.alteraBotoes(1);
                btLocalizar.ImageIndex = 2;
            }
            frmSubCCateg.Dispose();
        }