Beispiel #1
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
     {
     }
 }
 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);
     }
 }