Exemple #1
0
    protected void BindTimu()
    {
        DataTable dt = ZuoyeInfo.GetTeacherZuoyeTimuOrderByTixing(int.Parse(Request.QueryString["zuoyeid"]));

        GridView1.DataSource = dt;
        GridView1.DataBind();
    }
Exemple #2
0
    protected void Button1_Click(object sender, EventArgs e)//提交作业布置信息
    {
        lbl_fankui.Text = "";
        string    shangjiaoqixian = TextBox1.Text;
        string    yunxu           = RadioButtonList1.SelectedValue;
        string    yunxuchakan     = RadioButtonList2.SelectedValue;
        string    shuoming        = TextBox2.Text;
        string    zuoyebuzhiid    = Request.QueryString["zuoyebuzhiid"];
        string    zuoyeid         = string.Empty;
        string    banjiid         = string.Empty;
        DataTable dt = ZuoyeInfo.GetZuoyeBanjiidAndZuoyeid(int.Parse(zuoyebuzhiid));

        if (dt.Rows.Count > 0)
        {
            zuoyeid = dt.Rows[0][0].ToString();
            banjiid = dt.Rows[0][1].ToString();
            try
            {
                ZuoyeInfo.SetZuoyeBuzhiInfo(int.Parse(banjiid), int.Parse(zuoyeid), yunxu, yunxuchakan, shangjiaoqixian, shuoming);
                lbl_fankui.Text = "作业布置信息更新成功!";
                FormView1.DataBind();
            }
            catch (Exception ex)
            {
                lbl_fankui.Text = "作业布置信息更新失败!" + ex.Message;
            }
        }
        else
        {
            lbl_fankui.Text = "未找到作业布置信息!";
        }
    }
 protected void LinkButton4_Click(object sender, EventArgs e)//将某作业布置给某学生
 {
     Label1.Text = "";
     if (ListBoxzuoye.SelectedIndex >= 0 & ListBoxstu.SelectedIndex >= 0 && ListBoxbanji.SelectedIndex >= 0)
     {
         string zuoyeid     = ListBoxzuoye.SelectedValue;
         string stuusername = ListBoxstu.SelectedValue;
         string kechengid   = Session["kechengid"].ToString();
         string banjiid     = ListBoxbanji.SelectedValue;
         if (StudentInfo.IsStuHaveZuoye(int.Parse(zuoyeid), stuusername))//判断作业是否已布置给学生
         {
             ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "<script language='javascript'>alert('该作业在该学生作业表中已存在,无须重新布置!');</script>", false);
         }
         else
         {
             try
             {
                 ZuoyeInfo.ZuoyeFenfaToStudent(zuoyeid, stuusername, kechengid, banjiid);
                 ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "<script language='javascript'>alert('作业分发成功!');</script>", false);
             }
             catch (Exception ex)
             {
                 ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "<script language='javascript'>alert('作业分发失败!');</script>", false);
                 Label1.Text = ex.Message;
             }
         }
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "<script language='javascript'>alert('请选择课程、班级、作业、学生!');</script>", false);
     }
 }
    protected void BindTimu()//绑定知识点题目
    {
        string tixing = DropDownList1.SelectedValue.Trim();

        if (TreeView1.CheckedNodes.Count > 0)
        {
            try
            {
                List <string> zhishidianids = TreeView1.CheckedNodesAndChildrenIds;//选择的知识点及其子孙知识点的id
                DataTable     dt            = TimuInfo.GetTimuOnZhishidian(zhishidianids, tixing);
                grvw_timu.DataSource   = dt;
                ViewState["timutable"] = dt;
                grvw_timu.DataBind();
            }
            catch
            {
                ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "<script language='javascript'>alert('获取题目失败!');</script>", false);
            }
        }
        else
        {
            int       zuoyeid   = int.Parse(Request.QueryString["zuoyeid"]);
            string    kechengid = ZuoyeInfo.getZuoye_Kechengid(zuoyeid);
            DataTable dt        = TimuInfo.GetTimuOnKecheng(kechengid, tixing);
            grvw_timu.DataSource   = dt;
            ViewState["timutable"] = dt;
            grvw_timu.DataBind();
        }
    }
