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; } } }
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; } } }
/// <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); }