private void saveButton_Click(object sender, EventArgs e) { Student aStudent = new Student(); string regNo = regNoTextBox.Text; aStudent = studentManager.SearchStudent(regNo); string message = ""; if (aStudent != null) { foreach (Book aBook in books) { bookManager.UpdateBook(aBook.Id, aBook.OutsideCopy, 1); } string dateTime = dtpIssueDate.Text; message = issueManager.GetBook(books, DateTime.ParseExact(dateTime, "dd-MM-yyyy hh:mm:ss", CultureInfo.InvariantCulture), aStudent); ClearAll(); MessageBox.Show(message); } }