Package com.titan.travelagent

Source Code of com.titan.travelagent.TicketDO

package com.titan.travelagent;

import com.titan.cruise.CruiseLocal;
import com.titan.cabin.CabinLocal;
import com.titan.customer.CustomerRemote;
import com.titan.customer.Name;

import java.rmi.RemoteException;

public class TicketDO implements java.io.Serializable {

  public Integer customerID;
  public Integer cruiseID;
  public Integer cabinID;
  public double price;
  public String description;
 
  public TicketDO(CustomerRemote customer,
          CruiseLocal cruise, CabinLocal cabin,
          double amount)
  throws javax.ejb.FinderException, java.rmi.RemoteException, 
       javax.naming.NamingException {
   
    Name custname = customer.getName();
        System.out.println("Got customer Name");

    description = custname.getFirstName()+
       " " + custname.getLastName() +
       " has been booked for the "
       + cruise.getName() +
       " cruise on ship " +
       cruise.getShip().getName() + ".\n"
       " Your accommodations include " +
       cabin.getName() +
       " a " + cabin.getBedCount() +
       " bed cabin on deck level " + cabin.getDeckLevel() +
       ".\n Total charge = " + amount;
        System.out.println("Finished the description of the Ticket");
    customerID = (Integer)customer.getPrimaryKey();
    cruiseID = (Integer)cruise.getPrimaryKey();
    cabinID = (Integer)cabin.getPrimaryKey();
    price = amount;
  }
   
  public String toString() {
    return description;
  }
}
TOP

Related Classes of com.titan.travelagent.TicketDO

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.