智能电表收费管理系统毕业设计_第1页
智能电表收费管理系统毕业设计_第2页
智能电表收费管理系统毕业设计_第3页
智能电表收费管理系统毕业设计_第4页
智能电表收费管理系统毕业设计_第5页
已阅读5页,还剩39页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、毕业设计电表管理系统摘 要1abstract2第一章 引言411 课题背景412 系统简介5第二章 系统的分析621 系统开发的目标和思想622 系统的可行性分析8第三章 系统的设计1831 系统的功能结构设计1832 系统的数据库设计33 界面设计与代码设计2324结束语46致谢47参考文献48摘 要 传统的电费管理都是由工作人员手工查表,抄表完成的,其中要完成用户电费的收取,每月抄度,用户购电情况查询,以及列出欠费用户的信息名单,之类的信息.其工作强度大,工作流程繁琐,由于工作人员的不细心,将会造成电费收支的出错也是经常发生的.鉴于以上原因我们有必要开发一种帮作电费管理人员的软件系统,可以

2、完成检查用户用电情况,每月抄度,信息录入以及基本数据维护的各项功能.本系统采用visual basic 6.0与微软access数据库方式.界面尽量做到人性化,数据维护方面做到可靠安全.关键字: 电费管理,visual basic, access,数据库abstractelectricity from the traditional management staff are artisanal chabiao, meter reading completed, which should be completed by the users of electricity per month pen

3、alty for users to buy electricity enquiries, and a list of user information channels list such information. its work-intensive, cumbersome workflow, because staff are not careful. would result in the tariff revenue is recurring mistakes. given the above reasons we need to develop a management softwa

4、re to help make electricity system, the user can complete the inspection of electricity monthly copied degrees, information includes basic data and the maintenance function. with the system using visual basic microsoft access 6.0 database. as far as possible humanization interface, data maintenance

5、to reliable security. keyword : tariff management, visual basic, access, the database第一章 引言11 课题背景传统的电费管理都是由工作人员手工查表,抄表完成的,其中要完成用户电费的收取,每月抄度,用户购电情况查询,以及列出欠费用户的信息名单,之类的信息.其工作强度大,工作流程繁琐,由于工作人员的不细心,将会造成电费收支的出错也是经常发生的.鉴于以上原因我们有必要开发一种帮作电费管理人员的软件系统,可以完成检查用户用电情况,每月抄度,信息录入以及基本数据维护的各项功能.本系统采用visual basic 6.0

6、与微软access数据库方式.界面尽量做到人性化,数据维护方面做到可靠安全.12 系统简介 本系统主要由以下几大功能模块组成:一. 用户交费:(交纳电费,本日小节)二. 本月抄度:(单户抄度 多户抄度)三. 资料导出 (全部清单,欠费清单)四. 数据查询 (电费查询与统计,用户欠费查询)五. 信息录入 (资料录入,资料修改, 资料删除)六. 系统数据维护 (数据备份,数据恢复)七. 基本数据维护 (用户类型维护, 操作员维护)八. 帮助九. 退出第二章 系统的分析21 系统开发的目标和思想 本系统主要服务于电费管理人员的日常工作.设计思路主要参照工作人员抄表,记录资料,资料管理,信息录入等方面

7、的工作流程展开的.22 系统的可行性分析本系统采用visual basic6.0与微软的access作为数据库结合.在系统编写上具有可行性.经济方面:本系统可以服务电厂,电费管理单位,为企业节省人力开支.社会方面:服务于大众,方便抄表人员工作,可靠方便.第三章 系统的设计31 系统的功能结构设计程序登陆主界面用户交费本月抄费资料导出数据查询信息录入系统数据维护基本数据维护帮助退出32 系统的数据库设计1. 用户类型表:字段名称数据类型说明atypeid自动编号atype文本电费类型unitprice货币adate日期/时间电费设置日期2. 密码表: 字段名称数据类型姓名文本操作权限文本密码文本

8、3. maxid表:字段名称数据说明tablename文本maxid数字33 界面设计与代码设计1.用户登陆界面设计:34 界面设计与代码设计用户登陆界面代码分析:private sub command1_click()dim rstpchard as new adodb.recordsetdim rehard as stringdim getid as stringrehard = getpchard(getid)rstpchard.open select * from getpchard , gcnn, adopenkeyset, adlockbatchoptimisticif rstpc