Exemple #5
0
    protected void BindFenxi()
    {
        DataTable dt = ZuoyeInfo.ZuoyeFenxi(int.Parse(Request.QueryString["banjiid"]), int.Parse(Request.QueryString["zuoyeid"]));

        FormView1.DataSource = dt;
        FormView1.DataBind();
    }
Exemple #6
0
    protected void BindZuoyeTimu()
    {
        DataTable tmtable = ZuoyeInfo.GetTeacherZuoyeTimuOrderByTixing(int.Parse(Request.QueryString["zuoyeid"]));

        grvw_zuoyetimu.DataSource = tmtable;
        grvw_zuoyetimu.DataBind();
    }
Exemple #7
0
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)//设置作业列表中各控件的可用状态,自动编号
    {
        if (e.Row.RowIndex != -1)
        {
            ((Label)(e.Row.Cells[0].FindControl("Lbl_zybh"))).Text = (e.Row.RowIndex + 1).ToString();
            string zuoyeid = GridView1.DataKeys[e.Row.RowIndex].Value.ToString().Trim();
            if (ZuoyeInfo.IsZuoyeUsed(zuoyeid))//如果作业已布置,则不允许修改题目
            {
                ((HyperLink)(e.Row.Cells[5].FindControl("HyperLink1"))).Enabled   = false;
                ((LinkButton)(e.Row.Cells[4].FindControl("LinkButton1"))).Enabled = false;
            }
            else
            {
                ((HyperLink)(e.Row.Cells[5].FindControl("HyperLink1"))).Enabled   = true;
                ((LinkButton)(e.Row.Cells[4].FindControl("LinkButton1"))).Enabled = true;
            }

            if (ZuoyeInfo.GetTimuCount(zuoyeid) <= 0)
            {
                ((LinkButton)(e.Row.Cells[7].FindControl("LinkButton3"))).Enabled = false;
            }
            else
            {
                ((LinkButton)(e.Row.Cells[7].FindControl("LinkButton3"))).Enabled = true;
            }
        }
    }
    protected void DetailsView1_ItemUpdated(object sender, DetailsViewUpdatedEventArgs e)
    {
        int    zuoyeid         = int.Parse(Request.QueryString["zuoyeid"]);
        string studentusername = ListBox1.SelectedValue;

        ZuoyeInfo.HuizongStuZuoyeChengji(zuoyeid, studentusername);
    }
    protected void BindZuoye()
    {
        string  banjiid   = ListBoxbanji.SelectedValue;
        string  kechengid = Session["kechengid"].ToString();
        DataSet zuoyeds   = ZuoyeInfo.GetZuoyeInfo(int.Parse(kechengid), int.Parse(banjiid), ((FormsIdentity)HttpContext.Current.User.Identity).Ticket.Name);

        ListBoxzuoye.DataSource = zuoyeds;
        ListBoxzuoye.DataBind();
    }
    protected void BindZuoye()
    {
        string    username  = ((FormsIdentity)HttpContext.Current.User.Identity).Ticket.Name;
        string    kechengid = Session["kechengid"].ToString();
        DataTable dt        = ZuoyeInfo.GetStuKechengZuoyeInfo(username, int.Parse(kechengid));

        GridView1.DataSource = dt;
        GridView1.DataBind();
    }
Exemple #11
0
    protected void BindStuZuoyeinfo()
    {
        string    zuoyeid     = Request.QueryString["zuoyeid"];
        string    stuusername = ((FormsIdentity)HttpContext.Current.User.Identity).Ticket.Name;
        DataTable dt          = ZuoyeInfo.GetStuZuoyeInfo(stuusername, int.Parse(zuoyeid));

        FormView1.DataSource = dt;
        FormView1.DataBind();
    }
