package UI;

import java.math.BigDecimal;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.Statement;
import java.sql.SQLException;
import java.sql.Time;
import java.sql.Timestamp;
import javax.sql.DataSource;
import org.postgresql.ds.PGSimpleDataSource;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import RDG.*;
/**
 *
 * @author Marcel
 */
public class TicketCancel {
    /**
    * Print Menu for ticket cancel
    * @throws SQLException
    */
    static public void Menu() throws SQLException{
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        try{
            System.out.println("Na ktorý let?");
            int flight_id = Integer.valueOf(input.readLine());
            BoughtTickets.print(flight_id);
            Integer id = Integer.valueOf(input.readLine());
            if(TS.TicketCancelTS.transactionTicketCancel(id))
                System.out.println("Lístok úspešne stornovaný");
            else
                System.out.println("Nepodarilo sa");
        }catch(Exception e){
            System.out.println(e);
        }
    }
}
