def saveDeliver(self): self.deliver.deliver_date = _date_from_str(self.ui.deliver_date.text()) self.deliver.distributor = self.distributor self.deliver.financing = self.financing s = Session() s.add(self.deliver) s.commit() s.close() self.parent().close()
def addPatient(self): p = Patient() p.first_name = str(self.ui.first_name.text().toUtf8()) p.last_name = str(self.ui.last_name.text().toUtf8()) p.birth_date = _date_from_str(self.ui.birth_date.text()) s = Session() s.add(p) s.commit() s.close() self.emit(SIGNAL("patientAdded()")) self.close()
def addDrug(self): drug = Drug(str(self.ui.drug_name.text().toUtf8()), self.manufacter, str(self.ui.serial_number.text().toUtf8()), _date_from_str(self.ui.best_before.text()), float(self.ui.price.text().toUtf8())) s = Session() s.add(drug) s.commit() s.close() self.emit(SIGNAL("drugCreated()")) self.close()