HyperLesson/Admin/Student-A.aspx.cs

(开头部分) 7KB

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

using BLL;
using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace HyperLesson
{
    public partial class Student_A : System.Web.UI.Page
    {
        private void Bind()
        {
            GridView1.DataSource = StudentManager.getCategoryList();
            GridView1.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                Bind();
                this.Button1.Attributes.Add("onclick", "return confirm('确认删除选中的项目吗??')");
                
            }
        }
        //删除
        protected void GridView1__RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int StuNum = int.Parse(GridView1.Rows[e.RowIndex].Cells[2].Text);
            string StuName = GridView1.Rows[e.RowIndex].Cells[3].Text;
            if (StudentManager.Delete(int.Parse(GridView1.Rows[e.RowIndex].Cells[1].Text)))
            {

                Response.Write("<script>alert('删除"+StuNum+StuName+"成功!');location.href='Student-A.aspx';</script>");
            }
            else
                Response.Write("<script>alert('删除失败!');location.href='Student-A.aspx';</script>");
            Bind();
        }
        //批量删除
        protected void Button1_Click(object sender, EventArgs e)
        {
            int flag = 0;  //记录删除的数量
            for (int i = 0; i < this.GridView1.Rows.Count; i++)
            {
                CheckBox ckb = (CheckBox)this.GridView1.Rows[i].FindControl("CheckBox1");
                if (ckb.Checked)
                {
                    int Id = int.Parse(this.GridView1.Rows[i].Cells[1].Text);
                    StudentManager.Delete(Id);   //根据项目id删除
                    flag = flag + 1;
                }

            }
            string fileName = "Student-A.aspx";
            if (Request.Params["id"] != null)
            {
                fileName = "Student-A.aspx?id=" + Request.Params["id"];
后面还有 127 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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