Exemple #12
0
    protected void BindZuoyeBuzhi()
    {
        string zuoyeid = GridView1.SelectedValue.ToString();

        lbl_zuoyemingcheng.Text = GridView1.Rows[GridView1.SelectedIndex].Cells[1].Text;
        DataTable dt = ZuoyeInfo.GetZuoyeBanji(zuoyeid);

        GridView2.DataSource = dt;
        GridView2.DataBind();
    }
    protected void BindZuoyeTonji()
    {
        string    kechengid = Session["kechengid"].ToString();
        string    username  = ((FormsIdentity)HttpContext.Current.User.Identity).Ticket.Name;
        string    banjiid   = Request.QueryString["banjiid"];
        DataTable dt        = ZuoyeInfo.StuZuoyeHuiZong(int.Parse(kechengid), int.Parse(banjiid));

        GridView1.DataSource = dt;
        GridView1.DataBind();
    }
Exemple #14
0
    /// <summary>
    /// 将作业分发给某班的所有学生
    /// </summary>
    /// <param name="zuoyeid">作业id</param>
    /// <param name="banjiid">班级id</param>
    /// <returns></returns>
    //public static void ZuoyeFenfaToBanji(string zuoyeid, string banjiid)//将作业分发给某班的所有学生
    //{
    //    //找到班级学生
    //    //将作业布置信息写入学生作业表
    //    //将作业题目写入学生作业题目表
    //    DataTable stuTb = BanjiInfo.GetStudentUserName(int.Parse(banjiid));//班级学生信息表
    //    string kechengid = ZuoyeInfo.getZuoye_Kechengid(int.Parse(zuoyeid));
    //    DataTable BuzhiTb = ZuoyeInfo.GetZuoyeBuzhiInfo(zuoyeid, banjiid);//作业布置信息
    //    DataTable ZuoyeTimuTb = ZuoyeInfo.GetTeacherZuoyeTimuOrderByTixing(int.Parse(zuoyeid));//作业题目
    //    try
    //    {
    //        foreach (DataRow dr in stuTb.Rows)
    //        {
    //            //将作业布置给学生
    //            ZuoyeInfo.ZuoyeFenfaToStudent(zuoyeid, dr[0].ToString(), BuzhiTb, ZuoyeTimuTb, kechengid);
    //        }
    //    }
    //    catch (Exception ex)
    //    {
    //        throw ex;
    //    }
    //}

    /// <summary>
    /// 将作业分发给某个学生
    /// </summary>
    /// <param name="zuoyeid">作业id</param>
    /// <param name="studentusername">学生用户名——学号</param>
    /// <param name="BuzhiTb">作业布置信息</param>
    /// <param name="ZuoyeTimuTb">作业题目信息</param>
    /// <param name="kechengid">课程id</param>
    /// <returns></returns>
    public static void ZuoyeFenfaToStudent(string zuoyeid, string studentusername, string kechengid, string banjiid)
    {
        DataTable     timudt  = ZuoyeInfo.GetZuoyeTimuIdAndFenzhi(int.Parse(zuoyeid)); //作业题目信息
        DataTable     buzhidt = ZuoyeInfo.GetZuoyeBuzhiInfo(zuoyeid, banjiid);         //作业布置信息
        SqlConnection conn    = new SqlConnection();

        conn.ConnectionString = ConfigurationManager.ConnectionStrings["kecheng2012ConnectionString"].ConnectionString;
        conn.Open();
        SqlTransaction st   = conn.BeginTransaction();
        SqlCommand     comm = conn.CreateCommand();

        comm.Transaction = st;
        try
        {
            //布置信息写入学生作业表
            comm.CommandText = "insert into tb_studentzuoye(zuoyeid,studentusername,wancheng,shangjiaoqixian,zongfen,kechengid,buzhishijian,shuoming,yunxuzuoti,yunxuchakan,teacherusername) values(@zuoyeid,@studentusername,'未完成',@shangjiaoqixian,0,@kechengid,@buzhishijian,@shuoming,@yunxuzuoti,@yunxuchakan,@teacherusername)";
            comm.Parameters.AddWithValue("@zuoyeid", zuoyeid);
            comm.Parameters.AddWithValue("@studentusername", studentusername);
            comm.Parameters.AddWithValue("@kechengid", kechengid);
            comm.Parameters.AddWithValue("@buzhishijian", buzhidt.Rows[0][5].ToString());    //布置时间
            comm.Parameters.AddWithValue("@shangjiaoqixian", buzhidt.Rows[0][6].ToString()); //上交期限
            comm.Parameters.AddWithValue("@shuoming", buzhidt.Rows[0][7].ToString());
            comm.Parameters.AddWithValue("@yunxuzuoti", buzhidt.Rows[0][3].ToString());      //允许做题
            comm.Parameters.AddWithValue("@yunxuchakan", buzhidt.Rows[0][4].ToString());     //允许查看结果
            comm.Parameters.AddWithValue("@teacherusername", buzhidt.Rows[0][8].ToString()); //教师
            comm.ExecuteNonQuery();
            comm.Parameters.Clear();
            comm.CommandText = "insert into tb_stuzuoyetimu(zuoyeid,questionid,studentusername,defen,fenzhi) values(@zuoyeid,@questionid,@studentusername,0,@fenzhi)";
            comm.Parameters.AddWithValue("@zuoyeid", zuoyeid);
            comm.Parameters.AddWithValue("@studentusername", studentusername);
            comm.Parameters.Add("@questionid", SqlDbType.Int);
            comm.Parameters.Add("@fenzhi", SqlDbType.Int);
            //comm.Parameters["@zuoyeid"].Value =int.Parse(zuoyeid);
            //comm.Parameters["@studentusername"].Value = studentusername.ToString();
            foreach (DataRow dr in timudt.Rows)
            {
                comm.Parameters["@questionid"].Value = Convert.ToInt32(dr[0]);
                comm.Parameters["@fenzhi"].Value     = Convert.ToInt32(dr[1]);
                comm.ExecuteNonQuery();
            }
            st.Commit();
        }
        catch (Exception ex)
        {
            st.Rollback();
            throw ex;
        }
        finally
        {
            if (conn.State == ConnectionState.Open)
            {
                conn.Close();
            }
        }
    }
Exemple #15
0
    protected void GridView2_RowEditing(object sender, GridViewEditEventArgs e)
    {
        GridView2.EditIndex = e.NewEditIndex;
        string zuoyeid = GridView1.SelectedValue.ToString();

        lbl_zuoyemingcheng.Text = GridView1.Rows[GridView1.SelectedIndex].Cells[1].Text;
        DataTable dt = ZuoyeInfo.GetZuoyeBanji(zuoyeid);

        GridView2.DataSource = dt;
        GridView2.DataBind();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Labelbanji.Text     = BanjiInfo.GetBanjiName(int.Parse(Request.QueryString["banjiid"]));
         Labelzuoyename.Text = ZuoyeInfo.getZuoyeName(int.Parse(Request.QueryString["zuoyeid"]));
         DataTable studt = BanjiInfo.GetStudentNameAndUsername(int.Parse(Request.QueryString["banjiid"]));
         ListBox1.DataSource = studt;
         ListBox1.DataBind();
     }
 }
Exemple #17
0
    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        int banjiid = int.Parse(Request.QueryString["banjiid"]);
        int zuoyeid = int.Parse(Request.QueryString["zuoyeid"]);

        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Cells[0].Text = (e.Row.RowIndex + 1).ToString();
            string questionid = GridView1.DataKeys[e.Row.RowIndex].Value.ToString();
            e.Row.Cells[5].Text = string.Format("{0:P}", ZuoyeInfo.ZuoyeTimuDefenLv(banjiid, zuoyeid, int.Parse(questionid)));
            e.Row.Cells[6].Text = TimuInfo.TimuZhishidian(int.Parse(questionid));
        }
    }
