<% Option Explicit If not Session("isLoggedIn") Then response.redirect("/ecommerce/default.asp?returnUrl=" & Server.URLEncode(Request.ServerVariables("SCRIPT_NAME"))) End If %> <% Dim intPortID, intCountryID, strPortDesc, dblContainerCost20, dblContainerCost40 Dim strSQL, rsPort, strAction strPortDesc = "" If Request.Form("portDesc") <> "" Then strPortDesc = CStr(Request.Form("portDesc")) intPortID = 0 If Request.Form("portID") <> "" Then intPortID = CInt(Request.Form("portID")) intCountryID = 0 If Request.Form("countryID") <> "" Then intCountryID = CInt(Request.Form("countryID")) dblContainerCost20 = "" If Request.Form("containerCost20") <> "" Then dblContainerCost20 = CDbl(Request.Form("containerCost20")) dblContainerCost40 = "" If Request.Form("containerCost40") <> "" Then dblContainerCost40 = CDbl(Request.Form("containerCost40")) If Request.Form("isSubmitted") = 1 Then If intCountryID = 0 Then isErr = true strErrMsg = strErrMsg & "
  • you must select a country
  • " End If If strPortDesc = "" Then isErr = true strErrMsg = strErrMsg & "
  • you must supply a port name
  • " End If If dblContainerCost20 = 0 Then isErr = true strErrMsg = strErrMsg & "
  • you must supply the cost to ship a 20' container to this port
  • " End If If dblContainerCost40 = 0 Then isErr = true strErrMsg = strErrMsg & "
  • you must supply the cost to ship a 40' container to this port
  • " End If If not isErr Then If intPortID <> 0 Then strSQL = "EXEC stpPortUpdate " & intPortID & ", " & intCountryID & ", " & toSQLStr(strPortDesc) & ", " & dblContainerCost20 & " , " & dblContainerCost40 dbconn.Execute(strSQL) Else strSQL = "EXEC stpPortInsert " & intCountryID & ", " & toSQLStr(strPortDesc) & ", " & dblContainerCost20 & " , " & dblContainerCost40 Set rsPort = dbconn.Execute(strSQL) If not rsPort.EOF Then intPortID = CInt(rsPort("portID")) If intPortID = 0 Then isErr = true strErrMsg = "
  • that port name already exists
  • " End If End If If not rsPort.State = 0 Then rsPort.Close() Set rsPort = Nothing End If End If End If If intPortID <> 0 Then strSQL = "EXEC stpPortSelect " & intPortID Set rsPort = dbconn.Execute(strSQL) If not rsPort.EOF Then intCountryID = CInt(rsPort("countryID")) strPortDesc = CStr(rsPort("portDesc")) dblContainerCost20 = CDbl(rsPort("containerCost20")) dblContainerCost40 = CDbl(rsPort("containerCost40")) End If If rsPort.State <> 0 Then rsPort.Close() Set rsPort = Nothing strAction = "Edit" Else strAction = "Create" End if %> Galuku Cocopeat

    <%= strAction %> Port

    <% If isErr Then %> <% End If %> <% If Request("isSubmitted") = "1" And not isErr Then %> <% End If %>
    The following errors occurred:
      <%= strErrMsg %>
    Port Name
    Country <%= writeSelectSTP("countryID", "countryID", "countryDesc", "stpCountrySelectAll 1, 1", "", "Please Select", intCountryID) %>
    Container Cost 20' $
    Container Cost 40' $
    <%= Request.Form("action") %> successful
     
    Return to Port List    |    <%= strAction %> Port

    ^ back to top