版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)
文檔簡介
stringusername,pass_word,pw,qxusername=trim(sle_1.text)pass_word=trim(sle_2.text)ifusername=""thenmessagebox("提示","請輸入用戶名")returnendififpass_word=""thenmessagebox("提示","請輸入密碼")returnendifselect"user"."password","user"."quanxian"into:pw,:qxfrom"user"where"user"."user_name"=:username;ifpass_word=pwthenifqx="圖書管理員"thenopen(w_main)close(parent)endififqx="普通學(xué)生"thenopen(w_xuesheng)close(parent)endifelsemessagebox("提示","輸入密碼錯誤")sle_1.text=""sle_2.text=""returnendifstringuname,pword,newpword,agnewpword,pass_worduname=sle_1.textpword=sle_2.textnewpword=sle_3.textagnewpword=sle_4.textifuname=""thenmessagebox("提示","請輸入用戶名")returnendififpword=""thenmessagebox("提示","請輸入密碼")returnendifselect"user"."password"into:pass_wordfrom"user"where"user"."user_name"=:uname;ifpword=""thenmessagebox("提示","請輸入新密碼")returnendififagnewpword=""thenmessagebox("提示","請再次輸入新密碼")returnendififnewpword<>agnewpwordthenmessagebox("提示","兩次密碼不一致")returnendififpass_word=pwordandnewpword=agnewpwordthenupdate"user"set"user"."password"=:newpwordwhere"user"."user_name"=:uname;messagebox("提示","修改成功")endifstringuname,pword,agpword,qx,ununame=sle_1.textpword=sle_2.textagpword=sle_3.textqx=sle_4.textifuname=""thenmessagebox("提示","請輸入用戶名")returnendififpword=""thenmessagebox("提示","請輸入密碼")returnendififagpword=""thenmessagebox("提示","請再次輸入新密碼")returnendififqx=""thenmessagebox("提示","請輸入用戶權(quán)限")returnendififpword<>agpwordthenmessagebox("提示","兩次密碼不一致")returnendifselect"user"."user_name"into:unfrom"user";ifun=unamethenmessagebox("系統(tǒng)警告:","此用戶已經(jīng)存在,請重新輸入!")sle_1.text=""returnendififpword=agpwordtheninsertinto"user"("user_name","password","quanxian")values(:uname,:pword,:qx);messagebox("提示","添加成功")endifstringuname,ununame=sle_1.textselect"user"."user_name"into:unfrom"user"where"user"."user_name"=:uname;ifun<>unamethenmessagebox("系統(tǒng)警告:","此用戶不存在,請重新輸入!")sle_1.text=""returnendifdeletefrom"user"where"user"."user_name"=:uname;messagebox("提示","刪除成功")longls_stuid,ls_bookid,ls_countdatels_borrowdatesintegerls_flag//0表示圖書已歸還(可再借),1表示圖書已借出(不可再借)ls_stuid=long(sle_1.text)ls_bookid=long(sle_2.text)ls_borrowdates=today()//得到delflag標(biāo)記值SELECTdelflagINTO:ls_flagFROMborrowWHEREbookid=:ls_bookid;//得到該生所借圖書數(shù)量SELECTCOUNT(*)INTO:ls_countFROMborrowWHEREstud_id=:ls_stuidanddelflag=1;//判斷該書是否借出ifls_flag=1thenmessagebox("系統(tǒng)提示","本書已經(jīng)外借!")sle_2.setfocus()returnelseifls_count<5thenINSERTINTOborrow(bookid,stud_id)VALUES(:ls_bookid,:ls_stuid);UPDATEborrowsetborrowdate=:ls_borrowdates,returndate=NULL,fine=0,delflag=1WHEREbookid=:ls_bookid;messagebox("提示","圖書編號為"+string(ls_bookid)+"的圖書借出成功!")elsemessagebox("提示","該生所借圖書數(shù)量已達最大(5本)!借閱失??!")endifendifsle_2.text=""sle_2.setfocus()dw_1.visible=falsecb_2.enabled=false
longls_bookid,ls_bookid2,daysdatels_borrowdates,ls_returndatesdecls_fine//驗證圖書編號是否為空ifsle_1.text=""ORisNULL(sle_1.text)thenmessagebox("缺少數(shù)據(jù)!","請輸入圖書編號!")sle_1.setfocus()returnendifls_bookid=long(sle_1.text)//判斷圖書是否借出selectbookidinto:ls_bookid2fromborrowwherebookid=:ls_bookidanddelflag=1;ifls_bookid2=0thenmessagebox("系統(tǒng)提示","此圖書未借出!請驗證后重新輸入圖書編號!")sle_1.setfocus()returnendifselectborrowdateinto:ls_borrowdatesfromborrowwherebookid=:ls_bookid;ls_returndates=today()days=daysafter(ls_borrowdates,ls_returndates)sle_2.text=string(ls_borrowdates)sle_3.text=string(ls_returndates)ifdays>30thenls_fine=dec(days-30)*0.1sle_4.text=string(days-30)sle_5.text=string(ls_fine)elsesle_4.text="0"sle_5.text="0"endifcb_2.enabled=tru
stringls_title,ls_author,ls_keywords,ls_abstractlongls_bookid,ls_bookid2,ls_bookid3,ls_pricedatels_publishdate//圖書編號,書名ifsle_1.text=""ORisNULL(sle_1.text)thenmessagebox("缺少數(shù)據(jù)!","請輸入圖書編號!")sle_1.setfocus()returnelseifsle_2.text=""ORisNULL(sle_2.text)thenmessagebox("缺少數(shù)據(jù)!","請輸入書名!")sle_2.setfocus()returnendif//作者,出版日期ifsle_3.text=""ORisNULL(sle_3.text)thenmessagebox("缺少數(shù)據(jù)!","請輸入作者")sle_3.setfocus()returnelseifsle_4.text=""ORisNULL(sle_4.text)thenmessagebox("數(shù)據(jù)錯誤!","請輸入'年-月-日'格式的出版日期!")sle_4.setfocus()returnendif//日期格式的驗證ifsle_4.text<>""andnotisnull(sle_4.text)thenifisDate(sle_4.text)thenls_publishdate=date(sle_4.text)elsemessagebox("數(shù)據(jù)錯誤!","請輸入'年-月-日'格式的出版日期!")sle_4.setfocus()returnendifendif//定價,關(guān)鍵字的驗證ifsle_5.text=""ORisNULL(sle_5.text)thenmessagebox("缺少數(shù)據(jù)!","請輸入定價!")sle_5.setfocus()returnelseifsle_6.text=""ORisNULL(sle_6.text)thenmessagebox("缺少數(shù)據(jù)!","請輸入關(guān)鍵字!")sle_6.setfocus()returnendif//ls_bookid=long(sle_1.text)ls_title=trim(sle_2.text)ls_publishdate=date(sle_4.text)ls_author=trim(sle_3.text)ls_price=long(sle_5.text)ls_keywords=trim(sle_6.text)ls_abstract=trim(sle_7.text)//判斷是否重號selectbookinfo.bookidinto:ls_bookid2frombookinfowherebookinfo.bookid=:ls_bookid;ifls_bookid2<>0thenmessagebox("出錯信息","圖書編號第"+string(ls_bookid2)+"號重號!請改正!")sle_1.setfocus()returnendif//添加圖書信息insertinto"bookinfo"("bookid",
"title","publishdate","author","abstract","price","keywords")values(:ls_bookid,:ls_title,:ls_publishdate,:ls_author,:ls_abstract,:ls_price,:ls_keywords);//判斷是否添加成功selectbookinfo.bookidinto:ls_bookid3frombookinfowherebookinfo.bookid=:ls_bookid;ifls_bookid3<>0thenmessagebox("提示sle_1.setfocus()sle_1.text=""","圖書信息添加成功!")sle_2.text=""sle_3.text=""sle_4.text=""sle_5.text=""sle_6.text=""sle_7.text=""sle_1.setfocus()elsemessagebox("提示","添加失?。?)endif
longls_bookid,ls_bookid2ls_bookid=long(sle_1.text)ifnotsle_1.text=""thenselectbookinfo.bookidinto:ls_bookid2frombookinfowherebookinfo.bookid=:ls_bookid;ifls_bookid2=0thenmessagebox("系統(tǒng)提示sle_1.setfocus()return","沒有此圖書信息!請驗證后重新輸入圖書編號!")endifdw_1.visible=truecb_2.enabled=truedw_1.retrieve(ls_bookid)elsemessageBox("數(shù)據(jù)不全","請輸入圖書編號")endifstringls_namels_name=trim(sle_1.text)ifnotls_name=""thenls_name="%"+ls_name+"%"dw_1.retrieve(ls_name)//檢索數(shù)據(jù)放入dw_1中elseMessageBox("查詢出錯","請輸入要查詢的書本名稱")endifsle_1.SetFocus()stringls_qauthorls_qauthor=trim(sle_1.text)ifnotsle_1.text=""thenls_qauthor="%"+ls_qauthor+"%"http://模糊查詢dw_1.retrieve(ls_qauthor)elsemessageBox("數(shù)據(jù)不全","請輸入作者姓名!")endifstringls_bookidls_bookid=trim(sle_1.text)ifnotls_bookid=""thenls_bookid="%"+ls_bookid+"%"dw_1.retrieve(ls_bookid)//檢索數(shù)據(jù)放入dw_1中elseMessageBox("查詢出錯","請輸入要查詢的書本名稱")endifsle_1.SetFocus()longls_studidls_studid=long(sle_1.text)deletefromstudentwherestudent.stud_id=:ls_studid;messagebox("提示","刪除信息成功!")sle_1.text=""sle_1.setfocus()dw_1.visible=falsecb_2.stringls_name,ls_sex,ls_depart,ls_speciality,ls_remarklongls_studid,ls_studid2,ls_studid3//學(xué)生編號,姓名ifsle_1.text=""ORisNULL(sle_1.text)thenmessagebox("缺少數(shù)據(jù)!","請輸入學(xué)生編號!")sle_1.setfocus()returnelseifsle_2.text=""ORisNULL(sle_2.text)thenmessagebox("缺少數(shù)據(jù)!","請輸入姓名!")sle_2.setfocus()returnendif//性別,系別ifsle_3.text=""ORisNULL(sle_3.text)thenmessagebox("缺少數(shù)據(jù)!","請輸入性別")sle_3.setfocus()returnelseifsle_4.text=""ORisNULL(sle_4.text)thenmessagebox("缺少數(shù)據(jù)!","請輸入系別")sle_4.setfocus()returnendif//專業(yè)ifsle_5.text=""ORisNULL(sle_5.text)thenmessagebox("缺少數(shù)據(jù)!","請輸入專業(yè)")sle_5.setfocus()returnendif//ls_studid=long(sle_1.text)ls_name=trim(sle_2.text)ls_sex=trim(sle_3.text)ls_depart=trim(sle_4.text)ls_speciality=trim(sle_5.text)ls_remark=trim(sle_6.text)//判斷是否重號selectstudent.stud_idinto:ls_studid2fromstudentwherestudent.stud_id=:ls_studid;ifls_studid2<>0thenmessagebox("出錯信息","學(xué)生編號第"+string(ls_studid2)+"號重號!請改正!")sle_1.setfocus()returnendif//添加學(xué)生信息insertinto"student"("stud_id","name","sex","depart","speciality","remark")values(:ls_studid,:ls_name,:ls_sex,:ls_depart,:ls_speciality,:ls_remark);//判斷是否添加成功selectstudent.stud_idinto:ls_studid3
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 汽車廢水處理課程設(shè)計
- 直播美膚教學(xué)課程設(shè)計
- 研學(xué)旅行特色課程設(shè)計
- 碗盤餐具課程設(shè)計
- 液壓泵站課程設(shè)計紙
- 電子元器件在汽車電子中的應(yīng)用考核試卷
- 畜牧飼料營銷策略與網(wǎng)絡(luò)推廣考核試卷
- 組成原理課程設(shè)計反思
- 玉米餅生產(chǎn)考核試卷
- 四年級數(shù)學(xué)(四則混合運算帶括號)計算題專項練習(xí)與答案匯編
- 眼鏡學(xué)智慧樹知到答案2024年溫州醫(yī)科大學(xué)
- 2024年電大勞動與社會保障法期末考試題庫及答案
- MOOC 傳熱學(xué)-西安交通大學(xué) 中國大學(xué)慕課答案
- 2024年四川省自然資源投資集團有限責(zé)任公司招聘筆試參考題庫附帶答案詳解
- 賈玲春晚搞笑公司年會小品《真假老師》臺詞劇本完整版
- 簡約中國風(fēng)蘭花信紙背景模板
- 安利培訓(xùn)體系介紹
- 消防機器人項目可行性研究報告寫作范文
- 身股制實施辦法(新版)
- 原材料密度、級配碎石、水穩(wěn)層、混凝土及瀝青砼配合比大全
- 23、PFMEA檢查表
評論
0/150
提交評論