private void button12_Click(object sender, EventArgs e) { String publisherID = txtPublisherID.Text; if (publisherID.Length == 0) { MessageBox.Show("Pls input publisherID first!!"); } else { if (!checkDupplicatePublisher(publisherID)) { if (MessageBox.Show("Are you sure? Delete?", "Delete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { if (publisherdao.delete(publisherID)) { MessageBox.Show("Delete Success!!"); txtPublisherID.Text = ""; txtPublisherName.Text = ""; txtPublisherPhone.Text = ""; txtPublisherEmail.Text = ""; txtPublisherAddress.Text = ""; LoadPublisher(); } else { MessageBox.Show("Can not Delete!!"); } } } else { MessageBox.Show("This Publisher is not exist!!"); } } }