private void btnAgregarAutor_Click(object sender, EventArgs e)
        {
            if (btnAgregarAutor.Text == "Agregar")
            {
                using (contexto db = new contexto())
                {
                    AUTOR nuevoAutor = new AUTOR();
                    nuevoAutor.nombreAutor    = txtAutor.Text;
                    nuevoAutor.idNacionalidad = (int)cmbNacionalidad.SelectedValue;

                    db.AUTORs.Add(nuevoAutor);
                    db.SaveChanges();
                    cargarTablaAutores();
                }
            }
            else
            {
                if (idAutor != 0)
                {
                    using (contexto db = new contexto())
                    {
                        AUTOR autorMod = db.AUTORs.Find(idAutor);
                        autorMod.nombreAutor    = txtAutor.Text;
                        autorMod.idNacionalidad = (int)cmbNacionalidad.SelectedValue;

                        db.Entry(autorMod).State = System.Data.Entity.EntityState.Modified;
                        db.SaveChanges();

                        cargarTablaAutores();
                    }
                }
            }
        }
        private void btnEliminarAutor_Click(object sender, EventArgs e)
        {
            if (idAutor != 0)
            {
                using (contexto db = new contexto())
                {
                    AUTOR autorDel = db.AUTORs.Find(idAutor);

                    db.AUTORs.Remove(autorDel);
                    db.SaveChanges();

                    cargarTablaAutores();
                }
            }
        }