我正在使用仓储管理系统,这个系统中碰到一个问题需要各位老师帮助解决一下。
这入库信息中,我需要对入库的信息进行编辑修改时,入库日期、供应商、单价、数量都可修改,但类别 和 品名|规格|计量单位(三项联在一起) 不能修改。则在出库信息编辑时能全部修改,
我看了在入库信息修改中class 品名|规格|计量单位是修改进了表store,而其他的修改是表in_store,但我自已修改不了,恳请各位帮一下!
类别:class 品名|规格|计量单位:pinming guige unit
入库修改的部分代码:
sub SaveModify
class1=request.Form("d_position1")
pinming=request.Form("pinming")
names=Split(pinming,"|")
pinming=names(0)
guige=names(1)
unit=names(2)
num=names(3)
num0=request.Form("use_num")
num1=num-num0
set rs1=server.createobject("adodb.recordset")
if guige="" then
sql1="select * from store where pinming='"&pinming&"'"
else
sql1="select * from store where pinming='"&pinming&"' and guige='"&guige&"'"
end if
rs1.open sql1,conn,1,3
if not rs1.eof and not rs1.bof then
rs1("number")=rs1("number")-num1
rs1("price") = request.Form("use_price")
end if
rs1.update
rs1.close
set rs1=nothing
这下面是出库修改的部分代码:
sub SaveModify
old_num=request.Form("old_num")
Loan_num=request.Form("Loan_num")
pinming=trim(request.Form("pinming"))
names=Split(pinming,"|")
id=names(0)
pinming=names(1)
guige=names(2)
unit=names(4)
num= old_num-Loan_num
if id=0 then
response.Write "<script language=javascript>alert('对不起,请重新选择分类与品名!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=out_store.asp"">"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="select * from store where id="&id&""
rs.open sql,conn,1,3
if not rs.eof then
if rs("number")+num<0 then
response.Write "<script language=javascript>alert('对不起,库存不足,请调整您的出库量!');</script>"
response.write "<meta http-equiv=""refresh"" content=""0;url=out_store.asp"">"
response.end
else
rs("number")=rs("number")+num
rs.update
end if
end if
rs.close
set rs=nothing