Ejemplo n.º 1
0
 def choose_operation(self):
     while True:
         check = self._type_of_table == TypeOfTable.PLAYER__GAME or self._type_of_table == TypeOfTable.DEVELOPER_COMPANY__GAME;
         list_operations = ['Create', 'Read', 'Update', 'Delete', 'List all', 'Back']
         if check:
             list_operations = ['Create', 'List all', 'Back']
         operation = self._main_controller.make_choice(list_operations, self._type_of_table.value[0])
         if check:
             if operation == 0:
                 self.insert()
             elif operation == 1:
                 self.show_all()
             elif operation == 2:
                 break
         else:
             if operation == 0:
                 self.insert()
             elif operation == 1:
                 self.show(MainController.get_uint_value("Print id: "))
             elif operation == 2:
                 self.update(MainController.get_uint_value("Print id: "))
             elif operation == 3:
                 self.delete(MainController.get_uint_value("Print id: "))
             elif operation == 4:
                 self.show_all()
             elif operation == 5:
                 break
Ejemplo n.º 2
0
 def choose_operation(self):
     while True:
         list_operations = ['Create', 'Read', 'Update', 'Delete', 'List all', 'Back']
         operation = self._main_controller.make_choice(list_operations, self._type_of_table.value[0])
         if operation == 0:
             self.insert()
         elif operation == 1:
             self.show(MainController.get_uint_value("Print id: "))
         elif operation == 2:
             self.update(MainController.get_uint_value("Print id: "))
         elif operation == 3:
             self.delete(MainController.get_uint_value("Print id: "))
         elif operation == 4:
             self.show_all()
         elif operation == 5:
             break