<%@ Language=VBScript %>
<!--#include file="../../yns_chklogin.asp" -->
<!--#include File="../Functions.asp"-->
<!--#INCLUDE FILE="upload.inc"-->
<%
Dim MyConn, RS, SqlSelect, SqlInsert
Set MyConn = Server.CreateObject("Adodb.Connection")
Set MyConn = GetConnection

'Fields("xxx").Name 取得Form中xxx(Form Object)的名字
'Fields("xxx").FilePath 如果是file Object 取得文件的完整路径
'Fields("xxx").FileName 如果是file Object 取得文件名
'Fields("xxx").ContentType 如果是file Object 取得文件的类型
'Fields("xxx").Length 取得Form中xxx(Form Object)的数据长度
'Fields("xxx").Value 取得Form中xxx(Form Object)的数据内容
Dim FormData,FormSize
FormSize=Request.TotalBytes
FormData=Request.BinaryRead(FormSize)
Set Fields = GetUpload(FormData)

SitcomName = Fields("SitcomName").Value
'SitcomenName = Fields("SitcomenName").Value
sitcombh = Fields("sitcombh").Value
SitcomType = Fields("SitcomType").Value
SmallPic = Fields("SmallPic").Value
LargePic = Fields("LargePic").Value
BriefIntroduction = Fields("BriefIntroduction").Value
Detail = Fields("Detail").Value
enDetail = Fields("enDetail").Value
guzhang = Fields("guzhang").Value

SitcomName = SqlStr(SitcomName)
SitcomenName = SqlStr(SitcomenName)
sitcombh = SqlStr(sitcombh)
SitcomType = Cstr(SitcomType)
BriefIntroduction = SqlStr(BriefIntroduction)
Detail = SqlStr(Detail)
enDetail = SqlStr(enDetail)
guzhang = SqlStr(guzhang)
on error resume next
tj=sqlStr(trim(Fields("tj").Value))

SqlInsert = "Insert Into SitcomInfo (SitcomName, "
SqlInsert = SqlInsert & "SitcomenName, sitcombh, Type, BriefIntroduction, Detail, enDetail, "
if cstr(tj)="'true'" then SqlInsert = SqlInsert & "tj, "
SqlInsert = SqlInsert & "guzhang"

SqlInsert = SqlInsert & ") Values("
SqlInsert = SqlInsert & SitcomName & ","
SqlInsert = SqlInsert & SitcomenName & ","
SqlInsert = SqlInsert & sitcombh & ","
SqlInsert = SqlInsert & SitcomType & ","
SqlInsert = SqlInsert & BriefIntroduction & ","
SqlInsert = SqlInsert & Detail & ","
SqlInsert = SqlInsert & enDetail & ","
if cstr(tj)="'true'" then
	SqlInsert = SqlInsert & "true, "
	tj="是"
else
	tj="否"
end if

SqlInsert = SqlInsert & guzhang & ")"
Set RS = Server.CreateObject("Adodb.RecordSet")
RS.Open SqlInsert, MyConn, 1, 3
Set RS = Nothing

Set RS = Server.CreateObject("Adodb.RecordSet")
SqlSelect = "Select Top 1 * From SitcomInfo Order By SitcomID DESC"
	
RS.Open SqlSelect,MyConn,1,3

Dim HaveSmallPic, HaveLargePic

HaveSmallPic = True
HaveLargePic = True
If IsEmpty(SmallPic) Or IsNull(SmallPic) Or Cstr(SmallPic)="" Then
	HaveSmallPic = False
End If
If IsEmpty(LargePic) Or IsNull(LargePic) Or Cstr(LargePic)="" Then
	HaveLargePic = False
End If

If HaveSmallPic Or HaveLargePic Then
	If HaveSmallPic Then
		RS("SmallPicture").appendchunk SmallPic
	End If
	If HaveLargePic Then
		RS("LargePicture").appendchunk LargePic
	End If
	
	RS.Update
End If
%>
<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 width="600" align=center cellpadding=0 cellspacing=2>
  <tr> 
    <td align=center colspan=4><font size=4><b>添加成功</b></font></td>
  </tr>
  <tr> 
    <td align=center colspan=4>以下是您刚添加的产品信息</td>
  </tr>
  <tr> 
    <td align=center colspan=4><hr></td>
  </tr>
  <tr> 
    <td align=right>名　　称：</td>
    <td align=left><%=RS("SitcomName")%></td>
  </tr>
  <tr>
    <td align=right>推　　荐：</td>
    <td align=left><%=tj%></td>
  </tr>
  <tr> 
    <td align=right>编　　号：</td>
    <td align=left><%=RS("Sitcombh")%></td>
  </tr>
  <tr> 
    <td align=right>类　　别：</td>
    <td align=left><%=GetSitcomTypeName(RS("Type"))%></td>
  </tr>
  <tr> 
    <td align=right>简　　介：</td>
    <td align=left colspan=3><TEXTAREA rows=4 cols=55 id=textarea1 name=BriefIntroduction readonly><%=RS("BriefIntroduction")%></TEXTAREA></td>
  </tr>
  <tr> 
    <td align=right>详　　情：</td>
    <td align=left colspan=3><TEXTAREA rows=4 cols=55 id=textarea2 name=Detail class=text readonly><%=RS("Detail")%></TEXTAREA></td>
  </tr>
  <tr> 
    <td colspan=4><HR></td>
  </tr>
  <tr> 
    <td colspan=4 align=right> <INPUT type="button" value="继续添加" id=button1 name=button1 class=buttonmanager onclick="window.location='AddSitcom.asp?TypeID=<%=SitcomType%>'"> 
      <INPUT type="button" value="返回" id=button1 name=button1 class=buttonmanager onclick="window.location='ListSitcom.asp?TypeID=<%=SitcomType%>'"> 
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
  </tr>
</table>

</BODY>
</HTML>
<%
RS.Close
Set RS = Nothing
MyConn.Close
Set MyConn = Nothing
%>