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)
    {
        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;
        }
    }
Beispiel #3
0
    /// <summary>
    /// 根据用户ID查询对应详细信息
    /// </summary>
    /// <param name="YhID"></param>
    public void GetStudent(int YhID)
    {
        TbStudent student = TbStudentManager.GetStudentByID(YhID);
        TbUser    user    = TbUserManager.GetAllUser(YhID);
        string    message = student.YhID + "," + student.XsName + "," + student.XsSex + "," + student.BjName + "," + student.Remark + "," + user.YhName + "," + user.Xh + "," + user.YhPwd;

        Response.Write(message);
    }
Beispiel #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Ls = new List <string>();
        if (!IsPostBack)
        {
            if (Request["sjid"] != null)
            {
                SjID = Request["sjid"].ToString();
            }
        }
        DataTable dtPaper = TbTestPaperManager.getOnePaperInfo(SjID);

        if (dtPaper != null)
        {
            drPaper = dtPaper.Rows[0];
            DateTime Jstime = DateTime.Parse(drPaper["JsTime"].ToString());     //结束时间
            DateTime Kstime = DateTime.Parse(drPaper["KsTime"].ToString());     //开始时间
            int      Min    = PublicClass.GetMinutes(Kstime, Jstime);           //间隔时间
            Ls.Add(Min.ToString());                                             //Ls[0] = 剩余时间 分钟数
            if (STimeMin == -1)
            {
                STimeMin = Min;
            }
            int Zfen = TbQuestionTypesManager.GetSumScoreBySjid(int.Parse(SjID));
            Ls.Add(Zfen.ToString());
            string KstrTime = drPaper["KsTime"].ToString();
            KstrTime = KstrTime.Substring(KstrTime.LastIndexOf(' '));
            Ls.Add(KstrTime);
        }

        HttpCookie ck     = Request.Cookies["nowloginuser"];
        string     user   = ck.Value;//获得当前登录用户用户名
        int        YhID   = TbUserManager.GetStudentID(user);
        string     XsName = TbStudentManager.GetStudentByID(YhID).XsName;

        Ls.Add(XsName);


        ScoreZt = TbScoreManager.getScore(YhID.ToString(), SjID).Zt;
        if (ScoreZt == 2)
        {
            //ScriptManager.RegisterStartupScript(Page, typeof(string), "3", "error()", true);
            Response.Write("<script>alert('本次考试已结束,请勿重复提交');</script>");
            Response.Write("<script>window.close();</script>");
            return;
        }
    }