private void btnCancelBooking_Click(object sender, EventArgs e) { try { var confirmResult = MessageBox.Show("Are you sure to cancel this booking?", "Confirm booking cancel", MessageBoxButtons.YesNo); if (confirmResult == DialogResult.Yes) { DateTime ThisTime = DateTime.Now; Cancellation c = new Cancellation() { CancelTime = ThisTime, BookingID = txtBookingId.Text }; bool rs1 = ManagerDAL.AddNewCancel(c); //add room_cancel & update payment cancelled + paytime bool rs2 = ManagerDAL.AddNewRoomCancel(CurrentRoom.RoomNumber); bool rs3 = ManagerDAL.UpdatePayment(txtBookingId.Text, ThisTime, true); if (rs1 && rs2 && rs3) { ManagerDAL.UpdateRoomStatus(CurrentRoom.RoomNumber, "Available"); ManagerDAL.AddNewLog(new Log() { StaffID = StaffID, ActionTime = DateTime.Now, Main = "Cancel Booking Id: " + txtBookingId.Text }); MessageBox.Show("Cancel process successful!"); GoBackToMain(); } else { MessageBox.Show("Cancel process failed!"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }