'**-- lngAspAction: '**-- 1 - NEW '**-- 2 - UPDATE function SubmitForm(lngAspAction) if CheckForm(lngAspAction) then document.frm.submit() end if end function function CanOpenAccount(lngId) dim strUrl dim sResponse strUrl = "../include/XMLHTTP/GetCustCanOpenAccount.asp?Id=" & lngId sResponse = XMLRequestExecute(strUrl) if sResponse = "" then exit function end if '**-- check if succeed if CInt(GetXMLResponseText(sResponse)) = 1 then CanOpenAccount = false else CanOpenAccount = true end if end function function CanOpenAccountPassport(strPassport) dim strUrl dim sResponse strUrl = "../include/XMLHTTP/GetCustCanOpenAccount.asp?Passport=" & strPassport sResponse = XMLRequestExecute(strUrl) if sResponse = "" then exit function end if '**-- check if succeed if CInt(GetXMLResponseText(sResponse)) = 1 then CanOpenAccountPassport = false else CanOpenAccountPassport = true end if end function function CheckUserNameExist(strUserName,strFirstName,strLastName) dim strUrl dim sResponse dim objXmlRs strUrl = "../include/XMLHTTP/GetCustUserNameExist.asp?UserName=" & strUserName _ & "&FirstName=" & strFirstName _ & "&LastName=" & strLastName sResponse = XMLRequestExecute(strUrl) if sResponse = "" then exit function end if '**-- get results set objXmlRs = new XMLRecordset objXmlRs.XML = sResponse if cint(objXmlRs.Fields(0).value) = 1 then '**-- user name not found CheckUserNameExist = true '**-- return alternative user names redim arrOtherUserNames(0) for i = 1 to 4 if objXmlRs.Fields(i).Value <> "" then redim preserve arrOtherUserNames(i) arrOtherUserNames(i) = objXmlRs.Fields(i).Value end if next elseif (objXmlRs.Fields(0).value = 2) then '**-- user name not found CheckUserNameExist = false end if set objXmlRs = nothing end function function CheckUserNameDefaultStatusExist(strUserName,strFirstName,strLastName) dim strUrl dim sResponse dim objXmlRs strUrl = "../include/XMLHTTP/GetCustUserNameByStatusExist.asp?UserName=" & strUserName _ & "&FirstName=" & strFirstName _ & "&LastName=" & strLastName sResponse = XMLRequestExecute(strUrl) if sResponse = "" then exit function end if '**-- get results set objXmlRs = new XMLRecordset objXmlRs.XML = sResponse if cint(objXmlRs.Fields(0).value) = 1 then '**-- user name not found CheckUserNameDefaultStatusExist = true '**-- return alternative user names redim arrOtherUserNames(0) for i = 1 to 4 if objXmlRs.Fields(i).Value <> "" then redim preserve arrOtherUserNames(i) arrOtherUserNames(i) = objXmlRs.Fields(i).Value end if next elseif (objXmlRs.Fields(0).value = 2) then '**-- user name not found CheckUserNameDefaultStatusExist = false end if set objXmlRs = nothing end function function CheckUserExist(strUserName,strPassword) dim strUrl dim sResponse dim lngResult strUrl = "../include/XMLHTTP/GetUserExist.asp?UserName=" & strUserName _ & "&Password=" & strPassword sResponse = XMLRequestExecute(strUrl) if sResponse = "" then exit function end if lngResult = GetXMLResponseText(sResponse) '**-- if not found then returns 0 '**-- if found then returns UserType (1,3,5) CheckUserExist = lngResult set objXmlRs = nothing end function