Ejemplo n.º 1
0
        private void btnAlterar_Click(object sender, EventArgs e)
        {
            try
            {
                tb_autor autor = new tb_autor();

                autor.id_autor         = Convert.ToInt32(lblid.Text);
                autor.nm_autor         = txtAutor.Text.Trim();
                autor.nm_nomeCompleto  = txtNomeCompleto.Text.Trim();
                autor.ds_nacionalidade = txtNascionalidade.Text.Trim();

                AutorBusiness business = new AutorBusiness();
                business.AlterarAutor(autor, autor.id_autor);

                MessageBox.Show("Autor alterado com sucesso!", "Biblioteca",
                                MessageBoxButtons.OK, MessageBoxIcon.Information);

                frmConsultar frm = new frmConsultar();
                ((frmPrincipal)this.ParentForm).CarregarPanel(frm);
            }
            catch (ArgumentException ex)
            {
                MessageBox.Show(ex.Message, "Biblioteca",
                                MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
            catch (Exception ex)
            {
                MessageBox.Show($"Ocorreu um erro não identificado: {ex.Message}", "Biblioteca",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
        private void btnAutores_Click(object sender, EventArgs e)
        {
            Modulos.Autor.frmConsultar frm = new Modulos.Autor.frmConsultar();
            CarregarPanel(frm);

            telaSel = 4;

            //Mudar posição do Panel esquerdo
            pnBtnSel.Location = new Point(0, btnAutores.Location.Y);
        }
Ejemplo n.º 3
0
        private void pictureBox2_Click(object sender, EventArgs e)
        {
            frmConsultar frm = new frmConsultar();

            ((frmPrincipal)this.ParentForm).CarregarPanel(frm);
        }