📄 selproduct.aspx
字号:
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.Collections" %>
<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="SelProduct.aspx.cs" Inherits="YXShop.Web.Admin.Product.SelProduct" %>
<%@ Register src="../Control/ProductCategories.ascx" tagname="ProductCategories" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>选择产品</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="expires" content="0" />
<link href="../CSS/sys.css" rel="stylesheet">
<script language="JavaScript">
function tch_sel(a,b)
{
document.form1.tchid.value =a;
document.form1.tchname.value = b;
}
function tch_sub()
{
//if(document.form1.tchid.value=="")
// {
// alert("请选择产品!");
// return(false);
//}
//else
//{
var obj=new Object();
obj.chCode = document.form1.tchid.value;
obj.chName = document.form1.tchname.value;
window.returnValue=obj;
window.close();
//}
}
function form_sub()
{
var a,b,c,d;
a=document.form1.bm.value;
b=document.form1.gjz.value;
c=document.form1.tchid.value;
d=document.form1.tchname.value;
window.location="SelProduct.aspx?bm="+a+"&gjz="+b+"&jgbh="+c+"&jgxm="+d;
}
function winreload(a)
{
var b,c;
b=document.form1.tchid.value;
c=document.form1.tchname.value;
window.location="SelProduct.aspx?deptid="+a+"&jgbh="+b+"&jgxm="+c;
}
</script>
<base target="_self" />
</head>
<body bgcolor="#d0d0c8" leftmargin="6" topmargin="4">
<form id="form1" runat="server">
<input type="hidden" name="ifaction" value="true">
<input type="hidden" id="type" name="type" value="<% =type %>">
<table width="500" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight=#666666 bordercolordark=#ffffff>
<tr>
<td><table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="22%" align="center"><strong>选择产品</strong></td>
<td width="2%"> </td>
<td width="76%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%" align="right" nowrap>商品分类:</td>
<td width="23%">
<uc1:ProductCategories ID="ProductCategories1" runat="server" />
</td>
<td width="19%" align="right" nowrap>关键字:</td>
<td width="22%"><input name="gjz" type="text" size="9"></td>
<td width="21%"> <asp:Button ID="Button1" runat="server" Text="搜 索" style="height:19;width:45;font-size:9pt;BORDER-BOTTOM: 1px solid;BORDER-RIGHT: 1px solid"
onclick="Button1_Click" /></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="340" align="center" valign="top" bgcolor="#FFFFFF">
<table width="100%" height="305" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" height="322" align="center" valign="top">
<%
string sql1="";
YXShop.BLL.Product data = new YXShop.BLL.Product();
//Response.Write(gjz + "," + type + "," + bm);
//Response.End();
List<YXShop.Model.Product> Rooms = data.GetSpeArea("Pro_Name", gjz, type, bm);
int i=0;
int page_start = 1;
int page_end = 1;
int total= Convert.ToInt32((Math.Ceiling(Rooms.Count / 10.0)).ToString());
int pagecount=1;
if ((Request["page"]!=null)&&(Request["page"]!=""))
{
pagecount=int.Parse(Request["page"]);
}
if (( pagecount > total) || (pagecount<=0))
{
pagecount=1;
}
page_start=(pagecount-1)*10+1;
if (pagecount==1) page_start=1;
page_end=10*pagecount;
if (page_end > Rooms.Count) { page_end = Rooms.Count; }
%>
<table width="99%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#ffffff">
<tr align="center" bgcolor="#F0F0F0">
<td width="15%" height="20">商品型号</td>
<td width="20%" height="20">商品编码</td>
<td width="65%">产品名称</td>
</tr>
<%
for(int index=page_start-1;index<page_end;index++)
{
%>
<tr align="center" onMouseOver="bgColor='#E6F2FF'" onMouseOut="bgColor='#ffffff'">
<td height="20"><a href="#" onClick="tch_sel('<% =Rooms[index].Pro_ID %>','<% =Rooms[index].Pro_Name.Trim() %>')" title="点击选择产品"> <% =Rooms[index].Pro_MOdel.ToString()%></a></td>
<td height="20"><a href="#" onClick="tch_sel('<% =Rooms[index].Pro_ID %>','<% =Rooms[index].Pro_Name.Trim() %>')" title="点击选择产品"> <% =Rooms[index].Pro_NO%> </a></td>
<td><a href="#" onClick="tch_sel('<% =Rooms[index].Pro_ID %>','<% =Rooms[index].Pro_Name.Trim() %>')" title="点击选择产品"><% =Rooms[index].Pro_Name.Trim()%></a></td>
</tr>
<%
}
%>
</table>
</td>
</tr>
</table>
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1" valign="top" bgcolor="#ccccccc"></td>
</tr>
</table>
<table width="100%" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="45%" align="center">总共有 <font color=red><% =total %></font> 页,当前为第 <font color=red><% =pagecount%></font> 页 </td>
<td width="3%">|</td>
<td width="52%">
<%
if (pagecount<2)
{
Response.Write(" 首 页 上一页 ");
}
else
{
Response.Write(" <a href='SelProduct.aspx?page=1&bm=" + Request["bm"] + "&gjz=" + gjz + "&tchid=" + jgbh + "&tchname=" + jgxm + "&type=" + type + "'>首 页</a> <a href='SelProduct.aspx?page=" + (pagecount - 1).ToString() + "&bm=" + Request["bm"] + "&gjz=" + gjz + "&tchid=" + jgbh + "&tchname=" + jgxm + "&type=" + type + "'>上一页</a> ");
}
if ((total-pagecount) < 1)
{
Response.Write("下一页 尾 页");
}
else
{
Response.Write("<a href='SelProduct.aspx?page=" + (pagecount + 1).ToString() + "&bm=" + Request["bm"] + "&gjz=" + gjz + "&tchid=" + jgbh + "&tchname=" + jgxm + "&type=" + type + "'>下一页</a> <a href='SelProduct.aspx?page=" + total.ToString() + "&bm=" + Request["bm"] + "&gjz=" + gjz + "&tchid=" + jgbh + "&tchname=" + jgxm + "&type=" + type + "'>尾 页</a>");
}
%>
</td>
</tr>
</table></td>
</tr>
<tr>
<td>
<table width="100%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="60%" align="center"><table width="100%" height="20" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="0%" align="right" style="display:none">商品ID:</td>
<td width="0%" style="display:none"><input name="tchid" type="text" size="9" value="<% =jgbh%>" readonly style="width:100%;height:18;color:#FF0000;font-size:9pt;background:#d0d0c8;BORDER-BOTTOM: 1px solid;BORDER-RIGHT: 0px solid;BORDER-left: 0px solid;BORDER-top: 0px solid"></td>
<td width="25%" align="right">商品名称:</td>
<td width="75%"><input name="tchname" type="text" size="9" value="<% =jgxm%>" readonly style="width:90%;height:18;color:#FF0000;font-size:9pt;background:#d0d0c8;BORDER-BOTTOM: 1px solid;BORDER-RIGHT: 0px solid;BORDER-left: 0px solid;BORDER-top: 0px solid"></td>
</tr>
</table></td>
<td width="40%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><input name="xt33" type="button" value="确定选择" style="height:19;width:70;font-size:9pt;BORDER-BOTTOM: 1px solid;BORDER-RIGHT: 1px solid" onClick="tch_sub()">
<input name="xt332" type="button" value="放弃选择" style="height:19;width:70;font-size:9pt;BORDER-BOTTOM: 1px solid;BORDER-RIGHT: 1px solid" onClick="window.close();"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -