<%@ Language=VBScript %>
<!--#include file="../../yns_chklogin.asp" -->
<!--#include File="../Functions.asp"-->
<%
Dim SitcomID
SitcomID = Request("SitcomID")
SitcomName = Request("SitcomName")


Dim SitcomRS, SitcomTypeRS, MyConn, SqlDelete, ThisTypeCommend, i, ThisCommend,TypeID
Set SitcomRS = Server.CreateObject("Adodb.RecordSet")
Set SitcomTypeRS = Server.CreateObject("Adodb.RecordSet")
Set MyConn = Server.CreateObject("Adodb.Connection")
Set MyConn = GetConnection


SqlSelect = "Select Type From SitcomInfo Where SitcomID=" & SitcomID
SitcomRS.Open SqlSelect, MyConn

SqlSelect = "Select * From SitcomType Where TypeID=" & SitcomRS("Type")
SitcomTypeRS.Open SqlSelect, MyConn, 1, 2
if not SitcomTypeRS.Eof THen TypeID=SitcomTypeRS("TypeID")
SitcomRS.Close
Set SitcomRS = Nothing

ThisCommend = ""
if SitcomTypeRS("CommendSitcom")<>"" then
ThisTypeCommend = Split(SitcomTypeRS("CommendSitcom"), ",")
For i = 0 To Ubound(ThisTypeCommend)
	If CLng(ThisTypeCommend(i)) <> Clng(SitcomID) Then
		ThisCommend = ThisCommend + ThisTypeCommend(i) + ","
	End If
Next
end if
If ThisCommend<>"" Then
	ThisCommend = Left(ThisCommend, Len(ThisCommend)-1)
End If
SitcomTypeRS("CommendSitcom") = ThisCommend
SitcomTypeRS.Update

SitcomTypeRS.Close
Set SitcomTypeRS = Nothing

SqlDelete = "Delete From SitcomInfo Where SitcomID=" & SitcomID
MyConn.Execute SqlDelete
MyConn.Close
Set MyConn = Nothing
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">

<link rel="stylesheet" href="../../zf.css">

<TITLE>删除成功</TITLE>
</HEAD>
<BODY bgcolor="#ffffff">

<P>&nbsp;</P>
<table align=center cellpadding=0 cellspacing=0 width=68%>
  <tr>
    <td align=center>
      <font size=4><b>删除成功！</b><font>
    </td>
  </tr>
  <tr><td align=center><HR></td></tr>
  <tr>
	<td align=center>
	  连续剧“<%=SitcomName%>”已被成功删除！
	</td>
  </tr>
  <tr height=40 valign=bottom>
    <td align=center>
    <INPUT type="button" value="确定" id=button1 name=button1 class=buttonmanager onclick="document.all('backtolist').click();">
    <a href="ListSitcom.asp?TypeID=<%=TypeID%>" id=backtolist></a>
    </td>
  </tr>
</table>
</BODY>
</HTML>