Exemple #18
0
 protected void LinkButton1_Click(object sender, EventArgs e)//删除作业布置
 {
     try
     {
         string zuoyebuzhiid = ((LinkButton)sender).CommandArgument.ToString();
         //删除作业布置信息,删除学生作业,删除学生作业题目
         ZuoyeInfo.DeleteZuoyeFromBanji(int.Parse(zuoyebuzhiid));
         BindZuoyeBuzhi();
         GridView1.SelectedIndex = -1;
     }
     catch
     {
     }
 }
Exemple #19
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Request.QueryString["zuoyeid"] == null)
     {
         Response.Redirect("zuoyeyuzhi.aspx");
     }
     else
     {
         zuoyeyibuzhi = !ZuoyeInfo.IsZuoyeUsed(Request.QueryString["zuoyeid"]);
     }
     if (!IsPostBack)
     {
         BindZuoyeTimu();
     }
 }
Exemple #20
0
    protected void DeleteTimuFromZuoye(object sender, CommandEventArgs e)//从作业中删除题目
    {
        string        zuoyetimuid = e.CommandArgument.ToString();
        SqlConnection conn        = new SqlConnection();

        conn.ConnectionString = ConfigurationManager.ConnectionStrings["kecheng2012ConnectionString"].ConnectionString;
        SqlCommand comm = conn.CreateCommand();

        comm.CommandText = "delete from tb_teacherzuoyetimu where zuoyetimuid=" + zuoyetimuid;
        conn.Open();
        comm.ExecuteNonQuery();
        conn.Close();
        BindZuoyeTimu();
        ZuoyeInfo.UpdateTeacherZuoyeZongfen(Request.QueryString["zuoyeid"]);
        FormView1.DataBind();
    }
 protected void HyperLinkzuoyejbxx_Click(object sender, EventArgs e)//作业基本信息及修改
 {
     if (ListBoxzuoye.SelectedIndex >= 0 && ListBoxbanji.SelectedIndex >= 0)
     {
         string    zuoyeid      = ListBoxzuoye.SelectedValue;
         string    banjiid      = ListBoxbanji.SelectedValue;
         DataTable zy           = ZuoyeInfo.GetZuoyeBuzhiInfo(zuoyeid, banjiid);
         string    zuoyebuzhiid = zy.Rows[0][0].ToString();
         string    urlx         = "zuoye_editbuzhi.aspx?zuoyebuzhiid=" + zuoyebuzhiid;
         string    URL          = "<script  language= 'javascript'> window.open('" + urlx + "','_blank');</script>";
         ScriptManager.RegisterClientScriptBlock(this, typeof(string), "zyxx", URL, false);
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(this, typeof(string), "zyxx", "<script language='javascript'>alert('请选择班级、作业!');</script>", false);
     }
 }
Exemple #22
0
    protected void grvw_zuoyetimu_RowUpdating(object sender, GridViewUpdateEventArgs e)//更新题目分值
    {
        string        fenzhi      = ((TextBox)(grvw_zuoyetimu.Rows[grvw_zuoyetimu.EditIndex].FindControl("TextBox1"))).Text.Trim();
        string        zuoyetimuid = grvw_zuoyetimu.DataKeys[e.RowIndex].Value.ToString();
        SqlConnection conn        = new SqlConnection();

        conn.ConnectionString = ConfigurationManager.ConnectionStrings["kecheng2012ConnectionString"].ConnectionString;
        SqlCommand comm = conn.CreateCommand();

        comm.CommandText = "update tb_teacherzuoyetimu set fenzhi=" + fenzhi + " where zuoyetimuid=" + zuoyetimuid;
        conn.Open();
        comm.ExecuteNonQuery();
        conn.Close();
        grvw_zuoyetimu.EditIndex = -1;
        BindZuoyeTimu();
        ZuoyeInfo.UpdateTeacherZuoyeZongfen(Request.QueryString["zuoyeid"]);
        FormView1.DataBind();
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["zuoyeid"] != null && Request.QueryString["banjiid"] != null)
         {
             Labelbanji.Text     = BanjiInfo.GetBanjiName(int.Parse(Request.QueryString["banjiid"]));
             Labelzuoyename.Text = ZuoyeInfo.getZuoyeName(int.Parse(Request.QueryString["zuoyeid"]));
             DataTable dt = ZuoyeInfo.GetQuantiStuZuoyeXinxi(int.Parse(Request.QueryString["banjiid"]), int.Parse(Request.QueryString["zuoyeid"]));
             GridView1.DataSource = dt;
             GridView1.DataBind();
         }
         else
         {
             Response.Redirect("default.aspx");
         }
     }
 }
