def queryAll(self): '''前台:查询所有商品信息''' info=Basic.queryAllCommodity() table = comm = Commodity.getTableaHead() for i in info: table.add_row(i) print(table) print("以上共 {} 条记录.".format(len(info)))
def queryOneCahier(): cash_no = input("请输入需要查询的售货员的编号:").strip() cash = Basic.queryOneCashier(cash_no) if cash == []: print("该售货员不存在.") return table = Commodity.getTableaHead() table.add_row(cash) print(table)
def queryOne(self): '''前台:查询一个商品信息''' com_num=input("请输入需要查询商品的编号:") res=Basic.queryOneCommodity(com_num) if not res:#res为空 print("没有该商品") else: table=comm=Commodity.getTableaHead() table.add_row(res) print(table,end="\n\n")