<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/Function.asp"-->

<%
Call ChkLogin(session("WebAdminsUserName"))
Call ConnectionDataBase(2)
Action = Request("Action")
Select Case Action
	Case "AddProduct"
		Call AddProduct
End Select
'添加产品
Sub AddProduct()
	ProCategory = Request.Form("ProCategory")
	ProName = Request.Form("ProName")
	ProPic = Request.Form("ProPic")
	SortID = Request.Form("SortID")
	Content = Request.Form("Content")
	Price = Request.Form("Price")
	Brand = Request.Form("Brand")
	ID = Request.Form("ID")
	 
	Call ChkIsNumber(ID,"参数类型错误!")
	Call ChkIsNumber(ProCategory,"参数类型错误!")
	Call ChkIsNull(ProName,"请输入产品名称!")
	Call ChkIsNull(ProPic,"请选择产品图片!")
	Call ChkIsNumber(SortID,"参数类型错误!")
	strSql = "Select * From T_Products Where ID=" & ID	
	SetRs Rs,strSql,conn,1,3
	IF Rs.EOF Then	Rs.Addnew()
	Rs("ClassID") = ProCategory
	Rs("Price") = Price	
	Rs("BrandID") = Brand	
	Rs("ProName") = ProName	
	Rs("ProPic") = ProPic
	Rs("SortID") = SortID
	Rs("Content") = Content
	Rs.Update
	DisRs Rs
	Call CloseDatabase
	Call Success("信息提交成功!",Request.ServerVariables("HTTP_REFERER"))
End Sub
%>
