📄 index.aspx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using myPaimai;
public partial class _Default : System.Web.UI.Page
{
public string strSQL = "";//"SELECT * FROM goods,paimaiManner Where goods.manner=paimaiManner.mannerID";
dataOperate do1 = new dataOperate();
protected void Page_Load(object sender, EventArgs e)
{
dlCompany1.DataSource = do1.getDataView("select top 5 * from goods where sellUserID='汤军' order by startTime desc");
dlCompany1.DataBind();
dlCompany2.DataSource = do1.getDataView("select top 5 * from goods where sellUserID='矿大' order by startTime desc");
dlCompany2.DataBind();
dlNotice.DataSource = do1.getDataView("SELECT top 9 * FROM notice ORDER BY expressTime desc");
dlNotice.DataBind();
dlUserPaimai.DataSource = do1.getDataView("SELECT top 9 * FROM userPaimai ORDER BY credit");
dlUserPaimai.DataBind();
dlAllGoods.DataSource = do1.getDataView("select top 11 * from goods order by startTime desc");
dlAllGoods.DataBind();
bindDll();
}
protected void Button_Click(object sender, EventArgs e)
{
// strSQLCount = "SELECT COUNT(*) FROM goods,paimaiManner Where goods.manner=paimaiManner.mannerID";
if (DropDownList2.SelectedIndex != 0)
{
strSQL = strSQL + " AND goods.manner=" + DropDownList2.SelectedValue;
}
if (DropDownList3.SelectedIndex != 0)
{
strSQL = strSQL + " AND goods.catalID=" + DropDownList3.SelectedValue;
}
if (TextBox2.Text != "填写拍卖人用户名...")
{
strSQL = strSQL + " AND goods.sellUserID='" + TextBox2.Text + "'";
}
if (TextBox3.Text != "填写关键字...")
{
strSQL = strSQL + " AND goods.nameOfGoods LIKE '%" + TextBox3.Text + "%'";
}
Response.Redirect("~/displayGoods.aspx?sql=" + Convert.ToBase64String(System.Text.UnicodeEncoding.Unicode.GetBytes(strSQL)).Replace(" ", "+"));
}
protected void bindDll()
{
DropDownList2.DataSource = do1.getDataView("SELECT * FROM paimaiManner");
DropDownList2.DataTextField = "mannerName";
DropDownList2.DataValueField = "mannerID";
DropDownList2.DataBind();
ListItem li = DropDownList2.Items[0];
ListItem li2 = new ListItem(li.Text, li.Value);
li.Text = "请选择拍卖方式..."; li.Value = "-1";
DropDownList2.Items.Add(li2);
DropDownList3.DataSource = do1.getDataView("SELECT * FROM catal");
DropDownList3.DataTextField = "catalName";
DropDownList3.DataValueField = "ID";
DropDownList3.DataBind();
ListItem lii = DropDownList3.Items[0];
ListItem lii2 = new ListItem(lii.Text, lii.Value);
lii.Text = "请选择拍品种类..."; lii.Value = "-1";
DropDownList3.Items.Add(lii2);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -