MyLesson/ServiceUser/qingjia_Edit.aspx.cs
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
namespace MyLesson.ServiceUser
{
public partial class qingjia_Edit : System.Web.UI.Page
{
string str = ConfigurationManager.ConnectionStrings["PersonResourceConnectionString"].ConnectionString;
//ConfigurationManager
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
if (string.IsNullOrEmpty(Request.QueryString["id"]))
{
this.txtDeptID.Text = Session["username"].ToString();
this.InitForm();
PRDataContext pr = new PRDataContext();
this.lstDeptID.DataSource = pr.Inf_Dept;
this.lstDeptID.DataTextField = "DeptName";
this.lstDeptID.DataValueField = "DeptID";
this.lstDeptID.DataBind();
lstDeptID.SelectedValue = Session["DeptID"].ToString();
}
else {
PRDataContext pr = new PRDataContext();
this.lstDeptID.DataSource = pr.Inf_Dept;
this.lstDeptID.DataTextField = "DeptName";
this.lstDeptID.DataValueField = "DeptID";
this.lstDeptID.DataBind();
lstDeptID.SelectedValue = Session["DeptID"].ToString();
SqlConnection conn = new SqlConnection(str);
conn.Open();
SqlDataAdapter sdr = new SqlDataAdapter("select * from tb_qingjia where id="+Request.QueryString["id"],conn);
DataSet ds = new DataSet();
sdr.Fill(ds);
txtDeptID.Text=ds.Tables[0].Rows[0]["name"].ToString();
lstDeptID.SelectedValue = ds.Tables[0].Rows[0]["bm"].ToString();
txtContent.Text = ds.Tables[0].Rows[0]["yy"].ToString();
TextBox1.Text = ds.Tables[0].Rows[0]["sj"].ToString();
txtDeptID.Enabled = false;
lstDeptID.Enabled = false;
txtContent.Enabled = false;
TextBox1.Enabled = false;
}
后面还有 65 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
