<% option explicit %> <% dim strpagecode strpagecode ="FAIRG06" 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 nmShellRs dim nmShellUS dim strTypeCodes dim strCategoryType dim strModifyDate dim nmBareRateRs dim nmBareRateUS nmId = 0 strName = "" strCategoryType = "" strCategoryCodes = "" strIsAvailable = "" strCreateUserId = "" strCreateDate = "" strQry = "" nmNextMaxHallId = 0 strTypeCodes= "" nmBareRateRs = 0 nmBareRateUS = 0 nmShellRs = 0 nmShellUS = 0 strTypeCodes = trim(Request.Form("cboType")) strCategoryCodes = trim(request.Form("cboCategory")) if instr(1,strCategoryCodes,"Y",1) <> 0 then 'ie Indian nmBareRateRs = trim(Request.Form("RateBareSpace")) nmShellRs = trim(Request.Form("RateBareShell_IN")) else 'ie Foreign Agents nmBareRateUS = trim(Request.Form("RateBareSpace_US")) nmShellUS = trim(Request.Form("RateBareShell_US")) 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 categoryid from HallRateMaster where Upper(ltrim(rtrim(TypeCode))) = '" & Ucase(trim(strTypeCodes)) & _ ' "' 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 HallRateMaster (TypeCode, CategoryId, " & _ ' " RateBareSpace_INR ,RateBareSpace_USD ," & _ ' " RateBareShell_INR ,RateBareShell_USD ," & _ ' " CreateUserId, createDate) values('" & strTypeCodes & "'," & _ ' strCategoryCodes & "," & nmBareRateRs & "," & nmBareRateUS & "," & _ ' nmShellRs & "," & nmShellUS & ",'" & _ ' strCreateUserId & "','" & strCreateDate & "' )" strinsert = " update HallRateMaster set RateBareSpace_INR = " & nmBareRateRs & " ,RateBareSpace_USD = " & nmBareRateUS & ",RateBareShell_INR = " & nmShellRs & " ,RateBareShell_USD = " & nmShellUS & " ,CreateUserId = '" & strCreateUserId & "', createDate = '" & strCreateDate & "' where TypeCode = '" & trim(request("tc")) & "' and CategoryId = " & trim(request("ci")) & " " ' 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 %>