Exemple #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["zuoyeid"] != null && Request.QueryString["banjiid"] != null)
         {
             Labelbanji.Text     = BanjiInfo.GetBanjiName(int.Parse(Request.QueryString["banjiid"]));
             Labelzuoyename.Text = ZuoyeInfo.getZuoyeName(int.Parse(Request.QueryString["zuoyeid"]));
             BindFenxi();
             BindTimu();
             Labelsjrs.Text = ZuoyeInfo.GetZuoyeShangjiaoRenShu(int.Parse(Request.QueryString["zuoyeid"]), int.Parse(Request.QueryString["banjiid"])).ToString();
         }
         else
         {
             Response.Redirect("default.aspx");
         }
     }
 }
    protected void AddTimuToZuoye(object sender, CommandEventArgs e)//将题目添加到作业,按题目id,questionid
    {
        lbl_fankui.Text = "";
        bool          chenggong  = true;
        string        zuoyeid    = Request.QueryString["zuoyeid"];
        string        questionid = e.CommandArgument.ToString();
        string        fenzhi     = ((TextBox)(((GridViewRow)(((Button)sender).NamingContainer)).FindControl("TextBox1"))).Text.Trim();
        string        tixing     = ((GridViewRow)(((Button)sender).NamingContainer)).Cells[1].Text.Trim();
        SqlConnection conn       = new SqlConnection();

        conn.ConnectionString = ConfigurationManager.ConnectionStrings["kecheng2012ConnectionString"].ConnectionString;
        SqlCommand comm = conn.CreateCommand();

        try
        {
            comm.CommandText = "insert into tb_teacherzuoyetimu(zuoyeid,questionid,fenzhi) values(@zuoyeid,@questionid,@fenzhi)";
            comm.Parameters.AddWithValue("@zuoyeid", zuoyeid);
            comm.Parameters.AddWithValue("@questionid", questionid);
            comm.Parameters.AddWithValue("@fenzhi", fenzhi);
            conn.Open();
            comm.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            chenggong       = false;
            lbl_fankui.Text = ex.Message;
        }
        finally
        {
            conn.Close();
        }
        if (chenggong)
        {
            ZuoyeInfo.UpdateTeacherZuoyeZongfen(zuoyeid);
            FormView1.DataBind();
            Button shanchubtn = (Button)(((GridViewRow)(((Button)sender).NamingContainer)).FindControl("btn_del"));
            shanchubtn.Enabled       = true;
            ((Button)sender).Enabled = false;
        }
        else
        {
            ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "<script language='javascript'>alert('添加失败!');</script>", false);
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.QueryString["zuoyeid"] != null)
         {
             //绑定课程知识树
             int    zuoyeid   = int.Parse(Request.QueryString["zuoyeid"]);
             string kechengid = ZuoyeInfo.getZuoye_Kechengid(zuoyeid);
             TreeView1.ConnectionString = ConfigurationManager.ConnectionStrings[TreeView1.ConnectionStringName].ConnectionString;
             TreeView1.kechengid        = int.Parse(kechengid);
             Hylk_buzhi.NavigateUrl     = "zuoye_id_buzhi01.aspx?zuoyeid=" + zuoyeid.ToString();
         }
         else
         {
             Response.Redirect("zuoyeyuzhi.aspx");
         }
     }
 }
    protected void DelTimuFromZuoye(object sender, CommandEventArgs e)//从作业中删除题目,按题目questionid,zuoyeid
    {
        string        questionid = e.CommandArgument.ToString();
        string        zuoyeid    = Request.QueryString["zuoyeid"];
        SqlConnection conn       = new SqlConnection();

        conn.ConnectionString = ConfigurationManager.ConnectionStrings["kecheng2012ConnectionString"].ConnectionString;
        SqlCommand comm = conn.CreateCommand();

        comm.CommandText = "delete from tb_teacherzuoyetimu where zuoyeid=" + zuoyeid + " and questionid=" + questionid;
        conn.Open();
        comm.ExecuteNonQuery();
        conn.Close();
        ZuoyeInfo.UpdateTeacherZuoyeZongfen(Request.QueryString["zuoyeid"]);
        FormView1.DataBind();
        Button tianjiabtn = (Button)(((Button)sender).NamingContainer.FindControl("btn_add"));

        tianjiabtn.Enabled       = true;
        ((Button)sender).Enabled = false;
    }
 protected void LinkButtonshanchuzy_Click(object sender, EventArgs e)//删除作业
 {
     if (ListBoxzuoye.SelectedIndex >= 0 && ListBoxbanji.SelectedIndex >= 0)
     {
         string zuoyeid = ListBoxzuoye.SelectedValue;
         string banjiid = ListBoxbanji.SelectedValue;
         if (ZuoyeInfo.DeleteZuoyeFromBanji(int.Parse(banjiid), int.Parse(zuoyeid)))
         {
             ScriptManager.RegisterClientScriptBlock(this, typeof(string), "zyxx", "<script language='javascript'>alert('作业删除成功!');</script>", false);
             BindZuoye();
         }
         else
         {
             ScriptManager.RegisterClientScriptBlock(this, typeof(string), "zyxx", "<script language='javascript'>alert('作业删除失败!');</script>", false);
         }
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(this, typeof(string), "zysc", "<script language='javascript'>alert('请选择班级和作业!');</script>", false);
     }
 }
 protected void LinkButtonzdpgkgt_Click(object sender, EventArgs e)//自动批改作业客观题并汇总成绩
 {
     if (ListBoxzuoye.SelectedIndex >= 0 && ListBoxbanji.SelectedIndex >= 0)
     {
         int zuoyeid = int.Parse(ListBoxzuoye.SelectedValue);
         int banjiid = int.Parse(ListBoxbanji.SelectedValue);
         if (ZuoyeInfo.PigaiZuoyeKeguanti(zuoyeid, banjiid))
         {
             ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "<script language='javascript'>alert('客观题批改成功!并重新计算了学生成绩。');</script>", false);
             //GridView2.DataBind();
         }
         else
         {
             ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "<script language='javascript'>alert('客观题批改失败!');</script>", false);
         }
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "<script language='javascript'>alert('请选择班级、作业!');</script>", false);
     }
 }
 protected void LinkButtonyxck_Click(object sender, EventArgs e)//允许学生查看作业
 {
     if (ListBoxzuoye.SelectedIndex >= 0 && ListBoxbanji.SelectedIndex >= 0)
     {
         string yxck    = LinkButtonyxck.CommandArgument.ToString();
         string zuoyeid = ListBoxzuoye.SelectedValue;
         string banjiid = ListBoxbanji.SelectedValue;
         if (ZuoyeInfo.SetZuoyeYunxuChakan(int.Parse(zuoyeid), int.Parse(banjiid), yxck))
         {
             ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "<script language='javascript'>alert('" + yxck + "学生查看作业,成功!');</script>", false);
             BindZuoye();
         }
         else
         {
             ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "<script language='javascript'>alert('" + yxck + "学生查看作业,成功!');</script>", false);
         }
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(this, typeof(string), "zyxx", "<script language='javascript'>alert('请选择班级、作业!');</script>", false);
     }
 }