depedit.aspx.cs

来自「医院的用户管理与缴费与当病人去医院看病的时候要挂号等作用。」· CS 代码 · 共 56 行

CS
56
字号
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;

public partial class Management_depedit : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string id = Session["id"].ToString();
            string name = Session["name"].ToString();
            string psw = Session["psw"].ToString();
            string type = Session["type"].ToString();


            int idint = Convert.ToInt32(id);

            string sql = "select * from department where adminid=" + idint;
            DataTable Info = GenericDataAccess.ExecuteSelectCommand(sql, Page);

            Label1.Text = Info.Rows[0]["dename"].ToString();
       
        string test = Info.Rows[0]["sectype"].ToString();
        TextBox2.Text = "";
        if (Info.Rows[0]["sectype"].ToString() != "")
        {
            TextBox2.Text = Info.Rows[0]["sectype"].ToString();
        }

        TextBox3.Text = Info.Rows[0]["descrption"].ToString();
        }
    }

    protected void Button1_Click1(object sender, EventArgs e)
    {
        string t = TextBox2.Text;


        string sql = "update department set sectype='" + t + "',descrption='" + TextBox3.Text + "'";
        GenericDataAccess.ExecuteNonQuery(sql, Page);
        Response.Write("<script language=javascript>alert('修改成功')</script>");
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/BusinessSys/depedit.aspx");
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?