-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
63 lines (52 loc) · 1.47 KB
/
main.py
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
# Do not modify this file
# run this program (the ERP software) from the terminal from thd root directory of this project
import sys
import ui # User Interface
# Store module
from store import store
# Human Resources module
from hr import hr
# Tool manager module
from inventory import inventory
# Accounting module
from accounting import accounting
# Sales module
from sales import sales
# Customer Relationship Management (CRM) module
from crm import crm
def choose():
inputs = ui.get_inputs(["Please enter a number: "], "")
option = inputs[0]
if option == "1":
store.start_module()
elif option == "2":
hr.start_module()
elif option == "3":
inventory.start_module()
elif option == "4":
accounting.start_module()
elif option == "5":
sales.start_module()
elif option == "6":
crm.start_module()
elif option == "0":
sys.exit(0)
else:
raise KeyError("There is no such option.")
def handle_menu():
options = ["Store manager",
"Human resources manager",
"Inventory manager",
"Accounting manager",
"Sales manager",
"Customer Relationship Management (CRM)"]
ui.print_menu("Main menu", options, "Exit program")
def main():
while True:
handle_menu()
try:
choose()
except KeyError as err:
ui.print_error_message(str(err))
if __name__ == '__main__':
main()