版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
畢業(yè)設(shè)計電表管理系統(tǒng)班級____姓名____學(xué)號____摘要…………1Abstract………………………2第一章引言…………………41.1課題背景……………………41.2系統(tǒng)簡介……………………5第二章系統(tǒng)分析……………62.1系統(tǒng)開發(fā)目的和思想……………………62.2系統(tǒng)可行性分析…………8第三章系統(tǒng)設(shè)計……………183.1系統(tǒng)功能構(gòu)造設(shè)計………183.2系統(tǒng)數(shù)據(jù)庫設(shè)計3.3界面設(shè)計與代碼設(shè)計……………………23…………24結(jié)束語………………46道謝…………………47參照文獻(xiàn)……………48摘要老式電費管理都是由工作人員手工查表,抄表完畢,其中要完畢顧客電費收取,每月抄度,顧客購電狀況查詢,以及列出欠費顧客信息名單,之類信息.其工作強(qiáng)度大,工作流程繁瑣,由于工作人員不細(xì)心,將會導(dǎo)致電費收支出錯也是經(jīng)常發(fā)生.鑒于以上因素咱們有必要開發(fā)一種幫作電費管理人員軟件系統(tǒng),可以完畢檢查顧客用電狀況,每月抄度,信息錄入以及基本數(shù)據(jù)維護(hù)各項功能.本系統(tǒng)采用visualbasic6.0與微軟Access數(shù)據(jù)庫方式.界面盡量做到人性化,數(shù)據(jù)維護(hù)方面做到可靠安全.核心字:電費管理,visualbasic,Access,數(shù)據(jù)庫AbstractElectricityfromthetraditionalmanagementstaffareartisanalChabiao,meterreadingcompleted,whichshouldbecompletedbytheusersofelectricitypermonthpenaltyforuserstobuyelectricityenquiries,andalistofuserinformationchannelslistsuchinformation.Itswork-intensive,cumbersomeworkflow,becausestaffarenotcareful.wouldresultinthetariffrevenueisrecurringmistakes.Giventheabovereasonsweneedtodevelopamanagementsoftwaretohelpmakeelectricitysystem,theusercancompletetheinspectionofelectricitymonthlycopieddegrees,Informationincludesbasicdataandthemaintenancefunction.withthesystemusingvisualbasicMicrosoftAccess6.0database.asfaraspossiblehumanizationinterface,datamaintenancetoreliablesecurity.
keyword:tariffmanagement,visualbasic,Access,thedatabase引言課題背景老式電費管理都是由工作人員手工查表,抄表完畢,其中要完畢顧客電費收取,每月抄度,顧客購電狀況查詢,以及列出欠費顧客信息名單,之類信息.其工作強(qiáng)度大,工作流程繁瑣,由于工作人員不細(xì)心,將會導(dǎo)致電費收支出錯也是經(jīng)常發(fā)生.鑒于以上因素咱們有必要開發(fā)一種幫作電費管理人員軟件系統(tǒng),可以完畢檢查顧客用電狀況,每月抄度,信息錄入以及基本數(shù)據(jù)維護(hù)各項功能.本系統(tǒng)采用visualbasic6.0與微軟Access數(shù)據(jù)庫方式.界面盡量做到人性化,數(shù)據(jù)維護(hù)方面做到可靠安全.系統(tǒng)簡介本系統(tǒng)重要由如下幾大功能模塊構(gòu)成:顧客交費:(交納電費,本日小節(jié))本月抄度:(單戶抄度多戶抄度)資料導(dǎo)出(所有清單,欠費清單)數(shù)據(jù)查詢(電費查詢與記錄,顧客欠費查詢)信息錄入(資料錄入,資料修改,資料刪除)系統(tǒng)數(shù)據(jù)維護(hù)(數(shù)據(jù)備份,數(shù)據(jù)恢復(fù))基本數(shù)據(jù)維護(hù)(顧客類型維護(hù),操作員維護(hù))協(xié)助退出系統(tǒng)分析系統(tǒng)開發(fā)目的和思想本系統(tǒng)重要服務(wù)于電費管理人員尋常工作.設(shè)計思路重要參照工作人員抄表,記錄資料,資料管理,信息錄入等方面工作流程展開.系統(tǒng)可行性分析本系統(tǒng)采用visualbasic6.0與微軟access作為數(shù)據(jù)庫結(jié)合.在系統(tǒng)編寫上具備可行性.經(jīng)濟(jì)方面:本系統(tǒng)可以服務(wù)電廠,電費管理單位,為公司節(jié)約人力開支.社會方面:服務(wù)于大眾,以便抄表人員工作,可靠以便.系統(tǒng)設(shè)計系統(tǒng)功能構(gòu)造設(shè)計程序登陸程序登陸主界面顧客交費本月抄費資料導(dǎo)出數(shù)據(jù)查詢信息錄入系統(tǒng)數(shù)據(jù)維護(hù)基本數(shù)據(jù)維護(hù)協(xié)助退出系統(tǒng)數(shù)據(jù)庫設(shè)計顧客類型表:字段名稱數(shù)據(jù)類型闡明ATypeID自動編號AType文本電費類型UNITPRICE貨幣Adate日期/時間電費設(shè)立日期密碼表:字段名稱數(shù)據(jù)類型姓名文本操作權(quán)限文本密碼文本MaxID表:字段名稱數(shù)據(jù)闡明TableName文本MaxID數(shù)字界面設(shè)計與代碼設(shè)計1.顧客登陸界面設(shè)計:界面設(shè)計與代碼設(shè)計顧客登陸界面代碼分析:PrivateSubCommand1_Click()DimrstpchardAsNewADODB.RecordsetDimreHardAsStringDimgetidAsStringreHard=GetpcHard(getid)rstpchard.Open"select*fromgetpchard",gCnn,adOpenKeyset,adLockBatchOptimisticIfrstpchard.RecordCount=0Thenrstpchard.AddNewrstpchard.Fields(0)=reHardrstpchard.UpdateBatchadAffectCurrentElseIfTrim(reHard)<>Trim(rstpchard.Fields(0))ThenMsgBox"對不起,使用不合法請與開發(fā)者聯(lián)系!",vbInformationEndEndIfEndIfIfCheck1.Value=1ThenSetrec=NewADODB.Recordsetrec.Open"select*from記住密碼",gCnn,3,3rec("標(biāo)記")="1"IfCombo2.Text<>""Thenrec("姓名")=Combo2.TextElserec("姓名")=""EndIfIfCombo1.Text<>""Thenrec("權(quán)限")=Combo1.TextElserec("權(quán)限")=""EndIfIfText2.Text<>""Thenrec("密碼")=Text2.TextElserec("密碼")=""EndIfrec.Updaterec.CloseElseSetrec=NewADODB.Recordsetrec.Open"select*from記住密碼",gCnn,3,3rec("標(biāo)記")="0"rec.Updaterec.CloseEndIfDimrec1AsADODB.RecordsetSetrec1=NewADODB.Recordsetrec1.Open"select*from登錄人員",gCnn,3,3Setrec=NewADODB.Recordsetrec.Open"select*from密碼表where姓名='"&Combo2.Text&"'and操作權(quán)限='"&Combo1.Text&"'and密碼='"&Text2.Text&"'",gCnn,3,3Ifrec.EOF=FalseThenIfrec("操作權(quán)限")<>"管理員"Then'FRMMAIN.XZCK.Enabled=FalseMDIme.mczy.Enabled=FalseMDIme.xtwh.Enabled=FalseMDIme.del.Enabled=False'FRMMAIN.DJGL.Enabled=False'FRMMAIN.delte.Enabled=FalseElse'Me.XZCK.Enabled=TrueMDIme.mczy.Enabled=TrueMDIme.xtwh.Enabled=TrueCreateNewKeyHKEY_CURRENT_USER,"ZhiYuanTechnologe"SetKeyValueHKEY_CURRENT_USER,"ZhiYuanTechnologe","UserName",dlj,REG_SZSetKeyValueHKEY_CURRENT_USER,"ZhiYuanTechnologe","PassWord",dlj,REG_SZ'FRMMAIN.DJGL.Enabled=True'FRMMAIN.delte.Enabled=TrueEndIfrec1("姓名")=Combo2.Textrec1.Updaterec1.CloseMe.HideGuser=Combo2.TextMDIme.ShowElseMsgBox"權(quán)限或密碼不對的,請重試!",vbInformationEndIfrec.CloseEndSubPrivateSubCommand11_Click()EndSubPrivateSubCommand2_Click()Combo2.Text=""Text2.Text=""Combo1.Text=""EndSubPrivateSubCommand3_Click()EndEndSubPrivateSubCommand4_Click()Me.HideFRMMMXG.Show1EndSubPrivateSubForm_Activate()Text2.Text=""Combo1.Text=""Combo2.Text=""Setrec=NewADODB.Recordsetrec.Open"select*from記住密碼",gCnn,3,3Ifrec("標(biāo)記")="0"Orrec("標(biāo)記")="1"ThenCheck1.Value=rec("標(biāo)記")EndIfrec.CloseSetrec=NewADODB.Recordsetrec.Open"select*from記住密碼",gCnn,3,3Ifrec("標(biāo)記")=1ThenCombo2.Text=rec("姓名")Combo1.Text=rec("權(quán)限")Text2.Text=rec("密碼")EndIfrec.CloseCommand1.SetFocusEndSubPrivateSubForm_Load()gCnn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;JetOLEDB:databasepassword="&DbPassword&";DataSource="&_App.Path&"\data\dbdb.mdb;PersistSecurityInfo=False"gCnn.CursorLocation=adUseClientgCnn.OpenSetrec=NewADODB.Recordsetrec.Open"selectdistinct姓名from密碼表",gCnn,3,3WithCombo2DoUntilrec.EOF.AddItemrec("姓名")rec.MoveNextLoopEndWithrec.CloseSetrec=NothingEndSubPrivateSubForm_QueryUnload(CancelAsInteger,UnloadModeAsInteger)Cancel=TrueSelectCaseMsgBox("此操作將退出本系統(tǒng),繼續(xù)嗎?",vbYesNo,"警告")CasevbYesCancel=FalseEndCaseElseCancel=TrueEndSelectEndSub2.主界面設(shè)計:主界面代碼設(shè)計:PrivateSuballlm_Click()frmList.qfFlg=FalsefrmList.ShowEndSubPrivateSubbackup_Click()frmbeifen.ShowEndSubPrivateSubbenrixiaojie_Click()frmCount.ShowEndSubPrivateSubCommand1_Click()frameFee.Visible=FalseEndSubPrivateSubcmdQuery_Click()DimrstAsNewADODB.Recordsetrst.Open"select*frompanelinfowhereholder='"&Me.txtUser&"'anddelflag<>true",gCnn,adOpenStatic,adLockBatchOptimisticIfrst.RecordCount<>0Thendcvalue.Text=rst.Fields(2)txtUserName(0)=rst.Fields(1)txtUserName(1)=rst.Fields!nowecounttxtUserName(2)=rst.Fields!cendcodedtpwdate.Value=rst.Fields(4)txtUserName(3)=Format(rst.Fields!lMoney,"###0.00")txtUserName(4)=Format(rst.Fields!bmoney,"###0.00")txtUserName(6)=Format(rst.Fields!lsFee,"###0.00")'txtUserName(5)=txtUserName(1)*rst.Fields!lMoney*(rst.Fields!lightScale/100)+txtUserName(1)*txtUserName(4)*(1-rst.Fields!lightScale/100)txtUserName(5)=Format(txtUserName(1)*rst.Fields!lMoney*(rst.Fields!lightScale/100)+rst.Fields!nowecount*rst.Fields!bmoney*(1-rst.Fields!lightScale/100),"###0.00")txtUserName(8)=rst.Fields(9)txtUserName(7)=Format(Val(txtUserName(5))+Val(txtUserName(6)),"####0.00")dcNum.Text=rst.Fields(1)ElseMsgBox"沒有查詢到數(shù)據(jù)!",vbInformationEndIfrst.CloseSetrst=NothingEndSubPrivateSubdcNum_Click(AreaAsInteger)DimrstAsNewADODB.Recordsetrst.Open"select*frompanelinfowhereholderid='"&dcNum.Text&"'anddelflag<>true",gCnn,adOpenKeyset,adLockBatchOptimisticIfNotrst.EOFThendcvalue.Text=rst.Fields(2)txtUserName(0)=rst.Fields(1)txtUserName(1)=rst.Fields!nowecounttxtUserName(2)=rst.Fields!cendcodedtpwdate.Value=rst.Fields(4)txtUserName(3)=Format(rst.Fields!lMoney,"###0.00")txtUserName(4)=Format(rst.Fields!bmoney,"###0.00")txtUserName(6)=Format(rst.Fields(8),"####0.00")txtUserName(5)=Format(txtUserName(1)*txtUserName(3)*(rst.Fields!lightScale/100)+txtUserName(1)*txtUserName(4)*(1-rst.Fields!lightScale/100),"####0.00")txtUserName(8)=rst.Fields(9)txtUserName(7)=Format(Val(txtUserName(5))+Val(txtUserName(6)),"####0.00")EndIfrst.CloseEndSubPrivateSubdcvalue_Click(AreaAsInteger)DimrstAsNewADODB.Recordsetrst.Open"select*frompanelinfowhereholderid='"&dcvalue.BoundText&"'anddelflag<>true",gCnn,adOpenStatic,adLockBatchOptimisticIfNotrst.EOFThendcvalue.Text=rst.Fields(2)txtUserName(0)=rst.Fields(1)txtUserName(1)=rst.Fields!nowecounttxtUserName(2)=rst.Fields!cendcodedtpwdate.Value=rst.Fields(4)txtUserName(3)=Format(rst.Fields!lMoney,"###0.00")txtUserName(4)=Format(rst.Fields!bmoney,"###0.00")txtUserName(6)=Format(rst.Fields!lsFee,"###0.00")'txtUserName(5)=txtUserName(1)*rst.Fields!lMoney*(rst.Fields!lightScale/100)+txtUserName(1)*txtUserName(4)*(1-rst.Fields!lightScale/100)txtUserName(5)=Format(txtUserName(1)*rst.Fields!lMoney*(rst.Fields!lightScale/100)+rst.Fields!nowecount*rst.Fields!bmoney*(1-rst.Fields!lightScale/100),"###0.00")txtUserName(8)=rst.Fields(9)txtUserName(7)=Format(Val(txtUserName(5))+Val(txtUserName(6)),"####0.00")dcNum.Text=rst.Fields(1)EndIfrst.CloseSetrst=NothingEndSubPrivateSubdcvalue_KeyPress(KeyAsciiAsInteger)KeyAscii=0EndSubPrivateSubdel_Click()frmdel.ShowEndSubPrivateSubdhcb_Click()usrcopyP.ShowEndSubPrivateSubdhcp_Click()frmCopyP.ShowEndSubPrivateSubduohu_Click()frmCuifei.muser1=2frmCuifei.ShowEndSubPrivateSubedit_Click()frmEdit.ShowEndSubPrivateSubexit_Click()EndEndSubPrivateSubinsert_Click()frmInsert.Show1EndSubPrivateSubjiaonadianfei_Click()frmFee.ShowEndSubPrivateSubM_USERYTPE_Click()FRMUSERTYPE.Show1EndSubPrivateSubMDIForm_Load()loadAddEndSubPublicSubloadAdd()Ifrst.State=1Thenrst.CloseEndIfrst.Open"select*frompanelinfowheredelflag<>true",gCnn,adOpenKeyset,adLockBatchOptimisticIfrst.RecordCount<>0ThenSetdcvalue.RowSource=rstdcvalue.BoundColumn="holderID"dcvalue.ListField="holder"SetdcNum.DataSource=rstSetdcNum.RowSource=rstdcNum.ListField="holderid"IfNotrst.EOFThendcNum.Text=rst.Fields!holderiddcvalue.Text=rst.Fields(2)txtUserName(0)=rst.Fields(1)txtUserName(1)=rst.Fields!nowecounttxtUserName(2)=rst.Fields!cendcodedtpwdate.Value=rst.Fields(4)txtUserName(3)=Format(rst.Fields!lMoney,"##0.00")txtUserName(4)=Format(rst.Fields!bmoney,"###.0.00")txtUserName(6)=rst.Fields!lsFeetxtUserName(5)=Val(txtUserName(1))*Val(txtUserName(3))*(Val(rst.Fields!lightScale)/100)+Val(txtUserName(1))*Val(txtUserName(4))*(1-rst.Fields!lightScale/100)txtUserName(8)=rst.Fields(9)txtUserName(7)=Val(txtUserName(5))+Val(txtUserName(6))rst.Fields!cFeeMoney=txtUserName(7)rst.UpdateBatchadAffectCurrentEndIfEndIfEndSubPublicSubloadData(HidAsString)DimrstAsNewADODB.RecordsetDimcnnAsNewADODB.ConnectionDimAtimesAsIntegerDimsqlAddAsStringcnn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;JetOLEDB:databasepassword="&DbPassword&";DataSource="&_App.Path&"\data\dbdb.mdb;PersistSecurityInfo=False"cnn.CursorLocation=adUseClientcnn.OpenIfTrim(Hid)<>""Thenrst.Open"select*frompanelinfowhereholderid='"&Hid&"'anddelflag<>true",cnn,adOpenStatic,adLockBatchOptimisticElserst.Open"select*frompanelinfowheredelflag<>true",cnn,adOpenStatic,adLockBatchOptimisticEndIfIfNotrst.EOFThendcNum.Text=rst.Fields!holderiddcvalue.Text=rst.Fields(2)txtUserName(0)=rst.Fields(1)txtUserName(1)=rst.Fields!nowecounttxtUserName(2)=rst.Fields!cendcodedtpwdate.Value=rst.Fields(4)txtUserName(3)=Format(rst.Fields!lMoney,"####0.00")txtUserName(4)=Format(rst.Fields!bmoney,"####0.00")txtUserName(6)=Format(rst.Fields!lsFee,"####0.00")'txtUserName(5)=Format(txtUserName(1)*txtUserName(3)*(rst.Fields!lightScale/100)+txtUserName(1)*txtUserName(4)*(1-rst.Fields!lightScale/100),"####0.00")Ifrst.Fields!Atimes=0ThenAtimes=1ElseAtimes=rst.Fields!AtimesEndIftxtUserName(5)=Format(Val(txtUserName(1))*txtUserName(3)*Atimes,"####0.00")txtUserName(8)=rst.Fields(9)txtUserName(7)=Format(Val(txtUserName(5))+Val(txtUserName(6)),"####0.00")rst.Fields!cFeeMoney=txtUserName(7)rst.UpdateBatchadAffectCurrentEndIfrst.Closecnn.CloseEndSubPrivateSubMDIForm_Unload(CancelAsInteger)gCnn.CloseSetgcon=NothingEndSubPrivateSubmgcf_Click()frmFeefind.ShowEndSubPrivateSubmhf_Click()frmdaoru.ShowEndSubPrivateSubmsf_Click()frmFind1.ShowEndSubPrivateSubqianfeilm_Click()frmList.qfFlg=TruefrmList.ShowEndSubPrivateSubToolbar1_ButtonClick(ByValButtonAsMSComctlLib.Button)SelectCaseTrim(Button.Key)Case"a"frmFee.Show1Case"b"frmCopyP.ShowCase"c"frmFee.Show1Case"d"frmbeifen.Show1Case"e"frmdaoru.Show1Case"f"frmFeefind.Show1Case"g"frmFind1.Show1Case"dhcb1"Case"dbcb2"Case"j"X=MsgBox("真要退出嗎?",vbYesNo+vbQuestion,"警告")IfX=vbYesThenEndElseEndIfEndSelectEndSubPrivateSubToolbar1_ButtonMenuClick(ByValButtonMenuAsMSComctlLib.ButtonMenu)SelectCaseButtonMenu.KeyCase"dhcb1"frmCopyP.ShowCase"dhcb2"usrcopyP.ShowEndSelectEndSubPrivateSubweihu_Click()FRMYHSD.ShowEndSubPrivateSubyihu_Click()frmCuifei.muser1=1frmCuifei.ShowEndSub備份界面設(shè)計::備份代碼設(shè)計:PrivateSubCommand1_Click()DimaAsStringa=App.Patha=a&"\"b=Text1.Text'OnErrorGoToerrhandle:DimfilenameAsStringfilename=""&Text1.Text&"dbdb.mdb"Ifa=Text1.TextThenMsgBox"備份目錄與原文獻(xiàn)目錄相似,請重新選取!"ExitSubEndIfIfDir(""&b&"dbdb.mdb")<>""ThenDimllpAsStringllp=MsgBox("此目錄下已有該文獻(xiàn),要覆蓋嗎?",vbYesNo,"備份文獻(xiàn)")Ifllp=vbYesThenKill(""&b&"dbdb.mdb")FileCopy""&a&"\data\dbdb.mdb",""&b&"dbdb.mdb"Dimll=MsgBox("備份成功!",vbOKOnly,"提示")ElseExitSubEndIfElseFileCopy""&a&"\data\dbdb.mdb",""&b&"dbdb.mdb"Dimllll=MsgBox("備份成功!",vbOKOnly,"提示")EndIfExitSub'errhandle:'MsgBox"浮現(xiàn)錯誤,不能復(fù)制",vbOKOnly+vbCritical,"復(fù)制文獻(xiàn)"'ResumeNextEndSubPrivateSubCommand2_Click()'dy'Me.HideUnloadMeEndSubPrivateSubDir1_Change()'Drive1.Drive=Dir1IfRight(Dir1.Path,1)<>"\"ThenText1.Text=Dir1.Path+"\"ElseText1.Text=Dir1.PathEndIfCommand1.Enabled=TrueEndSubPrivateSubDir1_Click()IfRight(Dir1.Path,1)<>"\"ThenText1.Text=Dir1.Path+"\"ElseText1.Text=Dir1.PathEndIfCommand1.Enabled=TrueEndSubPrivateSubDrive1_Change()Dir1.Path=Drive1.DriveEndSubPrivateSubForm_Activate()Command1.Enabled=FalsegCnn.CloseChDriveApp.PathChDirApp.Path'Text1.SetFocus'Text1.Text="c:\"Text1.Text=CurDir()Text1.Enabled=FalseEndSubPrivateSubForm_Load()ChDriveApp.PathChDirApp.PathEndSubPrivateSubForm_QueryUnload(CancelAsInteger,UnloadModeAsInteger)dyEndSubPrivateSubForm_Unload(CancelAsInteger)IfgCnn.State=0ThengCnn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;JetOLEDB:databasepassword="&DbPassword&";DataSource="&_App.Path&"\data\dbdb.mdb;PersistSecurityInfo=False"gCnn.CursorLocation=adUseClientgCnn.OpenEndIfMDIme.loadAddEndSub單戶抄表界面設(shè)計:單戶抄表代碼設(shè)計:PrivateSubCommand2_Click()DimcnnAsNewADODB.ConnectionDimrstEAsNewADODB.RecordsetDimcmdExeAsNewADODB.CommandDimnowEvAsDoubleDimsqlAddAsStringIfTrim(txtUserName(0).Text)=""ThenMsgBox"沒有要抄表顧客,請先添加顧客!",vbInformationExitSubEndIfIfTrim(txtUserName(9).Text)=""ThenMsgBox"請先輸入數(shù)據(jù)!",vbInformationExitSubEndIfIfTrim(txtUserName(9).Text)<Trim(txtUserName(2).Text)ThenMsgBox"輸入數(shù)據(jù)錯誤,當(dāng)前止碼太小!",vbInformationExitSubEndIfcnn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;JetOLEDB:databasepassword="&DbPassword&";DataSource="&_App.Path&"\data\dbdb.mdb;PersistSecurityInfo=False"cnn.CursorLocation=adUseClientcnn.OpencmdExe.ActiveConnection=cnnrstE.Open"selectnowecountfrompanelinfowhereholderID='"&Trim(txtUserName(0))&"'",cnn,adOpenStatic,adLockBatchOptimisticnowEv=Val(rstE.Fields(0).Value)+(Val(txtUserName(9))-Val(txtUserName(2)))sqlAdd="updatepanelinfosetLEndPCode="&Val(txtUserName(2).Text)&",cEndCode="&Val(txtUserName(9).Text)&",nowEcount="&nowEv&",writedate=#"&dtpwdate(1)&"#whereholderID='"&Trim(txtUserName(0))&"'"cmdExe.CommandText=sqlAddcmdExe.ExecutesqlAdd'cnn.ExecutesqlAddtxtUserName(2).Text=txtUserName(9)txtUserName(9)=""cnn.CloseMsgBox"數(shù)據(jù)保存完畢!",vbInformationUnloadMeEndSubPrivateSubForm_Load()DimrstAsNewADODB.RecordsetDimsqlEditAsStringdtpwdate(1).Value=Format(Now,"yyyy-mm-dd")sqlEdit="select*frompanelinfo"sqlEdit=sqlEdit&"whereholderid='"&Trim(MDIme.txtUserName(0))&"'anddelflag<>true"rst.OpensqlEdit,gCnn,adOpenStatic,adLockBatchOptimisticIfNotrst.EOFThentxtUserName(0)=rst.Fields(1)txtUserName(1)=rst.Fields(2)txtUserName(2)=rst.Fields!cendcodedtpwdate(0).Value=rst.Fields(4)EndIfbuttontime=FalseEndSubPrivateSubForm_Unload(CancelAsInteger)MDIme.loadData(txtUserName(0))Cancel=0EndSubPrivateSubnextuser_Click()DimrstAsNewADODB.RecordsetDimsqlEditAsStringsqlEdit="select*frompanelinfo"sqlEdit=sqlEdit&"whereholderid<>'"&Trim(txtUserName(0))&"'anddelflag<>true"rst.OpensqlEdit,gCnn,adOpenStatic,adLockBatchOptimisticIfbuttontime=FalseThenIfNotrst.EOFThentxtUserName(0)=rst.Fields(1)txtUserName(1)=rst.Fields(2)txtUserName(2)=rst.Fields!cendcodedtpwdate(0).Value=rst.Fields(4)buttontime=TrueEndIfElserst.MoveNextIfNotrst.EOFThentxtUserName(0)=rst.Fields(1)txtUserName(1)=rst.Fields(2)txtUserName(2)=rst.Fields!cendcodedtpwdate(0).Value=rst.Fields(4)buttontime=TrueEndIfEndIfEndSubPrivateSubtxtUserName_KeyPress(IndexAsInteger,KeyAsciiAsInteger)IfIndex=9ThenIfKeyAscii<>8AndKeyAscii<>46AndKeyAscii<48OrKeyAscii>57ThenKeyAscii=0EndIfEndSub數(shù)據(jù)導(dǎo)入界面設(shè)計:數(shù)據(jù)導(dǎo)入代碼設(shè)計:PrivateSubCommand1_Click()OnErrorGoToerrhandle:DimaAsStringa=App.Patha=a&"\"b=Text1.TextDimfilenameAsStringIfDir(""&a&"計費系統(tǒng)數(shù)據(jù)庫.mdb")<>""ThenDimllAsStringll=MsgBox("此目錄下有此文獻(xiàn)要覆蓋嗎",vbYesNo,"復(fù)制文獻(xiàn)")Ifll=vbYesThenKill(""&a&"計費系統(tǒng)數(shù)據(jù)庫.mdb")FileCopy""&Text1.Text&"",""&a&"計費系統(tǒng)數(shù)據(jù)庫.mdb"Dimll=MsgBox("數(shù)據(jù)導(dǎo)入成功",vbOKOnly,"提示")ElseExitSubEndIfElseFileCopy""&Text1.Text&"",""&a&"計費系統(tǒng)數(shù)據(jù)庫.mdb"Dimllpllp=MsgBox("數(shù)據(jù)導(dǎo)入成功",vbOKOnly,"提示")EndIfExitSuberrhandle:MsgBox"浮現(xiàn)錯誤,不能復(fù)制",vbOKOnly+vbCritical,"復(fù)制文獻(xiàn)"EndSubPrivateSubCommand2_Click()dyUnloadMeEndSubPrivateSubDir1_Change()IfRight(Dir1.Path,1)<>"\"ThenText1.Text=Dir1.Path+"\"ElseText1.Text=Dir1.PathEndIfFile1.Path=Dir1.PathEndSubPrivateSubDrive1_Change()IfDrive1.Drive="a:"ThenMsgBox"不能從A盤導(dǎo)入"ExitSubEndIfDir1.Path=Drive1.DriveEndSubPrivateSubFile1_Click()Text1.Text=Text1.Text+File1.filenameCommand1.Enabled=TrueEndSubPrivateSubForm_Activate()gCnn.CloseCommand1.Enabled=False'Text1.Text="c:\"Text1.Text=CurDir()Text1.Enabled=FalseEndSubPrivateSubForm_QueryUnload(CancelAsInteger,UnloadModeAsInteger)dyUnloadMeEndSubPrivateSubForm_Unload(CancelAsInteger)IfgCnn.State=0ThengCnn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;JetOLEDB:databasepassword="&DbPassword&";DataSource="&_App.Path&"\data\dbdb.mdb;PersistSecurityInfo=False"gCnn.CursorLocation=adUseClientgCnn.OpenEndIfMDIme.loadAddEndSub數(shù)據(jù)刪除界面設(shè)計:數(shù)據(jù)刪除代碼設(shè)計:PrivateSubcmdAsure_Click()IfMsgBox("你擬定要刪除該數(shù)據(jù)嗎?",vbInformation+vbYesNo)<>vbYesThenExitSubEndIfIfTrim(MDIme.dcvalue.BoundText)<>""ThenDimcnnAsNewADODB.ConnectionDimsqlAddAsStringcnn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;JetOLEDB:databasepassword="&DbPassword&";DataSource="&_App.Path&"\data\dbdb.mdb;PersistSecurityInfo=False"cnn.CursorLocation=adUseClientcnn.OpensqlAdd="updatepanelinfosetdelflag=true"sqlAdd=sqlAdd&"whereholderid='"&Trim(MDIme.dcvalue.BoundText)&"'"cnn.ExecutesqlAddcnn.CloseMsgBox"數(shù)據(jù)刪除完畢!",vbInformationEndIfEndSubPrivateSubCommand1_Click()Fori=0To10Ifi<>9ThenMDIme.txtUserName(i)=""EndIfNextMDIme.dcNum=""MDIme.dcvalue=""UnloadMeEndSubPrivateSubForm_Load()DimrstAsNewADODB.RecordsetDimsqlEditAsStringsqlEdit="select*frompanelinfo"sqlEdit=sqlEdit&"whereholderid='"&Trim(MDIme.txtUserName(0))&"'anddelflag<>true"rst.OpensqlEdit,gCnn,adOpenKeyset,adLockBatchOptimisticIfNotrst.EOFThentxtUserName(0)=rst.Fields(1)txtUserName(1)=rst.Fields(2)txtUserName(2)=rst.Fields(3)dtpWdate.Value=rst.Fields(4)txtUserName(3)=rst.Fields(5)txtUserName(4)=Format(rst.Fields(6),"####0.00")txtUserName(5)=Format(rst.Fields(7),"####0.00")txtUserName(6)=rst.Fields(8)txtUserName(7)=rst.Fields(9)txtUserName(8)=rst.Fields(10)txtUserName(9)=rst.Fields!cendcodechangeE=rst.Fields!cendcodecEcount=rst.Fields!nowecountIfrst.Fields(14)<>NullThenDTPicker1.Value=rst.Fields(14)EndIftxtUserName(10)=rst.Fields!cFeeMoneyEndIfrst.CloseEndSubPrivateSubForm_Unload(CancelAsInteger)MDIme.loadAddEndSub數(shù)據(jù)修改界面設(shè)計:數(shù)據(jù)修改代碼設(shè)計:DimchangeEAsDoubleDimcEcountAsDoublePrivateSubcmdAsure_Click()IfTrim(MDIme.dcvalue.BoundText)<>""ThenDimcnnAsNewADODB.ConnectionDimsqlAddAsStringcnn.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;JetOLEDB:databasepassword="&DbPassword&";DataSource="&_App.Path&"\data\dbdb.mdb;PersistSecurityInfo=False"cnn.CursorLocation=adUseClientcnn.OpensqlAdd="updatepanelinfosetholderid='"&txtUserName(0)&"',holder='"&txtUserName(1)&"',LEndPCode='"&txtUserName(2)&"',CopyDate=#"&dtpWdate.Value&"#,lightscale="&txtUserName(3)&",lsfee="&txtUserName(4)&",lmoney="&txtUserName(5)&",bmoney="&txtUserName(6)&",cname='"&txtUserName(7)&"',memotext='"&txtUserName(8)&"',cEndCode="&txtUserName(9)&",cFeeMoney="&Val(txtUserName(10))&",nowecount="&changeE&",atimes="&Me.Text1&""sqlAdd=sqlAdd&"whereholderid='"&Trim(MDIme.dcvalue.BoundText)&"'"cnn.ExecutesqlAddsqlAdd="update顧客類型setUNITPRICE="&Me.txtUserName(5)&"whereATypeID="&dcob用途.BoundTextcnn.CloseMsgBox"數(shù)據(jù)修改完畢!",vbInformationEndIfEndSubPrivateSubCommand1_Click()UnloadMeEndSubPrivateSubdcob用途_Click(AreaAsInteger)DimrstAsNewADODB.RecordsetIfdcob用途.BoundText<>""Thenrst.Open"select*from顧客類型whereATypeID="&dcob用途.BoundText&"",gCnn,adOpenStatic,adLockBatchOptimisticMe.txtUserName(5)=Format(rst.Fields(2),"###0.00")rst.CloseElseMsgBox"請先添加顧客電表類型信息!",vbInformationExitSubEndIfEndSubPrivateSubForm_Load()DimrstAsNewADODB.RecordsetDimsqlEditAsStringsqlEdit="select*frompanelinfo"sqlEdit=sqlEdit&"whereholderid='"&Trim(MDIme.txtUserName(0))&"'anddelflag<>true"rst.OpensqlEdit,gCnn,adOpenKeyset,adLockBatchOptimisticIfNotrst.EOFThentxtUserName(0)=rst.Fields(1)txtUserName(1)=rst.Fields(2)txtUserName(2)=rst.Fields(3)dtpWdate.Value=rst.Fields(4)txtUserName(3)=Format(rst.Fields(5),"####0.00")txtUserName(4)=Format(rst.Fields(6),"####0.00")txtUserName(5)=Format(rst.Fields(7),"####0.00")txtUserName(6)=Format(rst.Fields(8),"####0.00")txtUserName(7)=rst.Fields(9)txtUserName(8)=rst.Fields(10)txtUserName(9)=rst.Fields!cendcodeText1.Text=rst.Fields!AtimeschangeE=rst.Fields!cendcodecEcount=rst.Fields!nowecountIfrst.Fields(14)<>NullThenDTPicker1.Value=rst.Fields(14)EndIftxtUserName(10)=rst.Fields!cFeeMoneyEndIfDimrstJBAsNewADODB.RecordsetSetrstJB.ActiveConnection=gCnnrstJB.CursorLocation=adUseClientrstJB.LockType=adLockBatchOptimisticrstJB.CursorType=adOpenKeysetrstJB.Open"select*from顧客類型whereatypeid="&rst.Fields!AtypeIDSetdcob用途.DataSource=rstJBSetdcob用途.RowSource=rstJBdcob用途.BoundColumn="ATYPEID"dcob用途.ListField="ATYPE"IfrstJB.RecordCount<>0Thendcob用途.Text=rstJB.Fields(1)Me.txtUserName(5)=Format(rstJB.Fields(2),"###0.00")EndIfrst.CloseEndSubPrivateSubForm_Unload(CancelAsInteger)MDIme.loadData(txtUserName(0))EndSubPrivateSubtxtUserName_Change(IndexAsInteger)IfIndex=9ThenchangeE=cEcount+(Val(txtUserName(9))-changeE)EndIfEndSubPrivateSubUpDown1_Change()Me.Text1=UpDown1.ValueEndSub開始收費界面設(shè)計:開始收費代碼設(shè)計:PrivateSubCmdPrint_Click()OnErrorGoTolDimLongColorAsLongIfMsgBox("打印機(jī)準(zhǔn)備好了嗎?",vbYesNo+vbInformation)<>vbYesThenExitSubEndIfMe.CmdPrint.Visible=FalseLongColor=Me.BackColorMe.BackColor=vbWhitetxtPrint.BackColor=vbWhiteMe.PrintFormMe.BackColor=LongColorMe.CmdPrint.Visible=TrueExitSubl:MsgBoxErr.DescriptionEndSubPrivateSubCommand1_Click()DimrstFeeEndAsNewADODB.RecordsetDimcmdExeAsNewADODB.CommandDimreMoneyAsStringDimsqlStringAsStringIfTrim(txtFee)=""OrTrim(txtM)=""ThenMsgBox"請先輸入數(shù)據(jù)!",vbInformationExitSubEndIfreMoney=ConvertMe(Trim(txtFee))DimChangeAsStringChange=Val(txtM)-Val(txtFee)IfChange<0ThenIfMsgBox("實收電費比應(yīng)收鈔票大,您擬定要這樣收取?",vbYesNo+vbInformation)=vbNoThenExitSubEndIfEndIfMe.txtHoldernum=MDIme.txtUserName(0)Me.holderName=MDIme.dcvalue.TextMe.lblEAmount=MDIme.txtUserName(1)&"度"Me.endA=MDIme.txtUserName(2)&"度"Me.lblHandInMoney="¥"&Format(txtFee,"####0.00")Me.lblSum="¥"&Format(txtM.Text,"####0.00")Me.lblfinaldate=DateIfChange>=0ThenMe.lblMoneyOfCard="¥"&Format(Change,"####0.00")ElseMe.lblMoneyOfCard=0EndIfrstFeeEnd.Open"select*frompanelinfowhereholderid='"&MDIme.txtUserName(0)&"'anddelflag<>true",gCnn,adOpenStatic,adLockBatchOptimisticDimrusrTypeAsNewADODB.RecordsetIfrstFeeEnd.RecordCount<>0ThenrusrType.Open"select*from顧客類型whereAtypeID="&rstFeeEnd.Fields!AtypeID,gCnn,adOpenStatic,adLockBatchOp
溫馨提示
- 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)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 高級動物疫病防治員模擬題+參考答案
- (新)國家義務(wù)教育質(zhì)量監(jiān)測心理健康測考試試題練習(xí)題及答案解析
- 德育骨干教師試題及答案
- 初中語文教師素養(yǎng)試題及答案
- 2026高校區(qū)域技術(shù)轉(zhuǎn)移轉(zhuǎn)化中心(福建)新型功能材料分中心招聘5人備考題庫附答案
- 上海煙草集團(tuán)有限責(zé)任公司2026年應(yīng)屆生招聘備考題庫附答案
- 樂平市市屬國資控股集團(tuán)有限公司面向社會公開招聘人員【15人】備考題庫必考題
- 北京科技大學(xué)智能科學(xué)與技術(shù)學(xué)院招聘3人考試備考題庫必考題
- 古藺縣2025年公開招募新興領(lǐng)域黨建工作專員的參考題庫附答案
- 城發(fā)水務(wù)(固始)有限公司招聘11人(河南)考試備考題庫必考題
- 老年癡呆科普課件整理
- 2022年鈷資源產(chǎn)業(yè)鏈全景圖鑒
- von frey絲K值表完整版
- 勾股定理復(fù)習(xí)導(dǎo)學(xué)案
- GB/T 22900-2022科學(xué)技術(shù)研究項目評價通則
- SB/T 11094-2014中藥材倉儲管理規(guī)范
- GB/T 6418-2008銅基釬料
- GB/T 16621-1996母樹林營建技術(shù)
- GB/T 14518-1993膠粘劑的pH值測定
- GB/T 14072-1993林木種質(zhì)資源保存原則與方法
- 垃圾分類科普指南課件(21張PPT)
評論
0/150
提交評論