// Delete the selected student.
        private void Button_Delete_Click(object sender, EventArgs e)
        {
            IssueBook issueBook = new IssueBook();

            if (MessageBox.Show("Are you sure, you want to delete the student?",
                                "Delete Student",
                                MessageBoxButtons.OKCancel,
                                MessageBoxIcon.Warning) == DialogResult.OK)
            {
                if (!issueBook.HasStudentIssuedBooks(this.currentStudentNo, out string errorMessage))
                {
                    if (issueBook.DeleteStudentRecordsFromIssueReturnBook(this.currentStudentNo, out errorMessage))
                    {
                        if (this.student.DeleteStudent(this.currentStudentNo, out errorMessage))
                        {
                            MessageBox.Show(errorMessage,
                                            "Delete Student",
                                            MessageBoxButtons.OK,
                                            MessageBoxIcon.Information);
                            FillDataGridView();
                        }
                        else
                        {
                            MessageBox.Show(errorMessage,
                                            "Delete Student",
                                            MessageBoxButtons.OK,
                                            MessageBoxIcon.Error);
                        }
                    }
                    else
                    {
                        MessageBox.Show(errorMessage,
                                        "Delete Student",
                                        MessageBoxButtons.OK,
                                        MessageBoxIcon.Error);
                    }
                }
                else
                {
                    MessageBox.Show(errorMessage,
                                    "Delete Student",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);
                }
            }
        }