-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathOrders.py
141 lines (105 loc) · 4.32 KB
/
Orders.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
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
from Customers import Customers
from Employees import Employees
class Orders:
id_order = 0
# --- Método Constructor ---
def __init__(self, customer_id, employee_id, order_date, required_date, shipped_date,
ship_via, freight, ship_name, ship_address, ship_city, ship_region,
ship_postal_code, ship_country):
Orders.id_order += 1
self._id_order = Orders.id_order
self._customer_id = customer_id
self._employee_id = employee_id
self._order_date = order_date
self._required_date = required_date
self._shipped_date = shipped_date
self._ship_via = ship_via
self._freight = freight
self._ship_name = ship_name
self._ship_address = ship_address
self._ship_city = ship_city
self._ship_region = ship_region
self._ship_postal_code = ship_postal_code
self._ship_country = ship_country
# --- Fin Constructor de clase ---
# --- Métodos Set ---
def set_customer_id(self, customer_id):
self._customer_id = customer_id
def set_employee_id(self, employee_id):
self._employee_id = employee_id
def set_order_date(self, order_date):
self._order_date = order_date
def set_required_date(self, required_date):
self._required_date = required_date
def set_shipped_date(self, shipped_date):
self._shipped_date = shipped_date
def set_ship_via(self, ship_via):
self._ship_via = ship_via
def set_freight(self, freight):
self._freight = freight
def set_ship_name(self, ship_name):
self._ship_name = ship_name
def set_ship_address(self, ship_address):
self._ship_address = ship_address
def set_ship_city(self, ship_city):
self._ship_city = ship_city
def set_ship_region(self, ship_region):
self._ship_region = ship_region
def set_ship_postal_code(self, ship_postal_code):
self._ship_postal_code = ship_postal_code
def set_ship_country(self, ship_country):
self._ship_country = ship_country
# --- Fin Métodos Set ---
# --- Métodos Get ---
def get_customer_id(self):
return self._customer_id
def get_employee_id(self):
return self._employee_id
def get_order_date(self):
return self._order_date
def get_required_date(self):
return self._required_date
def get_shipped_date(self):
return self._shipped_date
def get_ship_via(self):
return self._ship_via
def get_freight(self):
return self._freight
def get_ship_name(self):
return self._ship_name
def get_ship_address(self):
return self._ship_address
def get_ship_city(self):
return self._ship_city
def get_ship_region(self):
return self._ship_region
def get_ship_postal_code(self):
return self._ship_postal_code
def get_ship_country(self):
return self._ship_country
# --- Fin Métodos Get ---
def __str__(self) -> str:
return f"""
Order N° {self._id_order}
customer id: {self._customer_id}
employee id: {self._employee_id}
order_date: {self._order_date}
required_date: {self._required_date}
shipped_date: {self._shipped_date}
ship_via: {self._ship_via}
freight: {self._freight}
ship_name: {self._ship_name}
ship_address: {self._ship_address}
ship_city: {self._ship_city}
ship_region: {self._ship_region}
ship_postal_code: {self._ship_postal_code}
ship_country: {self._ship_country}
"""
if __name__ == "__main__":
customer_prueba = Customers("calle 67 90-09", "New York", "Coca bit",
"contact name", "contact title", "EEUU", "fax", 5555098, 98765, "Norte")
empleado1 = Employees("Estevez", "Juan", "Title", "Courtesy", "10/10/1978", "23/02/2001", "Calle 3 27 68",
"Bogotá", "Cundinamarca", "45678", "Colombia", "5465476296", "+57", "No hay notas", "Pepito Perez")
orden1 = Orders(customer_prueba.get_contact_title(), empleado1.get_id_employee(), "27-05-2010", "28-05-2010",
"29-10-2017", "ship_via", "freight", "ship name", "dirección", "Bogotá", "norte", 987654, "colombia")
print(orden1)