public cadPeriodicos(string valid)
        {
            InitializeComponent();
            cSelf        = this;
            this.Visible = true;
            if (valid != null)
            {
                gpbPeriodico.Enabled = true;
                btnEditar.Enabled    = true;
                btnExcluir.Enabled   = true;
                textID.Text          = valid;
                btnSalvar.Enabled    = false;
            }

            // adiciona dados na comboBox -> Assinatura
            cbAssinatura.Items.Add("Mensal");
            cbAssinatura.Items.Add("Semestral");
            cbAssinatura.Items.Add("Anual");
            cbAssinatura.Items.Add("Nenhuma");


            if (cbAutorP.Items.Count == 0)
            {
                cbAutorP.Enabled = false;
                MessageBox.Show("Não há dados de Autor");
            }
            carregaAutor();

            if (cbEditoraP.Items.Count == 0)
            {
                cbEditoraP.Enabled = false;
                MessageBox.Show("Não há dados de Editora");
            }
            carregarComboEditoraP();
        }
        private void FrmPesquisaPeri_FormClosed(object sender, FormClosedEventArgs e)
        {
            //clsControl.abreMenu(frmMenu.Self);
            cadPeriodicos cadPeriodicos = cadPeriodicos.cSelf;

            cadPeriodicos.Visible = true;
            this.Dispose();
        }
 private void dgvPeri_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (dgvPeri.Rows.Count > 0)
     {
         string        valid        = Convert.ToString(dgvPeri.CurrentRow.Cells[0].Value);
         cadPeriodicos novocadastro = new cadPeriodicos(valid);
         novocadastro.txtPeriodico.Text     = Convert.ToString(dgvPeri.CurrentRow.Cells[1].Value);
         novocadastro.txtMaterial.Text      = Convert.ToString(dgvPeri.CurrentRow.Cells[3].Value);
         novocadastro.cbAutorP.Text         = Convert.ToString(dgvPeri.CurrentRow.Cells[2].Value);
         novocadastro.cbEditoraP.Text       = Convert.ToString(dgvPeri.CurrentRow.Cells[4].Value);
         novocadastro.cbAssinatura.Text     = Convert.ToString(dgvPeri.CurrentRow.Cells[5].Value);
         novocadastro.chkEmprestimo.Checked = Convert.ToBoolean(dgvPeri.CurrentRow.Cells[6].Value);
         this.Dispose();
     }
     else
     {
         MessageBox.Show("Nenhum dado cadastrado!");
     }
 }
        public void btnVoltar_Click(object sender, EventArgs e, string text)
        {
            if (Box1.Text == "livro")
            {
                cadLivro cadTipo = cadLivro.cadSelf;
                cadLivro.cadSelf.carregarComboCategoria();
                cadLivro.cadSelf.carregarComboEditora();
                cadLivro.cadSelf.carregarComboGenero();
                cadLivro.cadSelf.carregaAutor();
                cadLivro.cadSelf.carregarColecao();
                cadTipo.Visible = true;
                this.Dispose();
            }

            else if (Box1.Text == "periodicos")
            {
                cadPeriodicos cadTipo = cadPeriodicos.cSelf;
                cadPeriodicos.cSelf.carregaAutor();
                cadPeriodicos.cSelf.carregarComboEditoraP();
                cadTipo.Visible = true;
                this.Dispose();
            }
            foreach (Control ctr in cadLivro.cadSelf.Controls)
            {
                if (ctr is GroupBox)
                {
                    foreach (Control ct2 in ctr.Controls)
                    {
                        if (ct2 is ComboBox)
                        {
                            if (((ComboBox)ct2).Items.Count < 1)
                            {
                                ct2.Enabled = false;
                            }
                            else
                            {
                                ct2.Enabled = true;
                            }
                        }
                    }
                }
            }
        }
Exemple #5
0
 private void btnPeriodicos_Click(object sender, EventArgs e)
 {
     this.Visible = false;
     cadPeriodicos novoPeriodico = new cadPeriodicos(null);
 }