1 package org.apache.ojb.broker; 2 3 public class ArticleWithStockDetail implements java.io.Serializable 4 { 5 6 7 public String toString() 8 { 9 return "----\n" + 10 "Article No: " + articleId + "\n" + 11 "Description: " + articleName + "\n" + 12 "stock: " + stock + "\n" + 13 "price: " + price + "\n" + 14 "stock-value " + getStockValue() + "\n"; 15 16 } 17 18 19 protected int articleId; 20 21 protected String articleName; 22 23 boolean isSelloutArticle; 24 25 int minimumStock; 26 27 int orderedUnits; 28 29 30 protected StockDetail stockDetail; 31 32 33 34 protected double price; 35 36 protected int productGroupId; 37 38 int stock; 39 40 protected int supplierId; 41 42 String unit; 43 44 45 public void addToStock(int diff) 46 { 47 stock += diff; 48 } 49 50 54 public int getArticleId() 55 { 56 return articleId; 57 } 58 59 63 public String getArticleName() 64 { 65 return articleName; 66 } 67 68 69 70 public double getStockValue() 71 { 72 return price * stockDetail.getStock(); 73 } 74 75 79 public void setArticleId(int newArticleId) 80 { 81 articleId = newArticleId; 82 } 83 84 88 public void setArticleName(String newArticleName) 89 { 90 articleName = newArticleName; 91 } 92 93 97 public ArticleWithStockDetail() 98 { 99 } 100 101 105 public ArticleWithStockDetail( 106 int artId, 107 String artName, 108 int suppId, 109 int pgId, 110 String uni, 111 double pric, 112 int sto, 113 int ordUnits, 114 int minStock, 115 boolean isSellout) 116 { 117 articleId = artId; 118 articleName = artName; 119 supplierId = suppId; 120 productGroupId = pgId; 121 unit = uni; 122 price = pric; 123 stock = sto; 124 orderedUnits = ordUnits; 125 minimumStock = minStock; 126 isSelloutArticle = isSellout; 127 } 128 129 134 public boolean getIsSelloutArticle() 135 { 136 return isSelloutArticle; 137 } 138 139 144 public int getMinimumStock() 145 { 146 return minimumStock; 147 } 148 149 154 public int getOrderedUnits() 155 { 156 return orderedUnits; 157 } 158 159 164 public double getPrice() 165 { 166 return price; 167 } 168 169 170 175 public int getProductGroupId() 176 { 177 return productGroupId; 178 } 179 180 181 186 public int getSupplierId() 187 { 188 return supplierId; 189 } 190 191 196 public String getUnit() 197 { 198 return unit; 199 } 200 201 206 public void setIsSelloutArticle(boolean newIsSelloutArticle) 207 { 208 isSelloutArticle = newIsSelloutArticle; 209 } 210 211 216 public void setMinimumStock(int newMinimumStock) 217 { 218 minimumStock = newMinimumStock; 219 } 220 221 226 public void setOrderedUnits(int newOrderedUnits) 227 { 228 orderedUnits = newOrderedUnits; 229 } 230 231 236 public void setPrice(double newPrice) 237 { 238 price = newPrice; 239 } 240 241 242 247 public void setProductGroupId(int newProductGroupId) 248 { 249 productGroupId = newProductGroupId; 250 } 251 252 253 258 public void setSupplierId(int newSupplierId) 259 { 260 supplierId = newSupplierId; 261 } 262 263 268 public void setUnit(String newUnit) 269 { 270 unit = newUnit; 271 } 272 273 public StockDetail getDetail() 274 { 275 return stockDetail; 276 } 277 281 public int getStock() 282 { 283 return stock; 284 } 285 286 290 public void setStock(int stock) 291 { 292 this.stock = stock; 293 } 294 295 } 296 | Popular Tags |