<%
If QISheetFormSubmitted = 1 THEN
'Response.Write "QIID: " & QIID
Response.Write "Adding Customer to the database<br><br>This screen should not appear for more than 30 seconds."
If Len(QIApptDate) < 1 Or Len(QIApptTime) < 1 Or QIMakeApptLater = 1 THEN
QIApptTimeComplete = "Null"
Else
QIApptTimeComplete = "'" & QIApptDate & " " & QIApptTime & "'"
END IF
[COLOR=red]The code that follows this is the code that throws all the information into the SQL Database, so I will not post all that. The code the follows that is here:[/color]
elseif QISheetFormSubmitted = 2 THEN
strFirst=QIFirstName
firstLen=Len(strFirst)
strLast=QILastName
lastLen=Len(strLast)
strHome=QIHomeNumber
homeLen=Len(strHome)
strWork=QIWorkNumber
workLen=Len(strWork)
strCell=QICellNumber
cellLen=Len(strCell)
if homeLen > 1 then
if firstLen > 1 then
if lastLen > 1 then
sqlSTR2 = "Select FirstName,LastName from Customer Where FirstName='" & NoApos(strFirst)& "' and LastName='" & NoApos(strLast) & "' and HomePhone='" & NoApos(strHome) & "'"
else
sqlSTR2 = "Select FirstName,LastName from Customer Where FirstName='" & NoApos(strFirst) & "' and HomePhone='" & NoApos(strHome) & "'"
end if
else
sqlSTR2 = "Select FirstName,LastName from Customer Where HomePhone='" & NoApos(strHome) & "'"
end if
elseif workLen > 1 then
if firstLen > 1 then
if lastLen > 1 then
sqlSTR2 = "Select FirstName,LastName from Customer Where FirstName='" & NoApos(strFirst)& "' and LastName='" & NoApos(strLast) & "' and WorkPhone='" & NoApos(strWork) & "'"
else
sqlSTR2 = "Select FirstName,LastName from Customer Where FirstName='" & NoApos(strFirst) & "' and WorkPhone='" & NoApos(strWork) & "'"
end if
else
sqlSTR2 = "Select FirstName,LastName from Customer Where WorkPhone='" & NoApos(strWork) & "'"
end if
elseif cellLen > 1 then
if firstLen > 1 then
if lastLen > 1 then
sqlSTR2 = "Select FirstName,LastName from Customer Where FirstName='" & NoApos(strFirst)& "' and LastName='" & NoApos(strLast) & "' and CellPhone='" & NoApos(strCell) & "'"
else
sqlSTR2 = "Select FirstName,LastName from Customer Where FirstName='" & NoApos(strFirst) & "' and CellPhone='" & NoApos(strCell) & "'"
end if
else
sqlSTR2 = "Select FirstName,LastName from Customer Where CellPhone='" & NoApos(strCell) & "'"
end if
elseif firstLen > 1 then
if lastLen > 1 then
sqlSTR2 = "Select FirstName,LastName from Customer Where FirstName='" & NoApos(strFirst)& "' and LastName='" & NoApos(strLast) & "'"
else
sqlSTR2 = "Select FirstName,LastName from Customer Where FirstName='" & NoApos(strFirst) & "'"
end if
elseif lastLen > 1 then
sqlSTR2 = "Select FirstName,LastName from Customer Where LastName='" & NoApos(strLast) & "'"
end if
'response.write sqlStr
rsA.Open sqlSTR2
If NOT rsA.EOF Then
Session("CustomerFound")="yes"
rsA.Close
Response.Redirect("default.asp?page=NEWQI")
End IF
Session("CustomerFound")="no"
Session("CustomerFirst")=QIFirstName
Session("CustomerLast")=QILastName
Session("CustomerHome")=QIHomeNumber
Session("CustomerWork")=QIWorkNumber
Session("CustomerCell")=QICellNumber
Response.Redirect("default.asp?page=NEWQI")
End If
%>