private void buttonDeleteAuthor_Click(object sender, EventArgs e)
 {
     if (IsValidAuthorData())
     {
         DialogResult ans = MessageBox.Show("Do you really want to delete this Author?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
         if (ans == DialogResult.Yes)
         {
             AuthorDA.Delete(Convert.ToInt32(textBoxAuthorID.Text));
             MessageBox.Show("Author record has been deleted successfully", "Confirmation");
             ClearAll();
             textBoxAuthorID.Enabled = true;
         }
     }
 }
Esempio n. 2
0
        //Delete
        private void buttonAutDel_Click(object sender, EventArgs e)
        {
            DialogResult ans = MessageBox.Show("Are you sure you want to delete the Author information?", "Delete Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Information);

            if (ans == DialogResult.Yes)
            {
                if (BookDA.SearchAuthor(Convert.ToInt32(textBoxAutID.Text)) != null)
                {
                    MessageBox.Show("This author has one or more books registered in the inventory, please be sure that there are no books by this author before deleting it!", "ALERT!");
                    return;
                }
                AuthorDA.Delete(Convert.ToInt32(textBoxAutID.Text));
                AuthorDA.ListAuthors(listViewAuthor);
                UpdateComboBoxes();
            }
        }
Esempio n. 3
0
 private void buttonDeleteAuthor_Click(object sender, EventArgs e)
 {
     AuthorDA.Delete(Convert.ToInt32(textBoxAuthorId.Text));
     MessageBox.Show("Author has been deleted successfully from the database", "Confirmation");
 }
Esempio n. 4
0
 private void buttonDeleteauthor_Click(object sender, EventArgs e)
 {
     AuthorDA.Delete(Convert.ToInt32(textBoxAuthorID.Text));
     MessageBox.Show(" Author record has been deleted successfully", "Confirmation");
     ClearAll3();
 }
Esempio n. 5
0
 public void Delete(int id)
 {
     authorDA.Delete(id);
 }
Esempio n. 6
0
 private void btn_Delete_Click(object sender, EventArgs e)
 {
     AuthorDA.Delete(Convert.ToInt32(txt_input.Text));
     MessageBox.Show("Student data has beeen deleted", "DONE");
 }