private void showmenu() { if (Request.QueryString["Cid"] != null) { string Cid = Request.QueryString["Cid"].ToString(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); GVlistmenu.DataSource = lbll.GetMenu(Int32.Parse(Cid)); GVlistmenu.DataBind(); } }
protected void Btnedit_Click(object sender, EventArgs e) { string fckstr = mcontent.InnerText; string mtitle = Texttitle.Text.Trim(); if (mtitle != "" && fckstr != "") { if (Request.QueryString["Mcid"] != null && Request.QueryString["Mid"] != null) { Labelmsg.Text = "无"; string Mcid = Request.QueryString["Mcid"].ToString(); string Mid = Request.QueryString["Mid"].ToString(); LearnSite.Model.TxtForm tmode = new LearnSite.Model.TxtForm(); tmode.Mid = Int32.Parse(Mid); tmode.Mcid = Int32.Parse(Mcid); tmode.Mtitle = mtitle; tmode.Mpublish = CheckPublish.Checked; tmode.Mcontent = HttpUtility.HtmlEncode(fckstr); tmode.Mdate = DateTime.Now; tmode.Mhit = 0; tmode.Mdelete = false; LearnSite.BLL.TxtForm tfmbll = new LearnSite.BLL.TxtForm(); tfmbll.Update(tmode); //string msg = tmode.Mtitle + "<br>\r\n" + tmode.Mcontent + "<br>\r\n" + tmode.Mdate.ToString() + "<br>\r\n" + tmode.Mpublish.ToString() + "<br>\r\n" + Mid; // Labelmsg.Text = msg; LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); lmodel.Lcid = Int32.Parse(Mcid); lmodel.Lxid = Int32.Parse(Mid); lmodel.Ltype = 4; lmodel.Lshow = CheckPublish.Checked; lmodel.Ltitle = mtitle; lbll.UpdateMenuThree(lmodel); System.Threading.Thread.Sleep(500); string url = "~/Teacher/txtformshow.aspx?Mcid=" + Mcid + "&Mid=" + Mid; Response.Redirect(url, false); } else { Labelmsg.Text = "取不到表单编号Mid!"; } } else { Labelmsg.Text = "内容及标题不能为空!"; } }
protected void Btnadd_Click(object sender, EventArgs e) { string fckstr = Request.Form["textareaItem"].Trim(); if (Texttitle.Text != "" && fckstr != "") { if (Request.QueryString["Mcid"] != null) { LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook(); string hidstr = tcook.Hid.ToString(); //string serverUrl = LearnSite.Common.WordProcess.ServerUrl(); //fckstr = fckstr.Replace(serverUrl, ""); int Mcid = Int32.Parse(Request.QueryString["Mcid"].ToString()); LearnSite.BLL.TopicDiscuss bll = new LearnSite.BLL.TopicDiscuss(); LearnSite.Model.TopicDiscuss model = new LearnSite.Model.TopicDiscuss(); model.Tcid = Mcid; model.Ttitle = Texttitle.Text.Trim(); model.Tcontent = HttpUtility.HtmlEncode(fckstr); model.Tcount = 0; model.Tteacher = Int32.Parse(hidstr); model.Tdate = DateTime.Now; model.Tclose = CheckPublish.Checked; model.Tresult = ""; int tid = bll.Add(model); LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); lmodel.Lcid = Mcid; lmodel.Lshow = true; lmodel.Lsort = lbll.GetMaxLsort(Mcid) + 1; lmodel.Ltitle = Texttitle.Text.Trim(); lmodel.Ltype = 3; lmodel.Lxid = tid; lbll.Add(lmodel); System.Threading.Thread.Sleep(500); //Labelmsg.Text = "添加主题讨论成功"; string url = "~/Teacher/courseshow.aspx?Cid=" + Mcid.ToString(); Response.Redirect(url, false); } } else { Labelmsg.Text = "内容及标题不能为空!"; } }
protected void Btnadd_Click(object sender, EventArgs e) { string fckstr = Request.Form["textareaItem"].Trim(); if (Texttitle.Text != "" && fckstr != "") { if (Request.QueryString["Mcid"] != null) { string Mcidstr = Request.QueryString["Mcid"].ToString(); int Mcid = Int32.Parse(Mcidstr); LearnSite.BLL.TxtForm tbll = new LearnSite.BLL.TxtForm(); LearnSite.Model.TxtForm tmode = new LearnSite.Model.TxtForm(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); int maxSort = lbll.GetMaxLsort(Mcid) + 1; tmode.Mcid = Mcid; tmode.Mtitle = Texttitle.Text.Trim(); tmode.Mpublish = CheckPublish.Checked; tmode.Mcontent = HttpUtility.HtmlEncode(fckstr); tmode.Mdate = DateTime.Now; tmode.Mhit = 0; int mid = tbll.Add(tmode); LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu(); lmodel.Lcid = Mcid; lmodel.Lshow = CheckPublish.Checked; lmodel.Lsort = maxSort; lmodel.Ltitle = Texttitle.Text.Trim(); lmodel.Ltype = 4;//表单类型为4 lmodel.Lxid = mid; lbll.Add(lmodel); System.Threading.Thread.Sleep(500); string url = "~/Teacher/courseshow.aspx?Cid=" + Mcid.ToString(); Response.Redirect(url, false); } } else { Labelmsg.Text = "内容及标题不能为空!"; } }
protected void Btnedit_Click(object sender, EventArgs e) { if (Request.QueryString["Tcid"] != null) { string fckstr = mcontent.InnerText; if (Texttitle.Text != "" && fckstr != "") { LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook(); string hidstr = tcook.Hid.ToString(); int Tcid = Int32.Parse(Request.QueryString["Tcid"].ToString()); int Tid = Int32.Parse(Request.QueryString["Tid"].ToString()); LearnSite.BLL.TopicDiscuss bll = new LearnSite.BLL.TopicDiscuss(); string Ttitle = Texttitle.Text.Trim(); string Tcontent = HttpUtility.HtmlEncode(fckstr); bool Tclose = CheckClose.Checked; bll.UpdateTopic(Tid, Ttitle, Tcontent, Tclose); LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); lmodel.Lcid = Tcid; lmodel.Lxid = Tid; lmodel.Ltype = 3; lmodel.Ltitle = Texttitle.Text.Trim(); lbll.UpdateLtitle(lmodel); System.Threading.Thread.Sleep(200); string url = "~/Teacher/topicshow.aspx?Tid=" + Tid; Response.Redirect(url, false); } else { Labelmsg.Text = "内容及标题不能为空!"; } } }
protected void Btnedit_Click(object sender, EventArgs e) { string fckstr = mcontent.InnerText; if (Texttitle.Text != "" && fckstr != "") { if (Request.QueryString["Mcid"] != null && Request.QueryString["Mid"] != null && Request.QueryString["Lid"] != null) { string Mcid = Request.QueryString["Mcid"].ToString(); string Mid = Request.QueryString["Mid"].ToString(); string Lid = Request.QueryString["Lid"].ToString(); string coursePath = LearnSite.Store.CourseStore.CoursePath(Mcid); if (CheckRemote.Checked) { fckstr = LearnSite.Common.ImageDown.UploadRemote(fckstr, coursePath); } LearnSite.Model.Mission mission = new LearnSite.Model.Mission(); mission.Mid = Int32.Parse(Mid); mission.Mtitle = Texttitle.Text.Trim(); bool uploadcan = CheckUpload.Checked; mission.Mupload = uploadcan; if (uploadcan) { mission.Mcategory = 0;//有作业提交 } else { mission.Mcategory = 1;//无作业提交 } mission.Mexample = ""; mission.Mpublish = CheckPublish.Checked; mission.Mcontent = HttpUtility.HtmlEncode(fckstr); mission.Mfiletype = DDLmfiletype.SelectedValue; mission.Mdate = DateTime.Now; mission.Mhit = 0; mission.Mgroup = CheckGroup.Checked; if (DDLMgid.SelectedValue != "") { mission.Mgid = Int32.Parse(DDLMgid.SelectedValue); } else { mission.Mgid = 0; } LearnSite.BLL.Mission missionbll = new LearnSite.BLL.Mission(); missionbll.Update(mission); LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); lmodel.Lid = Int32.Parse(Lid); if (uploadcan) { lmodel.Ltype = 1; } else { lmodel.Ltype = 6;//描述页面 } lmodel.Lshow = CheckPublish.Checked; lmodel.Ltitle = Texttitle.Text.Trim(); lbll.UpdateMenuMission(lmodel);//专用活动分类更新 System.Threading.Thread.Sleep(500); string url = "~/Teacher/missionshow.aspx?Mcid=" + Mcid + "&Mid=" + Mid + "&Lid=" + Lid; Response.Redirect(url, false); } else { Labelmsg.Text = "取不到活动编号Mid!"; } } else { Labelmsg.Text = "内容及标题不能为空!"; } }
protected void Btnedit_Click(object sender, EventArgs e) { string fckstr = mcontent.InnerText; if (Texttitle.Text != "" && fckstr != "") { if (Request.QueryString["Mcid"] != null && Request.QueryString["Mid"] != null) { string Mcid = Request.QueryString["Mcid"].ToString(); string Mid = Request.QueryString["Mid"].ToString(); string Example = HlExample.NavigateUrl; if (Fupload.HasFile) { string savePath = LearnSite.Store.CourseStore.GetSaveUrl("Course", Mcid); string sbfilename = Fupload.FileName; string shortFileName = Path.GetFileName(sbfilename); string savefilename = savePath + shortFileName; string sbpath = this.Server.MapPath(savefilename); Fupload.SaveAs(sbpath); Example = savefilename; } LearnSite.Model.Mission mission = new LearnSite.Model.Mission(); mission.Mid = Int32.Parse(Mid); mission.Mtitle = Texttitle.Text.Trim(); mission.Mupload = true; mission.Mcategory = 2; //编程页面 mission.Mexample = Example; //编程实例 mission.Microworld = CheckMicoWorld.Checked; mission.Mpublish = CheckPublish.Checked; mission.Mcontent = HttpUtility.HtmlEncode(fckstr); mission.Mfiletype = "sb2"; mission.Mdate = DateTime.Now; mission.Mhit = 0; mission.Mgroup = false; if (DDLMgid.SelectedValue != "") { mission.Mgid = Int32.Parse(DDLMgid.SelectedValue); } else { mission.Mgid = 0; } LearnSite.BLL.Mission missionbll = new LearnSite.BLL.Mission(); missionbll.Update(mission); LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); lmodel.Lcid = Int32.Parse(Mcid); lmodel.Lxid = Int32.Parse(Mid); lmodel.Ltype = 5;//页面类型为5 编程 lmodel.Lshow = CheckPublish.Checked; lmodel.Ltitle = Texttitle.Text.Trim(); lbll.UpdateMenuThree(lmodel); System.Threading.Thread.Sleep(500); string url = "~/Teacher/programshow.aspx?Mcid=" + Mcid + "&Mid=" + Mid; Response.Redirect(url, false); } else { Labelmsg.Text = "取不到主题编号Mid!"; } } else { Labelmsg.Text = "内容及标题不能为空!"; } }
protected void Btnadd_Click(object sender, EventArgs e) { string fckstr = mcontent.InnerText; if (Texttitle.Text != "" && fckstr != "") { if (Request.QueryString["Cid"] != null) { LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook(); string hidstr = tcook.Hid.ToString(); int Vcid = Int32.Parse(Request.QueryString["Cid"].ToString()); LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey(); LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey(); vmodel.Vcid = Vcid; vmodel.Vclose = CheckClose.Checked; vmodel.Vcontent = HttpUtility.HtmlEncode(fckstr); vmodel.Vdate = DateTime.Now; vmodel.Vhid = Int32.Parse(hidstr); bool vp = false; vmodel.Vpoint = vp; vmodel.Vtitle = Texttitle.Text.Trim(); int Vtype = Int32.Parse(DDLvtype.SelectedValue); vmodel.Vtype = Vtype; //Vcid,Vhid,Vtitle,Vcontent,Vtype,Vclose,Vpoint,Vdate string url = ""; LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); lmodel.Lcid = Vcid; lmodel.Lshow = true; lmodel.Lsort = lbll.GetMaxLsort(Vcid) + 1; lmodel.Ltitle = Texttitle.Text.Trim(); lmodel.Ltype = 2; if (Request.QueryString["Vid"] != null) { int vid = Int32.Parse(Request.QueryString["Vid"].ToString()); vmodel.Vid = vid; vbll.UpdateSurvey(vmodel); //更新到调查表中 lmodel.Lxid = vid; lbll.UpdateLtitle(lmodel); //更新到导航中 LearnSite.BLL.SurveyFeedback fkbll = new LearnSite.BLL.SurveyFeedback(); fkbll.UpdateFvtype(vid, Vtype); //2014-3-15修订,如果调查类型改变的话,同时也改变调查结果记录中的类型 url = "~/Survey/survey.aspx?Cid=" + Vcid + "&Vid=" + vid; System.Threading.Thread.Sleep(500); } else { int newvid = vbll.Addsurvey(vmodel); //增加到调查表中 lmodel.Lxid = newvid; lbll.Add(lmodel); //增加到导航中 System.Threading.Thread.Sleep(500); url = "~/Survey/survey.aspx?Cid=" + Vcid + "&Vid=" + newvid; } Response.Redirect(url, false); } } else { Labelmsg.Text = "内容及标题不能为空!"; } }
protected void Btnadd_Click(object sender, EventArgs e) { string fckstr = Request.Form["textareaItem"].Trim(); if (Texttitle.Text != "" && fckstr != "") { if (Request.QueryString["Mcid"] != null) { string Mcidstr = Request.QueryString["Mcid"].ToString(); int Mcid = Int32.Parse(Mcidstr); LearnSite.BLL.Mission missionbll = new LearnSite.BLL.Mission(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); int maxSort = lbll.GetMaxLsort(Mcid) + 1; string exampleurl = "~/Statics/cat.sb2";//实例路径 if (Fupload.HasFile) { string sbfilename = Fupload.FileName; string savePath = LearnSite.Store.CourseStore.GetSaveUrl("Course", Mcidstr); string shortFileName = Path.GetFileName(sbfilename); string savefilename = savePath + shortFileName; string sbpath = this.Server.MapPath(savefilename); Fupload.SaveAs(sbpath); exampleurl = savefilename; } LearnSite.Model.Mission mission = new LearnSite.Model.Mission(); mission.Mcid = Mcid; mission.Mtitle = Texttitle.Text.Trim(); mission.Msort = maxSort; mission.Mupload = true; mission.Mcategory = 2;//编程页面 mission.Mexample = exampleurl;//编程实例 mission.Microworld = CheckMicoWorld.Checked; mission.Mpublish = CheckPublish.Checked; mission.Mcontent = HttpUtility.HtmlEncode(fckstr); mission.Mfiletype = "sb2"; mission.Mdate = DateTime.Now; mission.Mhit = 0; mission.Mgroup = false; if (DDLMgid.SelectedValue != "") { mission.Mgid = Int32.Parse(DDLMgid.SelectedValue); } else { mission.Mgid = 0; } int mid = missionbll.Add(mission); LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu(); lmodel.Lcid = Mcid; lmodel.Lshow = CheckPublish.Checked; lmodel.Lsort = maxSort; lmodel.Ltitle = Texttitle.Text.Trim(); lmodel.Ltype = 5;//页面类型为5 编程 lmodel.Lxid = mid; lbll.Add(lmodel); System.Threading.Thread.Sleep(500); string url = "~/Teacher/courseshow.aspx?Cid=" + Mcid.ToString(); Response.Redirect(url, false); } } else { Labelmsg.Text = "请填写标题或选择实例!"; } }
private void ShowListMenu() { if (Request.QueryString["Cid"] != null) { string Cid = Request.QueryString["Cid"].ToString(); string Uploadmode = LearnSite.Common.XmlHelp.GetUploadMode(); if (LearnSite.Common.WordProcess.IsNum(Cid)) { string mUrl; if (Uploadmode == "0") { mUrl = "active"; } else { mUrl = "mission"; } string CurWay = ""; LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses(); string Ctitle = cbll.GetTitle(Int32.Parse(Cid)); AddLessonFirst(CurWay, Cid); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); DataTable dt = lbll.GetShowedMenu(Int32.Parse(Cid)).Tables[0]; int dcount = dt.Rows.Count; if (dcount > 0) { string myLid = ""; if (Request.QueryString["Lid"] != null) { myLid = Request.QueryString["Lid"].ToString(); } for (int i = 0; i < dcount; i++) { string Lid = dt.Rows[i]["Lid"].ToString(); string Lsort = dt.Rows[i]["Lsort"].ToString(); string Ltype = dt.Rows[i]["Ltype"].ToString(); string Lxidstr = dt.Rows[i]["Lxid"].ToString(); string Ltitlestr = dt.Rows[i]["Ltitle"].ToString(); MenuItem ma = new MenuItem(); ma.Text = Ltitlestr; ma.SeparatorImageUrl = "~/Images/separate.gif"; switch (Ltype) { case "1": //活动 ma.ImageUrl = "~/Images/mission.png"; ma.NavigateUrl = "~/Student/show" + mUrl + ".aspx?Cid=" + Cid + "&Mid=" + Lxidstr + "&Lid=" + Lid + "&Lsort=" + Lsort; break; case "2": //调查 ma.ImageUrl = "~/Images/survey.png"; ma.NavigateUrl = "~/Student/mysurvey.aspx?Cid=" + Cid + "&Vid=" + Lxidstr + "&Lid=" + Lid + "&Lsort=" + Lsort; break; case "3": //讨论 ma.ImageUrl = "~/Images/topic.png"; ma.NavigateUrl = "~/Student/topicdiscuss.aspx?Cid=" + Cid + "&Tid=" + Lxidstr + "&Lid=" + Lid + "&Lsort=" + Lsort; break; case "4": //表单 ma.ImageUrl = "~/Images/inquiry.png"; ma.NavigateUrl = "~/Student/txtform.aspx?Cid=" + Cid + "&Mid=" + Lxidstr + "&Lid=" + Lid + "&Lsort=" + Lsort; break; case "5": //编程 ma.ImageUrl = "~/Images/program.png"; ma.NavigateUrl = "~/Student/program.aspx?Cid=" + Cid + "&Mid=" + Lxidstr + "&Lid=" + Lid + "&Lsort=" + Lsort; break; case "6": //描述 ma.ImageUrl = "~/Images/description.png"; ma.NavigateUrl = "~/Student/description.aspx?Cid=" + Cid + "&Mid=" + Lxidstr + "&Lid=" + Lid + "&Lsort=" + Lsort; break; } if (myLid == Lid) { CurWay = Ltitlestr; ma.Selected = true; } Menuact.Items.Add(ma);//添加活动菜单 } } dt.Dispose(); AddReturn(); string stuName = ""; if (Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname] != null) { LearnSite.Model.Cook cook = new LearnSite.Model.Cook(); stuName = cook.Sname; } this.Page.Title = HttpUtility.UrlDecode(stuName) + " " + Ctitle + "—>" + CurWay; } } }
private void ShowListMenu() { if (Request.QueryString["Cid"] != null) { string Cid = Request.QueryString["Cid"].ToString(); string Uploadmode = LearnSite.Common.XmlHelp.GetUploadMode(); if (LearnSite.Common.WordProcess.IsNum(Cid)) { string CurWay = ""; LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses(); string Ctitle = cbll.GetTitle(Int32.Parse(Cid)); AddLessonFirst(CurWay, Cid); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); DataTable dt = lbll.GetShowedMenu(Int32.Parse(Cid)).Tables[0]; int dcount = dt.Rows.Count; if (dcount > 0) { string myLid = ""; if (Request.QueryString["Lid"] != null) { myLid = Request.QueryString["Lid"].ToString(); } for (int i = 0; i < dcount; i++) { string Lid = dt.Rows[i]["Lid"].ToString(); string Lsort = dt.Rows[i]["Lsort"].ToString(); string Ltype = dt.Rows[i]["Ltype"].ToString(); string Lxidstr = dt.Rows[i]["Lxid"].ToString(); string Ltitlestr = dt.Rows[i]["Ltitle"].ToString(); MenuItem ma = new MenuItem(); ma.Text = Ltitlestr; ma.SeparatorImageUrl = "~/Images/separate.png"; switch (Ltype) { case "1": //活动 ma.ImageUrl = "~/Images/mission.png"; ma.NavigateUrl = "~/Lessons/premission.aspx?Cid=" + Cid + "&Mid=" + Lxidstr + "&Lid=" + Lid + "&Lsort=" + Lsort; break; case "2": //调查 ma.ImageUrl = "~/Images/survey.png"; ma.NavigateUrl = "~/Lessons/presurvey.aspx?Cid=" + Cid + "&Vid=" + Lxidstr + "&Lid=" + Lid + "&Lsort=" + Lsort; break; case "3": //讨论 ma.ImageUrl = "~/Images/topic.png"; ma.NavigateUrl = "~/Lessons/pretopicdiscuss.aspx?Cid=" + Cid + "&Tid=" + Lxidstr + "&Lid=" + Lid + "&Lsort=" + Lsort; break; } if (myLid == Lid) { CurWay = Ltitlestr; ma.Selected = true; } Menuact.Items.Add(ma);//添加活动菜单 } } dt.Dispose(); AddReturn(); this.Page.Title = Ctitle + "—>" + CurWay; } } }
protected void Btnadd_Click(object sender, EventArgs e) { string fckstr = Request.Form["textareaItem"].Trim(); if (Texttitle.Text != "" && fckstr != "") { if (Request.QueryString["Mcid"] != null) { string Mcidstr = Request.QueryString["Mcid"].ToString(); int Mcid = Int32.Parse(Mcidstr); string coursePath = LearnSite.Store.CourseStore.CoursePath(Mcidstr); if (CheckRemote.Checked) { fckstr = LearnSite.Common.ImageDown.UploadRemote(fckstr, coursePath); } LearnSite.BLL.Mission missionbll = new LearnSite.BLL.Mission(); LearnSite.Model.Mission mission = new LearnSite.Model.Mission(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); int maxSort = lbll.GetMaxLsort(Mcid) + 1; mission.Mcid = Mcid; mission.Mtitle = Texttitle.Text.Trim(); mission.Msort = maxSort; bool uploadcan = CheckUpload.Checked; mission.Mupload = uploadcan; if (uploadcan) { mission.Mcategory = 0;//有作业提交 } else { mission.Mcategory = 1;//无作业提交 } mission.Mexample = ""; mission.Mpublish = CheckPublish.Checked; mission.Mcontent = HttpUtility.HtmlEncode(fckstr); mission.Mfiletype = DDLmfiletype.SelectedValue; mission.Mdate = DateTime.Now; mission.Mhit = 0; mission.Mgroup = CheckGroup.Checked; if (DDLMgid.SelectedValue != "") { mission.Mgid = Int32.Parse(DDLMgid.SelectedValue); } else { mission.Mgid = 0; } int mid = missionbll.Add(mission); LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu(); lmodel.Lcid = Mcid; lmodel.Lshow = CheckPublish.Checked; lmodel.Lsort = maxSort; lmodel.Ltitle = Texttitle.Text.Trim(); if (uploadcan) { lmodel.Ltype = 1; } else { lmodel.Ltype = 6;//描述页面 } lmodel.Lxid = mid; lbll.Add(lmodel); System.Threading.Thread.Sleep(500); //Labelmsg.Text = "添加学案活动成功"; string url = "~/Teacher/courseshow.aspx?Cid=" + Mcid.ToString(); Response.Redirect(url, false); } } else { Labelmsg.Text = "内容及标题不能为空!"; } }
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(); }
/// <summary> /// 返回本课的活动、调查、讨论、表单 汇总表 /// </summary> /// <param name="Cid"></param> /// <param name="Sgrade"></param> /// <param name="Sclass"></param> public DataTable CourseTotals(int Cid, int Sgrade, int Sclass) { Students sbll = new Students(); DataTable dtstus = sbll.GetStudentsSnumSname(Sgrade, Sclass).Tables[0];//学号和姓名 if (dtstus.Rows.Count > 0) { ListMenu lbll = new ListMenu(); DataTable dt = lbll.GetShowedMenu(Cid).Tables[0]; int dcount = dt.Rows.Count; if (dcount > 0) { Works wbll = new Works(); SurveyFeedback fbll = new SurveyFeedback(); TopicReply rbll = new TopicReply(); TxtFormBack xbll = new TxtFormBack(); for (int i = 0; i < dcount; i++) { string Ltype = dt.Rows[i]["Ltype"].ToString(); //获取学案项目类型:1活动2调查3讨论4表单 int Lxid = Convert.ToInt32(dt.Rows[i]["Lxid"].ToString()); //获取对应项目ID编号 string Ltitle = dt.Rows[i]["Ltitle"].ToString().Replace(" ", ""); //获取菜单标题 string Ltitlestr = "l" + Ltype + "x" + Lxid.ToString(); switch (Ltype) { case "1": //活动 case "5": //编程 DataTable dtms = wbll.getScoreList(Lxid, Sgrade, Sclass); if (dtms.Rows.Count > 0) { dtstus.Columns.Add(Ltitlestr, typeof(int)); GetScore(dtstus, Ltitlestr, dtms); dtstus.Columns[Ltitlestr].ColumnName = Ltitle; } dtms.Dispose(); break; case "2": //调查 DataTable dtsf = fbll.GetClassScore(Lxid, Sgrade, Sclass); if (dtsf.Rows.Count > 0) { dtstus.Columns.Add(Ltitlestr, typeof(int)); GetScore(dtstus, Ltitlestr, dtsf); dtstus.Columns[Ltitlestr].ColumnName = Ltitle; } dtsf.Dispose(); break; case "3": //讨论 DataTable dttr = rbll.GetClassListScore(Sgrade, Sclass, Lxid); if (dttr.Rows.Count > 0) { dtstus.Columns.Add(Ltitlestr, typeof(int)); GetScore(dtstus, Ltitlestr, dttr); dtstus.Columns[Ltitlestr].ColumnName = Ltitle; } dttr.Dispose(); break; case "4": //表单 DataTable dttx = xbll.GetClassTxtFormScore(Sgrade, Sclass, Lxid); if (dttx.Rows.Count > 0) { dtstus.Columns.Add(Ltitlestr, typeof(int)); GetScore(dtstus, Ltitlestr, dttx); dtstus.Columns[Ltitlestr].ColumnName = Ltitle; } dttx.Dispose(); break; } } } dt.Dispose(); //汇总 int cml = dtstus.Columns.Count; if (cml > 2) { Signin gbll = new Signin(); DataTable dtatd = gbll.GetClassListQattitude(Sgrade, Sclass, Cid); if (dtatd.Rows.Count > 0) { string clmatd = "clmattitude"; dtstus.Columns.Add(clmatd, typeof(int)); GetScore(dtstus, clmatd, dtatd); dtstus.Columns[clmatd].ColumnName = "课堂表现"; cml = cml + 1;//新增了课堂表现列 } dtstus.Columns.Add("汇总", typeof(float)); dtTotal(dtstus, cml); } } dtstus.Columns["Snum"].ColumnName = "学号"; dtstus.Columns["Sname"].ColumnName = "姓名"; return(dtstus); }