public int book(int id, int flight_no, int paymentStatus) { flightAvailability ob = new flightAvailability(); int value = ob.available(flight_no); if (value == 0) { return(-1); } else { if (paymentStatus == (int)payStatus.paid && value > 0) { return(value); } else if (paymentStatus != (int)payStatus.cancelled && value > 0) { return(-2); } else { return(0); } } }
public String cancel(int id) { Models.userBooking ob = new Models.userBooking(); flightAvailability ob1 = new flightAvailability(); if (ob.bookingStatus == "Confirmed") { int flight_no = ob.Flight_no; return("Confirmed"); } else if (ob.bookingStatus == "Pending") { return("Pending"); } else if (ob.bookingStatus == "Cancelled") { return("Cancelled"); } else { return("Invalid"); } }