<%Checklogin("信息管理")%> 产品信息管理
<% Act = Request.QueryString("act") ProductName=TextEnCode(Request.Form("ProductName")) ProductImg=TextEnCode(Request.Form("ProductImg")) unit=TextEnCode(Request.Form("unit")) moq=TextEnCode(Request.Form("moq")) nosale=Request.Form("nosale") num=Request.Form("num") price=Request.Form("price") note=TextEnCode(Request.Form("note")) tips=TextEnCode(Request.Form("tips")) If act = "save" Then Set Rs = Server.CreateObject("ADODB.RecordSet") isedit = False id = Request.Form("id") If id<>"" And IsNumeric(id) Then isedit = True If isedit Then Rs.Open "Select * From Products Where id="&id,Conn,1,3 Rs("ProductName") = ProductName Rs("ProductImg") = ProductImg Rs("Addtime")=now() Rs("moq")=moq Rs("unit")=unit Rs("nosale")=nosale Rs("note")=note Rs("tips")=tips Rs.Update:Rs.Close Set Rs=Nothing numarr=split(num,",") pricearr=split(price,",") Conn.execute("delete from price where productId="&id&" and AreaId=0") For i=0 to ubound(numarr) If numarr(i)="" then numarr(i)=0 If pricearr(i)="" then pricearr(i)=0 Conn.execute("insert into price (productId,AreaId,num,price) values("&id&",0,"&numarr(i)&",'"&pricearr(i)&"')") Next Conn.close Set Conn=Nothing Page = Request.QueryString("Page") Keys=Server.UrlEnCode(Request.QueryString("Keys")) Response.Redirect "?keys="&Keys&"&Page="&Page&urlStr Set Rs=Nothing:Conn.Close:Set Conn=Nothing Else Rs.Open "Products",Conn,1,3 Rs.Addnew() Rs("ProductName") = ProductName Rs("ProductImg") = ProductImg Rs("Addtime")=now() Rs("unit")=unit Rs("moq")=moq Rs("nosale")=nosale Rs("note")=note Rs("tips")=tips Rs.Update:Rs.Close Rs.open "select top 1 id from Products order by id desc",Conn,1,3 id=Rs("id") Rs.close numarr=split(num,",") pricearr=split(price,",") For i=0 to ubound(numarr) If numarr(i)="" then numarr(i)=0 If pricearr(i)="" then pricearr(i)=0 Conn.execute("insert into price (productId,AreaId,num,price) values("&id&",0,"&numarr(i)&",'"&pricearr(i)&"')") Next Set Rs=Nothing Conn.close Set Conn=Nothing Page = Request.QueryString("Page") Keys=Server.UrlEnCode(Request.QueryString("Keys")) Response.Redirect "?keys="&Keys&"&Page="&Page&urlStr Set Rs=Nothing:Conn.Close:Set Conn=Nothing End If Conn.Close:Set Conn=Nothing Response.End End If 'end save If Act = "add" or Act = "edit" Then id = Request.QueryString("id") isedit = False If id<>"" And IsNumeric(id) Then isedit=True If isedit Then Set Rs = Server.CreateObject("ADODB.RecordSet") Rs.Open "Select ProductName,ProductImg,unit,moq,nosale,note,tips from Products Where id="&id,Conn,1,1 If Not Rs.Bof And Not Rs.Eof Then ProductName=TextUnCode(Rs("ProductName")) ProductImg=TextUnCode(Rs("ProductImg")) unit=Rs("unit") moq=TextUnCode(Rs("moq")) nosale=Rs("nosale") note=TextUnCode(Rs("note")) tips=TextUnCode(Rs("tips")) Else isedit = False End If Rs.Close:Set Rs=Nothing End If Page = Request.QueryString("Page") Keys=Server.UrlEnCode(Request.QueryString("Keys")) hrefstr = "?keys="&Keys&"&Page="&Page %>
产品名称
产品图片
计价单位
起订数量
默认售价
<% If isedit Then Set Rs = Server.CreateObject("ADODB.RecordSet") Rs.open "Select num,price from price where AreaId=0 and productId="&id&" order by num asc",conn,1,1 If Not Rs.bof and Not Rs.eof Then For i=1 to Rs.RecordCount %>
"> ">
<% Rs.moveNext Next Rs.close Else %>
<% End If Else%>
<%End If%>
不报价地区
    <% If nosale<>"" Then Rs.open "select id,countryName from country where id in("&nosale&")",conn,1,1 Do while not Rs.bof And not Rs.eof %>
  • "><%=Rs("countryName")%>
  • <% Rs.moveNext loop Rs.close End If %>
    不报价处理方式
    备注
    <% Set Rs=Nothing conn.close Set conn=Nothing Response.End End If 'End Edit If Act="postchk" Then Keys = Server.UrlEnCode(Request.QueryString("Keys")) Page = Request.QueryString("Page") chkact = Request.Form("chkact") SqlStr = "" For i = 1 To Request.Form("chkbox").Count If SqlStr<>"" Then SqlStr = SqlStr & " Or id="&Request.Form("chkbox")(i) Else SqlStr = " Where id="&Request.Form("chkbox")(i) End If Next Select Case chkact Case "0":SqlStr = "Update customer Set cs_state="&chkact&SqlStr Case "1":SqlStr = "Update customer Set cs_state="&chkact&SqlStr Case Else:SqlStr = "Delete From products"&SqlStr End Select Conn.Execute(SqlStr):Conn.Close:Set Conn=Nothing Response.Redirect "?Keys="&Keys&"&Page="&Page Response.End End If 'End postchk Keyscode=TextEnCode(Request.QueryString("Keys")) Page = Request.QueryString("Page") sqlStr="Select id,ProductName,ProductImg from Products order by id Desc" Set Rs=Server.CreateObject("ADODB.RecordSet") Keys=Server.UrlEnCode(Request.QueryString("Keys")) hrefstr = "?keys="&Keys&urlStr Set Rs1=Server.CreateObject("ADODB.RecordSet") %>
    <% Rs.Open sqlStr,Conn,1,1 If Not Rs.Bof And Not Rs.Eof Then Rs.PageSize = 18 If Page = "" Then Page = 1 If Page = "end" Then Page = Rs.PageCount If Not IsNumeric(Page) Or Page < 1 Then Page = 1 Page = Cint(Page) If Page > Rs.PageCount Then Page = Rs.PageCount Rs.AbsolutePage = Page TempNum = Rs.PageSize * (Page - 1) Set Rs1=Server.CreateObject("ADODB.RecordSet") For i=1 To Rs.PageSize If Rs.Bof Or Rs.Eof Then Exit For TempNum=TempNum+1:classid=Rs(1) %> <% Rs.MoveNext Next Else If Keys="" Then %> <% Else %> <% End If End If %>
    序号 产品名称 图片 操作
    <%=TempNum%> <%=Rs("ProductName")%> " width="80px"> 修改
    Sorry,当前暂无信息
    Sorry,没有找到“<%=Keyscode%>”相关的信息,点击返回
    <% If Rs.PageCount > 1 Then PageName="?Keys="&Keys&urlStr&"&" Pagelen=3 If Page>1 Then Response.Write "首页" Response.Write "上一页" End If If Pagelen*2+1 >= Rs.PageCount Then StartPage=1:EndPage=Rs.PageCount Else If Page<=Pagelen+1 Then StartPage=1 EndPage=Pagelen*2+1 Else StartPage=Page-Pagelen EndPage=Page+Pagelen End If If Page+Pagelen>Rs.PageCount Then StartPage=Rs.PageCount-Pagelen*2:EndPage=Rs.PageCount End If For i = StartPage To EndPage If i = Page Then Response.Write ""&i&"" Else Response.Write ""&i&"" End If Next If Page Pagelen Then Response.Write "..."&Rs.PageCount&"" Response.Write "下一页" Response.Write "尾页" End If Response.Write "" End If %>
    <%Rs.Close:Set Rs=Nothing:Set Rs1=Nothing:Conn.Close:Set Conn=Nothing%>