% 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") CID = request.QueryString("CID") BID = request.QueryString("BID") if DistributionListID > 0 then s = "SELECT * From tblContactDistributionList WHERE refContactID = " & CID & " AND refDistributionListID = " & BID & " AND ContactDistributionListID <> " & DistributionListID set rst = cn.execute(s) if not rst.eof then response.Write "" lngID = ContactDistributionListID else s = "Update tblContactDistributionList Set refDistributionListID = " & BID & ", refContactID = " & CID & " WHERE ContactDistributionListID = " & DistributionListID set rst1 = cn.execute(s) end if rst.close else s = "SELECT * From tblContactDistributionList WHERE refContactID = " & CID & " AND refDistributionListID = " & BID set rst = cn.execute(s) if not rst.eof then btnAdd = true response.Write "" else s = "Insert Into tblContactDistributionList (refDistributionListID, refContactID) values (" & BID & ", " & CID & ")" set rst2 = cn.execute(s) end if end if elseif (request.QueryString("btnDelete") = "Delete") and (blnAdmin) then arrID = split(Request.QueryString("arrID"),",") for i = 0 to ubound(arrID) s = "Delete From tblContactDistributionList WHERE ContactDistributionListID = " & arrID(i) set rst2 = cn.execute(s) next end if %>