houtai/edit_yg.aspx.cs

(开头部分) 2KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Data;
using System.Data.SqlClient;
namespace 淮安协和门诊.houtai
{
    public partial class edit_yg : System.Web.UI.Page
    {
        SQLHelper db = new SQLHelper();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                bind();
            }
        }
        //
        public void bind()
        {
            string sql = "select * from depart";
            DataTable dt = db.ExecuteQuery(sql, CommandType.Text);
            this.ddl_depart.DataSource = dt;
            this.ddl_depart.DataTextField = "depart";
            this.ddl_depart.DataValueField = "depart_id";
            this.ddl_depart.DataBind();
            //
            int id = int.Parse(Request.QueryString["id"].ToString());
            string cx= "select * from yg where yg_id=" + id;
            DataTable d= db.ExecuteQuery(cx, CommandType.Text);
            this.txt_zh.Text = d.Rows[0]["zh"].ToString();
            this.txt_mima.Text = d.Rows[0]["mima"].ToString();
            this.txt_name.Text = d.Rows[0]["name"].ToString();
            this.rbt_sex.Items.FindByValue(d.Rows[0]["sex"].ToString()).Selected = true;
            this.txt_tel.Text = d.Rows[0]["tel"].ToString();
            this.txt_email.Text = d.Rows[0]["email"].ToString();
            this.rbt_type.Items.FindByValue(d.Rows[0]["yg_type"].ToString()).Selected = true; ;
            this.ddl_depart.Items.FindByValue(d.Rows[0]["depart_id"].ToString()).Selected = true;
            //
        }
        //
        protected void Button1_Click(object sender, EventArgs e)
        {
            int id = int.Parse(Request.QueryString["id"].ToString());
            int depart_id = int.Parse(this.ddl_depart.SelectedValue.ToString());
            string zh = this.txt_zh.Text.ToString();
            string mima = this.txt_mima.Text.ToString();
            string name = this.txt_name.Text.ToString();
            string sex = this.rbt_sex.SelectedValue.ToString();
            string tel = this.txt_tel.Text.ToString();
            string email = this.txt_email.Text.ToString();
            string yg_type = this.rbt_type.SelectedValue.ToString();
            string sql = "update yg set zh='" + zh + "',mima='" + mima + "',name='" + name + "',sex='" + sex + "',tel='" + tel + "',email='"+email+"',depart_id='" + depart_id + "',yg_type='"+yg_type+"' where yg_id="+id;
            int r = db.ExecuteNonQuery(sql, CommandType.Text);
            Response.Write("<script>alert('成功!');location='manage_yg.aspx'</script>");
        }
后面还有 4 行代码,购买后查看完整代码

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

AI 解读 AI

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

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