def updating(): print("当前进入更新窗格") while True: selectall() c = input("请选择你要更改的线路的编号,输入quit退出当前模块") if c is 'quit': mainui.uiDisplay() else: c = (eval)(c) item = ['1.线路信息', '2.线路花费', '3.线路介绍', '4.线路路径'] for w in item: print(w) c2 = eval(input("请选择你要更改的信息")) if c2 == 1: newinfo = input("请输入新的线路信息:") cursor.execute( 'UPDATE DestInfoSheet SET Name = %s WHERE DestNo = %d', (newinfo, c)) elif c2 == 2: newfee = eval(input("请输入新的线路花费")) cursor.execute( 'UPDATE DestInfoSheet SET Cost = %d WHERE DestNo = %d', (newfee, c)) elif c2 == 3: newintro = input("请输入线路介绍:") cursor.execute( 'UPDATE DestInfoSheet SET Intro = %s WHERE DestNo = %d', (newintro, c)) elif c2 == 4: newpath = input("请输入新的线路路径") cursor.execute( 'UPDATE DestInfoSheet SET Graph = %s WHERE DestNo = %d', (newpath, c)) conn.commit()
def updating(): print("当前进入更新窗格") while True: selectall() c = input("请选择你要更改的团队编号,输入quit退出当前模块") if c is 'quit': mainui.uiDisplay() else: c = (eval)(c) item = ['该组负责人', '人数', '日期', '出发', '费用', '盈利'] count = 1 for w in item: print((str)(count) + ":" + w) count = count + 1 c2 = eval(input("请选择你要更改的信息")) if c2 == 1: newGroupNo = input("请输入负责人") cursor.execute( 'UPDATE GroupInfoSheet SET GroupNo = %d WHERE GroupNo = %d', (newGroupNo, c)) elif c2 == 2: newnum = eval(input("请输入人数")) cursor.execute( 'UPDATE GroupInfoSheet SET Name = %s WHERE GroupNo = %d', (newnum, c)) elif c2 == 3: newdate = input("请输入日期") cursor.execute( 'UPDATE GroupInfoSheet SET Sex = %s WHERE GroupNo = %d', (newdate, c)) elif c2 == 4: newisleave = input("请输入是否出发") cursor.execute( 'UPDATE GroupInfoSheet SET Tel = %s WHERE GroupNo = %d', (newisleave, c)) elif c2 == 5: newfee = eval(input("请输入新的费用")) cursor.execute( 'UPDATE GroupInfoSheet SET Tel = %s WHERE GroupNo = %d', (newfee, c)) elif c2 == 6: newshare = eval(input("请输入盈利金额")) cursor.execute( 'UPDATE GroupInfoSheet SET Tel = %s WHERE GroupNo = %d', (newshare, c)) conn.commit()
def updating(): print("当前进入更新窗格") while True: selectall() c = input("请选择你要更改的团队编号,输入quit退出当前模块") if c is 'quit': mainui.uiDisplay() else: c = (eval)(c) item = ['团队编号', '目的地编号', '团队人数', '出发日期', '返程日期'] count = 1 for w in item: print((str)(count) + ":" + w) count = count + 1 c2 = eval(input("请选择你要更改的信息")) if c2 == 1: newdestno = eval(input("请输入团队编号")) cursor.execute( 'UPDATE TeamInfoSheet SET DestNo = %d WHERE TeamNo = %d', (newdestno, c)) elif c2 == 2: newteamno = eval(input("请输入目的地编号")) cursor.execute( 'UPDATE TeamInfoSheet SET TeamNo = %d WHERE TeamNo = %d', (newteamno, c)) elif c2 == 3: newname = input("请输入团队人数") cursor.execute( 'UPDATE TeamInfoSheet SET Name = %s WHERE TeamNo = %d', (newname, c)) elif c2 == 4: newsex = input("请输入出发日期") cursor.execute( 'UPDATE TeamInfoSheet SET Sex = %s WHERE TeamNo = %d', (newsex, c)) elif c2 == 5: newtel = input("请输入返程日期") cursor.execute( 'UPDATE TeamInfoSheet SET Tel = %s WHERE TeamNo = %d', (newtel, c)) conn.commit()
def main(): while True: print("当前是排团信息管理窗格") menuList = ['增加', '修改', '删除', '查询', '退出模块', '自定义SQL语句'] count = 1 for words in menuList: print((str)(count) + ":" + words) count = count + 1 choose = eval(input("请选择你需要的功能:")) if choose == 1: add() elif choose == 2: updating() elif choose == 3: deleting() elif choose == 4: selectall() elif choose == 5: mainui.uiDisplay()
def updating(): print("当前进入更新窗格") while True: selectall() c = input("请选择你要更改的团员编号,输入quit退出当前模块") if c is 'quit': mainui.uiDisplay() else: c = (eval)(c) item = [ '目的地编号', '团队编号', '团员编号', '姓名', '性别', '电话', '地址', '身份证号码', '是否支付', '备注' ] count = 1 for w in item: print((str)(count) + ":" + w) count = count + 1 c2 = eval(input("请选择你要更改的信息")) if c2 == 1: newdestno = eval(input("请输入目的地编号:")) cursor.execute( 'UPDATE MemInfoSheet SET DestNo = %d WHERE MemNo = %d', (newdestno, c)) elif c2 == 2: newteamno = eval(input("请输入新的团队编号:")) cursor.execute( 'UPDATE MemInfoSheet SET TeamNo = %d WHERE MemNo = %d', (newteamno, c)) elif c2 == 3: newname = input("请输入新的姓名") cursor.execute( 'UPDATE MemInfoSheet SET Name = %s WHERE MemNo = %d', (newname, c)) elif c2 == 4: newsex = input("请输入新的性别") cursor.execute( 'UPDATE MemInfoSheet SET Sex = %s WHERE MemNo = %d', (newsex, c)) elif c2 == 5: newtel = input("请输入新的电话") cursor.execute( 'UPDATE MemInfoSheet SET Tel = %s WHERE MemNo = %d', (newtel, c)) elif c2 == 6: newadd = input("请输入新的地址") cursor.execute( 'UPDATE MemInfoSheet SET Address = %s WHERE MemNo = %d', (newadd, c)) elif c2 == 7: newidcardnum = input("请输入新的身份证号码") cursor.execute( 'UPDATE MemInfoSheet SET IdcardNum = %s WHERE MemNo = %d', (newidcardnum, c)) elif c2 == 8: newispaid = input("请输入是否支付") cursor.execute( 'UPDATE MemInfoSheet SET IsPaid = %s WHERE MemNo = %d', (newispaid, c)) elif c2 == 9: newtips = input("请输入备份") cursor.execute( 'UPDATE MemInfoSheet SET tips = %s WHERE MemNo = %d', (newtips, c)) conn.commit()
#author:liuliu import UserInfo #导入用户管理模块 import Connect #数据库连接模块 import mainui if __name__ == "__main__": #程序入口 Connect.main() a = UserInfo.login() if a == 1: mainui.uiDisplay() else: exit()