<% Option Explicit If not Session("isLoggedIn") Then response.redirect("/ecommerce/default.asp?returnUrl=" & Server.URLEncode(Request.ServerVariables("SCRIPT_NAME"))) End If %> <% Dim strItemCategoryDesc, intItemCategoryID Dim strSQL, rsItemCategory, strAction intItemCategoryID = 0 If Request.Form("itemCategoryID") <> "" Then intItemCategoryID = Request.Form("itemCategoryID") strItemCategoryDesc = "" If Request.Form("itemCategoryDesc") <> "" Then strItemCategoryDesc = Request.Form("itemCategoryDesc") If Request.Form("isSubmitted") = 1 Then If strItemCategoryDesc = "" Then isErr = true strErrMsg = strErrMsg & "
  • you must supply an item category name
  • " End If If not isErr Then If intItemCategoryID <> 0 Then strSQL = "EXEC stpItemCategoryUpdate " & intItemCategoryID & ", " & toSQLStr(strItemCategoryDesc) dbconn.Execute(strSQL) Else strSQL = "EXEC stpItemCategoryInsert " & toSQLStr(strItemCategoryDesc) Set rsItemCategory = dbconn.Execute(strSQL) If not rsItemCategory.EOF Then intItemCategoryID = CInt(rsItemCategory("itemCategoryID")) If intItemCategoryID = 0 Then isErr = true strErrMsg = "
  • that item category name already exists
  • " End If End If If not rsItemCategory.State = 0 Then rsItemCategory.Close() Set rsItemCategory = Nothing End If End If End If If intItemCategoryID <> 0 Then strSQL = "EXEC stpItemCategorySelect " & intItemCategoryID Set rsItemCategory = dbconn.Execute(strSQL) If not rsItemCategory.EOF Then strItemCategoryDesc = rsItemCategory("itemCategoryDesc") End If If rsItemCategory.State <> 0 Then rsItemCategory.Close() Set rsItemCategory = Nothing strAction = "Edit" Else strAction = "Create" End if %> Galuku Cocopeat

    <%= strAction %> Item Category

    <% If isErr Then %> <% End If %> <% If Request("isSubmitted") = "1" And not isErr And intItemCategoryID <> 0 Then %> <% End If %>
    The following errors occurred:
      <%= strErrMsg %>
    Item Category Name
    <%= Request.Form("action") %> successful
     
    Return to Item Category List    |    <%= strAction %> Item Category

    ^ back to top