protected void DLnewkc_ItemCommand(object source, DataListCommandEventArgs e) { int Cid = Int32.Parse(DLnewkc.DataKeys[e.Item.ItemIndex].ToString()); if (e.CommandName == "P" && Btnset.Enabled) { LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses(); cbll.UpdateCpublish(Cid); System.Threading.Thread.Sleep(200); Showkc(); showCid(); } }
protected void BtnPublish_Click(object sender, EventArgs e) { if (Request.QueryString["Cid"] != null && Request.QueryString["Cpublish"] != null) { bool Cpublish = bool.Parse(Request.QueryString["Cpublish"].ToString()); bool Setpublish = !Cpublish;//取反 int Cid = Int32.Parse(Request.QueryString["Cid"].ToString()); LearnSite.BLL.Courses bll = new LearnSite.BLL.Courses(); bll.UpdateCpublish(Cid, Setpublish);//修改课程发布状态 System.Threading.Thread.Sleep(1000); Response.Redirect("~/Teacher/course.aspx", false); } }
protected void GVCourse_RowCommand(object sender, GridViewCommandEventArgs e) { string pCid = e.CommandArgument.ToString(); if (e.CommandName == "Cp") { LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses(); cbll.UpdateCpublish(Int32.Parse(pCid)); CoursesLimit(); } if (e.CommandName == "Cg") { LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses(); cbll.UpdateCgood(Int32.Parse(pCid)); CoursesLimit(); } if (e.CommandName == "Cu") { LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses(); cbll.UpdateCold(Int32.Parse(pCid)); CoursesLimit(); } }