/// <summary> /// 显示本班级已学和未学学案 /// </summary> private void Showkc() { int Rhid = tcook.Hid; int Rgrade = Int32.Parse(DDLgrade.SelectedValue); int Rclass = Int32.Parse(DDLclass.SelectedValue); LearnSite.BLL.Students sbll = new LearnSite.BLL.Students(); int Syear = sbll.GetYear(Rgrade, Rclass); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); int Wterm = Int32.Parse(LearnSite.Common.XmlHelp.GetTerm()); string Wcids = wbll.ShowDoneWorkCids(Rgrade, Rclass, Wterm, Syear); LearnSite.BLL.TopicReply Tbll = new LearnSite.BLL.TopicReply(); string Tcids = Tbll.ShowDoneReplyCids(Rgrade, Rclass, Wterm, Syear); LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback(); string Fcids = fbll.ShowFeedbackCids(Rgrade, Rclass, Wterm, Syear); string allCids = Wcids + Tcids + Fcids; allCids = LearnSite.Common.WordProcess.SimpleWords(allCids); LearnSite.BLL.Courses cs = new LearnSite.BLL.Courses(); DLdonekc.DataSource = cs.ShowClassDoneCourse(Rgrade, Rhid, allCids); DLdonekc.DataBind(); DLnewkc.DataSource = cs.ShowClassnewCourse(Rgrade, Rhid, allCids); DLnewkc.DataBind(); }
protected void ButtonClearStudent_Click(object sender, EventArgs e) { if (CheckBoxDel.Checked) { string cip = Page.Request.UserHostAddress; //客户端IP string sip = LearnSite.Common.Computer.GetServerIp(); //服务器IP if (cip == sip) { string countstu = TextBoxcount.Text; if (countstu != "" && countstu != "0") { int sgrade = Int32.Parse(DDLgrade.SelectedValue); int sclass = Int32.Parse(DDLclass.SelectedValue); LearnSite.BLL.Webstudy wbll = new LearnSite.BLL.Webstudy(); wbll.DelWebClass(sgrade, sclass); LearnSite.BLL.Students sbll = new LearnSite.BLL.Students(); int delcount = sbll.DeleteClassMate(sgrade, sclass);//清空该班级学生 Labelmsg.Text = "您请空了" + DDLgrade.SelectedValue + "年级" + DDLclass.SelectedValue + "班所有学生共" + delcount.ToString() + "位!"; int syear = sbll.GetYear(sgrade, sclass); LearnSite.BLL.Signin gbll = new LearnSite.BLL.Signin(); gbll.DelSignClass(sgrade, sclass, syear); //清空签到 LearnSite.BLL.Works kbll = new LearnSite.BLL.Works(); kbll.DelClass(sgrade, sclass, syear); //清空作品 LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback(); fbll.DelClass(sgrade, sclass, syear); //清空调查 LearnSite.BLL.TopicReply rbll = new LearnSite.BLL.TopicReply(); rbll.DelClass(sgrade, sclass, syear); //清空讨论 } else { Labelmsg.Text = "无学生记录可清空!"; } } else { Labelmsg.Text = "此操作只能在服务器上浏览该页面才能执行,谢谢!"; } } else { Labelmsg.Text = "请在确认操作选项上打勾!"; } }
private void surveyClass() { if (Request.QueryString["Vid"] != null && Request.QueryString["Cid"] != null) { int syear = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Syear"].ToString()); int sgrade = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString()); int sclass = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString()); int sterm = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["ThisTerm"].ToString()); int vid = Int32.Parse(Request.QueryString["Vid"].ToString()); int cid = Int32.Parse(Request.QueryString["Cid"].ToString()); LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback(); string allselect = fbll.GetClassFselect(sgrade, sclass, vid); if (!string.IsNullOrEmpty(allselect)) { LearnSite.BLL.SurveyItem mbll = new LearnSite.BLL.SurveyItem(); itemandcount = mbll.GetListItemAndCount(vid, allselect); // LearnSite.Common.WordProcess.Alert(itemandcount, this.Page);//调试信息 string[] itemcountStr = itemandcount.Split('|'); LearnSite.Model.SurveyClass ymodel = new LearnSite.Model.SurveyClass(); ymodel.Ycid = cid; ymodel.Yclass = sclass; ymodel.Ycount = itemcountStr[1].ToString(); ymodel.Ydate = DateTime.Now; ymodel.Ygrade = sgrade; int yscore = fbll.GetClassYscore(syear, sgrade, sclass, sterm, vid); ymodel.Yscore = yscore; Lbscore.Text = yscore.ToString(); ymodel.Yselect = itemcountStr[0].ToString(); ymodel.Yterm = sterm; ymodel.Yvid = vid; ymodel.Yyear = syear; LearnSite.BLL.SurveyClass ybll = new LearnSite.BLL.SurveyClass(); int yid = ybll.ExistsClass(syear, sgrade, sclass, sterm, vid); if (yid > 0) { //更新 ymodel.Yid = yid; ybll.UpdateClass(ymodel); } else { ybll.Add(ymodel); } } } }
private void showclassmate() { if (Request.QueryString["Vid"] != null && Request.QueryString["Mid"] != null) { int vid = Int32.Parse(Request.QueryString["Vid"].ToString()); int mid = Int32.Parse(Request.QueryString["Mid"].ToString()); int syear = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Syear"].ToString()); int sgrade = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString()); int sclass = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString()); LearnSite.BLL.SurveyItem mbll = new LearnSite.BLL.SurveyItem(); Mitem.InnerHtml = "<br />" + HttpUtility.HtmlDecode(mbll.GetMitem(mid)); LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback(); Repeater1.DataSource = fbll.ShowItemClassMate(syear, sgrade, sclass, vid, mid); Repeater1.DataBind(); } }
private void showSurvey() { if (Request.QueryString["Vid"] != null && Request.QueryString["Cid"] != null) { int vid = Int32.Parse(Request.QueryString["Vid"].ToString()); int syear = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Syear"].ToString()); int sgrade = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString()); int sclass = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString()); int sterm = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["ThisTerm"].ToString()); int cid = Int32.Parse(Request.QueryString["Cid"].ToString()); LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey(); LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey(); vmodel = vbll.GetModel(vid); int vtype = vmodel.Vtype.Value; Lbtitle.Text = "《" + vmodel.Vtitle + "》班级统计分析"; vcontent.InnerHtml = HttpUtility.HtmlDecode(vmodel.Vcontent); Lbdate.Text = vmodel.Vdate.ToString(); Lbsgrade.Text = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString(); string fnum = Server.UrlDecode(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Snum"].ToString()); Lbsclass.Text = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString(); bool isClose = vmodel.Vclose; if (!isClose) { surveyClass();//更新统计 } else { itemandcount = surveyClassView(syear, sgrade, sclass, sterm, cid, vid);//历史统计显示 } if (fnum.IndexOf('s') > -1) { Btnrefresh.Visible = true;//限制为模拟学生可以进行统计(方便老师,减少数据库查询) } else { Btnrefresh.Visible = false; } showQuestion();//显示问题 LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback(); Lbstus.Text = fbll.GetSurveyStu(sgrade, sclass, cid, vid).ToString() + "人"; stuList.InnerHtml = "未参与同学列表:<br />" + fbll.GetNoSurveyStu(sgrade, sclass, cid, vid); HLclassrank.NavigateUrl = "mysurveyrank.aspx?Vid=" + vid; HLclassrank.Visible = true; } }
private void showclassmate() { if (Request.QueryString["Vid"] != null && Request.QueryString["Mid"] != null) { LearnSite.Model.Cook cook = new LearnSite.Model.Cook(); int vid = Int32.Parse(Request.QueryString["Vid"].ToString()); int mid = Int32.Parse(Request.QueryString["Mid"].ToString()); int syear = cook.Syear; int sgrade = cook.Sgrade; int sclass = cook.Sclass; LearnSite.BLL.SurveyItem mbll = new LearnSite.BLL.SurveyItem(); Mitem.InnerHtml = "<br />" + HttpUtility.HtmlDecode(mbll.GetMitem(mid)); LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback(); Repeater1.DataSource = fbll.ShowItemClassMate(syear, sgrade, sclass, vid, mid); Repeater1.DataBind(); } }
private void showFscore() { if (Request.QueryString["Vid"] != null) { int sgrade = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString()); int sclass = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString()); int vid = Int32.Parse(Request.QueryString["Vid"].ToString()); LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback(); GridViewclass.DataSource = fbll.GetClassFscore(sgrade, sclass, vid); GridViewclass.DataBind(); LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey(); LearnSite.Model.Survey model = new LearnSite.Model.Survey(); model = vbll.GetModel(vid); Labeltitle.Text = HttpUtility.HtmlDecode(model.Vtitle); if (GridViewclass.Rows.Count < 1) { Labelmsg.Text = "暂无排行!"; } } }
private void getoldCids() { int Cterm = cook.ThisTerm; int Cgrade = cook.Sgrade; string mySnum = cook.Snum; LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback(); string fcids = fbll.ShowStuFeedbackCids(mySnum, Cterm, Cgrade); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); string wcids = wbll.ShowStuDoneWorkCids(mySnum, Cterm, Cgrade); LearnSite.BLL.TopicReply tbll = new LearnSite.BLL.TopicReply(); string tcids = tbll.ShowStuDoneReplyCids(mySnum, Cterm, Cgrade); LearnSite.BLL.TxtFormBack mbll = new LearnSite.BLL.TxtFormBack(); string mcids = mbll.ShowStuDoneBackCids(mySnum, Cterm, Cgrade); string allcids = ""; if (wcids != "") { allcids = allcids + wcids; } if (fcids != "") { allcids = allcids + fcids; } if (tcids != "") { allcids = allcids + tcids; } if (mcids != "") { allcids = allcids + mcids; } LabelCids.Text = LearnSite.Common.WordProcess.SimpleWordsNew(allcids); }
private void getoldCids() { int Cterm = Int32.Parse(LearnSite.Common.XmlHelp.GetTerm()); int Cgrade = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString()); string mySnum = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Snum"].ToString(); LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback(); string fcids = fbll.ShowStuFeedbackCids(mySnum, Cterm, Cgrade); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); string wcids = wbll.ShowStuDoneWorkCids(mySnum, Cterm, Cgrade); LearnSite.BLL.TopicReply tbll = new LearnSite.BLL.TopicReply(); string tcids = tbll.ShowStuDoneReplyCids(mySnum, Cterm, Cgrade); LearnSite.BLL.TxtFormBack mbll = new LearnSite.BLL.TxtFormBack(); string mcids = mbll.ShowStuDoneBackCids(mySnum, Cterm, Cgrade); string allcids = ""; if (wcids != "") { allcids = allcids + wcids; } if (fcids != "") { allcids = allcids + fcids; } if (tcids != "") { allcids = allcids + tcids; } if (mcids != "") { allcids = allcids + mcids; } LabelCids.Text = LearnSite.Common.WordProcess.SimpleWordsNew(allcids); }
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 = "内容及标题不能为空!"; } }
private void showSurvey() { if (Request.QueryString["Vid"] != null && Request.QueryString["Cid"] != null) { int vid = Int32.Parse(Request.QueryString["Vid"].ToString()); int cid = Int32.Parse(Request.QueryString["Cid"].ToString()); string fnum = cook.Snum; LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey(); LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey(); vmodel = vbll.GetModel(vid); Lbtitle.Text = vmodel.Vtitle; vcontent.InnerHtml = HttpUtility.HtmlDecode(vmodel.Vcontent); int vtype = vmodel.Vtype.Value; Lbtype.Text = vtype.ToString(); if (vtype > 0) { Lbtypecn.Text = "测验"; } else { Lbtypecn.Text = "调查"; } Lbsname.Text = Server.UrlDecode(cook.Sname); Lbsnum.Text = fnum; bool isClose = vmodel.Vclose; if (isClose) { Btnclock.ImageUrl = "~/Images/clockred.gif" + "?temp=" + DateTime.Now.Millisecond.ToString(); Btnclock.ToolTip = "暂停,请咨询老师!"; } else { Btnclock.ImageUrl = "~/Images/clock.gif" + "?temp=" + DateTime.Now.Millisecond.ToString(); Btnclock.ToolTip = "开启,请开始回答!"; showQuestion(); } int myscore = GetMyScore(vid, fnum); if (myscore != -1024) { //如果已经回答过调查 Btnok.Visible = false; Lbcheck.Text = "已完成!"; Lbcheck.BackColor = System.Drawing.Color.Green; Lbfscore.Text = myscore.ToString(); int syear = cook.Syear; int sgrade = cook.Sgrade; int sclass = cook.Sclass; LearnSite.BLL.Students sbll = new LearnSite.BLL.Students(); int cns = sbll.CountClassMate(sgrade, sclass); LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback(); int dcn = fbll.GetSurveyStu(sgrade, sclass, cid, vid); if (dcn == cns) { Btnshow.Visible = true; } } else { Lbfscore.Text = "0"; if (isClose) { Btnok.Visible = false;//如果关闭调查,则提交按钮无效 } else { Btnok.Visible = true; if (Session[fnum + "survey" + vid] != null) { DateTime oldtime = DateTime.Parse(Session[fnum + "survey" + vid].ToString()); DateTime nowtime = DateTime.Now; Lbtime.Text = LearnSite.Common.Computer.DatagoneMinute(oldtime, nowtime); } else { Session[fnum + "survey" + vid] = DateTime.Now.ToString(); } } Lbcheck.Text = "未完成!"; Lbcheck.BackColor = System.Drawing.Color.Red; Btnshow.Visible = false; } if (fnum.IndexOf('s') > -1) { Btnshow.Visible = true; Btnok.Visible = false; Btnclock.Enabled = true; } else { Btnclock.Enabled = false; } } }
protected void Btnok_Click(object sender, EventArgs e) { if (Request.QueryString["Vid"] != null && Request.QueryString["Cid"] != null) { string fnum = cook.Snum; int vid = Int32.Parse(Request.QueryString["Vid"].ToString()); int limitTime = Int32.Parse(LbLimitTime.Text); if (GetMyScore(vid, fnum) == -1024) { int qcount = DataListonly.Items.Count;//考题数 if (qcount > 0) { //如果有题目则分析 int scount = 0;//做题数 string midselect = ""; foreach (DataListItem item in this.DataListonly.Items) { RadioButtonList rblm = (RadioButtonList)item.FindControl("RBLselect"); if (rblm.SelectedIndex > -1) { scount++; midselect = midselect + rblm.SelectedValue + ","; } } if (qcount == scount) { if (midselect.EndsWith(",")) { midselect = midselect.Substring(0, midselect.Length - 1); } int syear = cook.Syear; int sgrade = cook.Sgrade; int sclass = cook.Sclass; int cid = Int32.Parse(Request.QueryString["Cid"].ToString()); int sid = cook.Sid; LearnSite.Model.SurveyFeedback fmodel = new LearnSite.Model.SurveyFeedback(); fmodel.Fnum = fnum; fmodel.Fyear = syear; fmodel.Fgrade = sgrade; fmodel.Fclass = sclass; fmodel.Fterm = cook.ThisTerm; fmodel.Fcid = cid; fmodel.Fvid = vid; fmodel.Fvtype = Int32.Parse(Lbtype.Text); fmodel.Fselect = midselect; LearnSite.BLL.SurveyItem mbll = new LearnSite.BLL.SurveyItem(); int tt = Int32.Parse(Lbtime.Text) / 60; int myscore = mbll.GetItemScore(midselect); if (tt > limitTime) { if (tt - limitTime > scount) { fmodel.Fscore = 0;//限制一下扣分,最低分为0 } else { fmodel.Fscore = myscore + limitTime - tt; } } else { fmodel.Fscore = myscore; } fmodel.Fdate = DateTime.Now; fmodel.Fsid = sid; LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback(); if (fbll.Add(fmodel) > 0) { showSurvey(); } } else { string msg = "您还有题目未做好,请仔细查看!"; LearnSite.Common.WordProcess.Alert(msg, this.Page); } } } else { Btnok.Enabled = false; } } }
private int GetMyScore(int vid, string fnum) { LearnSite.BLL.SurveyFeedback fbll = new LearnSite.BLL.SurveyFeedback(); return(fbll.ExistsScore(vid, fnum)); }
/// <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); }