def searchIsbnExist(self, infoList): sender = TcpClienter() ret = sender.send(infoList) ##isbn存在 if ret[0][0] is '1': return '1' ##isbn不存在 else: ##二维列表返回 return ret
class VC_BuyBook: def __init__(self): self.__sendToServ = TcpClienter() #生成一个对象 #向服务器发送购买书籍请求 def sendBuyMessage(self, bookId, payFlag): dataList = ['2'] dataList.append(str(bookId)) dataList.append(str(payFlag)) dataList.append('==') ret = self.__sendToServ.send(dataList)[0][0] return ret
def getLogKeyToCompare(self,logkey): sender = TcpClienter() recList = sender.send(logkey) return recList[0]
def __init__(self): self.__sendToServ = TcpClienter() #生成一个对象
def beginSearchReader(self): sender = TcpClienter() infoList = ['6'] ret = sender.send(infoList) return ret
def sendSearchToTcp(self, v_searchPlus, searchList): tcpClienter = TcpClienter() self.bookList = tcpClienter.send(searchList) self.viewBookInformation(v_searchPlus)
def addBookNotExist(self, infoList): sender = TcpClienter() bookId = sender.send(infoList) ##返回值不为0则添加成功 return bookId[0][0]
def addBookExist(self, infoList): sender = TcpClienter() bookId = sender.send(infoList) #判断成功依据 return bookId[0][0]
def getBorrowList(self, searchList): sender = TcpClienter() borrowList = sender.send(searchList) return borrowList