基于条形码的仓库管理系统源码
十.用户管理界面设计:运行效果如下
1.添加按钮代码:
ifallt(thiorm.text1.value)等于等于""
messagebox("用户名必须填写!","系统提示:")
else
locateforallt(thiorm.text1.value)等于等于allt(yh.user)
iffound()
messagebox("用户已存在!","系统提示:")
thiorm.text1.value等于""
else
ifallt(thiorm.text2.value)等于等于""
messagebox("必须填写!","系统提示:")
else
selectmax(yh.yhid)fromyhintoarraya
insertintoyhvalues(a+1,thiorm.text1.value,thiorm.text2.value,"普通用户",thiorm.text3.value,0)
messagebox("用户添加成功!","系统提示:")
endif
endif
endif
thiorm.text1.value等于""
thiorm.text2.value等于""
thiorm.text3.value等于""
thiorm.refresh
2.修改按钮:
ifthis.caption等于"修改"
thiorm.grid1.enabled等于.t.
this.caption等于"退出修改"
messagebox("你直接可以在表中修改记录了!","系统提示:")
else
thiorm.grid1.enabled等于.f.
messagebox("你作的所有操作都已经保存了!","系统提示:")
this.caption等于"修改"
endif
thiorm.refresh
这个按钮的思想是利用了表中的数据可以修改并返回到源表中这个特性
3.删除与恢复:
与管理商品信息中的思路是一样,同样是添加与删除一个标记,在退出本页面时将彻底删除添加了删除标记的数据,代码如下:
ifallt(thiorm.text1.value)等于等于""
messagebox("请输入你要删除的用户名!","系统提示:")
else
locateforallt(thiorm.text1.value)等于等于allt(yh.user)
iffound()
a等于messagebox("确实要删除此记录吗!",4+32,"系统提示:")
ifa等于6
ifreo()<,>,1
deletefromyhwhereallt(thiorm.text1.value)等于等于allt(yh.user)
messagebox("添加删除标记成功,退出页面将被彻底删除!","")
else
messagebox("第一个用户是管理员,不能删除些用户!","系统提示:")
endif
else
endif
else
messagebox("没有此用户!","系统提示:")
endif
删除:
ifallt(thiorm.text1.value)等于等于""
messagebox("请输入你要恢复删除的用户名!","系统提示:")
else
locateforallt(thiorm.text1.value)等于等于allt(yh.user)
iffound()
ifdeleted()
recall
messagebox("恢复已删除的用户成功!","系统提示:")
thiorm.text1.value等于""
else
messagebox("此用户没有添加删除标记!","系统提示:")
endif
else
messagebox("没有此用户!","系统提示:")
thiorm.text1.value等于""
endif
endif
thiorm.refresh
十一.计量单位管理页面:
保存按钮代码:
ifthiorm.co1.enabled等于.f.
this.caption等于"保存"
thiorm.co1.enabled等于.t.
thiorm.co1.setfocus
else
thiorm.co1.enabled等于.f.
this.caption等于"添加记录"
s等于allt(thiorm.co1.value)
ifs等于等于""
messagebox("计量单位为空,不能添加!","系统提示:")
else
locatefors等于等于allt(jiliangdanwei.单位)
iffound()
messagebox("此单位计量单位已经存在!","系统提示:")
else
inseintojiliangdanweivalue(s)
messagebox("成功添加信息到计量单位表!","系统提示:")
thiorm.co1.enabled等于.t.
this.caption等于"保存"
endif
endif
endif
thiorm.co1.value等于""
thiorm.co1.setfocus
thiorm.refresh
删除与恢复:与上文的思路相同代码相似,在这里不再赘述
(未完待续)
06级信息管理1班基于条形码的仓库管理系统
中州大学信息工程学院06级信息管理班