<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%if WS_S.MemberPriv("WS_SaleManageProductManage")<>1 then HX_GoBack "对不起,您的权限不够!",""
ColumnName="":Tablename="HX_Product":Tablename1="HX_SaleShop":Orderby="":action=request("action")
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
if action="saveinfo" then
SSID=WS_s.HX_Replace(request("SSID")):Productname=WS_s.HX_Replace(request("Productname")):Producttype=WS_s.HX_Replace(request("Producttype")):ProductUnitPrice=WS_s.HX_Replace(request("ProductUnitPrice")):ProductPrice=WS_s.HX_Replace(request("ProductPrice")):ProductSalePrice=WS_s.HX_Replace(request("ProductSalePrice")):ProductIntr=WS_s.HX_Replace(request("ProductIntr"))
Orderby=" where WS_ProductName='"&ProductName&"' and WS_ProductCreateMan="&loginuid
set ifrs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
if ifrs.recordcount>0 then HX_GoBack "产品已添加",""
rs.addnew:rs("WS_SSID")=SSID:rs("WS_ProductName")=ProductName:rs("WS_Producttype")=Producttype:rs("WS_ProductUnitPrice")=ProductUnitPrice
if WS_S.HX_IsNUM(ProductPrice) then:rs("WS_ProductPrice")=ProductPrice
if WS_S.HX_IsNUM(ProductSalePrice) then:rs("WS_ProductSalePrice")=ProductSalePrice
rs("WS_ProductIntr")=ProductIntr:rs("WS_ProductCreateMan")=loginuid:rs.update
response.write "<script>if(confirm('添加成功！是否继续添加？')) {location.href='ProductCreate.asp';}else {location.href='ProductManage.asp';}</script>"
response.end
end if
WSOASCOMSTR="<html><head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title>产品添加</title><link rel=stylesheet type=text/css href='../HXinclude/HX_Style.css'><script src='../HXinclude/HX_Function.js'></script></head><body topmargin='20' leftmargin='0' bottommargin='0'>"
WSOASCOMSTR=WSOASCOMSTR&"<table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td colspan='2' bgcolor=FFFBE8><table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>添加产品</font>　　　　　<a href='ProductManage.asp' class='menu'>产品管理(产品总数 "&rs.recordcount&" )</a></td></tr></table><table width='100%'  border='0' cellspacing='1' cellpadding='3' bgcolor=FFFBE8><form name='form1' method='post' action='?action=saveinfo' onSubmit='return ProductCheck(this);'><tr bgcolor='#FFFBE8'><td width='23%' align='right'>供 应 商：</td><td width='77%'><select name='SSID' id='SSID'><option value='0'>选择供应商</option>"
set urs=WS_S.HX_SetRSD(ColumnName,Tablename1,Orderby)
if urs.recordcount>0 then
   do until urs.eof
    WSOASCOMSTR=WSOASCOMSTR&"<option value='"&urs("WS_SSID")&"'>"&urs("WS_SaleShopName")&"</option>"
   urs.movenext
  loop
end if
WS_S.HX_RSClose urs  
WSOASCOMSTR=WSOASCOMSTR&"</select></td></tr><tr bgcolor='#FFFBE8'><td align='right'>产品名称：</td><td><input type='text' size='36' name='ProductName'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>产品型号：</td><td><input type='text' size='36' name='Producttype' style='ime-mode:disabled'></td></tr>"
WSOASCOMSTR=WSOASCOMSTR&"<tr bgcolor='#FFFBE8'><td align='right'>计量单位：</td><td><input type='text' size='36' name='ProductUnitPrice'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>成 本 价：</td><td><input type='text' size='36' name='ProductPrice' style='ime-mode:disabled'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>出 售 价：</td><td><input type='text' size='36' name='ProductSalePrice' style='ime-mode:disabled'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>库 存 量：</td><td><input type='text' size='36' name='ProductStocks' style='ime-mode:disabled'></td></tr><tr bgcolor='#FFFBE8'><td align='right'>产品描述：</td><td><input type='text' size='36' name='ProductIntr'></td></tr><tr bgcolor='#FFFBE8'><td align='right' valign=top>&nbsp;</td><td><input type='submit' name='Submit' value=' 添 加 '> <input type='reset' name='Submit2' value=' 重 置 '></td></tr></form></table></td></tr></table>"
RESPONSE.Write WSOASCOMSTR
WS_S.HX_RSClose rs%>
