private void btnCancel_Click(object sender, EventArgs e) {// Check if the booking had been cancelled before if (lblStatus.Text == "Cancelled") { MessageBox.Show("The booking had already cancelled before", "Cancellation Booking", MessageBoxButtons.OK, MessageBoxIcon.Error); } else { // Cancel the booking and update the booking's status after checking the policy DBConnect Cance = new DBConnect(); bool success = Cance.CancelBooking(txtBookingNo.Text); if (success == true) { MessageBox.Show("The booking is being cancelled successfully", "Successful Cancellation", MessageBoxButtons.OK, MessageBoxIcon.Information); FieldsValues(txtBookingNo.Text); } else { MessageBox.Show("Cancellation is faild because it doesn't match the cancellation policy", "Faild Cancellation", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }