private void showsurvey() { if (Request.QueryString["Vid"] != null) { string vid = Request.QueryString["Vid"].ToString(); LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey(); LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey(); vmodel = vbll.GetModel(Int32.Parse(vid)); Lbave.Text = vmodel.Vaverage.ToString(); 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 = "调查开启!"; } Lbdate.Text = vmodel.Vdate.ToString(); Lbscore.Text = vmodel.Vscore.ToString(); Lbtitle.Text = vmodel.Vtitle; if (vmodel.Vtype.Value == 0) { Lbtype.Text = "调查"; } else { Lbtype.Text = "测验"; } vcontent.InnerHtml = HttpUtility.HtmlDecode(vmodel.Vcontent); } }
private void showSurvey() { if (Request.QueryString["Vid"] != null && Request.QueryString["Cid"] != null) { string vid = Request.QueryString["Vid"].ToString(); LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey(); LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey(); vmodel = vbll.GetModel(Int32.Parse(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 = "调查"; } showQuestion(); 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 = "调查开启,请开始回答!"; } } }
private void showsurvey() { if (Request.QueryString["Vid"] != null) { Btnadd.Text = "修改调查"; string vid = Request.QueryString["Vid"].ToString(); LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey(); LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey(); vmodel = vbll.GetModel(Int32.Parse(vid)); Texttitle.Text = vmodel.Vtitle; DDLvtype.SelectedValue = vmodel.Vtype.ToString(); CheckClose.Checked = vmodel.Vclose; mcontent.InnerText = HttpUtility.HtmlDecode(vmodel.Vcontent); } }
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 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 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; } } }