uni

University stuff
git clone git://git.margiolis.net/uni.git
Log | Files | Refs | README | LICENSE

Ticket.java (761B)


      1 public class Ticket {
      2     public String TicketID;
      3 
      4     public ClientInfo Holder;
      5 
      6     public int SeatID;
      7 
      8     public String FlightID;
      9 
     10     public Ticket(ClientInfo Holder_, String FlightID_, int SeatID_, String TicketID_) {
     11 		Holder = Holder_;
     12 		FlightID = FlightID_;
     13 		SeatID = SeatID_;
     14 		TicketID = TicketID_;
     15     }
     16 	
     17 	public String toString()
     18 	{
     19 		String s = "Ticket info:\n";
     20 		s += "Seat ID : " + Integer.toString(SeatID) + "\n";
     21 		s += "Flight ID : " + FlightID + "\n";
     22 		s += "Holder info : \n" + Holder.toString();
     23 
     24 		return s;
     25 	}
     26 
     27 	public String toDataString()
     28 	{
     29 		return FlightID + "-" + SeatID + "-" + TicketID
     30 				+ "-" + Holder.FullName + "-" + Holder.Phone
     31 				+ "-" + Holder.BirthDate + "-" + Holder.CreditCard
     32 				+ "-" + Holder.Address;
     33 	}
     34 
     35 }