-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
79 lines (69 loc) · 1.63 KB
/
main.go
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
package main
import (
"github.com/DestCom-Student-Projects/GO-PROJECT-1/pkg/menu"
"github.com/DestCom-Student-Projects/GO-PROJECT-1/pkg/services"
)
func main() {
var locked bool = false
if !locked {
menu.DisplayBase()
menu.DisplayMenuOne(false)
inpts := menu.Inputs([]string{"1", "2", "3"})
if inpts == 1 {
var lockedLoopOne bool = false
var choice int
for !lockedLoopOne {
menu.DisplayMenuCustomers()
choice = menu.Inputs([]string{"1", "2", "3"})
switch choice {
case 1:
services.DisplayProducts()
case 2:
services.BuyProduct()
case 3:
lockedLoopOne = true
default:
menu.DisplayErrors("Invalid choice, exiting...")
return
}
}
} else if inpts == 2 {
var lockedLoopTwo bool = false
var choice int
for !lockedLoopTwo {
menu.DisplayMenuAdmins()
choice = menu.Inputs([]string{"1", "2", "3", "4", "5", "6", "7", "8", "9"})
switch choice {
case 1:
services.AddProduct()
case 2:
services.EditProduct()
case 3:
services.DeleteProduct()
case 4:
services.AddCustomer()
case 5:
services.EditCustomer()
case 6:
services.DeleteCustomer()
case 7:
services.ExportServices()
case 8:
services.ListingsServices()
case 9:
lockedLoopTwo = true
default:
menu.DisplayErrors("Invalid choice, exiting...")
return
}
}
} else if inpts == 3 {
menu.DisplayGoodbye()
locked = true
} else {
menu.DisplayErrors("Invalid choice, exiting...")
return
}
}
}
//AZEVEDO-DA-SILVA, A. (2024) GO-PROJECT-1. [Source code] https://github.com/DestCom-Student-Projects/GO-PROJECT-1