001: /**
002: * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2.1 of the License, or any later version.
008: *
009: * This library is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
017: * USA
018: *
019: * Component of: Red Hat Application Server
020: *
021: * Initial Developers: Aizaz Ahmed
022: * Vivek Lakshmanan
023: * Andrew Overholt
024: * Matthew Wringe
025: *
026: */package olstore.dto;
027:
028: //import olstore.entity.ItemLocal;
029: import olstore.entity.OrderLocal; //import olstore.util.WebUtils;
030:
031: import java.math.BigDecimal;
032:
033: public class OrderEntry {
034: private Integer orderId;
035: private String userName;
036: private String itemName;
037: private Integer itemId;
038: private Integer itemQuantity;
039: private BigDecimal orderCost;
040: private String orderStatus;
041:
042: public OrderEntry() {
043: orderId = null;
044: userName = null;
045: itemName = null;
046: itemQuantity = null;
047: orderCost = null;
048: orderStatus = null;
049: itemId = null;
050: }
051:
052: public OrderEntry(OrderLocal order) {
053: orderId = order.getOrderId();
054: userName = order.getUser().getUsername();
055: itemName = order.getItem().getName();
056: itemQuantity = order.getQuantity();
057: orderCost = order.getPricePaid();
058: orderStatus = order.getStatus();
059: itemId = order.getItem().getItemId();
060: }
061:
062: public String toString() {
063: return ("orderId=" + orderId + "\tuserName=" + userName
064: + "\titemName=" + itemName + "\titemQuantity="
065: + itemQuantity + "\torderCost=" + orderCost
066: + "\torderStatus=" + orderStatus);
067: }
068:
069: public Integer getOrderId() {
070: return orderId;
071: }
072:
073: public void setOrderId(Integer orderId) {
074: this .orderId = orderId;
075: }
076:
077: public String getUserName() {
078: return userName;
079: }
080:
081: public String getItemName() {
082: return itemName;
083: }
084:
085: public Integer getItemQuantity() {
086: return itemQuantity;
087: }
088:
089: public BigDecimal getOrderCost() {
090: return orderCost;
091: }
092:
093: public String getOrderStatus() {
094: return orderStatus;
095: }
096:
097: public void setOrderStatus(String status) {
098: orderStatus = status;
099: }
100:
101: public Integer getItemId() {
102: return itemId;
103: }
104:
105: public void setItemId(Integer itemId) {
106: this.itemId = itemId;
107:
108: }
109:
110: }
|