VF进销存管理系统论文
在Rainsupinput1控件的执行方法程序下添加如下代码:
thisform.rainsupinput2.enabled=.t.
thisform.rainsupinput2.setfocus
gys=thisform.rainfunction1.numbertoname("供应商信息表","全称",;
alltrim(this.value),0)
thisform.msgrid.textmatrix(thisform.msgrid.rows-1,3)=gys
SELECT * FROM 商品信息表 WHERE 供应商编号=gys INTO DBF lsspxxb
在Rainsupinput2控件的执行方法程序下添加如下代码:
thisform.into
spbh=thisform.rainfunction1.numbertoname("商品信息表","名称",alltrim(this.value),0)
thisform.Msgrid.textmatrix(thisform.msgrid.rows-1,4)=spbh
thisform.rainsupinput1.enabled=.f.
thisform.msgrid.textmatrix(0,9)=gly
4.5 销售管理模块设计
销售管理模块主要用于进行商品销售信息的录入。销售管理模块运行结果。如图8所示。
图8 销售管理模块运行结果
1.表单设计
(1)在“通用进销存管理系统”项目文件中添加一个表单,命名为Frm销售管理。
(2)向表单内添加自制类控件Back、Label控件、Text控件、Combo控件、RainSupInput类控件、MSHFlexGrid控件、Command控件、RainFunction类控件、FormIn类控件。
(3)重要控件的属性设置如表8所示。
表8 重要控件及属性
对象 属性 值
Form1 AutoCenter .T.
Form1 ShowWindows 2-作为顶层表单
RainSupInput1 数据库 商品信息表
RainSupInput1 字段 名称
2.代码设计
在表单的 Init 事件下添加如下代码:
PUBLIC khbh,back &&声明两个全局变量
thisform.command2.enabled=.f. &&使保存按钮失效
thisform.rainsupinput1.enabled=.f.
在Combo2控件的KeyPress事件下添加如下代码:
IF nKeyCode=13
SELECT * FROM 订单表 WHERE 编号 = this.value INTO CURSOR ls1
nb= reccount()
FOR m=1 TO nb
GOTO m
SELECT * FROM 客户信息表 WHERE 编号=ls1.客户编号 INTO CURSOR lsb
kh=lsb.全称
SELECT * FROM 商品信息表 WHERE 编号=ls1.商品编号 INTO CURSOR lsb
sp=lsb.名称
SELE ls1
thisform.msgrid.additem("")
thisform.msgrid.TextMatrix(m,1)=ls1.编号
thisform.msgrid.TextMatrix(m,2)=ls1.订货时间
thisform.msgrid.TextMatrix(m,3)=KH
thisform.msgrid.TextMatrix(m,4)=SP
thisform.msgrid.TextMatrix(m,5)=销售类型
thisform.msgrid.TextMatrix(m,6)=ls1.订货数量
thisform.msgrid.TextMatrix(m,7)=ls1.金额
ENDFOR
thisform.msgrid.rows=thisform.msgrid.rows-1
thisform.combo3.enabled=.t.
thisform.combo4.enabled=.t.
FOR m=1 TO nb
thisform.text11.value=thisform.text11.value+;
val(thisform.msgrid.TextMatrix(m,7))
ENDFOR
thisform.text12.value=nb
ENDIF
在Msgrid控件的Init事件下添加如下代码:
thisform.msgrid.cols=9
thisform.msgrid.colwidth(0)=this.rowheight(0)
thisform.msgrid.colwidth(1)=1500
thisform.msgrid.colwidth(2)=1500
thisform.msgrid.colwidth(3)=2200
thisform.msgrid.colwidth(4)=2200
thisform.msgrid.TextMatrix(0,1)="销售编号"
thisform.msgrid.TextMatrix(0,2)="销售时间"
thisform.msgrid.TextMatrix(0,3)="销售类型"
thisform.msgrid.TextMatrix(0,4)="商品名称"
thisform.msgrid.TextMatrix(0,5)="商品单价"
thisform.msgrid.TextMatrix(0,6)="销售数量"
thisform.msgrid.TextMatrix(0,7)="总计金额"
thisform.msgrid.TextMatrix(0,8)="操作员"
在“数量”文本框的KeyPress事件下添加如下代码:
IF nkeycode=13
IF empty(this.value)=.f.
a=messagebox("此客户是否购买其他商品?",32+4,"系统提示")
IF a=6
thisform.msgrid.additem("")
thisform.msgrid.TextMatrix(thisform.msgrid.rows-1,1)=;
thisform.text1.value
thisform.msgrid.TextMatrix(thisform.msgrid.rows-1,2)=;
thisform.text2.value
thisform.msgrid.TextMatrix(thisform.msgrid.rows-1,3)=;
thisform.combo1.displayvalue
thisform.rainsupinput1.value=''
thisform.text4.value=''
thisform.text5.value=''
thisform.text6.value=''
thisform.text7.value=0
thisform.text8.value=0
thisform.JE.setfocus
ELSE
thisform.rainsupinput1.enabled=.f.
thisform.text8.enabled=.f.
FOR m=1 TO thisform.msgrid.rows-1
thisform.text11.value=thisform.text11.value+;
val(thisform.msgrid.TextMatrix(m,7))
ENDFOR
thisform.text12.value=thisform.msgrid.rows-1
thisform.text13.enabled=.t.
thisform.text14.value=thisform.text11.value
ENDIF
ELSE
messagebox("销售数量不允许为空!",16,"系统提示")
this.setfocus
ENDIF
ENDIF
在“数量”文本框的InterActiveChange事件下添加如下代码:
bh=thisform.rainfunction1.numbertoname("商品信息表",;
"名称",thisform.rainsupinput1.value,0)
SELECT * FROM 库存信息表 WHERE 商品编号=BH INTO CURSOR lskc
kcxx=lskc.库存下限
IF this.value>=thisform.text10.value-kcxx
messagebox("库存数量已经低于库存下限!请马上进货!",64,"系统提示")
ELSE
thisform.text9.value=thisform.text7.value*this.value
thisform.MSgrid.TextMatrix(thisform.msgrid.rows-1,6)=this.value
thisform.MSgrid.TextMatrix(thisform.msgrid.rows-1,7)=thisform.text9.value
ENDIF
在“金额”文本框的InterActiveChange事件下添加如下代码:
thisform.text10.value=thisform.text8.value*this.value
thisform.MSgrid.TextMatrix(thisform.msgrid.rows-1,6)=this.value
thisform.msgrid.TextMatrix(thisform.msgrid.rows-1,7)=thisform.text10.value
<< 上一页 [11] [12] [13] [14] [15] [16] 下一页