admin/ModifyTeachter.aspx.cs

(完整代码) 1KB

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_ModifyTeachter : System.Web.UI.Page
{
    Alert alert = new Alert();
    data data = new data();
    public string DownPath;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {


            GetArticle();
        }
    }


    private void GetArticle()
    {
        int id = int.Parse(Request.QueryString["id"].ToString());
        SqlDataReader dr;
        dr = data.GetDataReader("select * from  Teacher where id=" + id);
        dr.Read();
        txtname.Text = dr["UserName"].ToString();

        txtemal.Text = dr["emal"].ToString();
        txtds.Text = dr["Ds"].ToString();
        DropDownList1.Items[0].Text = dr["Sex"].ToString();



        txtxuehao.Text = dr["xuehao"].ToString();
        txttime1.Value = dr["chushengriqi"].ToString();


    }



    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        int id = int.Parse(Request.QueryString["id"].ToString());
        data.RunSql("update   Teacher set emal='" + txtemal.Text + "',UserName='" + txtname.Text + "',Ds='" + txtds.Text + "',Sex='" + DropDownList1.SelectedItem.Text + "',xuehao='" + txtxuehao.Text + "',chushengriqi='" + txttime1.Value + "'  where id=" + id);

        Alert.AlertAndRedirect("修改成功!", "Teacher.aspx");
    }

}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。