Sub Initialize
On Error Goto errormsg
dim sql1 as string
dim sql2 as string
dim sql3 as string
dim sql4 as string
dim Total1 as string
dim fldLst as new lcfieldList
dim fldLst2 as new lcfieldList
dim doc as notesdocument
msgbox "我进来了"
call rdb.Connect()
sql1="select * from S010_Scrapped"
msgbox "sql="+sql1
call WF_Con.execute(sql1,fldLst) '对数据到数据集fldLst中去
if WF_Con.fetch(fldLst)>0 then
msgbox "11111111111"
MoldCategory= fldLst.lookup("MoldCategories").text(0)
msgbox "MoldCategory="+MoldCategory
DepotCategoryName= fldLst.lookup("DepotCategoryName").text(0)
msgbox"sss"+DepotCategoryName
Quantity= fldLst.lookup("Quantity").text(0)
msgbox "Quantity="+ Quantity
end if
sql2="select * from S010_MoldManagement2 where MoldCategories='"+MoldCategory+"' and DepotCategoryName='"+DepotCategoryName+"'"
msgbox "sql2="+sql2
call WF_Con.execute(sql2,fldLst2) '对数据到数据集fldLst2中去
if WF_Con.fetch(fldLst2)>0 then
Total1 = fldLst2.lookup("Total").text(0)
msgbox "Total="+Total1
end if
Total1=Clng(Total1)-Clng(Quantity)
msgbox "Total"+Total1
dim updfldlst as new lcfieldlist
sql3="update S010_MoldManagement2 set Total='"+Cstr(Total1)+"' where MoldCategories='"+MoldCategory+"' and DepotCategoryName='"+DepotCategoryName+"'"
msgbox "sql3="+sql3
call WF_Con.execute(sql3,updfldlst)
msgbox "插入成功"
Exit Sub
errormsg:
Msgbox "Rule Error:" & Str(Erl) & " " & Error
End Sub
On Error Goto errormsg
dim sql1 as string
dim sql2 as string
dim sql3 as string
dim sql4 as string
dim Total1 as string
dim fldLst as new lcfieldList
dim fldLst2 as new lcfieldList
dim doc as notesdocument
msgbox "我进来了"
call rdb.Connect()
sql1="select * from S010_Scrapped"
msgbox "sql="+sql1
call WF_Con.execute(sql1,fldLst) '对数据到数据集fldLst中去
if WF_Con.fetch(fldLst)>0 then
msgbox "11111111111"
MoldCategory= fldLst.lookup("MoldCategories").text(0)
msgbox "MoldCategory="+MoldCategory
DepotCategoryName= fldLst.lookup("DepotCategoryName").text(0)
msgbox"sss"+DepotCategoryName
Quantity= fldLst.lookup("Quantity").text(0)
msgbox "Quantity="+ Quantity
end if
sql2="select * from S010_MoldManagement2 where MoldCategories='"+MoldCategory+"' and DepotCategoryName='"+DepotCategoryName+"'"
msgbox "sql2="+sql2
call WF_Con.execute(sql2,fldLst2) '对数据到数据集fldLst2中去
if WF_Con.fetch(fldLst2)>0 then
Total1 = fldLst2.lookup("Total").text(0)
msgbox "Total="+Total1
end if
Total1=Clng(Total1)-Clng(Quantity)
msgbox "Total"+Total1
dim updfldlst as new lcfieldlist
sql3="update S010_MoldManagement2 set Total='"+Cstr(Total1)+"' where MoldCategories='"+MoldCategory+"' and DepotCategoryName='"+DepotCategoryName+"'"
msgbox "sql3="+sql3
call WF_Con.execute(sql3,updfldlst)
msgbox "插入成功"
Exit Sub
errormsg:
Msgbox "Rule Error:" & Str(Erl) & " " & Error
End Sub