예제 #1
0
    //退选所选课程
    protected void DeleteChosenSub_Click(object sender, EventArgs e)
    {
        int count;

        Fannie.Student stu   = new Fannie.Student();
        int            subid = Convert.ToInt32(ChosenSub1.DataKey.Value.ToString());

        if (IsTime())
        {
            count = stu.DeleteChosen(id);
            if (count > 0)
            {
                stu.ReduceChosenPeople(subid);
                Response.Write("<script> alert('退选成功!')</script>");
                databind();
            }
            else
            {
                Response.Write("<script> alert('退选失败!')</script>");
            }
        }
        else
        {
            Response.Write("<script> alert('已超过选题时间,不能退选!');history.go(-1)</script>");
        }
    }
예제 #2
0
    //protected void btnDown_Click(object sender, EventArgs e)
    //{
    //    Response.Clear();
    //    Response.AddHeader("content-disposition", "attachment;filename=subinfo.xls");
    //    Response.Charset = "utf-8";//设定输出的字符集
    //    Response.ContentType = "application/ms.xls";
    //    System.IO.StringWriter stringWrite = new System.IO.StringWriter();
    //    System.Web.UI.HtmlTextWriter htmlwrite = new HtmlTextWriter(stringWrite);
    //    gvStu.AllowPaging = false;
    //    GetOneSubStu();
    //    gvStu.RenderControl(htmlwrite);
    //    Response.Write(stringWrite.ToString());
    //    Response.End();
    //    gvStu.AllowPaging = true;
    //    GetOneSubStu();
    //}

    protected void RefuseStu_Click(object sender, EventArgs e)          //退选学生
    {
        LinkButton lb = sender as LinkButton;
        int        count;
        string     sid = lb.CommandArgument;

        Fannie.Student stu   = new Fannie.Student();
        int            subid = Convert.ToInt32(id);

        count = stu.DeleteChosen(sid);
        if (count > 0)
        {
            stu.ReduceChosenPeople(subid);
            Response.Write("<script> alert('退选成功!')</script>");
            GetOneSubStu();
        }
        else
        {
            Response.Write("<script> alert('退选失败!')</script>");
        }
    }