-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
98 lines (77 loc) · 3.04 KB
/
Copy pathMain.java
File metadata and controls
98 lines (77 loc) · 3.04 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
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
import java.util.Scanner;
import javax.swing.JOptionPane;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
CustomerDriver c = new CustomerDriver();
SupplierDriver s = new SupplierDriver();
String input;
String choice;
boolean notexit = true;
JOptionPane.showMessageDialog(null,"Welcome to the Store!");
while(notexit){
choice = JOptionPane.showInputDialog("\n*****Choose the User Type*****\nIf you are a Customer, Press(c)\nIf you are Supplier, Press(s) \n Option: ");
//choice.toLowerCase().charAt(0);
if (choice.equals("s")) {
JOptionPane.showMessageDialog(null,"--------------------------Welcome to Supplier's Portal-----------------------------------");
input = JOptionPane.showInputDialog("\n\n1.Create Account. \n2.Login \n3.Exit \nChoose Option: ");
int input_int = Integer.parseInt(input);
switch(input_int){
case 1:
s.create();
break;
case 2:
s.login();
boolean end = true;
while(end)
{
String SupChoice_str = JOptionPane.showInputDialog("\n\n1.View Stock \n2.Process Order \n3.Ship Order\n4.Logout\nChoose Option:");
int SupChoice = Integer.parseInt(SupChoice_str);
if (SupChoice == 1) {
OrderControl.ViewStock();
}else if (SupChoice == 2) {
OrderControl.ProcessOrder();
}else if(SupChoice == 3) {
OrderControl.ShipOrder();
}else {
JOptionPane.showMessageDialog(null,"Logged out Successfully");
end = false;
}
}
System.exit(0);
break;
case 3:
JOptionPane.showMessageDialog(null,"Terminating from the program!");
notexit = false;
break;
default:
break;
}
}
if(choice.equals( "c")) {
JOptionPane.showMessageDialog(null,"--------------------------Welcome to Customer's Portal-----------------------------------");
String input_str = JOptionPane.showInputDialog("\n\n1.Create Account. \n2.Login \n3.Exit \nChoose Option: ");
int input_int = Integer.parseInt(input_str);
switch(input_int){
case 1:
c.create();
break;
case 2:
c.login();
ItemDriver i = new ItemDriver();
//i.Catalog();
i.SelectItems();
MakeOrder.ConfirmOrder();
break;
case 3:
JOptionPane.showMessageDialog(null, "Terminating from the program!");
notexit = false;
break;
default:
break;
}
}
}
System.exit(0);
}
}