% '
' Inventory Entry and Maintenance
'
'Initialize Standard Information
Index = request("Index") ' The last selected Index number
RowId = request("RowId") ' If a Row Id was passed
RunReport = (request("RunReport")<>"") ' If run report was selected
RunVendorReport = (request("RunVendorReport")<>"") ' If run report was selected
%>
<% ' redirects must occur before any html output!
If RunReport then
Response.redirect ("InvtList.asp?RunReport=1&Index=" & Index)
end if
If RunVendorReport then
VendorRowid = Request("Vendor__RowId")
Response.redirect ("InvtList.asp?RunReport=2&VendorRowID=" & VendorRowId)
end if
%>
Inventory
<% ' LoginRights: If 1 user has full rights, if 0 or -1, browse only rights %>
<% LoginRights = request.cookies("Rights") %>
" TYPE="text/css">
<% CheckFieldChange=oInvt.call("get_peFieldMultiUser") %>
<% ' DebugMode =1 ' uncomment this for page get/post debug help %>
<% If LoginRights = "1" then %>
Inventory Entry and Maintenance
<% else %>
Inventory Query
<% end if %>
<%
oInvt.call "set_pbReportErrors", 1 'normally show any errors that occur
'We either find a record, or clear the WBO
If RowId <> "" Then
Err = oInvt.RequestFindbyRowId( "Invt", RowId)
else
Err = oInvt.RequestClear("Invt",1)
End if
' process various buttons that might have been pressed.
' only support Post submissions
If request("Request_method")="POST" Then
if Request("clear")<>"" then
Err = oInvt.RequestClear("Invt",1)
end if
if Request("save")<>"" then
oInvt.call "set_pbReportErrors", 0
err = oInvt.RequestSave("Invt")
if err = 0 then
Response.Write("
Invt record saved
")
else
Response.Write("")
Response.Write("
Could not save changes. Errors Occurred
")
oInvt.call "msg_ReportAllErrors"
Response.Write("")
end if
end if
if Request("delete")<>"" then
oInvt.call "set_pbReportErrors", 0
Err = oInvt.RequestDelete("Invt")
if err = 0 then
Response.Write("
The record has been deleted.
")
else
Response.Write("")
Response.Write("
The record could not be deleted.
")
oInvt.call "msg_ReportAllErrors"
Response.Write("")
end if
end if
' note we use the Index variable we created above
if Request("findprev") <>"" then Err = oInvt.RequestFind("Invt", Index, LT)
if Request("find") <>"" then Err = oInvt.RequestFind("Invt", Index, GE)
if Request("findnext") <>"" then Err = oInvt.RequestFind("Invt", Index, GT)
if Request("findfirst")<>"" then Err = oInvt.RequestFind("Invt", Index, FIRST_RECORD)
if Request("findlast") <>"" then Err = oInvt.RequestFind("Invt", Index, LAST_RECORD)
end if
OldInvt = oInvt.ddvalue("Invt.RowId")
%>