public void Confirm(string tripID, string bookingID) { try { DataControlBaseDataAccess.StartTransaction(); BookingDetailController controller = new BookingDetailController(); BookingDetailInfo info = controller.SelectBookingDetail(tripID, 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, "S"); } string autoCode = SaleDataAccess.AutogenerateCode("Sale"); BookingDataAccess.Confirm(bookingID, autoCode); } catch (Exception ex) { DataControlBaseDataAccess.RollBackTransaction(); throw ex; } }
public SaleInfo AutogenerateCode(string code) { SaleInfo saleInfo = new SaleInfo(); saleInfo.AutoCode = SaleDataAccess.AutogenerateCode(code); return(saleInfo); }