Exemplo n.º 1
0
    public void DataBind(string courseID)
    {
        BusyworkManage bm = new BusyworkManage();

        Label1.Text          = bm.ReturnCourseName(courseID);
        GridView1.DataSource = bm.BusyworkDataBind(courseID);
        GridView1.DataBind();
    }
Exemplo n.º 2
0
    public void TeacherAddCourse()
    {
        string         path       = BusyworkManage.Path;
        string         teacherid  = Request.Cookies["TeacherID"].Value.ToString();
        string         topic      = Server.MapPath(path + teacherid + BusyworkManage.TopicPath);
        string         busywork   = Server.MapPath(path + teacherid + BusyworkManage.BusyworkPath);
        string         coursename = txtCourseName.Text.ToString().Trim();
        BusyworkManage bm         = new BusyworkManage();
        bool           result     = bm.TeacherAddCourse(teacherid, coursename, topic, busywork);

        if (result == true)
        {
            Response.Write("<Script language='JavaScript'>alert('" + "添加成功!" + "');</Script>");
        }
        else
        {
            Response.Write("<Script language='JavaScript'>alert('" + "添加失败!" + "');</Script>");
        }
    }