def onSave(self, event): dataBase = DataBase() try: plant = Plants.getByDialog(self) except: return None dataBase.addNew(plant) self.Close() self.GetParent().loadData()
def onSave(self, event): index = self.id dataBase = DataBase() try: plant = Plants.getByDialog(self) except: return None dataBase.update(plant, index) self.Close() if True == self.GetParent().isSearch: self.GetParent().loadFindData() else: self.GetParent().loadData()
def onDClickGrid(self, event): event.Skip() index = self.getRowAttachmentData(event.GetRow()) if index != None: editDialog = EditDialog(self.GetParent()) plant = Plants.get(index, editDialog) editDialog.row = event.GetRow() editDialog.setPlant(plant) editDialog.id = index editDialog.ShowModal() editDialog.Destroy() else: return None