Beispiel #1
0
        private void categoriaToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmConsultaCategoria f = new frmConsultaCategoria();

            f.ShowDialog();
            f.Dispose();
        }
        private void btnLocalizar_Click(object sender, EventArgs e)
        {
            frmConsultaCategoria tela = new frmConsultaCategoria();

            tela.ShowDialog();

            if (tela.codigo != 0)
            {
                DALConexao con = new DALConexao(DadosConexao.StringConexao);

                BLLCategoria c = new BLLCategoria(con);

                ModeloCategoria m = c.carregaCategoria(tela.codigo);

                txtCodigo.Text    = m.CodCategoria.ToString();
                txtDescricao.Text = m.NomeCategoria;

                this.AlteraBotoes(3);
            }
            else
            {
                this.LimparCampos();
                this.AlteraBotoes(1);
            }

            tela.Dispose();
        }
        private void btnConsultaCategoria_Click(object sender, EventArgs e)
        {
            frmConsultaCategoria f = new frmConsultaCategoria();

            f.ShowDialog();
            f.Dispose();
        }
Beispiel #4
0
        private void btLocalizar_Click(object sender, EventArgs e)
        {
            //Alterna imagens dos botões
            btLocalizar.ImageIndex = 3;

            //Abre o cadastro do item retornado nos campos
            frmConsultaCategoria frmCCateg = new frmConsultaCategoria();

            frmCCateg.ShowDialog();
            if (frmCCateg.codigo != 0)
            {
                DALConexao      cx     = new DALConexao(DadosDaConexao.StringDeConexao);
                DLLCategoria    dll    = new DLLCategoria(cx);
                ModeloCategoria modelo = dll.CarregaModeloCategoria(frmCCateg.codigo);
                txtcodigo.Text  = modelo.CatCod.ToString();
                txtnome.Text    = modelo.CatNome;
                txtcatdata.Text = modelo.CatData;
                txtcodigo.Text  = Convert.ToString(modelo.CatCod);
                label1.Visible  = true;
                this.alteraBotoes(3);
            }
            else
            {
                //Limpa os campos
                this.LimpaTela();
                //Altera os botões
                this.alteraBotoes(1);
                //Altera se o controle pode ser fechado
                closeCadCategoria = 1;
                //Altera Imagem do botão
                btLocalizar.ImageIndex = 2;
            }
            frmCCateg.Dispose();
        }
Beispiel #5
0
        private void categoriaToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmConsultaCategoria ConsCat = new frmConsultaCategoria();
            ConsCat.ShowDialog();
            ConsCat.Dispose();

        }
Beispiel #6
0
 private void btnLocalizar_Click(object sender, EventArgs e)
 {
     if (codigo != 0)
     {
         DALConexao      cx     = new DALConexao(DadosDaConexao.StringDeConexão);
         BLLCategoria    bll    = new BLLCategoria(cx);
         ModeloCategoria modelo = bll.CarregaModeloCategoria(codigo);
         PreencheCampos(modelo);
     }
     else
     {
         frmConsultaCategoria f = new frmConsultaCategoria();
         Close();
         f.ShowDialog();
         f.Dispose();
     }
 }
 private void btLocalizar_Click(object sender, EventArgs e)
 {
     frmConsultaCategoria f = new frmConsultaCategoria();
     f.ShowDialog();
     if (f.codigo != 0)
     {
         DALConexao cx = new DALConexao(DadosDaConexao.StringDeConexao);
         BLLCategoria bll = new BLLCategoria(cx);
         ModeloCategoria modelo = bll.CarregaModeloCategoria(f.codigo);
         txtCodigo.Text = modelo.CatCod.ToString();
         txtNome.Text = modelo.CatNome;
         alteraBotoes(3);
     }
     else
     {
         this.LimpaTela();
         this.alteraBotoes(1);
     }
     f.Dispose();
 }
Beispiel #8
0
        private void btLocalizar_Click(object sender, EventArgs e)
        {
            frmConsultaCategoria f = new frmConsultaCategoria();

            f.ShowDialog();
            if (f.codigo != 0)
            {
                DALConexao      cx     = new DALConexao(DadosDaConexao.StringDeConexao);
                BLLCategoria    bll    = new BLLCategoria(cx);
                ModeloCategoria modelo = bll.CarregaModeloCategoria(f.codigo);
                txtCodigo.Text = modelo.CatCod.ToString();
                txtNome.Text   = modelo.CatNome;
                alteraBotoes(3);
            }
            else
            {
                this.LimpaTela();
                this.alteraBotoes(1);
            }
            f.Dispose();
        }
Beispiel #9
0
        private void btLocalizar_Click(object sender, EventArgs e)
        {
            frmConsultaCategoria f = new frmConsultaCategoria();
            // obj para gravar os dados no banco
            DALConexao   cx  = new DALConexao(DadosDaConexao.StringDeConexao);
            BLLCategoria bll = new BLLCategoria(cx);

            //exibe o frmConsultaCategoria para seleção da alteração
            f.ShowDialog();
            //verifica se foi armazenado uma categoria no frmConsultaCategoria
            if (f.codigo != 0)
            {
                ModeloCategoria modelo = bll.CarregarModeloCategoria(f.codigo);
                txtCodigo.Text = modelo.CatCod.ToString();
                txtNome.Text   = modelo.CatNome;
                alteraBotoes(3);
            }
            else
            {
                this.limpaTela();
                this.alteraBotoes(1);
            }
            f.Dispose();
        }
        private void categoriaToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmConsultaCategoria f = new frmConsultaCategoria();

            CheckMdiChildren(f);
        }