<%@ LANGUAGE="VBSCRIPT" %>
<!--#include file="../SQLconn.asp"-->
<%
 
    tname=request.cookies("tname")
    gradename=request("gradename")
	classname=request("classname")
	abc=request("abc")
	
	
	''
	if classname=""  then 
	if abc<>"Yes"    then
	
	       set RsDel=server.createobject("adodb.recordset")
		   sqlDel="delete  from myclass  where tname='"&tname& "' and  gradename='"&gradename& "' "
		   RsDel.open sqlDel,conn,1,1
		  
		   RsDel.close
		   set RsDel=nothing 
	
		   
		   set RsDel=server.createobject("adodb.recordset")
		   sqlDel="Insert into myclass(tname,gradename,classname) select  '"&tname& "','"&gradename& "',vname  FROM varSet  where  name ='class'"
		   RsDel.open sqlDel,conn,1,1
		   RsDel.close
		   set RsDel=nothing  
   else
           set RsDel=server.createobject("adodb.recordset")
		   sqlDel="delete  from myclass  where tname='"&tname& "' and  gradename='"&gradename& "' "
		   RsDel.open sqlDel,conn,1,1
		  
		   RsDel.close
		   set RsDel=nothing 
          
   end if
   end if  
	
	
	
	if classname<>""  then 
	if abc<>""    then
		   
		   set RsDel=server.createobject("adodb.recordset")
		   sqlDel="delete  from myclass  where tname='"&tname& "' and  gradename='"&gradename& "'  and  classname='"&classname& "'"
		   RsDel.open sqlDel,conn,1,1
		  
		   RsDel.close
		   set RsDel=nothing  
   else
           set RsDel=server.createobject("adodb.recordset")
		   sqlDel="insert into myclass(tname,gradename,classname)  values('"&tname& "','"&gradename& "','"&classname& "')"
		   RsDel.open sqlDel,conn,1,1
		   RsDel.close
		   set RsDel=nothing  
   end if
   end if    
    
   
   
   conn.close
   set conn=nothing
  response.redirect   "setpMyClass.asp"
 %>
<%=powdergroup%><%=powderdetail%>