public void CancelBooking(string routeName, DateTime date, string time) { try { DataControlBaseDataAccess.StartTransaction(); string tripID = TripDataAccess.SelectInfoByTripID(routeName, date, time); BookingDetailController controller = new BookingDetailController(); BookingDetailCollection bookingDetailCollection = controller.BookingDetailSeatNo(tripID); BookingDetailDataAccess.BookingDetailBookingID(tripID); foreach (BookingDetailInfo info in bookingDetailCollection) { BookingDataAccess.BookingDelete(info.BookingID); string seat = info.SeatNo; string[] array = seat.Split(','); seatNo = ""; for (int i = 0; i < array.Length; i++) { seatNo = array[i]; TripDetailDataAccess.UpdateStatusByTripID(tripID, seatNo, "A"); } } DataControlBaseDataAccess.CommitTransaction(); } catch (Exception ex) { DataControlBaseDataAccess.RollBackTransaction(); throw ex; } }
public string BookingDetailBookingID(string tripID) { return(DataAccess.BookingDetailBookingID(tripID)); }