<%@ Language=VBScript %>
<!--#include File="../Functions2.asp"-->
<!--#include file="../../yns_chklogin.asp" -->
<%
Dim TypeID
TypeID = Request("TypeID")
If IsNull(TypeID) Or IsEmpty(TypeID) Then
	Response.End
End If

Dim MyConn, RS, SqlSelect, SqlDelete
Set MyConn = Server.CreateObject("Adodb.Connection")
Set MyConn = GetConnection
Set RS = Server.CreateObject("Adodb.RecordSet")

SqlSelect = "Select TypeName From SitcomType Where TypeID=" & TypeID

RS.Open SqlSelect, MyConn

If RS.BOF Then
	RS.Close
	Set RS = Nothing
	MyConn.Close
	Set MyConn = Nothing
	Response.Redirect "..//Unexpectable_Error.htm"
	Response.End
End If

Dim SitcomRS, CanDelete
Set SitcomRS = Server.CreateObject("Adodb.RecordSet")
SqlSelect = "Select SitcomName From SitcomInfo Where Type=" & TypeID
SitcomRS.Open SqlSelect, MyConn

If Not SitcomRS.EOF Then
	CanDelete = False
Else
	CanDelete = True
End If

SitcomRS.Close
Set SitcomRS = Nothing
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">

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

<TITLE>删除产品类别</TITLE>

</HEAD>
<BODY bgcolor="#ffffff">
<%
If CanDelete Then
%>
<P>&nbsp;</P>
<table align=center cellpadding=0 cellspacing=0>
  <tr>
    <td align=center>
      <font size=4><b><font color=red>删除</font>“<%=Server.HTMLEncode(RS("TypeName"))%>”？</b><font>
    </td>
  </tr>
  <tr><td align=center><HR></td></tr>
  <tr>
	<td align=left>
	  您的操作即将彻底删除产品类别“<%=Server.HTMLEncode(RS("TypeName"))%>”的信息，<br>
	  该产品类别将全部丢失，不可恢复。
	</td>
  </tr>
  <tr height=40 valign=bottom>
    <td align=center><font size=3><b>确信要删除吗？</b></font></td>
  </tr>
  <tr height=40 valign=bottom>
    <td align=center>
    <INPUT type="button" value="删除" id=button1 name=button1 class=buttonmanager onclick="window.location='DoDeleteSitcomType.asp?TypeID=<%=TypeID%>&SitcomTypeName=<%=RS("TypeName")%>'">
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <INPUT type="button" value="不删除" id=button2 name=button2 class=buttonmanager onclick="window.history.back()">
    </td>
  </tr>
</table>
<%
Else
%>
<P>&nbsp;</P>
<table align=center cellpadding=0 cellspacing=0>
  <tr>
    <td align=center>
      <font size=4><b><font color=red>不能删除产品类别</font><%=RS("TypeName")%>！</b><font>
    </td>
  </tr>
  <tr><td align=center><HR></td></tr>
  <tr>
	<td align=left>
	  系统中还有该类别的产品，要删除类别“<%=RS("TypeName")%>”，<br>
	  请确保系统中没有该类别的产品。
	</td>
  </tr>
  <tr height=40 valign=bottom>
    <td align=center>
    <INPUT type="button" value="确定" name=button1 class=buttonmanager onclick="window.history.back()">
    </td>
  </tr>
</table>
<%
End If
%>
</BODY>
</HTML>
<%
RS.Close
Set RS = Nothing
MyConn.Close
Set MyConn = Nothing
%>