def checkRepeatedNames(self, arrayOfObjects): name = self.nameEntry.get().strip() for obj in arrayOfObjects: if obj.name == name: MB.repeatedNames() return False return True
def checkEnoughMoney(self, money): if self.check(money): if float(money) < float(self.money) + Acc.EPS: return True else: MB.notEnoughMoney() return False
def check(self): if self.nameEntry.get().strip().__len__() == 0 or self.numberEntry.get( ).strip().__len__() == 0: MB.emptyEntry() self.nameEntry.focus_set() return False return True
def check(self): if super().check(): if not (self.subGroupMB.cget('text') == Acc.chooseSubGroup): return True else: MB.subGroupNotChosen() return False
def check(self): if self.choosenTime is None: MB.timeNotChoosen() return False if self.choosenTime > datetime.datetime.strptime(time.ctime(), "%a %b %d %H:%M:%S %Y"): MB.futureDate() return False return True
def checkPaid(self, paid): if not Acc.isNumber(paid): MB.nonNumberPaid() return False if float(paid) > float(self.rest()) + Acc.EPS: MB.paidGreaterThanRest() return False return True
def check(self): if self.nameEntry.get().strip().__len__() == 0: MB.emptyEntry() return False if self.controller.testExchange(self.moneyEntry.get().strip()): return True self.nameEntry.focus_set() return False
def check(self): if not (self.mainMB.cget('text') == Acc.chooseAdvancePayment): if self.choosenAdvancePayment.checkPaid(self.entry.get().strip()): if self.controller.checkEnoughMoney(self.entry.get().strip()): return True else: MB.advancePaymentNotChosen() self.entry.focus_set() return False
def resume(self, event=None): if self.check(): if self.checkRepeatedNames(self.choosenSub.sons): if MB.confirmation(): self.controller.addKind(self.entry.get().strip(), self.choosenSub) self.clear()
def resume(self, event=None): if self.check(): if self.checkRepeatedNames(self.controller.getSuppliers()): if MB.confirmation(): self.controller.addCustomer(self.nameEntry.get().strip(), self.numberEntry.get().strip()) self.clear()
def resume(self, event=None): if self.check(): if MB.confirmation(): self.controller.addOldSellAction( self.personFrame.choosenPerson, self.groupsFrame.choosenKind, self.getArea(), self.getPaid(), self.getPrice(), self.timeFrame.getTimeValue()) self.clear()
def check(area, paid, price): if not Acc.isNumber(area): MB.nonNumberArea() return False if not Acc.isNumber(paid): MB.nonNumberPaid() return False if not Acc.isNumber(price): MB.nonNumberPrice() return False if float(paid) > float(price) + Acc.EPS: MB.paidGreaterThanPrice() return False return True
def check(self): if self.mainGroupMB.cget('text') == Acc.chooseMainGroup: MB.mainGroupNotChosen() return False if self.subGroupMB.cget('text') == Acc.chooseSubGroup: MB.subGroupNotChosen() return False if self.kindMB.cget('text') == Acc.chooseKind: MB.kindNotChosen() return False return True
def check(self, money): if not Acc.isNumber(money): MB.nonNumberPaid() return False return True
def resume(self, event=None): if self.check(): if MB.confirmation(): self.controller.reAdvancePayment(self.entry.get().strip(), self.choosenAdvancePayment) self.clear()
def resume(self, event=None): self.controller.updatePasswordValue(self.entry.get()) MB.showNewPassword(self.entry.get()) self.entry.delete(0, 'end')
def check(self, password): if self.password == password: return True MB.wrongPassword() return False
def viewBuyActions(self): lates = self.controller.getLateBuyActions() if not lates: MB.nothingFound()
def viewAdvancePayments(self): lates = self.controller.getLateAdvancePayments() if not lates: MB.nothingFound()
def resume(self, event=None): if self.check(): if self.checkRepeatedNames(self.controller.getMenuGroups()): if MB.confirmation(): self.controller.addMainGroup(self.entry.get().strip()) self.clear()
def check(self): if super().check(): if not (self.mainGroupMB.cget('text') == Acc.chooseMainGroup): return True MB.mainGroupNotChosen() return False
def check(self, area): if not Acc.isNumber(area): MB.nonNumberArea() return False return True
def checkArea(self, area): if self.check(area): if float(float(area) - float(self.area)) <= Acc.EPS: return True MB.notEnoughArea() return False
def resume(self, event=None): if self.check(): if MB.confirmation(): self.choosenKind.updateArea( -1 * float(self.areaEntry.get().strip())) self.clear()
def resume(self, event=None): if self.controller.updateMoneyValue(self.entry.get()): MB.showNewMoney(self.controller.getMoneyValue()) self.entry.delete(0, 'end') else: self.entry.focus_set()
def resume(self, event=None): if self.check(): if self.controller.checkMoney(self.moneyEntry.get().strip()): if MB.confirmation(): self.controller.addAdvancePayment(self.nameEntry.get().strip(), self.moneyEntry.get().strip()) self.clear()