forked from nickrgarner/WolfWR-DB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainMenu.java
244 lines (232 loc) · 8.99 KB
/
MainMenu.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
import java.util.*;
import java.sql.SQLException;
import java.text.ParseException;
/**
* This is the Main Menu that will be displayed when the application is ran. This menu will allow the user to
* navigate through the different functionalities of application.
*/
public class MainMenu {
static Scanner scan = new Scanner(System.in);
static int input = -1;
public static void initiate()
{
try {
System.out.println("Welcome to our application for WolfWR, a WolfCity wholesale store chain");
System.out.println();
//This do while loop will reprompt the Main Menu options that the application can do
do{
System.out.println("0. Exit");
System.out.println("1. Information Processing (CRUD)");
System.out.println("2. Maintain Inventory");
System.out.println("3. Maintaining Billing and Transaction Records");
System.out.println("4. Reports");
System.out.print("Please choose one of the options above: ");
input = scan.nextInt();
System.out.println();
switch(input){
case 0:
System.out.println("Exiting Application");
return;
case 1:
informationProcessMenu();
break;
case 2:
maintainInventoryMenu();
break;
case 3:
maintainBillingTransactions();
break;
case 4:
reports();
break;
default:
System.out.println("Invalid input");
break;
}
input = -1;
} while(input != 0);
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* Information processing. Enter/update/delete basic
* information about stores, customers, staff, and suppliers.
* Manage promotion or sale information for products.”
*/
public static void informationProcessMenu() throws ClassNotFoundException, ParseException, SQLException
{
do{
System.out.println("Information Processing Menu");
System.out.println("0. Go back to Main Menu:");
System.out.println("1. Store");
System.out.println("2. Staff");
System.out.println("3. Sign Up");
System.out.println("4. Member");
System.out.println("5. Supplier");
System.out.println("6. Discount");
System.out.println("7. Merchandise");
System.out.println("8. Transaction");
System.out.print("Please choose one of the options above: ");
input = scan.nextInt();
System.out.println();
switch(input){
case 0:
System.out.println("Going back to Main Menu");
return;
case 1:
Store.storeMenu();
break;
case 2:
Staff.staffMenu();
break;
case 3:
SignUp.signUpMenu();
break;
case 4:
Member.memberMenu();
break;
case 5:
Supplier.supplierMenu();
break;
case 6:
Discount.discountMenu();
break;
case 7:
Merchandise.merchandiseMenu();
break;
case 8:
Transaction.transactionMenu();
break;
default:
System.out.println("Invalid input");
break;
}
input = -1;
} while(input != 0);
}
/**
* Create inventory for newly arrived products.
* Update inventory with returns. Manage product transfers
* between stores in the chain.
*/
public static void maintainInventoryMenu() throws ClassNotFoundException, ParseException, SQLException
{
do{
System.out.println("Maintain Inventory Menu");
System.out.println("0. Go back to Main Menu:");
System.out.println("1. Newly Arrived Products");
System.out.println("2. Returns");
System.out.println("3. Product Transfer Between Stores");
System.out.print("Please choose one of the options above: ");
input = scan.nextInt();
System.out.println();
switch(input){
case 0:
System.out.println("Going back to Main Menu");
return;
case 1:
Merchandise.newInventory();
break;
case 2:
Merchandise.returnInventory();
break;
case 3:
Merchandise.transferInventory();
break;
default:
System.out.println("Invalid input");
break;
}
input = -1;
} while(input != 0);
}
/**
* Maintaining billing and transaction records. Create or generate bills
* that are to be paid to a specific supplier. Generate reward
* checks for platinum customers that are due at the end of the year.
* For each transaction, calculate the total price, check if any item is on sale or not and,
* if it is, apply discounts according to the discount information.
*/
public static void maintainBillingTransactions() throws ClassNotFoundException, ParseException, SQLException
{
do{
System.out.println("Maintain Billing and Transactions Menu");
System.out.println("0. Go back to Main Menu:");
System.out.println("1. Generate Supplier Bill");
System.out.println("2. Generate Member Reward Check");
System.out.println("3. Calculate Transaction Totals");
System.out.println("4. Check Transaction for Discounts");
System.out.print("Please choose one of the options above: ");
input = scan.nextInt();
System.out.println();
switch(input){
case 0:
System.out.println("Going back to Main Menu");
return;
case 1:
Supplier.createSupplierBill();
break;
case 2:
Member.rewardCheck();
break;
case 3:
Transaction.transactionTotal();
break;
case 4:
Transaction.checkDiscounts();
break;
default:
System.out.println("Invalid input");
break;
}
input = -1;
} while(input != 0);
}
/**
* Reports: Generate all of the following reports. General reports such
* as total sales report by day, by month, or by year. Sales growth report
* for a specific store for a given time period. Merchandise stock report for each
* store or for a certain product. Customer growth report by month or by year.
* Customer activity report such as total purchase amount for a given time period.
*/
public static void reports() throws ClassNotFoundException, ParseException, SQLException
{
do{
System.out.println("Reports Menu");
System.out.println("0. Go back to Main Menu:");
System.out.println("1. Total Sales Report by day, month, or year");
System.out.println("2. Sales Growth Report for Specific Store");
System.out.println("3. Merchandise Stock report");
System.out.println("4. Customer Growth Report");
System.out.println("5. Customer Purchase Report");
System.out.print("Please choose one of the options above: ");
input = scan.nextInt();
System.out.println();
switch(input){
case 0:
System.out.println("Going back to Main Menu");
return;
case 1:
Transaction.totalSales();
break;
case 2:
Transaction.totalSales();
break;
case 3:
Merchandise.viewStockReport();
break;
case 4:
SignUp.memberGrowth();
break;
case 5:
Transaction.totalSales();
break;
default:
System.out.println("Invalid input");
break;
}
input = -1;
} while(input != 0);
}
}