9、hard.recordcount = 0 then rstpchard.addnew rstpchard.fields(0) = rehard rstpchard.updatebatch adaffectcurrentelse if trim(rehard) trim(rstpchard.fields(0) then msgbox 对不起,使用不合法请与开发者联系! , vbinformation end end ifend ifif check1.value = 1 thenset rec = new adodb.recordsetrec.open select * from 记住密码, g

10、cnn, 3, 3rec(标记) = 1if combo2.text thenrec(姓名) = combo2.textelserec(姓名) = end ifif combo1.text thenrec(权限) = combo1.textelserec(权限) = end ifif text2.text thenrec(密码) = text2.textelserec(密码) = end ifrec.updaterec.closeelseset rec = new adodb.recordsetrec.open select * from 记住密码, gcnn, 3, 3rec(标记) = 0

11、rec.updaterec.closeend ifdim rec1 as adodb.recordsetset rec1 = new adodb.recordsetrec1.open select * from 登录人员, gcnn, 3, 3set rec = new adodb.recordsetrec.open select * from 密码表 where 姓名= & combo2.text & and 操作权限= & combo1.text & and 密码= & text2.text & , gcnn, 3, 3if rec.eof = false then if rec(操作权限

12、) 管理员 then frmmain.xzck.enabled = false mdime.mczy.enabled = false mdime.xtwh.enabled = false mdime.del.enabled = false frmmain.djgl.enabled = false frmmain.delte.enabled = false else me.xzck.enabled = true mdime.mczy.enabled = true mdime.xtwh.enabled = true createnewkey hkey_current_user, zhiyuante

13、chnologe setkeyvalue hkey_current_user, zhiyuantechnologe, username, dlj, reg_sz setkeyvalue hkey_current_user, zhiyuantechnologe, password, dlj, reg_sz frmmain.djgl.enabled = true frmmain.delte.enabled = true end if rec1(姓名) = combo2.text rec1.update rec1.close me.hide guser = combo2.text mdime.sho

14、welse msgbox 权限或密码不正确,请重试!, vbinformationend ifrec.closeend subprivate sub command11_click()end subprivate sub command2_click()combo2.text = text2.text = combo1.text = end sub private sub command3_click()endend subprivate sub command4_click()me.hidefrmmmxg.show 1end sub private sub form_activate()te

15、xt2.text = combo1.text = combo2.text = set rec = new adodb.recordsetrec.open select * from 记住密码, gcnn, 3, 3if rec(标记) = 0 or rec(标记) = 1 thencheck1.value = rec(标记)end ifrec.closeset rec = new adodb.recordsetrec.open select * from 记住密码, gcnn, 3, 3if rec(标记) = 1 thencombo2.text = rec(姓名)combo1.text =

16、rec(权限)text2.text = rec(密码)end ifrec.closecommand1.setfocusend subprivate sub form_load()gcnn.connectionstring = provider=microsoft.jet.oledb.4.0;jet oledb:database password= & dbpassword & ;data source= & _app.path & datadbdb.mdb;persist security info=falsegcnn.cursorlocation = aduseclientgcnn.open

17、set rec = new adodb.recordsetrec.open select distinct 姓名 from 密码表, gcnn, 3, 3with combo2do until rec.eof.additem rec(姓名)rec.movenextloopend withrec.closeset rec = nothingend subprivate sub form_queryunload(cancel as integer, unloadmode as integer)cancel = trueselect case msgbox(此操作将退出本系统,继续吗?, vbyes

18、no, 警告)case vbyescancel = falseendcase elsecancel = trueend selectend sub2.主界面设计:主界面代码设计:private sub alllm_click()frmlist.qfflg = falsefrmlist.showend subprivate sub backup_click() frmbeifen.showend subprivate sub benrixiaojie_click()frmcount.showend subprivate sub command1_click()framefee.visible =

19、 falseend subprivate sub cmdquery_click() dim rst as new adodb.recordset rst.open select * from panelinfo where holder= & me.txtuser & and delflagtrue , gcnn, adopenstatic, adlockbatchoptimistic if rst.recordcount 0 then dcvalue.text = rst.fields(2) txtusername(0) = rst.fields(1) txtusername(1) = rs

20、t.fields!nowecount txtusername(2) = rst.fields!cendcode dtpwdate.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.field

21、s!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) t

