Beispiel #1
0
        private void btnReturn_Click(object sender, EventArgs e)
        {
            LibraryDB returnBookDB = new LibraryDB();

            returnBookDB.returnBook(Int32.Parse(txtISBN.Text), Int32.Parse(txtStudentID.Text), Int32.Parse(borrowerNum), dtpActualDate.Text);

            //Tells the user they successfully issued the book
            MessageBox.Show("Book has successfully been returned.", "Successful Return", MessageBoxButtons.OK, MessageBoxIcon.Information);

            //Goes through all the open forms and finds dashboard to show it again
            for (int i = 0; i < Application.OpenForms.Count; i++)
            {
                //Open the dashboard form
                if (Application.OpenForms[i].Name == "frmDashboard")
                {
                    Application.OpenForms[i].Show();
                }

                //Close the Issue book form
                if (Application.OpenForms[i].Name == "frmIssueReturn")
                {
                    Application.OpenForms[i].Close();
                }
            }

            //Close
            this.Close();
        }