private void btLocalizar_Click(object sender, EventArgs e)
        {
            frmConsultaSubCategoria f = new frmConsultaSubCategoria();
            // obj para gravar os dados no banco
            DALConexao      cx  = new DALConexao(DadosDaConexao.StringDeConexao);
            BLLSubcategoria bll = new BLLSubcategoria(cx);

            //exibe o frmConsultaCategoria para seleção da alteração
            f.ShowDialog();
            //verifica se foi armazenado uma categoria no frmConsultaCategoria
            if (f.codigo != 0)
            {
                ModeloSubCategoria modelo = bll.CarregarModeloSubCategoria(f.codigo);
                txtSCod.Text                  = modelo.ScatCod.ToString();
                txtNomeSubcategoria.Text      = modelo.ScatNome;
                cbNomeCategoria.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();
        }
        private void btnConsultaSubCategoria_Click(object sender, EventArgs e)
        {
            frmConsultaSubCategoria f = new frmConsultaSubCategoria();

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

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

                BLLSubCategoria sc = new BLLSubCategoria(con);

                ModeloSubCategoria m = sc.carregaSubCategoria(tela.codigo);

                txtCodigoSubCategoria.Text = m.CodSubCat.ToString();
                txtNomeSubCategoria.Text   = m.SubCategoriaNome;
                cbCategoria.SelectedValue  = m.FKCatCod;

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

                this.AlteraBotoes(1);
            }

            tela.Dispose();
        }
예제 #5
0
        private void btnLocalizar_Click(object sender, EventArgs e)
        {
            frmConsultaSubCategoria tela = new frmConsultaSubCategoria();

            tela.ShowDialog();

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

                BLLSubCategoria sc = new BLLSubCategoria(con);

                ModeloSubCategoria m = sc.carregaSubCategoria(tela.codigo);

                txtCodigoSubCategoria.Text = m.CodSubCat.ToString();
                txtNomeSubCategoria.Text   = m.SubCategoriaNome;
                cbCategoria.SelectedValue  = m.FKCatCod;


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

                this.AlteraBotoes(1);
            }

            tela.Dispose();
        }
예제 #6
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();
        }
예제 #7
0
        private void subCategoriaToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmConsultaSubCategoria ConsCat = new frmConsultaSubCategoria();
            ConsCat.ShowDialog();
            ConsCat.Dispose();

     
        }
예제 #8
0
 private void btnLocalizar_Click(object sender, EventArgs e)
 {
     if (codigo != 0)
     {
         DALConexao         cx     = new DALConexao(DadosDaConexao.StringDeConexão);
         BLLSubCategoria    bll    = new BLLSubCategoria(cx);
         ModeloSubCategoria modelo = bll.CarregaModeloSubCategoria(codigo);
         PreencheCampos(modelo);
     }
     else
     {
         frmConsultaSubCategoria f = new frmConsultaSubCategoria();
         Close();
         f.ShowDialog();
         f.Dispose();
     }
 }
        private void btLocalizar_Click(object sender, EventArgs e)
        {
            frmConsultaSubCategoria f = new frmConsultaSubCategoria();

            f.ShowDialog();
            if (f.codigo != 0)
            {
                DALConexao         cx     = new DALConexao(DadosDaConexao.StringDeConexao);
                BLLSubCategoria    bll    = new BLLSubCategoria(cx);
                ModeloSubCategoria modelo = bll.CarregaModeloSubCategoria(f.codigo);
                txtScatCod.Text     = modelo.SCatCod.ToString();
                txtScatNome.Text    = modelo.SCatNome;
                cbCat.SelectedValue = modelo.CatCod;
                alteraBotoes(3);
            }
            else
            {
                this.LimpaTela();
                this.alteraBotoes(1);
            }
            f.Dispose();
        }
        //==========================================================================================================================================
        private void btLocalizar_Click(object sender, EventArgs e) //auça 16
        {
            frmConsultaSubCategoria f = new frmConsultaSubCategoria();

            f.ShowDialog();    //ao dar duploclik na linha, fecha o form consultasubcart, e retornar o

            if (f.codigo != 0) //usa a propriedade codigo para retornar o codigo da subcat selecionado
            {
                DALConexao      cx  = new DALConexao(DadosDaConexao.StringDeConexao);
                BLLSubCategoria bll = new BLLSubCategoria(cx);

                ModeloSubCategoria modelo = bll.CarregaModeloSubCategoria(f.codigo); //carrega subcatagoria conforme propriedade cod
                txtScatCod.Text        = modelo.ScatCod.ToString();                  //carregar o cod da subcat
                txtNome.Text           = modelo.ScatNome;                            //carregar o nome da subcat
                cbCatCod.SelectedValue = modelo.CatCod;
                alteraBotoes(3);
            }
            else
            {
                this.LimpaTela();
                this.alteraBotoes(1);
            }
            f.Dispose();
        }
예제 #11
0
 private void btLocalizar_Click(object sender, EventArgs e)
 {
     
     frmConsultaSubCategoria consulta = new frmConsultaSubCategoria();
     consulta.ShowDialog();
     if (consulta.Scodigo != 0)
     {
         DALConexao cx = new DALConexao(DadosDaConexao.srtConexao);
         BLLSubCategoria bll = new BLLSubCategoria(cx);
         ModeloSubCategoria modelo = bll.CarregaModeloSubCategoria(consulta.Scodigo);
         txtSCatCod.Text = modelo.SCatCod.ToString();
         txtSnome.Text = modelo.SCatNome;
         cbCatCod.SelectedValue = modelo.CatCod;
         AlteraBotoes(3);
     }
     else
     {
         this.LimpaTela();
         this.AlteraBotoes(1);
     }
     consulta.Dispose();
 }
        private void subCategoriaToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            frmConsultaSubCategoria f = new frmConsultaSubCategoria();

            CheckMdiChildren(f);
        }
        // Botão Localizar
        private void btLocalizar_Click(object sender, EventArgs e)
        {

            frmConsultaSubCategoria f = new frmConsultaSubCategoria();
            f.ShowDialog();
            if (f.codigo != 0)
            {
                DALConexao cx = new DALConexao(DadosDaConexao.StringDeConexao);
                BLLSubCategoria bll = new BLLSubCategoria(cx);
                ModeloSubCategoria modelo = bll.CarregaModeloSubCategoria(f.codigo);
                txtSubcatcod.Text = modelo.ScatCod.ToString();
                txtNomeSubCategoria.Text = modelo.ScatNome;
                cbCatCod.SelectedValue = modelo.CatCod;
                alteraBotoes(3);
            }
            else
            {
                this.LimpaTela();
                this.alteraBotoes(1);
            }
            f.Dispose();             
        }