22、xtusername(7) = format(val(txtusername(5) + val(txtusername(6), #0.00) dcnum.text = rst.fields(1) else msgbox 没有查询到数据! , vbinformation end if rst.close set rst = nothingend subprivate sub dcnum_click(area as integer) dim rst as new adodb.recordset rst.open select * from panelinfo where holderid= & d

23、cnum.text & and delflagtrue , gcnn, adopenkeyset, adlockbatchoptimistic if not rst.eof then dcvalue.text = rst.fields(2) txtusername(0) = rst.fields(1) txtusername(1) = rst.fields!nowecount txtusername(2) = rst.fields!cendcode dtpwdate.value = rst.fields(4) txtusername(3) = format(rst.fields!lmoney,

24、 #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)

25、 txtusername(7) = format(val(txtusername(5) + val(txtusername(6), #0.00) end if rst.closeend subprivate sub dcvalue_click(area as integer) dim rst as new adodb.recordset rst.open select * from panelinfo where holderid= & dcvalue.boundtext & and delflagtrue , gcnn, adopenstatic, adlockbatchoptimistic

26、 if not rst.eof then dcvalue.text = rst.fields(2) txtusername(0) = rst.fields(1) txtusername(1) = rst.fields!nowecount txtusername(2) = rst.fields!cendcode dtpwdate.value = rst.fields(4) txtusername(3) = format(rst.fields!lmoney, #0.00) txtusername(4) = format(rst.fields!bmoney, #0.00) txtusername(6

27、) = 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!noweco

28、unt * 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) end if rst.close set rst = nothingend subprivate sub dcvalue_keypress(keyascii as integer)keyascii = 0

29、end subprivate sub del_click()frmdel.showend subprivate sub dhcb_click()usrcopyp.showend subprivate sub dhcp_click()frmcopyp.showend subprivate sub duohu_click()frmcuifei.muser1 = 2frmcuifei.showend subprivate sub edit_click()frmedit.showend subprivate sub exit_click()endend subprivate sub insert_cl

30、ick()frminsert.show 1end subprivate sub jiaonadianfei_click()frmfee.showend subprivate sub m_userytpe_click()frmusertype.show 1end subprivate sub mdiform_load() loadadd end subpublic sub loadadd()if rst.state = 1 then rst.closeend if rst.open select * from panelinfo where delflagtrue , gcnn, adopenk

31、eyset, adlockbatchoptimistic if rst.recordcount 0 then set dcvalue.rowsource = rst dcvalue.boundcolumn = holderid dcvalue.listfield = holder set dcnum.datasource = rst set dcnum.rowsource = rst dcnum.listfield = holderid if not rst.eof then dcnum.text = rst.fields!holderid dcvalue.text = rst.fields(

32、2) txtusername(0) = rst.fields(1) txtusername(1) = rst.fields!nowecount txtusername(2) = rst.fields!cendcode dtpwdate.value = rst.fields(4) txtusername(3) = format(rst.fields!lmoney, #0.00) txtusername(4) = format(rst.fields!bmoney, #.0.00) txtusername(6) = rst.fields!lsfee txtusername(5) = val(txtu

33、sername(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.updatebatch adaffectcur

34、rent end if end ifend subpublic sub loaddata(hid as string) dim rst as new adodb.recordset dim cnn as new adodb.connection dim atimes as integer dim sqladd as string cnn.connectionstring = provider=microsoft.jet.oledb.4.0;jet oledb:database password= & dbpassword & ;data source= & _ app.path & datad

35、bdb.mdb;persist security info=false cnn.cursorlocation = aduseclient cnn.open if trim(hid) then rst.open select * from panelinfo where holderid= & hid & and delflagtrue , cnn, adopenstatic, adlockbatchoptimistic else rst.open select * from panelinfo where delflagtrue , cnn, adopenstatic, adlockbatch

36、optimistic end if if not rst.eof then dcnum.text = rst.fields!holderid dcvalue.text = rst.fields(2) txtusername(0) = rst.fields(1) txtusername(1) = rst.fields!nowecount txtusername(2) = rst.fields!cendcode dtpwdate.value = rst.fields(4) txtusername(3) = format(rst.fields!lmoney, #0.00) txtusername(4

37、) = 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) if rst.fields!atimes = 0 then atimes = 1 else at

38、imes = rst.fields!atimes end if txtusername(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.updatebatch adaffectcurrent end if rst.close c

39、nn.close end subprivate sub mdiform_unload(cancel as integer)gcnn.closeset gcon = nothingend subprivate sub mgcf_click()frmfeefind.showend subprivate sub mhf_click()frmdaoru.showend subprivate sub msf_click()frmfind1.showend subprivate sub qianfeilm_click()frmlist.qfflg = truefrmlist.showend subpriv

40、ate sub toolbar1_buttonclick(byval button as mscomctllib.button)select case trim(button.key)case afrmfee.show 1case b frmcopyp.showcase c frmfee.show 1case dfrmbeifen.show 1case efrmdaoru.show 1case ffrmfeefind.show 1case gfrmfind1.show 1case dhcb1 case dbcb2case jx = msgbox(真的要退出吗?, vbyesno + vbque

41、stion, 警告)if x = vbyes thenendelseend ifend selectend subprivate sub toolbar1_buttonmenuclick(byval buttonmenu as mscomctllib.buttonmenu) select case buttonmenu.keycase dhcb1 frmcopyp.showcase dhcb2 usrcopyp.showend selectend subprivate sub weihu_click()frmyhsd.showend subprivate sub yihu_click()frm

42、cuifei.muser1 = 1frmcuifei.showend sub4. 备份界面设计:备份代码设计:private sub command1_click()dim a as stringa = app.patha = a & b = text1.texton error goto errhandle:dim filename as stringfilename = & text1.text & dbdb.mdbif a = text1.text thenmsgbox 备份目录与原文件目录相同,请重新选择!exit subend ifif dir( & b & dbdb.mdb) th

43、endim llp as stringllp = msgbox(此目录下已有该文件,要覆盖吗?, vbyesno, 备份文件)if llp = vbyes thenkill ( & b & dbdb.mdb)filecopy & a & datadbdb.mdb, & b & dbdb.mdbdim ll = msgbox( 备份成功! , vbokonly, 提示)elseexit subend ifelsefilecopy & a & datadbdb.mdb, & b & dbdb.mdbdim llll = msgbox( 备份成功! , vbokonly, 提示)end ifexit

44、 suberrhandle:msgbox 出现错误,不能复制, vbokonly + vbcritical, 复制文件resume nextend subprivate sub command2_click()dyme.hideunload meend subprivate sub dir1_change()drive1.drive = dir1if right(dir1.path, 1) thentext1.text = dir1.path + elsetext1.text = dir1.pathend ifcommand1.enabled = trueend subprivate sub

45、dir1_click()if right(dir1.path, 1) thentext1.text = dir1.path + elsetext1.text = dir1.pathend ifcommand1.enabled = trueend subprivate sub drive1_change()dir1.path = drive1.driveend subprivate sub form_activate()command1.enabled = falsegcnn.closechdrive app.pathchdir app.pathtext1.setfocustext1.text

46、= c:text1.text = curdir()text1.enabled = falseend subprivate sub form_load()chdrive app.pathchdir app.pathend subprivate sub form_queryunload(cancel as integer, unloadmode as integer)dyend subprivate sub form_unload(cancel as integer)if gcnn.state = 0 then gcnn.connectionstring = provider=microsoft.

47、jet.oledb.4.0;jet oledb:database password= & dbpassword & ;data source= & _ app.path & datadbdb.mdb;persist security info=false gcnn.cursorlocation = aduseclient gcnn.openend ifmdime.loadaddend sub5. 单户抄表界面设计:单户抄表代码设计:private sub command2_click() dim cnn as new adodb.connection dim rste as new adodb

48、.recordset dim cmdexe as new adodb.command dim nowev as double dim sqladd as string if trim(txtusername(0).text) = then msgbox 没有要抄表用户,请先添加用户! , vbinformation exit sub end if if trim(txtusername(9).text) = then msgbox 请先输入数据! , vbinformation exit sub end if if trim(txtusername(9).text) trim(txtusername(2).text) then msgbox 输入数据错误,当前止码太小! , vbinformation exit sub end if cnn.connectionstring = provider=microsoft.jet.oledb.4.0;jet oledb:database passwor

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论