private void cadLivro_FormClosed(object sender, FormClosedEventArgs e)
        {
            cadLivro cadLivro = cadLivro.cadSelf;

            cadLivro.Visible = true;
            this.Dispose();
        }
 private void dgvPesquisaLiv_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (dgvPesquisaLiv.Rows.Count < 1)
     {
         MessageBox.Show("Não há cadastro de livros aqui!");
     }
     //L.ID_LIVRO[Código], L.TITULO[Titulo], L.ISBN, L.CDU, L.REFERENCIA[Referencia], A.NOME_AUTOR[Autor],
     //A.PHA, E.NOME_EDITORA[Editora], C.NOME_CATEGORIA[Categoria], G.NOME[Gênero], CO.NOME_COLECAO[Coleção],
     //L.VOLUME[Volume], L.N_PAGINAS[N° páginas], L.N_EXEMPLARES[N° exemplares]
     else
     {
         string   valid     = Convert.ToString(dgvPesquisaLiv.CurrentRow.Cells[0].Value);
         cadLivro livroNovo = new cadLivro(valid);
         livroNovo.txtTitulo.Text        = Convert.ToString(dgvPesquisaLiv.CurrentRow.Cells[1].Value);
         livroNovo.txtISBN.Text          = Convert.ToString(dgvPesquisaLiv.CurrentRow.Cells[2].Value);
         livroNovo.txtCDU.Text           = Convert.ToString(dgvPesquisaLiv.CurrentRow.Cells[3].Value);
         livroNovo.chkReferencia.Checked = Convert.ToBoolean(dgvPesquisaLiv.CurrentRow.Cells[4].Value);
         livroNovo.cbAutor.Text          = Convert.ToString(dgvPesquisaLiv.CurrentRow.Cells[5].Value);
         livroNovo.txtpha.Text           = Convert.ToString(dgvPesquisaLiv.CurrentRow.Cells[6]);
         livroNovo.cbEditora.Text        = Convert.ToString(dgvPesquisaLiv.CurrentRow.Cells[7].Value);
         livroNovo.cbCategoria.Text      = Convert.ToString(dgvPesquisaLiv.CurrentRow.Cells[8].Value);
         livroNovo.cbGenero.Text         = Convert.ToString(dgvPesquisaLiv.CurrentRow.Cells[9].Value);
         livroNovo.cbColecao.Text        = Convert.ToString(dgvPesquisaLiv.CurrentRow.Cells[10].Value);
         livroNovo.txtVolume.Text        = Convert.ToString(dgvPesquisaLiv.CurrentRow.Cells[11].Value);
         livroNovo.txtPaginas.Text       = Convert.ToString(dgvPesquisaLiv.CurrentRow.Cells[12].Value);
         livroNovo.txtExemplares.Text    = Convert.ToString(dgvPesquisaLiv.CurrentRow.Cells[13].Value);
         this.Visible = false;
         this.Dispose();
     }
 }
Example #3
0
        public cadLivro(string valid)
        {
            InitializeComponent();
            this.Visible = true;
            cadSelf      = this;

            if (valid != null)
            {
                gpbInfoLivro.Enabled = true;
                btnEditL.Enabled     = true;
                btnExcluir.Enabled   = true;
                POGlivro.Text        = valid;
            }
            carregarComboEditora();
            if (cbEditora.Items.Count == 0)
            {
                cbEditora.Enabled = false;
                MessageBox.Show("Não há dados de editora!");
            }
            carregarComboCategoria();
            if (cbCategoria.Items.Count == 0)
            {
                cbCategoria.Enabled = false;
                MessageBox.Show("Não há dados de categoria!");
            }
            carregarComboGenero();
            if (cbGenero.Items.Count == 0)
            {
                cbGenero.Enabled = false;
                MessageBox.Show("Não há dados de coleção!");
            }
            carregaAutor();
            if (cbAutor.Items.Count == 0)
            {
                cbAutor.Enabled = false;
                MessageBox.Show("Não há dados de autor!");
            }
            carregarColecao();
            if (cbColecao.Items.Count == 0)
            {
                cbColecao.Enabled = false;
                MessageBox.Show("Não há dados de coleção!");
            }
        }
Example #4
0
        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;
                            }
                        }
                    }
                }
            }
        }
Example #5
0
 private void btnLivro_Click(object sender, EventArgs e)
 {
     this.Visible = false;
     cadLivro novoLivro = new cadLivro(null);
 }