|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.websphere.samples.pbw.ejb.ShoppingCartBean
@Named @SessionScoped public class ShoppingCartBean
ShopingCartBean provides a transactional facade for order collection and processing.
Constructor Summary | |
---|---|
ShoppingCartBean()
|
Method Summary | |
---|---|
void |
addItem(Inventory new_item)
Add an item to the cart. |
void |
checkInventory(Inventory si)
Method checkInventory. |
Order |
createOrder(String customerID,
String billName,
String billAddr1,
String billAddr2,
String billCity,
String billState,
String billZip,
String billPhone,
String shipName,
String shipAddr1,
String shipAddr2,
String shipCity,
String shipState,
String shipZip,
String shipPhone,
String creditCard,
String ccNum,
String ccExpireMonth,
String ccExpireYear,
String cardHolder,
int shippingMethod,
Collection<Inventory> items)
Create an order with contents of a shopping cart. |
ArrayList<Inventory> |
getItems()
Get the items in the shopping cart. |
int |
getSize()
|
float |
getSubtotalCost()
Get the cost of all items in the shopping cart. |
void |
removeAllItems()
Remove all items from the cart. |
void |
removeItem(Inventory item)
Remove an item from the cart. |
void |
removeZeroQuantityItems()
Remove zero quantity items. |
void |
setItems(Collection<Inventory> items)
Set the items in the shopping cart. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShoppingCartBean()
Method Detail |
---|
public void addItem(Inventory new_item)
new_item
- Item to add to the cart.public void removeItem(Inventory item)
item
- Item to remove from cart.public void removeAllItems()
public void removeZeroQuantityItems()
public ArrayList<Inventory> getItems()
public void setItems(Collection<Inventory> items)
items
- A Vector of ShoppingCartItem's.public float getSubtotalCost()
public void checkInventory(Inventory si)
si
- - Store itempublic Order createOrder(String customerID, String billName, String billAddr1, String billAddr2, String billCity, String billState, String billZip, String billPhone, String shipName, String shipAddr1, String shipAddr2, String shipCity, String shipState, String shipZip, String shipPhone, String creditCard, String ccNum, String ccExpireMonth, String ccExpireYear, String cardHolder, int shippingMethod, Collection<Inventory> items)
customerID
- customer's IDbillName
- billing namebillAddr1
- billing address line 1billAddr2
- billing address line 2billCity
- billing address citybillState
- billing address statebillZip
- billing address zip codebillPhone
- billing phoneshipName
- shippng nameshipAddr1
- shippng address line 1shipAddr2
- shippng address line 2shipCity
- shippng address cityshipState
- shippng address stateshipZip
- shippng address zip codeshipPhone
- shippng phonecreditCard
- credit cardccNum
- credit card numberccExpireMonth
- credit card expiration monthccExpireYear
- credit card expiration yearcardHolder
- credit card holder nameshippingMethod
- int of shipping method useditems
- vector of StoreItems ordered
public int getSize()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |