%
Dim ConnStr
Dim Conn
Dim rs
Dim SQL
Dim LogSQL
Dim UpdateFlag
Dim IsNew
Dim CaseID
Dim TrackID
Dim UserID
Dim UserType
Dim EntryDate
Dim Comment
Dim strErrorMsg
Dim NewTstamp
Dim Confidential
' On Error Resume Next
strErrorMsg = ""
' ***************************************
' Set new values
' ***************************************
TrackID = Request.QueryString("TrackID")
TrackID = trim(TrackID)
CaseID = Request.QueryString("CaseID")
CaseID = trim(CaseID)
EntryDate = Request.QueryString("DateEntered")
EntryDate = trim(EntryDate)
EntryDate = CDate(EntryDate)
If Err.number <> 0 Then
strErrorMsg = strErrorMsg & "The field DATE ENTERED is not a valid date (mm/dd/yyyy format).
" & vbCrLf
Err.Clear
End If
Comment = Request.QueryString("Comment")
Comment = EdLine(Comment)
Comment = Replace(Comment, "'", "''")
If len(Comment) = 0 Then
strErrorMsg = strErrorMsg & "The field COMMENT is a required field.
" & vbCrLf
Err.Clear
End If
Confidential = Request.QueryString("Confidential")
Confidential = trim(Confidential)
if Confidential <> "Y" then
Confidential = "N"
end if
UserID = Session("UserID")
UserType = Session("UserType")
' ***************************************
' Force Confidential option
' ***************************************
if UserType = 3 then
if AGENTPRIVATE then
Confidential = "Y"
end if
end if
' ***************************************
' Connect to database
' ***************************************
IF strErrorMsg = "" then
connectdb
If Err.number <> 0 Then
strErrorMsg = strErrorMsg & "305. Error Unable to connect to database.
"
Err.Clear
End If
end if
' ***************************************
' Update Tracking Table
' ***************************************
if strErrorMsg = "" then
NewTstamp = Now()
WriteLog TrackID,"Track", "Comment","L", Comment,newTstamp
WriteLog TrackID,"Track", "EntryDate","D", EntryDate,newTstamp
WriteLog TrackID,"Track", "EmpID","N", UserID,newTstamp
WriteLog TrackID,"Track", "Private","S", Confidential ,newTstamp
SQL = "UPDATE Track SET "
SQL = SQL & "EmpID = " & UserID & ", "
SQL = SQL & "EntryDate = '" & EntryDate & "', "
SQL = SQL & "Private = '" & Confidential & "', "
SQL = SQL & "Comment = '" & Comment & "' "
SQL = SQL & "WHERE TrackID = " & TrackID & " "
Conn.Execute SQL
If Err.number <> 0 Then
strErrorMsg = strErrorMsg & "Error occurred attempting to add a new update.
"
Err.Clear
End If
end if
if not conn is nothing then
conn.close
set conn = nothing
end if
' ***************************************
' Send Response
' ***************************************
if strErrorMsg = "" then
if Session("CurrentPage") = "case.asp" then
response.redirect("case.asp?CaseID=" & CaseID)
else
response.redirect("openInv.asp")
end if
else
ShowError(strErrorMsg)
end if
%>