⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 querystudentinform.aspx.cs

📁 项目开发完整系统
💻 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 XTeamBBL;

public partial class RS_Admin_Sys_XS_Mgt_XS_info_Mgt_Delstudentinformt : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string sql = "select * from student_info";
        if (student_num.Text != "")
            sql = sql + " where student_num = " + student_num.Text.Trim() ;


        DataSet ds = student.select_student(sql);
        GVstudent.DataSource = ds;
        GVstudent.DataBind();

    }

    protected void select_info_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {
        int student_ID = Convert.ToInt32(GVstudent.DataKeys[e.RowIndex].Value.ToString());
        student  st = new student(student_ID);
        Boolean flag = student.del_student(st);
        if (flag) { Response.Write("<script>alert('删除成功');</script>"); }
        else Response.Write("<script>alert('删除失败');</script>");
    }
    protected void select_info_RowDataBound(object sender, GridViewRowEventArgs e)
    {

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            ((LinkButton)(e.Row.Cells[7].Controls[0])).Attributes.Add("onclick", "return confirm('确定要删除吗')");
            e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#E0E0E0';this.style.cursor='hand'");
            e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='white'");

        }
        
    }
  
}

⌨️ 快捷键说明

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