1 27 package olstore.form; 28 29 import java.util.ArrayList; 30 31 import olstore.dto.OrderEntry; 32 35 public class UpdateOrderStatusForm extends DemoBaseForm { 36 37 private String submitType= null; 38 private ArrayList orders = new ArrayList() ; 39 private String numOrders = "0" ; 40 41 42 50 public OrderEntry getOrderEntry (int index) { 51 if ( index >= orders.size() ) { 52 int size = orders.size(); 53 for ( int i =0; i < (index-size) + 1 ; i++ ) { 54 orders.add ( new OrderEntry() ); 55 } 56 } 57 return (OrderEntry) orders.get ( index ); 58 } 59 60 public void setOrderEntry ( int index, OrderEntry order ) { 61 orders.set ( index, order ); 62 } 63 64 public void reset(){ 65 orders.clear() ; 66 submitType=null ; 67 numOrders = "0" ; 68 } 69 70 public String getSubmitType(){ 71 return submitType; 72 73 } 74 75 public void setSubmitType(String submitType){ 76 this.submitType = submitType; 77 78 } 79 80 public String getNumOrders(){ 81 if(orders.size()==0){ 82 return numOrders; 83 }else{ 84 numOrders = Integer.toString(orders.size()); 85 return numOrders; 86 } 87 88 89 } 90 91 92 public void setNumOrders(String numOrders){ 93 this.numOrders = numOrders ; 94 } 95 96 99 public ArrayList getOrders( ) { 100 return orders; 103 } 104 105 public void setOrders ( ArrayList orders ) { 106 this.orders = orders; 107 } 108 109 110 } 111 | Popular Tags |