4.2 建立表单 (1)登录界面
登录命令按钮添加代码: if
thisform
.combol1.value=\
井
志
成
\
and
thisform.text1.value=\
wait \欢迎使用职工工资管理系统\ thisform.release
do form g:\\毕业设计\\菜单\\myform.scx
else
thisform.number=thisform.number+1 if thisform.number=3
wait \管理员身份或输入的密码不对,登录失败!\timeout 3
thisform.release else
wait\管理员身份或输入的密码不对,请重新输入信息\window timeout 3 endif endif
(2)查询
组合框添加代码: Combol1的init过程:
this.additem(\职工工资规划一览表\this.additem(\公司(部门)奖励一览表\this.additem(\公司政策与物业费公开一览表\
combol1的interactivechange过程: thisform.grid1.columncount=-1
thisform.grid1.recordsource=this.value (3)表记录增加
增加记录添加代码: Command1的click过程: append blank addrecno=recno()
thisform.grid. staff.column1.text1.setfocus if recno()=addrecno if empty(部门号)
=messagebox(\部门号不能为空!\ return 0 endif
locate for alltrim(部门号)== alltrim(this.value)
if found() and recno() <> addrecno messagebox(\该编号已存在,请重新输入!\ go addrecno return 0 endif endif
(5) 表记录删除
删除记录添加代码: Command1的click过程:
qr=messagebox(\确实要删除职工的信息吗?\ if qr=1 delete skip -1
thisform.refresh endif
(6) 表记录更新
Check的click1过程: if thisform.check1.value=1 thisform.list1.rowsource=.t. else
thisform.list1.rowsource=.f. endif
Check的click2过程: if thisform.check2.value=1 thisform.list1.rowsource=.t. else
thisform.list1.rowsource=.f. endif
(7)设置密码