/**
 * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * Component of: Red Hat Application Server
 * 
 * Initial Developers: Aizaz Ahmed
 *                     Vivek Lakshmanan
 *                     Andrew Overholt
 *                     Matthew Wringe
 *
 */
package olstore.dto;
//import olstore.entity.ItemLocal;
import olstore.entity.OrderLocal;
//import olstore.util.WebUtils;

import java.math.BigDecimal;

public class OrderEntry {
    private Integer orderId;
    private String userName;
    private String itemName;
    private Integer itemId;
    private Integer itemQuantity;
    private BigDecimal orderCost;
    private String orderStatus;
    
    public OrderEntry(){
        orderId = null;
        userName = null;
        itemName = null;
        itemQuantity = null;
        orderCost = null;
        orderStatus = null;
        itemId = null;
    }
    
    public OrderEntry(OrderLocal order){
        orderId  = order.getOrderId();
        userName = order.getUser().getUsername();
        itemName = order.getItem().getName();
        itemQuantity = order.getQuantity();
        orderCost = order.getPricePaid();
        orderStatus = order.getStatus();
        itemId = order.getItem().getItemId();
    }
    
    public String toString(){
        return ("orderId="+ orderId + "\tuserName=" + userName + "\titemName=" + itemName + "\titemQuantity=" 
                + itemQuantity + "\torderCost=" + orderCost + "\torderStatus=" + orderStatus);
    }
    
    public Integer getOrderId(){
        return orderId ;
    }
    
    public void setOrderId(Integer orderId){
        this.orderId = orderId;
    }
    
    public String getUserName () {
        return userName ;
    }
    
    public String getItemName () {
        return itemName ;
    }
    
    public Integer getItemQuantity () {
        return itemQuantity;
    }
    
    public BigDecimal getOrderCost () {
        return orderCost;
    }
    
    public String getOrderStatus () {
        return orderStatus;
    }
    
    public void setOrderStatus ( String status) {
        orderStatus = status;
    }
    
    public Integer getItemId(){
        return itemId;
    }
    
    public void setItemId(Integer itemId){
        this.itemId = itemId;
        
    }
    
}
