Example #1
0
        private void lbox_Temas_Click(object sender, EventArgs e)
        {
            if (lbox_Temas.SelectedIndex != -1)
            {
                TemaBD obj_TemaBD = new TemaBD();

                string sLinha = lbox_Temas.Items[lbox_Temas.SelectedIndex].ToString();

                int ipos = 0;

                for (int t = 0; t <= sLinha.Length; t++)
                {
                    if (sLinha.Substring(t, 1) == "-")
                    {
                        ipos = t;
                        break;
                    }
                }

                Tema_Principal.COD_TEMA = Convert.ToInt16(sLinha.Substring(0, ipos));

                Tema_Principal = obj_TemaBD.FindByCodTema(Tema_Principal);

                PopulaTela(Tema_Principal);

                obj_FuncGeral.StatusBtn(this, 2);
            }
        }
Example #2
0
        /**********************************************************************************
        * NOME:            PopulaTela
        * PROCEDIMENTO:    Preenche a tela com os dados do Objeto Principal
        * DT CRIAÇÃO:      22/11/2019
        * DT ALTERAÇÃO:    -
        * PARAMETRO:
        * ESCRITA POR:     Mfacine (Monstro)
        * OBSERVAÇÕES:
        * ********************************************************************************/
        private void PopulaTela(Tatuagem aobj_Tatuagem)
        {
            if (aobj_Tatuagem.COD_TATUAGEM != -1)
            {
                TemaBD obj_TemaBD = new TemaBD();
                Tema   obj_Tema   = new Tema();

                tbox_Cod_Tatuagem.Text          = aobj_Tatuagem.COD_TATUAGEM.ToString();
                tbox_Nm_Tatuagem.Text           = aobj_Tatuagem.NM_TATUAGEM;
                cbox_Cor_Tatuagem.SelectedIndex = aobj_Tatuagem.COR_TATUAGEM;
                cbox_Tam_Tatuagem.SelectedIndex = aobj_Tatuagem.TAM_TATUAGEM;

                obj_Tema.COD_TEMA = aobj_Tatuagem.COD_TEMA;

                lb_Tit_Tema.Text = obj_TemaBD.FindByCodTema(obj_Tema).TIT_TEMA;
            }
        }
Example #3
0
        private void btn_Excluir_Click(object sender, EventArgs e)
        {
            TemaBD       obj_TemaBD = new TemaBD();
            DialogResult varResp    = MessageBox.Show("Confirma a Exclusão?", "Exclusão da Tema", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (varResp == DialogResult.Yes)
            {
                if (obj_TemaBD.Excluir(Tema_Principal))
                {
                    MessageBox.Show("Tema excluida com sucesso. ", "Exclusão da Tema", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }

                obj_FuncGeral.LimpaTela(this);
                obj_FuncGeral.HabilitaTela(this, false);
                obj_FuncGeral.StatusBtn(this, 1);
                PopulaLista();
            }
        }
Example #4
0
        /**********************************************************************************
        * NOME:            PopulaLista
        * PROCEDIMENTO:    Preenche o ListBox com os dados que estão na TB_Tema
        * DT CRIAÇÃO:      02/12/2019
        * DT ALTERAÇÃO:    -
        * ESCRITA POR:     Mfacine (Monstro)
        * OBSERVAÇÕES:
        * ********************************************************************************/
        private void PopulaLista()
        {
            // Instância do objeto TemaBD
            TemaBD obj_TemaBD = new TemaBD();

            // Instância do objeto Lista
            List <Tema> Lista = new List <Tema>();

            // Limpando o ListBox
            lbox_Temas.Items.Clear();

            Lista = obj_TemaBD.FindAllTema();

            if (Lista != null)
            {
                for (int i = 0; i <= Lista.Count - 1; i++)
                {
                    lbox_Temas.Items.Add(Lista[i].COD_TEMA.ToString() + "-" + Lista[i].TIT_TEMA);
                }
            }
        }
Example #5
0
        private void btn_Confirmar_Click(object sender, EventArgs e)
        {
            TemaBD obj_TemaBD = new TemaBD();

            Tema_Principal = PopulaObjeto();

            if (Tema_Principal.COD_TEMA != -1)
            {
                obj_TemaBD.Alterar(Tema_Principal);
                MessageBox.Show("Tema alterada com sucesso. ", "Alteração da Tema", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                Tema_Principal.COD_TEMA = obj_TemaBD.Incluir(Tema_Principal);
                MessageBox.Show("Tema Incluida com sucesso. ", "Inclusão da Tema", MessageBoxButtons.OK, MessageBoxIcon.Information);
                PopulaTela(Tema_Principal);
            }

            obj_FuncGeral.StatusBtn(this, 2);
            obj_FuncGeral.HabilitaTela(this, false);
            PopulaLista();
        }