def set_sample_name(self):
        self.sample_name = self.mylineEdit.text()
        print(self.sample_name)
        request = search_request(self.sample_name)
        if request is not False:
            item, value = search_request(self.sample_name)
            if value == '':
                value = ''

            budget = self.le.text()
            print(str(item) + '-' + str(value))
            added = add_request(str(item), str(value), str(budget),
                                str(self.date))
            if added:
                increase_quantity_item(str(item))
                self.restart_program()
                self.startNew = 1
                self.message1.setText("ID NUMBER: " + str(value))
                self.message2.setText("STUDENT NAME: " + str(item))
                self.message3.setText("Attendance Taken")
            else:
                self.restart_program()
                self.startNew
                self.message1.setText("ID NUMBER: " + str(value))
                self.message2.setText("STUDENT NAME: " + str(item))
                self.message3.setText("Attendance taken for this event!")
        else:
            self.message3.setText("Student does not exist")
            self.startNew = 1
 def set_sample_name(self):
     self.sample_name = self.mylineEdit.text()
     print(self.sample_name)
     item, value = search_request(self.sample_name)
     print(str(item) + '-' + str(value))
     add_request(str(item), str(value))
     self.update()
     self.startNew = 1
Exemple #3
0
 def set_sample_name(self):
     self.sample_name = self.mylineEdit.text()
     print(self.sample_name)
     request = search_request(self.sample_name)
     if request is not False:
         item, value = search_request(self.sample_name)
         if int(value) == 0:
             value = ''
         print(str(item) + '-' + str(value))
         item_, quantity = search_request_delete_item(item)
         print(str(quantity))
         if quantity > 1:
             add_request(str(item), str(value))
             reduce_quantity_item(str(item))
             self.restart_program()
             self.startNew = 1
         else:
             self.message3.setText("There's no stock for this item anymore")
             self.startNew = 1
     else:
         self.message3.setText("Item does not exist")
         self.startNew = 1
    def restart_program(self):

        total, items = fetch_items()
        print(items)

        self.clearLayout(self.v_box)

        item, value = search_request(self.sample_name)

        self.message2.setText("STUDENT NAME: " + str(item))
        f = self.message2.font()
        f.setPointSize(10)  # sets the size to 27
        f.setBold(True)
        self.message2.setFont(f)