<% option explicit %> <% dim strpagecode strpagecode ="FAIRG07" session("usertype")="SUS" %> <% dim strinsert dim rs dim nmId dim strName dim strCategoryCodes dim strIsAvailable dim strRate dim strCreateUserId dim strCreateDate dim strQry dim nmNextMaxHallId dim nmRateRs dim nmRateUS dim strSpaceCodes nmId = 0 strName = "" strCategoryCodes = "" strIsAvailable = "" strCreateUserId = "" strCreateDate = "" strQry = "" nmNextMaxHallId = 0 strSpaceCodes= "" nmRateRs = 0 nmRateUS = 0 strSpaceCodes = trim(Request.Form("cboSpace")) strCategoryCodes = trim(request.Form("cboCategory")) if instr(1,strCategoryCodes,"Y",1) <> 0 then 'ie Indian nmRateRs = trim(Request.Form("txtrupees")) else 'ie Foreign Agents nmRateUS = trim(Request.Form("txtdollar")) end if strCategoryCodes = mid( strCategoryCodes,1, instr(1,strCategoryCodes,"_",1) - 1) strCreateUserId = trim(Session("userid")) strCreateDate = now() set rs = Server.CreateObject("ADODB.RECORDSET") 'Before inserting the record for a Space Category, it has to be checked for duplicate 'Product Id / code. strQry = " Select spaceid from SpaceRateMaster where spaceid = " & strSpaceCodes & _ " and categoryid = " & strCategoryCodes on error resume next set rs = objConn.Execute(strqry) if err <> 0 then response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End end if on error goto 0 if (rs.EOF and rs.BOF ) then 'Inserting into the SpaceRateMaster. strinsert = " Insert into SpaceRateMaster (SpaceId, CategoryId, " & _ " Rate_INR ,Rate_USD ," & _ " CreateUserId, createDate) values(" & strSpaceCodes & "," & _ strCategoryCodes & "," & nmRateRs & "," & nmRateUS & ",'" & _ strCreateUserId & "','" & strCreateDate & "')" Response.Write strinsert 'Response.End on error resume next ObjConn.Execute strinsert if err <> 0 then response.Redirect "/inc/admin/error.asp?errortype=err_record§ion="&server.URLEncode("Hall Registration") Response.End else Response.redirect "/inc/admin/confirm.asp?message=1§ion=" & Server.URLEncode("Hall Registration")& "&path=/fairregistration/admin" end if on error goto 0 else response.Redirect "/inc/admin/error.asp?errorno=SRD§ion="&server.URLEncode("Hall Registration") Response.End end if %>