1 27 package olstore.dto; 28 import olstore.entity.OrderLocal; 30 32 import java.math.BigDecimal; 33 34 public class OrderEntry { 35 private Integer orderId; 36 private String userName; 37 private String itemName; 38 private Integer itemId; 39 private Integer itemQuantity; 40 private BigDecimal orderCost; 41 private String orderStatus; 42 43 public OrderEntry(){ 44 orderId = null; 45 userName = null; 46 itemName = null; 47 itemQuantity = null; 48 orderCost = null; 49 orderStatus = null; 50 itemId = null; 51 } 52 53 public OrderEntry(OrderLocal order){ 54 orderId = order.getOrderId(); 55 userName = order.getUser().getUsername(); 56 itemName = order.getItem().getName(); 57 itemQuantity = order.getQuantity(); 58 orderCost = order.getPricePaid(); 59 orderStatus = order.getStatus(); 60 itemId = order.getItem().getItemId(); 61 } 62 63 public String toString(){ 64 return ("orderId="+ orderId + "\tuserName=" + userName + "\titemName=" + itemName + "\titemQuantity=" 65 + itemQuantity + "\torderCost=" + orderCost + "\torderStatus=" + orderStatus); 66 } 67 68 public Integer getOrderId(){ 69 return orderId ; 70 } 71 72 public void setOrderId(Integer orderId){ 73 this.orderId = orderId; 74 } 75 76 public String getUserName () { 77 return userName ; 78 } 79 80 public String getItemName () { 81 return itemName ; 82 } 83 84 public Integer getItemQuantity () { 85 return itemQuantity; 86 } 87 88 public BigDecimal getOrderCost () { 89 return orderCost; 90 } 91 92 public String getOrderStatus () { 93 return orderStatus; 94 } 95 96 public void setOrderStatus ( String status) { 97 orderStatus = status; 98 } 99 100 public Integer getItemId(){ 101 return itemId; 102 } 103 104 public void setItemId(Integer itemId){ 105 this.itemId = itemId; 106 107 } 108 109 } 110 | Popular Tags |