private void btn_deleteauthor_Click(object sender, EventArgs e) //Button delete author { int i = grid_results_adm.CurrentRow.Index; int id = (int)grid_results_adm["AuthorID", i].Value; BibliotechDAL bd = new BibliotechDAL(); int s = bd.AuthorNbrOfBooks(id); if (s == 0) { bd.DeleteAuthor(id); FillViewAuthors(); } else { MessageBox.Show("Går ej att radera, författaren har böcker i biblioteket"); } }