<%
Dim LaunConn
Dim CookCartID
Dim objFSO
Set LaunConn=Server.CreateObject("ADODB.Connection")
LaunConn.Open "DSN=LaundryCarts;"
CookCartID = Session("CookCartID")
CustID = Session("CustID")
%>
| Parts
Administration |
|
<%if Session("level") <> 4 and Request.querystring("CustID") <> CustID2 then
response.redirect ("http://www.laundry-carts.com")
end if%>
|
<%
partnumber = Replace(request.form("partnumber"), "'", "''")
PartDescription = trim(Replace(request.form("PartDescription"), "'", "''"))
LongDescription1 = trim(Replace(request.form("LongDescription1"), "'", "''"))
LongDescription2 = trim(Replace(request.form("LongDescription2"), "'", "''"))
if request.form("price") = "" then
price = "none"
else
price = formatcurrency(Replace(request.form("price"), "'", "''"), 2)
end if
if request.form("weight") = "" then
weight = "0"
else
weight = formatnumber(Replace(request.form("price"), "'", "''"), 2)
end if
Category = request.form("Category")
if partnumber = "" then
errortext = errortext & "You must provide a part number. "
end if
if PartDescription = "" then
errortext = errortext & "You must provide a short part description. "
end if
if price = "none" then
errortext = errortext & "You must provide a price. "
end if
sql = "INSERT INTO " & Category &"(partnumber, partdescription, longdescription1, longdescription2, price, weight) "
sql = sql & "VALUES('" & partnumber & "', '" & partdescription & "', '" & longdescription1 & "', '" & longdescription2 & "', '"
sql = sql & price & "', " & weight & ");"
LaunConn.execute(sql)
LaunConn.Close
Set LaunConn = Nothing
%>
<%if errortext = "" then%>
Part
added to database!
Click here to
return to the parts administration page. |
<%else%>
Part
was NOT added
to the database due the following errors:
<%=errortext%> |
<%end if%>
|
|
|
Return
to Menu
|
|
|