% if (isNull(request.cookies("ckyUserID"))) or (request.cookies("ckyUserID")="") then response.redirect "index.asp" end if %> <% rowCount = 0 if getUserType(Request.Cookies("ckyUserID"))<>47 then 'response.redirect "home.asp" blnAdmin = false else blnAdmin = true end if if (Request.QueryString("btnSave") = "Save") and (blnAdmin) then DistributionListID = Request.QueryString("DistributionListID") strDescription = fixquote(Request.QueryString("strDescription")) if DistributionListID > 0 then s = "SELECT * From tblDistributionList WHERE strDescription = '" & strDescription & "' AND DistributionListID <> " & DistributionListID set rst = cn.execute(s) if not rst.eof then Response.Write "" lngID = DistributionListID else s = "Update tblDistributionList Set strDescription = '" & strDescription & "' WHERE DistributionListID = " & DistributionListID set rst2 = cn.execute(s) end if rst.close else s = "SELECT * From tblDistributionList WHERE strDescription = '" & strDescription & "'" set rst = cn.execute(s) if not rst.eof then btnAdd = "Add" Response.Write "" else s = "Insert Into tblDistributionList (strDescription) values ('" & strDescription & "')" set rst2 = cn.execute(s) end if rst.close end if elseif (Request.QueryString("btnDelete") = "Delete") and (blnAdmin) then intNotDeleted=0 arrID = split(Request.QueryString("arrID"),",") for i = 0 to ubound(arrID) s = "Select * From tblContactDistributionList WHERE refDistributionListID = " & arrID(i) set rst = cn.execute(s) if not rst.eof then intNotDeleted = intNotDeleted + 1 else s = "Delete From tblDistributionList WHERE DistributionListID = " & arrID(i) set rst2 = cn.execute(s) end if next if intNotDeleted > 0 then Response.Write "" end if end if %>