📄 displayareafac.aspx.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;
public partial class admin_editareafac : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (Convert.ToString(Session["UID"]) == "")
{
Response.Redirect("login.aspx");
}
if (!IsPostBack)
{
this.bind();
}
}
protected void bind()
{ string ID=Request.QueryString["ID"].ToString();
string str="select * from areaFacility where ID='"+ID+"'";
BaseClass bc = new BaseClass();
SqlDataReader sda=bc.ExecRead(str);
if(sda.Read())
{ //绑定数据
TextBox1.Text=sda["unitName"].ToString();
TextBox2.Text=sda["mainHead"].ToString();
TextBox4.Text = sda["contactPerson"].ToString();
TextBox5.Text=sda["tel"].ToString();
TextBox6.Text=sda["memo"].ToString();
string typeID = sda["typeID"].ToString();
sda.Close();
string str2="SELECT * FROM areaFacType";
bc.ExecDropDownList(ddl, str2, "name", "ID");//绑定设备类型到下拉列表框
ddl.SelectedValue = typeID;//默认选择
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -