def buyButtonClicked(self): contract = self.E1.get() buyerId = Contract.getBuyerId(self, contract) assetId = Contract.getAssetId(self, contract) buyPrice = Asset.getLastPrice(self, assetId) if (buyerId == 0): value = Contract.addBuyer(self, contract, self.user, buyPrice) if (not value): messagebox.showerror("Buy error", value) else: messagebox.showinfo("Buy info", "You bought the contract") else: messagebox.showerror("Buy error", "Contract already has a buyer")
def getAssetId(self, idContrato): assetId = Contract.getAssetId(self, idContrato) return assetId
def getAssetId(self, idContrato): return Contract.getAssetId(self, idContrato)