📄 goodlist.aspx.cs
字号:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.Security;
namespace chunsky.ctadmin
{
/// <summary>
/// goodlist 的摘要说明。
/// </summary>
public class goodlist : System.Web.UI.Page
{
protected System.Web.UI.WebControls.DataGrid domGrid;
protected System.Web.UI.WebControls.DataGrid hostGrid;
protected System.Web.UI.WebControls.DataGrid siteGrid;
protected System.Web.UI.WebControls.DataGrid mailGrid;
protected System.Web.UI.WebControls.DataGrid goodGrid;
protected System.Web.UI.WebControls.DataGrid taocanGrid;
config obj = new config();
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
if(Session["ctadminid"]==null)
Response.Redirect("login.aspx");
if(!IsPostBack)
{
BindGrid();
}
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
public void BindGrid()
{
obj.open();
string domsql="select * from [csgood] where dom Is Not Null";
OleDbDataAdapter domda=new OleDbDataAdapter(domsql,obj.myconn);
DataSet domds=new DataSet();
domda.Fill(domds);
domGrid.DataSource=domds;
domGrid.DataBind();
string hostsql="select * from [csgood] where host Is Not Null";
OleDbDataAdapter hostda=new OleDbDataAdapter(hostsql,obj.myconn);
DataSet hostds=new DataSet();
hostda.Fill(hostds);
hostGrid.DataSource=hostds;
hostGrid.DataBind();
string mailsql="select * from [csgood] where mail Is Not Null or impdom Is Not Null";
OleDbDataAdapter mailda=new OleDbDataAdapter(mailsql,obj.myconn);
DataSet mailds=new DataSet();
mailda.Fill(mailds);
mailGrid.DataSource=mailds;
mailGrid.DataBind();
string sitesql="select * from [csgood] where site Is Not Null";
OleDbDataAdapter siteda=new OleDbDataAdapter(sitesql,obj.myconn);
DataSet siteds=new DataSet();
siteda.Fill(siteds);
siteGrid.DataSource=siteds;
siteGrid.DataBind();
string taocansql="select * from [csgood] where taocan Is Not Null";
OleDbDataAdapter taocanda=new OleDbDataAdapter(taocansql,obj.myconn);
DataSet taocands=new DataSet();
taocanda.Fill(taocands);
taocanGrid.DataSource=taocands;
taocanGrid.DataBind();
obj.myconn.Close();
obj.myconn.Dispose();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -