protected void Page_Load(object sender, EventArgs e)
    {
        string     name       = "";
        HttpCookie usercookie = Request.Cookies["nowloginuser"];
        string     url        = PublicClass.CheckLogin(usercookie, "");

        if (url != "")
        {
            Response.Redirect(url);
        }
        if (!IsPostBack)
        {
            string action = Request["action"];
            if (action != null && action.ToString().Equals("Del"))
            {
                int kgtid = int.Parse(Request["kgtid"].ToString());
                deleteGetTestPaperInfo(kgtid);
            }
            else if (action != null && action.ToString().Equals("vlaues"))
            {
                name = Request["sjName"].ToString();
            }
            spannowtime.InnerText = "服务器时间:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
            string user = usercookie.Value;
            yhid = TbUserManager.GetStudentID(user);
            testPaperScoreList = TbScoreManager.GetTestPaperScoreByYhid(yhid, name);
            sjName.Value       = name;

            Hello = TbStudentManager.GetStudentByID(yhid).XsName;
        }
    }
    public static DataTable studentList = new DataTable(); //定义一个Table表格,初始化为null.
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie usercookie = Request.Cookies["nowloginuser"];
        string     url        = PublicClass.CheckLogin(usercookie, "main");

        if (url != "")
        {
            Response.Write(url);
            return;
        }
        if (!IsPostBack)
        {
            this.BjName.Items.Clear();
            this.BjName.Items.Add("请选择...");
            List <TbClass> TbClass = TbClassManager.GetAllClassList();
            foreach (TbClass TbClassRow in TbClass)
            {
                string AddList = TbClassRow.Nj + TbClassRow.BjName;
                this.BjName.Items.Add(AddList);
            }
            string yhid = Request["userid"];
            if (yhid != null)
            {
                TbStudentManager.DeleteStuByYuID(int.Parse(yhid));
            }
            Load_Student();
        }
    }
    public static int maxPage = 0;                            //定义显示页面的最大页数,初始化为0
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie usercookie = Request.Cookies["nowloginuser"];
        string     url        = PublicClass.CheckLogin(usercookie, "main");

        if (url != "")
        {
            Response.Write(url);
            return;
        }
        if (!IsPostBack)
        {
            string zyid = Request["ZyID"];
            if (zyid != null)
            {
                //判断是否存在科目信息,存在则提示不能删除专业信息,不存在则执行删除操作
                if (TbSubjectManager.QuerySubjectInfo(int.Parse(zyid)) <= 0)
                {
                    //根据专业ID删除班级、老师信息表以及专业信息表对应的信息
                    TbClassManager.DeleteClassByZyID(int.Parse(zyid));
                    TbTeacherManager.DeleteTeaByZyID(int.Parse(zyid));
                    TbSpecialityManager.DeleteSpecByZyID(int.Parse(zyid));
                }
                else
                {
                    Page.RegisterStartupScript("", "<script>alert('存在专业对应的科目信息,如需继续执行删除操作,请先删除科目信息!')</script>");
                }
            }
            GetAllSpenIntoCount();
        }
    }
    public static int Record  = 0;  //定义当前符号查询的记录总数,初始化为0
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie usercookie = Request.Cookies["nowloginuser"];
        string     url        = PublicClass.CheckLogin(usercookie, "main");

        if (url != "")
        {
            Response.Write(url);
            return;
        }

        if (!IsPostBack)
        {
            string bjid = Request["BjID"];
            if (bjid != null)
            {
                TbClassManager.DeleteClassInfo(int.Parse(bjid));
            }
            GetPageInfo();
            //绑定专业名称
            DataTable dt = TbSpecialityManager.BangdingZy();
            textZy.DataSource     = dt;
            textZy.DataTextField  = "ZyName";
            textZy.DataValueField = "ZyID";
            textZy.DataBind();
            textZy.Items.Insert(0, new ListItem("请选择..", "0"));
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string     sjName     = "";
        HttpCookie usercookie = Request.Cookies["nowloginuser"];
        string     url        = PublicClass.CheckLogin(usercookie, "");

        if (url != "")
        {
            Response.Redirect(url);
        }

        if (!IsPostBack)
        {
            string action = Request["action"];
            if (action != null && action.ToString().Equals("Elspenvlaues"))
            {
                sjName = Request["sjName"].ToString();
            }
            spannowtime.InnerText = "服务器时间:" + DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
            string user = usercookie.Value;
            Tobj.YhID = TbUserManager.GetStudentID(user);
            TbStudent tStudent = TbStudentManager.GetStudentByID(Tobj.YhID);
            testPaperList = TbTestPaperManager.GetAllTestpaperByPages(len, page, sjName, 2);
            Hello         = tStudent.XsName;
            Elspen.Value  = sjName;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie usercookie = Request.Cookies["nowloginuser"];
        string     url        = PublicClass.CheckLogin(usercookie, "main");

        if (url != "")
        {
            Response.Write(url);
            return;
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie usercookie = Request.Cookies["nowloginuser"];
        string     url        = PublicClass.CheckLogin(usercookie, "main");

        if (url != "")
        {
            Response.Write(url);
            return;
        }

        if (!IsPostBack)
        {
            string action = Request["action"];
            string sjid   = Request["sjid"];
            if (action != null && sjid != null)
            {
                int id = int.Parse(sjid);
                if (action.Equals("delete"))
                {
                    //删除服务器上面对应试卷的所有图片
                    foreach (DataRow row in TbImagesManager.GetImagesBySjid(id).Rows)
                    {
                        string path = Server.MapPath("images/" + row["Tpian"].ToString());
                        if (File.Exists(path))
                        {
                            File.Delete(path);
                        }
                    }
                    TbImagesManager.DeleteImageBySjid(id);
                    TbQuestionTypesManager.DeleteQuestionTypesBySjid(id);
                    TbTestPaperManager.DeleteTestpaperBySjid(id);
                }
            }
            GetAllTestPaperInfo();
        }
    }
    public static int Record  = 0;  //定义当前符号查询的记录总数,初始化为0
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie usercookie = Request.Cookies["nowloginuser"];
        string     url        = PublicClass.CheckLogin(usercookie, "main");

        if (url != "")
        {
            Response.Write(url);
            return;
        }

        if (!IsPostBack)
        {
            string lsid = Request["LsID"];
            if (lsid != null)
            {
                int yhid = TbUserManager.GetTeacherUserYhID(int.Parse(lsid)); //根据教师编号LsID得到对应的用户编号
                TbTeacherManager.DeleteTeacherInfo(int.Parse(lsid));          //根据教师编号LsID删除对应教师信息
                TbUserManager.DeleteUserByYhID(yhid);                         //根据用户编号删除教师对应的用户信息
            }
            GetPageInfo();
            GetSpeciality();
        }
    }
Example #9
0
    public static DataTable subjectList = new DataTable(); //定义一个Table表格,初始化为null.
    protected void Page_Load(object sender, EventArgs e)
    {
        HttpCookie usercookie = Request.Cookies["nowloginuser"];
        string     url        = PublicClass.CheckLogin(usercookie, "main");

        if (url != "")
        {
            Response.Write(url);
            return;
        }
        string Sub_Sc = Request["Sub_Sc"];

        if (!IsPostBack)
        {
            ZyName.Items.Clear();
            List <TbSpeciality> TbSpeciality = TbSpecialityManager.GetAllSpecialityList();
            ZyName.DataSource     = TbSpeciality;
            ZyName.DataTextField  = "ZyName";
            ZyName.DataValueField = "ZyID";
            ZyName.DataBind();
            ZyName.Items.Insert(0, new ListItem("请选择..", "0"));
            if (Sub_Sc != null)
            {
                int count = TbTestPaperManager.GetAllTestPaperIsExist(int.Parse(Sub_Sc));
                if (count <= 0)
                {
                    TbSubjectManager.Dele_Sub(int.Parse(Sub_Sc));
                }
                else
                {
                    Page.RegisterStartupScript("", "<script>alert('请先删除试卷信息!!')</script>");
                }
            }
            Load_Subject(); //调用方法实现数据加载。
        }
    }