?? st_customersmanmodule.ascx.cs
字號:
?using System;
using System.Data;
using System.Configuration;
using System.Collections;
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 System.Data.SqlClient;
using SQLExe;
public partial class Context_ST_CustomersManModule : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
SetDataBind();
}
public void SetDataBind()
{
DataSet ds = new DataSet();
SQLExe.SQLExe myExe = new SQLExe.SQLExe();
string str = "";
if (this.txtSearch.Text == "")
{
this.lblInfo.Text = "查詢內容不能為空";
return;
}
if (this.ddlType.SelectedValue == "按姓名")
{
str = "select * from ST_History where ST_CName='" + this.txtSearch.Text.ToString() + "'";
}
else if (this.ddlType.SelectedValue == "按身份證號")
{
str = "select * from ST_History where ST_CIdentityId='" + this.txtSearch.Text.ToString() + "'";
}
else if (this.ddlType.SelectedValue == "按地區")
{
str = "select * from ST_History where ST_Address like '%" + this.txtSearch.Text.ToString() + "%'";
}
ds = myExe.GetDataSet(str);
this.DataGrid1.DataSource = ds.Tables[0].DefaultView;
this.DataGrid1.DataBind();
}
protected void DataGrid1_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
this.DataGrid1.CurrentPageIndex = e.NewPageIndex;
SetDataBind();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -