课程设计报告书
班级:计机 062 班
学号:6333063202
姓名:张其俊
指导教师:余明艳
课程设计时间:2007 年 12 月 17 日-2007 年 12 月 21 日
一、系统设计模块图
进销存登陆界面
管理员主界面
普通用户界面
(1)
管理员主界面
仓
管
维
护
增
删
用
户
修
改
密
码
数
据
库
清
理
数
据
维
护
单
据
过
账
进
货
查
询
销
售
查
询
库
存
查
询
销
售
统
计
(2)
普通用户界面
修
改
密
码
进
货
查
询
销
售
查
询
库
存
查
询
销
售
统
计
进
销
存
统
计
娱
乐
放
松
娱
乐
放
松
退
出
系
统
退
出
系
统
(3)
二、功能模块的设计
1、1 进销存主程序
代码如下:
&&关闭命令响应
&&覆盖磁盘文件时不提示
&&日期为"年.月.日"格式
&&设置年为 4 位表示
set sysmenu off &&关闭 Visual foxpro 菜单
set talk off
set safety off
set date ansi
set century on
set delete on &&屏蔽带有删除标识的记录
set default to "e:\jxc"
do form systemload.scx &&系统登陆表单
&&启动事件处理程序
read events
set sysmenu to default &&退出事件处理程序前,将菜单恢复为系统认值
close all
cancel
&&设置软件缺省工作目录
&&关闭所有数据库
&& 程序运行结束
1、2 进销存系统登界面(表单:systenload.scx)
效果图(1)
功能:表单初始化提供用来存储用户名和权限的公有变量,并为组合框 combo1 提供合法操
作用户列表;用户选择某一用户名后,输入准确密码确定后根据其享有的权限可分别进入不
同的操作主界面,管理员操作界面(main1.scx)、普通用户界面(main2.scx),若用户连续三
次输入错误密码,将被视为非法用户,无权使用本系统,系统将会自动退出。
各事件代码如下:
表单 form1 初始化代码(Init 事件):
public popedom
public peop
popedom=""
peop=""
do while not eof()
this.container1.combo1.additem(czy)
skip
enddo
命令按钮 Comm_ok(确定)的 Click 事件代码:
thisform.i=thisform.i+1
locate for allt(czy)==alltrim(thisform.container1.combo1.value)
if found() and allt(kl)==alltrim(thisform.container1.text1.value)
popedom=password.qxdj
peop=alltrim(thisform.container1.combo1.value)
if val(popedom)==1
do form main1.scx
else
do form main2.scx
endif
release thisform
else
if thisform.i<3
=messagebox("操作口令第"+allt(str(thisform.i))+"次错误!"+chr(13)+"再试一次!",48,"警告")
thisform.container1.text1.setfocus
else
=messagebox("对不起,您已经错了三次!"+chr(13)+"非法用户!",48,"严重警告")
thisform.release
endif
endif
命令按钮 Comm_quit(退出),功能:退出系统,其 Click 事件代码如下:
release thisform
close all
quit
计时器控件,作用:使字体“进销存管理系统登陆“具有滚动功能。其 Timer1 事件代码如
下:
if thisform.label1.left<1
thisform.label1.left=thisform.width-20
thisform.label1.left=thisform.label1.left-2
else
endif
1、3 下拉菜单、快捷菜单设计
条形下拉菜单:管理员操作界面菜单(glcd.mnx)、普通用户界面菜单(yhcd.mnx)
快捷菜单:管理员操作界面右键快捷菜单(glcd1x..mnx)、普通用户界面右键快捷菜单
(yhcd1x.mnx)
快捷菜单的“设罢”代码为:PARAMETERS mfref
快捷菜单的“清理”代码为:RELEASE POPUPS glcd1(yhcd1)其中 glcd1、yhcd1 分别为快捷菜
单的内部名字。
1、4 进销存系统管理员界面(表单 main1.scx)
进入此界面的用户将享有本系统中所有功能,本界面是一个顶层表单,上附下拉
菜单及右键快捷菜单,下拉选项按属性分类。
效果预览(2)
表单 main1.scx(管理员操作)各事件代码如下:
表单初始化 Init 事件代码如下:
do glcd.mpr with this,'menu_example'
功能:调用菜单 glcd.mpr
表单 Rightclick 事件代码如下:
do glcd1x.mpr with this
功能:调用快捷菜单 glcd1x.mpr
表单 Destroy 事件代码:
release menu menu_example extended
功能:清除菜单命令
控件计时器的 Timer1 的事件代码如下:
thisform.label1.caption=" 今 天 是 : "+alltrim(str(year(date())))+" 年
"+alltrim(str(month(date())))+"月"+alltrim(str(day(date())))+"日"
thisform.label2.caption=time()
功能:显示当前系统时间
(1)、仓管维护(表单 modi_glry.scx)
该界面功能:对仓管人员记录进行增加、修改、删除、逐个浏览等。
效果预览(3)
以容器内为例,在容器中添加 8 个命令按钮。
各命令按钮的 Click 事件代码如下:
首记录(Command1):
go top
this.enabled=.f.
thisform.container1.command2.enabled=.t.
thisform.container1.command3.enabled=.f.
thisform.container1.command4.enabled=.t.
thisform.refresh
末记录(Command2):
go bottom
this.enabled=.f.
thisform.container1.command1.enabled=.t.
thisform.container1.command3.enabled=.t.
thisform.container1.command4.enabled=.f.
thisform.refresh
上一条(Command3):
skip -1
if bof()
this.enabled=.f.
thisform.container1.command1.enabled=.f.
thisform.container1.command2.enabled=.t.
thisform.container1.command4.enabled=.t.
else
this.enabled=.t.
thisform.container1.command1.enabled=.t.
thisform.container1.command2.enabled=.t.
thisform.container1.command4.enabled=.t.
endif
thisform.refresh
下一条(Command4):
skip 1
if eof()
this.enabled=.f.
thisform.container1.command1.enabled=.t.
thisform.container1.command2.enabled=.f.
thisform.container1.command3.enabled=.t.
else
this.enabled=.t.
thisform.container1.command1.enabled=.t.
thisform.container1.command2.enabled=.t.
thisform.container1.command3.enabled=.t.
endif
thisform.refresh
增加(command5):
if thisform.container1.command5.caption="增加"
append blank
thisform.Text1.setfocus
thisform.container1.command5.caption="保存"
else
thisform.container1.command5.caption="增加"
endif
thisform.refresh
删除(Command6):
use glry
if messagebox("确定要删除该仓库人员吗,该操作不可恢复",48+1,"警告")=1
delete all for glry.管理人员=allt(thisform.Text1.value)