forked from Izaiah-M/CakeShop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSales.java
81 lines (56 loc) · 1.63 KB
/
Sales.java
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package CakeShop;
//TODO make sales take in a cake object and set its attributes from there
public class Sales {
private int Sales_database_Id;
private int Cake_Id;
private String CakeDescription;
private String dateOfPurchased;
private int cost;
public Sales() {
}
public Sales(Cakes cake) {
this.setCake_Id(cake.getId());
this.setCakeDescription(cake.salesInfo());
this.setDateOfPurchased(cake.getDateMade()); //this is not the correct date, find a way to get the correct current date of when the sale is made
this.setCost(cake.getCost());
}
public int getCake_Id() {
return Cake_Id;
}
public void setCake_Id(int cake_Id) {
Cake_Id = cake_Id;
}
public int getSales_database_Id() {
return Sales_database_Id;
}
public void setSales_database_Id(int salesId) {
Sales_database_Id = salesId;
}
public String getCakeDescription() {
return CakeDescription;
}
public void setCakeDescription(String cakeDescription) {
CakeDescription = cakeDescription;
}
public String getDateOfPurchased() {
return dateOfPurchased;
}
public void setDateOfPurchased(String dateOfPurchased) {
this.dateOfPurchased = dateOfPurchased;
}
public int getCost() {
return cost;
}
public void setCost(int cost) {
this.cost = cost;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("***********************************\n");
sb.append("Sales ID: " + getSales_database_Id());
sb.append("Cake Description: "+ getCakeDescription());
sb.append("Cake Cost: " + getCost());
sb.append("***********************************\n");
return CakeDescription;
}
}