protected void Btnclock_Click(object sender, ImageClickEventArgs e) { if (Request.QueryString["Tid"] != null) { int tid = Int32.Parse(Request.QueryString["Tid"].ToString()); LearnSite.BLL.TopicDiscuss tdbll = new LearnSite.BLL.TopicDiscuss(); tdbll.UpdateTclose(tid);//更新 System.Threading.Thread.Sleep(500); ShowTopic(); } }
protected void Btnclock_Click(object sender, ImageClickEventArgs e) { if (Btnword.Text == "老师总结") { bool chbtn = false; if (TcloseCheck.Checked) { chbtn = false;//取反 } else { chbtn = true; } int tid = Int32.Parse(Request.QueryString["Tid"].ToString()); LearnSite.BLL.TopicDiscuss tdbll = new LearnSite.BLL.TopicDiscuss(); tdbll.UpdateTclose(tid, chbtn);//更新 System.Threading.Thread.Sleep(500); showtopic(); } }
protected void GVlistmenu_RowCommand(object sender, GridViewCommandEventArgs e) { int RowIndex = Convert.ToInt32(e.CommandArgument); int Lid = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex].FindControl("LabelLid")).Text); int lxid = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex].FindControl("LabelLxid")).Text); string ltype = ((Label)GVlistmenu.Rows[RowIndex].FindControl("LabelLtype")).Text; //int lsort = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex].FindControl("LabelLsort")).Text); int Lcid = Int32.Parse(Request.QueryString["Cid"].ToString()); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); if (e.CommandName == "P") { switch (ltype) { case "1": //活动 case "5": //编程 case "6": //描述 LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); mbll.UpdateMpublish(lxid); lbll.UpdateLshow(Lid); break; case "2": //调查 LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey(); vbll.UpdateVclose(lxid); lbll.UpdateLshow(Lid); break; case "3": //讨论 LearnSite.BLL.TopicDiscuss tbll = new LearnSite.BLL.TopicDiscuss(); tbll.UpdateTclose(lxid); lbll.UpdateLshow(Lid); break; case "4": //表单 LearnSite.BLL.TxtForm tbmbll = new LearnSite.BLL.TxtForm(); tbmbll.UpdateMpublish(lxid); lbll.UpdateLshow(Lid); break; } } if (e.CommandName == "D") { switch (ltype) { case "1": //活动 case "5": //编程 case "6": //描述 LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); mbll.DeleteMission(lxid); //假删除任务 lbll.Delete(Lid); //删除导航 break; case "2": //调查 LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey(); LearnSite.BLL.SurveyQuestion qbll = new LearnSite.BLL.SurveyQuestion(); if (!qbll.ExistsByQvid(lxid)) { vbll.Delete(lxid); //删除调查 lbll.Delete(Lid); //删除导航 } else { string msg = "该调查卷存在试题,请先删除试题!"; LearnSite.Common.WordProcess.Alert(msg, this.Page); } break; case "3": //讨论 LearnSite.BLL.TopicDiscuss tbll = new LearnSite.BLL.TopicDiscuss(); tbll.Delete(lxid); //删除讨论 lbll.Delete(Lid); //删除导航 break; case "4": //表单 LearnSite.BLL.TxtForm tfmbll = new LearnSite.BLL.TxtForm(); tfmbll.Delete(lxid); //删除表单 lbll.Delete(Lid); //删除导航 break; } } if (e.CommandName == "Top") { if (RowIndex == 0) { lbll.Lsortnew(Lcid);//如果首行,初始化序号 } if (RowIndex > 0) { int toplid = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex - 1].FindControl("LabelLid")).Text); //获取上个导航编号 lbll.UpdateLsort(Lid, false); //当前导航减1向上 lbll.UpdateLsort(toplid, true); //上个导航增1向下 } System.Threading.Thread.Sleep(500); lbll.UpdateMissonListMene(Lcid, lxid);//活动序号同步 } if (e.CommandName == "Bottom") { int rowscount = GVlistmenu.Rows.Count; if (RowIndex < rowscount - 1) { int bottomlid = Convert.ToInt32(((Label)GVlistmenu.Rows[RowIndex + 1].FindControl("LabelLid")).Text); //获取下个导航编号 lbll.UpdateLsort(bottomlid, false); //下个导航减1向上 lbll.UpdateLsort(Lid, true); //当前导航增1向下 System.Threading.Thread.Sleep(500); lbll.UpdateMissonListMene(Lcid, lxid); //活动序号同步 } } System.Threading.Thread.Sleep(200); showmenu(); }