《新华书店进销存基础管理系统部分程序源代码》由会员分享,可在线阅读,更多相关《新华书店进销存基础管理系统部分程序源代码(49页珍藏版)》请在金锄头文库上搜索。
1、附录2新华书店进销存管理系统部分程序源代码1、 主程序MAIN.PRG程序代码SET DEFAULT TO C:毕业设计PUBLIC nkfgl,nxsgl,ncggl,nkcgl,nxtglSTORE .f. TO nkfgl,nxsgl,ncggl,nkcgl,nxtglPUBLIC nname,ndepartmentSTORE TO nname,ndepartmentDo Form loginfRead EventsDo Form mainRead EventsQuit2、 主表单MAIN.SCX代码2.1 表单Init过程程序代码do mmenu.mpr with this,.T.th
2、is.label2.caption = nnamethis.label4.caption = ndepartment3、 系统登入表单LOGINF.SCX代码3.1 表单登入按钮Click事件程序代码SELECT userGO TOP*检查顾客名和密码与否输入If empty(thisform.text1.value) then thisform.label3.caption = 请输入顾客名 returnelse if empty(thisform.text2.value) then thisform.label3.caption = 请输入密码 return endifendif*操作US
3、ER表,查询满足条件记录locate for name = alltrim(thisform.text1.value) if !found() thisform.label3.caption=顾客不存在 returnelse if user.password != alltrim(thisform.text2.value) then thisform.label3.caption=密码错误 return endifendifnname = user.namendepartment = user.departmentnkfgl = user.kfglnxsgl = user.xsglncggl
4、= user.cgglnkcgl = user.kcglnxtgl = user.xtglthisform.releaseclear events4、 系统管理表单XTGLF.SCX代码4.1 表单Init过程程序代码thisform.text1.enabled = .f.thisform.text2.enabled = .f.thisform.text3.enabled = bo1.enabled = .f.thisform.check1.enabled = .f.thisform.check2.enabled = .f.thisform.check3.enabled = .f.thisfo
5、rm.check4.enabled = .f.thisform.check5.enabled = .f.thisform.label5.visible = .f.thisform.text3.visible = mand10.enabled = mand11.enabled = .f.thisform.dis_recordthisform.dis_reccommand4.2 表单自定义过程DIS_RECORD程序代码PUBLIC newcommandSTORE .f. TO newcommandif reccount(user) = 0 thisform.text1.value = thisf
6、orm.text2.value = bo1.value = thisform.check1.value = 0 thisform.check2.value = 0 thisform.check3.value = 0 thisform.check4.value = 0 thisform.check5.value = 0else thisform.text1.value = user.namethisform.text2.value = bo1.value = user.departmentif user.kfgl then thisform.check1.value = 1else thisfo
7、rm.check1.value = 0endifif user.xsgl then thisform.check2.value = 1else thisform.check2.value = 0endifif user.cggl then thisform.check3.value = 1else thisform.check3.value = 0endifif user.kcgl then thisform.check4.value = 1else thisform.check4.value = 0endifif user.xtgl then thisform.check5.value =
8、1else thisform.check5.value = 0endifendifthisform.refresh4.3 表单自定义过程DIS_RECCOMMAND程序代码private nstore 0 to nn = reccount(user) if n=1 .or. n=0 then mand1.enabled = .f. mand2.enabled = .f. mand3.enabled = .f. mand4.enabled = .f.else if recno(user)=1 then mand1.enabled = .f. mand2.enabled = .f. mand3.e
9、nabled = .t. mand4.enabled = .t. else if recno(user)=n then mand1.enabled = .t. mand2.enabled = .t. mand3.enabled = .f. mand4.enabled = .f. else mand1.enabled = .t. mand2.enabled = .t. mand3.enabled = .t. mand4.enabled = .t. endif endifendifthisform.refresh4.4 表单保存按钮Click事件程序代码if empty(thisform.text
10、1.value) then =messagebox(请输入顾客名,0+48+0,出错) thisform.text1.setfocus thisform.refresh returnendifif empty(thisform.text2.value) then =messagebox(请输入密码,0+48+0,出错) thisform.text2.setfocus thisform.refresh returnendifif .not.(alltrim(thisform.text2.value) = alltrim(thisform.text3.value) then =messagebox
11、(密码反复错误,请重新输入,0+48+0,出错) thisform.text2.value = thisform.text3.value = thisform.text2.setfocus thisform.refresh returnendifif empty(bo1.value) then =messagebox(请选择所属部门,0+48+0,出错) bo1.setfocus thisform.refresh returnendifif thisform.check1.value=0.and.thisform.check2.value=0.and.thisform.check3.value
12、=0.and.thisform.check4.value=0.and.thisform.check5.value=0 then =messagebox(至少选择一种顾客权限,0+48+0,出错) thisform.check1.setfocus thisform.refresh returnendifif thisform.check1.value=1.and.thisform.check2.value=1.and.thisform.check3.value=1.and.thisform.check4.value=1.and.thisform.check5.value=1 then mesbo
13、x=messagebox(此顾客将具有所有权限,请确认,4+48+0,警告) if mesbox=7 then thisform.check1.setfocus thisform.refresh return endifendif*顾客权限解决PRIVATE nname,npassword,ndepartment,nkf,nxs,ncg,nkc,nxtnname = alltrim(thisform.text1.value)npassword = alltrim(thisform.text2.value)ndepartment = alltrim(bo1.value)if thisform.check1.value = 1 then nkf = .t.else nkf = .f.endifif thisform.check2.value =