Esempio n. 1
0
 def add(self):
     nume = input("Name: ")
     cantitate = console.getNr("Quantity: ")
     try:
         self.__contr.addProduct(nume,cantitate)
     except RepositoryException as e:
         print(e.args)
     except ValidationException as e:
         for i in e.args:
             print(i[0])
Esempio n. 2
0
 def main(self):
     opt = 0
     while opt != 3:
         print("Alegeti o optiune")
         print("1. Test nou")
         print("2. Sumar al rezultatelor")
         print("3. Inapoi")
         opt = console.getNr()
         if opt == 1:
             self.__current.new()
         if opt == 2:
             self.__history.show()
Esempio n. 3
0
 def remove(self):
     id = console.getNr("Product Id: ")
     try:
         self.__contr.removeProduct(id)
     except RepositoryException as e:
         print(e.args[0])