Repository navigation
Expand file tree
/
Copy pathOrder.java
More file actions
53 lines (41 loc) · 1.37 KB
/
Copy pathOrder.java
File metadata and controls
53 lines (41 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package ECommerceApplication;
public class Order {
private User orderingUser;
private Product orderedProduct;
private CreditCard creditCard;
private int purchasedQuantity;
public Order(User orderingUser, Product orderedProduct, CreditCard creditCard, int purchasedQuantity) {
this.orderingUser = orderingUser;
this.orderedProduct = orderedProduct;
this.creditCard = creditCard;
this.purchasedQuantity = purchasedQuantity;
}
public void processOrder() {
orderedProduct.StockControl(purchasedQuantity);
orderingUser.orderProduct(orderedProduct, purchasedQuantity);
}
public User getOrderingUser() {
return orderingUser;
}
public void setOrderingUser(User orderingUser) {
this.orderingUser = orderingUser;
}
public Product getOrderedProduct() {
return orderedProduct;
}
public void setOrderedProduct(Product orderedProduct) {
this.orderedProduct = orderedProduct;
}
public CreditCard getCreditCard() {
return creditCard;
}
public void setCreditCard(CreditCard creditCard) {
this.creditCard = creditCard;
}
public int getPurchasedQuantity() {
return purchasedQuantity;
}
public void setPurchasedQuantity(int purchasedQuantity) {
this.purchasedQuantity = purchasedQuantity;
}
}