Beispiel #1
0
 def saveNewItem(self):
     specie = self.ui.comboBox.itemData(self.ui.comboBox.currentIndex())
     if specie != None:
         SqlHandler.addItem(self.session, SqlHandler.Color(self.ui.lineEdit.text(), specie.id))
         if self.parent().specieName() == specie.name:
             self.parent().setColor(self.ui.lineEdit.text())
     self.closeDialog()
Beispiel #2
0
 def saveNewItem(self):
     item = SqlHandler.WeightControl(animal_id=self.item.id,
                                     weight=self.priceSelector.value())
     SqlHandler.addItem(self.session, item)
     print('WeightControl saveNweItem, ', item)
     self.parent().addAskedItem(item)
     self.closeDialog()
Beispiel #3
0
 def saveNewItem(self):
     postoffice = self.ui.comboBox.itemData(self.ui.comboBox.currentIndex())
     if postoffice != None:
         SqlHandler.addItem(
             self.session,
             SqlHandler.PostNumber(postoffice.id, self.ui.lineEdit.text()))
         self.parent().setPostNumber(self.ui.lineEdit.text())
     self.closeDialog()
Beispiel #4
0
 def saveNewItem(self):
     specie = self.ui.comboBox.itemData(self.ui.comboBox.currentIndex())
     if specie != None:
         SqlHandler.addItem(
             self.session,
             SqlHandler.Color(self.ui.lineEdit.text(), specie.id))
         if self.parent().specieName() == specie.name:
             self.parent().setColor(self.ui.lineEdit.text())
     self.closeDialog()
Beispiel #5
0
 def saveDialog(self):
     if self.animalsearch.getCurrentItem() != None:
         if self.item != None:
             self.item.update()
             self.parent().update()
             self.closeDialog()
         else:
             self.item = SqlHandler.PhoneRecipie(self.animalsearch.getCurrentItem(), self.recipieMedicineTreeWidget.getItemsFromList())
             self.item.update(self.getData())
             SqlHandler.addItem(self.session, self.item)
             self.parent().update()
             self.closeDialog()
Beispiel #6
0
    def saveNewItem(self):

        tmp = SqlHandler.SummaryText(self.ui.lineEdit.text(), self.textEdit.toPlainText())

        if(tmp):
            SqlHandler.addItem(self.session, tmp)
            try:
                self.parent().addAskedItem(tmp)
            except:
                logERROR(self,"Failed to add text to parent!")
            self.closeDialog()
        else:
            popErrorMessage(g_error_msg_dict['summary_name_used'])
Beispiel #7
0
 def saveDialog(self):
     if self.animalsearch.getCurrentItem() != None:
         if self.item != None:
             self.item.update()
             self.parent().update()
             self.closeDialog()
         else:
             self.item = SqlHandler.PhoneRecipie(
                 self.animalsearch.getCurrentItem(),
                 self.recipieMedicineTreeWidget.getItemsFromList())
             self.item.update(self.getData())
             SqlHandler.addItem(self.session, self.item)
             self.parent().update()
             self.closeDialog()
Beispiel #8
0
    def saveNewItem(self):

        tmp = SqlHandler.SummaryText(self.ui.lineEdit.text(),
                                     self.textEdit.toPlainText())

        if (tmp):
            SqlHandler.addItem(self.session, tmp)
            try:
                self.parent().addAskedItem(tmp)
            except:
                logERROR(self, "Failed to add text to parent!")
            self.closeDialog()
        else:
            popErrorMessage(g_error_msg_dict['summary_name_used'])
Beispiel #9
0
 def saveTab(self):
     logDEBUG(self, 'GenericTab FUNCTIO: SaveTab')
     #check if tab is valid
     if self.saveAble():
         #check if there is items
         if self.item == None:
             #here self.item can be set because newToSaved will handle it
             self.item = self.makeItem()
             SqlHandler.addItem(self.session, self.item)
             self.update()
             Tabmanager.newToSaved(self)
         else:
             self.item.update(self.getData())
             SqlHandler.commitSession(self.session)
     else:
         from models.translationtables import g_save_error_message
         self.errorMessage(g_save_error_message)
Beispiel #10
0
 def saveAndCloseTab(self):
     logDEBUG(self, 'GenericTab FUNCTIO: saveAndCloseTab')
     tmp_item = None
     if self.saveAble():
         if self.item == None:
             self.item = self.makeItem()
             SqlHandler.addItem(self.session, self.item)
         else:
             if self.hasChanged():
                 #update item if it has changes
                 self.item.update(self.getData())
                 SqlHandler.commitSession(self.session)
             else:
                 pass  #logDEBUG(self,'No')
         self.closeTab()
     else:
         from models.translationtables import g_save_error_message
         self.errorMessage(g_save_error_message)
Beispiel #11
0
 def saveNewItem(self):
     item = SqlHandler.WeightControl(animal_id = self.item.id, weight=self.priceSelector.value())
     SqlHandler.addItem(self.session, item)
     print('WeightControl saveNweItem, ', item)
     self.parent().addAskedItem(item)
     self.closeDialog()
Beispiel #12
0
 def saveDialog(self):
     if self.hasChangedAndSaveAble():
         self.updateItem()
         SqlHandler.addItem(self.session, self.item)
Beispiel #13
0
 def saveNewItem(self):
     postoffice = self.ui.comboBox.itemData(self.ui.comboBox.currentIndex())
     if postoffice != None:
         SqlHandler.addItem(self.session, SqlHandler.PostNumber(postoffice.id,self.ui.lineEdit.text()))
         self.parent().setPostNumber(self.ui.lineEdit.text())
     self.closeDialog()
Beispiel #14
0
 def saveNewItem(self):
     SqlHandler.addItem(self.session, SqlHandler.PostOffice(self.ui.lineEdit.text()))
     #Will always be updated
     self.parent().setPostOffice(self.ui.lineEdit.text())
     self.closeDialog()
Beispiel #15
0
 def saveNewItem(self):
     _sex = SqlHandler.Sex(self.ui.lineEdit.text())
     SqlHandler.addItem(self.session, _sex)
     #Will always be updated 
     self.parent().setSex(self.ui.lineEdit.text())
     self.closeDialog()
Beispiel #16
0
 def saveNewItem(self):
     _sex = SqlHandler.Sex(self.ui.lineEdit.text())
     SqlHandler.addItem(self.session, _sex)
     #Will always be updated
     self.parent().setSex(self.ui.lineEdit.text())
     self.closeDialog()
Beispiel #17
0
 def saveNewItem(self):
     SqlHandler.addItem(self.session,
                        SqlHandler.PostOffice(self.ui.lineEdit.text()))
     #Will always be updated
     self.parent().setPostOffice(self.ui.lineEdit.text())
     self.closeDialog()