コード例 #1
0
 protected void LinkButton3_Click(object sender, EventArgs e)//允许学生做作业
 {
     if (ListBoxzuoye.SelectedIndex >= 0 && ListBoxbanji.SelectedIndex >= 0)
     {
         string yunxu   = LinkButton3.CommandArgument.ToString().Trim();
         string zuoyeid = ListBoxzuoye.SelectedValue;
         string banjiid = ListBoxbanji.SelectedValue;
         if (ZuoyeInfo.SetZuoyeYunxuZuoti(int.Parse(zuoyeid), int.Parse(banjiid), yunxu))
         {
             ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "<script language='javascript'>alert('" + yunxu + "学生做作业,成功!');</script>", false);
             BindZuoye();
         }
         else
         {
             ScriptManager.RegisterClientScriptBlock(this, typeof(string), "", "<script language='javascript'>alert('" + yunxu + "学生做作业,失败!');</script>", false);
         }
     }
     else
     {
         ScriptManager.RegisterClientScriptBlock(this, typeof(string), "zyxx", "<script language='javascript'>alert('请选择班级、作业!');</script>", false);
     }
 }