关于数据库论文范文集,与关于超市文题目2016年相关论文格式模板
本论文是一篇关于数据库论文格式模板,关于关于超市文题目2016年相关电大毕业论文范文。免费优秀的关于数据库及超市管理信息系统及超市管理方面论文范文资料,适合数据库论文写作的大学硕士及本科毕业论文开题报告范文和学术职称论文参考文献下载。
;EndSub
3.退货窗体
图4.6退货窗体
本窗体的功能是实现商品退货功能,当人为判断某商品可以退货时即可将该商品退货.其数据库实现为:先将该信息加入retreat表,然后从sell表中减掉,最后对goods表的数量做一下调整即可.其具体实现过程是:先在窗体集中定义三个记录集:rs_sell,rs_goods,rs_retreat用来控制三个数据表:sell表,goods和retreat表.在退货窗体中,如果用户输入的销货编号存在,则关于该商品的销售信息将依次出现在相应的对话框中.退货成功后,该退货信息先添加到退货表,然后将其退货数量从相应的sell表中减掉,并添加到goods表中.
该文url http://www.sxsky.net/xie/070241173.html
退货按钮的代码实现如下:
Dimrs_retreatAsNewADODB.Recordset
Dimrs_goodsAsNewADODB.Recordset
Dimrs_sellAsNewADODB.Recordset
Dimstr_retreatAsString
Dimstr_goodsAsString
Dimstr_sellAsString
DimnumsellAsInteger
DimnumgoodsAsInteger
DimcountsellAsInteger
PrivateSubCommand1_Click()
IfText1.Text等于""Then
MsgBox"请填写退货编号!",vbOKOnly+vbInformation,"注意"
Text1.SetFocus
ExitSub
ElseIfText2.Text等于""Then
MsgBox"请填写销货编号!",vbOKOnly+vbInformation,"注意"
Text2.SetFocus
ExitSub
ElseIfText11.Text等于""Then
MsgBox"请填写商品数量!",vbOKOnly+vbInformation,"注意"
Text11.SetFocus
ExitSub
EndIf
'下面是对销售表进行操作!
str_sell等于"select*fromsellwhere销货编号等于'"&,Text2.Text&,"'"
rs_sell.Openstr_sell,n,adOpenStatic,adLockOptimistic
Ifrs_sell.EOF等于TrueThen
MsgBox"对不起,没有销售此商品型号!无法退货!",vbOKOnly+vbInformation,"注意"
rs_sell.Close
ExitSub
ElseIfrs_sell.Fields("数量")<,Val(Text11.Text)Then
MsgBox"对不起,退货数量过大,无法退货!",vbOKOnly+vbInformation,"注意"
rs_sell.Close
ExitSub
EndIf
rs_sell.Close'加入退货表
str_retreat等于"select*fromretreatwhere退货编号等于'"&,Text1.Text&,"'"
rs_retreat.Openstr_retreat,n,adOpenStatic,adLockOptimistic
Ifrs_retreat.EOF等于TrueThen
rs_retreat.AddNew
rs_retreat.Fields("退货编号")等于Text1.Text
rs_retreat.Fields("销货编号")等于Text2.Text
rs_retreat.Fields("商品名称")等于Text3.Text
rs_retreat.Fields("生产厂商")等于Text4.Text
rs_retreat.Fields("型号")等于Text5.Text
rs_retreat.Fields("单价")等于Val(Text6.Text)
rs_retreat.Fields("退货年")等于Text7.Text
rs_retreat.Fields("退货月")等于Text8.Text
rs_retreat.Fields("退货日")等于Text9.Text
rs_retreat.Fields("业务员编号")等于Text10.Text
rs_retreat.Fields("数量")等于Val(Text11.Text)
rs_retreat.Fields("总金额")等于Val(Text12.Text)
rs_retreat.Update
rs_retreat.Close
Else
MsgBox"此退货编号已存在,请重添!",vbOKOnly+vbInformation,"注意"
Text1.Text等于""
Text1.SetFocus
rs_retreat.Close
ExitSub
EndIf
'从销售商品表中减去
str_sell等于"select*fromsellwhere销货编号等于'"&,Text2.Text&,"'"
rs_sell.Openstr_sell,n,adOpenStatic,adLockOptimistic
numsell等于rs_sell.Fields("数量")
countsell等于rs_sell.Fields("总金额")
rs_sell.Fields("数量")等于numsell-Val(Text11.Text)
rs_sell.Fields("总金额")等于countsell-Val(Text12.Text)
rs_sell.Update
rs_sell.Close
'加入现存商品表中
DimsqlAsString
sql等于"select*fromgoodswhere商品编号等于'"&,Text16.Text&,"'"
rs_goods.Opensql,n,adOpenStatic,adLockOptimistic
Ifrs_goods.EOF等于TrueThen
rs_goods.Close
str_goods等于"select*fromgoods"
rs_goods.Openstr_goods,n,adOpenStatic,adLockOptimistic'打开库存表
rs_goods.AddNew
rs_goods.Fields("商品编号")等于Text2.Text
rs_goods.Fields("商品名称")等于Text3.Text
rs_goods.Fields("生产厂商")等于Text4.Text
rs_goods.Fields("型号")等于Text5.Text
rs_goods.Fields("数量")等于Val(Text11.Text)
rs_goods.Fields("进货价")等于Val(Text7.Text)
rs_goods.Fields("销货价")等于Val(Text8.Text)
rs_goods.Update
MsgBox"退货成功",vbOKOnly+vbExclamation,""
rs_goods.Close'关闭库存表
Else
numgoods等于rs_goods.Fields("数量")
rs_goods.Fields("数量")等于Val(Text11.Text)+numgoods
rs_goods.Update
MsgBox"退货成功",vbOKOnly+vbExclamation,""
rs_goods.Close
EndIf
EndSub
PrivateSubCommand2_Click()
Text1.Text等于""
Text2.Text等于""
Text3.Text等于""
Text4.Text等于""
Text5.Text等于""
Text6.Text等于""
Text11.Text等于""
Text12.Text等于""
EndSub
PrivateSubForm_Load()
Text7.Text等于Year(Date)
Text8.Text等于Month(Date)
Text9.Text等于Day(Date)
Text3.Enabled等于False
Text4.Enabled等于False
Text5.Enabled等于False
Text6.Enabled等于False
Text7.Enabled等于False
Text8.Enabled等于False
Text9.Enabled等于False
Text10.Enabled等于False
Text12.Enabled等于False
Text13.Enabled等于False
Text14.Enabled等于False
Text15.Enabled等于False
Text16.Enabled等于False
EndSub
PrivateSubText11_Change()
IfText6.Text<,>,""Then
Text12.Text等于Val(Text6.Text)*Val(Text11.Text)
EndIf
EndSub
PrivateSubText2_Change()
str_sell等于"select*fromsellwhere销货编号等于
关于数据库论文范文集,与关于超市文题目2016年相关论文格式模板参考文献资料: