private void ShowDoneWorks() { int Sgrade = Int32.Parse(Request.QueryString["Grade"].ToString()); int Sclass = Int32.Parse(DDLclass.SelectedValue); int Wmid = Int32.Parse(DDLmid.SelectedValue); string mySort = RBsort.SelectedValue; LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); DataListworks.DataSource = wbll.ShowClassWorksBySort(Sgrade, Sclass, Wmid, mySort); DataListworks.DataBind();//Wid,Sname,Wurl,Wvote,Wscore,Qwork,Wcheck }
private void ListWorks() { string Mid = Request.QueryString["Mid"].ToString(); int MySgrade = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString()); int MySclass = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString()); int MySgroup = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgroup"].ToString()); //int MySyear = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Syear"].ToString()); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); DataListvote.DataSource = wbll.ShowMissionWorksGroup(MySgrade, MySclass, Int32.Parse(Mid), MySgroup); //改回为显示作品 DataListvote.DataBind(); }
private void showflash() { RBLselect.ClearSelection(); int icn = DDLstore.Items.Count; if (icn > 0) { bool ishtm = false; string Wurl = DDLstore.SelectedValue; url = Server.UrlEncode(Wurl); string ext = LearnSite.Common.WordProcess.getext(Wurl); string htmname = "index.htm"; int cur = DDLstore.SelectedIndex + 1; Labelnum.Text = cur.ToString() + "/" + icn.ToString(); if (ishtm) { Labelnum.ToolTip = LearnSite.Common.WordProcess.GetSnumhtm(Wurl); } else { Labelnum.ToolTip = LearnSite.Common.WordProcess.GetSnum(Wurl); } Literal1.Text = LearnSite.Common.WordProcess.SelectWriteTeaNew(ext, Wurl, true, htmname); GetScore(Labelnum.ToolTip); if (ext == "sb" || ext == "sb2") { string Mid = Request.QueryString["Mi"].ToString(); string Wnum = Labelnum.ToolTip; LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); string wid = wbll.GetWid(Mid, Wnum); if (!string.IsNullOrEmpty(wid)) { Hlcode.NavigateUrl = "~/Student/codeproject.aspx?id=" + wid; Hlcode.Visible = true; Hlshare.NavigateUrl = "~/Student/codeshare.aspx?id=" + wid; Hlshare.Visible = true; } } if (ext == "py") { PanelPython.Visible = true; } else { PanelPython.Visible = false; } } else { PanelPython.Visible = false; Literal1.Text = "当前没有学生作品"; } }
private void showWorks() { string midselect = Rblmission.SelectedValue; string cidselect = Rblcourse.SelectedValue; if (!string.IsNullOrEmpty(midselect) && !string.IsNullOrEmpty(cidselect)) { string yearselect = Rblyear.SelectedValue; string gradeselect = Rblgrade.SelectedValue; string classselect = Rblclass.SelectedValue; string termselect = Rblterm.SelectedValue; string displaymodel = Rbldisplay.SelectedValue; LearnSite.BLL.Courses cbll = new LearnSite.BLL.Courses(); string ctitle = cbll.GetTitle(Int32.Parse(cidselect)); LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); string mtitle = mbll.GetMissionTitle(Int32.Parse(midselect)); LabelTitle.Text = "【" + ctitle + "】" + mtitle; LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); switch (displaymodel) { case "1": DLworks.DataSource = wbll.ShowWclassWorks(Int32.Parse(yearselect), Int32.Parse(gradeselect), Int32.Parse(classselect), Int32.Parse(termselect), Int32.Parse(midselect)); DLworks.DataBind(); divlist.Visible = true; divview.Visible = false; Literal1.Visible = false; break; case "2": DDLstore.DataSource = wbll.ShowWclassWorks(Int32.Parse(yearselect), Int32.Parse(gradeselect), Int32.Parse(classselect), Int32.Parse(termselect), Int32.Parse(midselect)); DDLstore.DataTextField = "Wname"; DDLstore.DataValueField = "Wurl"; DDLstore.DataBind(); divlist.Visible = false; divview.Visible = true; Literal1.Visible = true; if (DDLstore.Items.Count > 0) { DDLstore.SelectedIndex = 0; showflash(); } break; } } else { LabelTitle.Text = "没有作品!"; divlist.Visible = false; divview.Visible = false; Literal1.Visible = false; } }
/// <summary> /// 分开是为了不让学案Cid重取 /// </summary> private void ShowWorks() { string Hid = Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname].Values["Hid"].ToString(); if (Request.QueryString["wGrade"] != null && Request.QueryString["wClass"] != null) { int Sgrade = Int32.Parse(Request.QueryString["wGrade"].ToString()); int Sclass = Int32.Parse(Request.QueryString["wClass"].ToString()); LearnSite.BLL.Students sbll = new LearnSite.BLL.Students(); int Syear = sbll.GetYear(Sgrade, Sclass); string myCid = DDLCid.SelectedValue; if (myCid != "" && DDLCid.Items.Count > 0) { if (DDLmid.SelectedValue != "" && DDLmid.Items.Count > 0) { int Wmid = Int32.Parse(DDLmid.SelectedValue); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); ShowDoneWorks(); //独立出来方便刷新 Labelcounts.Text = DataListworks.Items.Count.ToString(); DataListNoworks.DataSource = wbll.ShowTodayNotWorks(Syear, Sgrade, Sclass, Wmid);//获取今天本班未提交作品的学生列表 DataListNoworks.DataBind(); Labelmsg.Text = CalculateScores(); LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); string Mfiletype = mbll.GetMfiletype(Wmid).ToLower(); showGroup();//显示小组作品 HLautoplay.Visible = false; if (!string.IsNullOrEmpty(Mfiletype)) { ImageType.Visible = true; ImageType.ImageUrl = "~/Images/FileType/" + Mfiletype + ".gif"; string urlstr = Sgrade.ToString() + "&Sc=" + Sclass.ToString() + "&Ci=" + myCid + "&Mi=" + Wmid.ToString() + "&Ty=" + Mfiletype; HLautoplay.Visible = true; HLautoplay.NavigateUrl = "~/Teacher/circleshow.aspx?Sg=" + urlstr; HLautoplay.ImageUrl = "~/Images/flashauto.png"; } } else { ImageType.Visible = false; HLautoplay.Visible = false; HLgroupplay.Visible = false; } } else { Labelmsg.Text = "没找到发布的学案和活动!"; ImageType.Visible = false; } } }
protected void CB_CheckedChanged(object sender, EventArgs e) { CheckBox chk = sender as CheckBox; //取得当前被选中项的索引 int index = (chk.NamingContainer as DataListItem).ItemIndex; //取得当前选中项中的某个值,最好找ID。 Label lbl = this.DataListworks.Items[index].FindControl("Labelwid") as Label; LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); wbll.CancleScoreWork(Int32.Parse(lbl.Text), chk.Checked); System.Threading.Thread.Sleep(200); ShowDoneWorks(); }
protected void showCount() { LearnSite.BLL.Works bll = new LearnSite.BLL.Works(); sbcount = bll.GetSbCount(); if (sbcount > 0) { int Pcount = sbcount / 12 + 1; LabelCount.Text = Pcount.ToString(); int cpage = 1; LabelCurrent.Text = cpage.ToString(); showProject(cpage); } }
private void GetScore(string Wmid, string mySnum) { if (!string.IsNullOrEmpty(Wmid)) { string Wcid = Request.QueryString["Cid"].ToString(); LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); LabelMtitle.Text = mbll.GetMissionTitle(Int32.Parse(Wmid)); LearnSite.BLL.Works ws = new LearnSite.BLL.Works(); string[] myscoreself = ws.GetmyScoreWself(Wcid, Wmid, mySnum); string myscore = myscoreself[0].ToString(); TextBoxWself.Text = myscoreself[1].ToString(); TextBoxWdsocre.Text = myscoreself[2].ToString(); if (myscore != "") { int ascore = Int32.Parse(myscore); switch (ascore) { case 12: RBLselect.SelectedValue = "G"; break; case 10: RBLselect.SelectedValue = "A"; break; case 8: RBLselect.SelectedValue = "B"; break; case 6: RBLselect.SelectedValue = "C"; break; case 4: RBLselect.SelectedValue = "D"; break; case 2: RBLselect.SelectedValue = "E"; break; case 0: RBLselect.SelectedValue = "O"; break; } } } }
private void ShowOldWorks() { string Cid = Request.QueryString["Cid"].ToString(); if (LearnSite.Common.WordProcess.IsNum(Cid)) { int Sid = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sid"].ToString()); int Sgrade = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString()); int Sterm = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["ThisTerm"].ToString()); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); GVold.DataSource = wbll.ShowLastWorks(Sid, Sgrade, Sterm, Int32.Parse(Cid)); GVold.DataBind(); } }
protected void ImageBtnDel_Click(object sender, ImageClickEventArgs e) { string Wnum = Labelnum.ToolTip; string Wmid = LabelMid.Text; if (Wnum != "" && Wmid != "") { LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); wbll.Delmywork(Int32.Parse(Wmid), Wnum); System.Threading.Thread.Sleep(200);//延时 Readwork(); showflash(); } }
protected void ImageBtnDel_Click(object sender, ImageClickEventArgs e) { int Mid = Int32.Parse(Request.QueryString["Mi"].ToString()); string Wnum = Labelnum.ToolTip; if (Wnum != "") { LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); wbll.Delmywork(Mid, Wnum); System.Threading.Thread.Sleep(200);//延时 Readwork(); showflash(); } }
protected void ButtonClear_Click(object sender, EventArgs e) { int oldyear = Int32.Parse(DDLyear.SelectedValue); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); int wct = wbll.DeleteOldyear(oldyear);//清理作品记录 LearnSite.BLL.Signin sbll = new LearnSite.BLL.Signin(); int sct = sbll.DeleteOldyear(oldyear);//清理签到记录 LearnSite.BLL.Result rbll = new LearnSite.BLL.Result(); int rct = rbll.DeleteOldyear(oldyear);//清理测验记录 Labelmsg.Text = "执行结果:清理作品记录" + wct.ToString() + "条、清理签到记录" + sct.ToString() + "条、清理测验记录" + rct.ToString() + "条"; }
private void showyears() { Rblyear.Items.Clear(); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); Rblyear.DataSource = wbll.ShowWyears(); Rblyear.DataTextField = "Wyear"; Rblyear.DataValueField = "Wyear"; Rblyear.DataBind(); int icount = Rblyear.Items.Count; if (icount > 0) { Rblyear.SelectedIndex = icount - 1; } }
protected void ImgBtnFlasherror_Click(object sender, ImageClickEventArgs e) { int Sgrade = Int32.Parse(Request.QueryString["wGrade"].ToString()); int Sclass = Int32.Parse(Request.QueryString["wClass"].ToString()); string myCid = DDLCid.SelectedValue; if (DDLmid.SelectedValue != "") { int Wmid = Int32.Parse(DDLmid.SelectedValue); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); wbll.ClearWflasherror(Sgrade, Sclass, Wmid, Int32.Parse(myCid)); } System.Threading.Thread.Sleep(200); ShowDoneWorks(); }
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 ShowOldWorks() { string Cid = Request.QueryString["Cid"].ToString(); if (LearnSite.Common.WordProcess.IsNum(Cid)) { LearnSite.Model.Cook cook = new LearnSite.Model.Cook(); int Sid = cook.Sid; int Sgrade = cook.Sgrade; int Sterm = cook.ThisTerm; LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); GVold.DataSource = wbll.ShowLastWorks(Sid, Sgrade, Sterm, Int32.Parse(Cid)); GVold.DataBind(); } }
private void showflash() { RBLselect.ClearSelection(); int icn = DDLstore.Items.Count; if (icn > 0) { bool ishtm = false; string Wurl = DDLstore.SelectedValue; string ext = LearnSite.Common.WordProcess.getext(Wurl); string htmname = ""; if (string.IsNullOrEmpty(ext)) { ext = "htm"; ishtm = true; DDLhtmlname.Visible = true; htmname = DDLhtmlname.SelectedValue; } else { DDLhtmlname.Visible = false; } int cur = DDLstore.SelectedIndex + 1; Labelnum.Text = cur.ToString() + "/" + icn.ToString(); if (ishtm) { string mynum = LearnSite.Common.WordProcess.GetSnumhtm(Wurl); Labelnum.ToolTip = mynum; int Wcid = Int32.Parse(Request.QueryString["Cid"].ToString()); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); LabelMid.Text = wbll.GetHtmMid(Wcid, mynum); } else { Labelnum.ToolTip = LearnSite.Common.WordProcess.GetSnum(Wurl); LabelMid.Text = LearnSite.Common.WordProcess.GetMid(Wurl); } GetScore(LabelMid.Text, Labelnum.ToolTip); lbcount.Text = cur.ToString() + "/" + icn.ToString(); Literal1.Text = LearnSite.Common.WordProcess.SelectWriteTeaNew(ext, Wurl, true, htmname); } else { Literal1.Text = "当前没有学生作品"; } }
private void ShowIpWorkDone() { string Sname = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sname"].ToString(); string Snum = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Snum"].ToString(); string Wcid = Request.QueryString["Cid"].ToString(); string Wmid = Request.QueryString["Mid"].ToString(); VoteLink.NavigateUrl = "~/Student/myevaluate.aspx?Mid=" + Wmid + "&Cid=" + Wcid; LearnSite.BLL.Works bll = new LearnSite.BLL.Works(); LearnSite.Model.Works work = new LearnSite.Model.Works(); work = bll.GetModelByStu(Int32.Parse(Wmid), Snum); BtnScratch.Text = "开始编写"; Thumbnail.ImageUrl = "~/Images/thumbnail.png"; if (work != null) { string Wurl = work.Wurl; string Wthumbnail = work.Wthumbnail; if (!string.IsNullOrEmpty(Wthumbnail)) { Thumbnail.ImageUrl = Wthumbnail + "?temp=" + DateTime.Now.Millisecond.ToString(); Wtitle.Text = HttpUtility.HtmlDecode(work.Wtitle); string urlid = work.Wid.ToString(); Thumbnail.Attributes["OnClick"] = "scratchShare(" + urlid + ")"; } bool IsCheck = work.Wcheck; if (IsCheck) { Labelmsg.Text = "您的作品已评分!<br/>您不可以重新编写!"; BtnScratch.Visible = false; } else { Labelmsg.Text = "您的作品还未评分!<br/>您可以重新修改提交!"; BtnScratch.Text = "继续编写"; } } if (Snum.StartsWith("s")) { BtnBegin.Visible = true; } else { BtnBegin.Visible = false; } }
private void GetScore(string mySnum) { if (Request.QueryString["Mi"] != null) { int Mid = Int32.Parse(Request.QueryString["Mi"].ToString()); LearnSite.BLL.Works ws = new LearnSite.BLL.Works(); string[] myscoreself = ws.GetmyScoreWself(Mid, mySnum); string myscore = myscoreself[0].ToString(); TextBoxWself.Text = myscoreself[1].ToString(); TextBoxWdsocre.Text = myscoreself[2].ToString(); if (myscore != "") { int ascore = Int32.Parse(myscore); switch (ascore) { case 12: RBLselect.SelectedValue = "G"; break; case 10: RBLselect.SelectedValue = "A"; break; case 8: RBLselect.SelectedValue = "B"; break; case 6: RBLselect.SelectedValue = "C"; break; case 4: RBLselect.SelectedValue = "D"; break; case 2: RBLselect.SelectedValue = "E"; break; case 0: RBLselect.SelectedValue = "O"; break; } } } }
private void showWgrade() { Rblgrade.Items.Clear(); string yearselect = Rblyear.SelectedValue; if (!string.IsNullOrEmpty(yearselect)) { LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); Rblgrade.DataSource = wbll.ShowWgrades(Int32.Parse(yearselect)); Rblgrade.DataTextField = "Wgrade"; Rblgrade.DataValueField = "Wgrade"; Rblgrade.DataBind(); if (Rblgrade.Items.Count > 0) { Rblgrade.SelectedIndex = 0; } } }
private void ShowMission() { if (Request.QueryString["id"] != null) { int wid = Int32.Parse(Request.QueryString["id"].ToString()); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); LearnSite.Model.Works model = new LearnSite.Model.Works(); string ipwid = "ip" + LearnSite.Common.Computer.MyIp().Replace('.', 'a') + "_" + wid.ToString(); if (Session[ipwid] == null) { wbll.UpdateWhit(wid); Session[ipwid] = wid; } model = wbll.GetModel(wid); Id = wid.ToString(); Owner = model.Wname; Titles = model.Wtitle; this.Page.Title = Titles + " " + Owner; int Wcid = model.Wcid.Value; int Wgrade = model.Wgrade.Value; if (Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname] != null) { LearnSite.Model.Cook cook = new LearnSite.Model.Cook(); LearnSite.BLL.Room rbll = new LearnSite.BLL.Room(); string result = rbll.GetRcid(cook.Sgrade, cook.Sclass); if (!string.IsNullOrEmpty(result)) { int cid = Int32.Parse(result); if (cid == Wcid && cook.Sgrade == Wgrade) { //如果是正在上的课节内容,则不显示作品的脚本 ViewMode = "true"; } if (Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname] != null) { ViewMode = "false"; } } } } }
private void ShowMission() { string Mid = Request.QueryString["Mid"].ToString(); string Cid = Request.QueryString["Cid"].ToString(); Id = Cid + "-" + Mid; int mill = DateTime.Now.Millisecond; Fpage = "program.aspx?Cid=" + Cid + "&Mid=" + Mid + "&Mill=" + mill; if (LearnSite.Common.WordProcess.IsNum(Mid)) { LearnSite.Model.Mission model = new LearnSite.Model.Mission(); LearnSite.BLL.Mission mn = new LearnSite.BLL.Mission(); model = mn.GetModel(Int32.Parse(Mid)); if (model != null) { LearnSite.Model.Cook cook = new LearnSite.Model.Cook(); string Sname = cook.Sname; string Snum = cook.Snum; this.Page.Title = HttpUtility.UrlDecode(Sname) + " " + model.Mtitle + "—>" + DateTime.Now.ToString(); Microworld = model.Microworld.ToString().ToLower(); Mcontents = HttpUtility.HtmlDecode(model.Mcontent); Owner = HttpUtility.UrlDecode(Sname); Titles = model.Mtitle; Filename = LearnSite.Common.WordProcess.getshortfname(model.Mexample); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); if (!Snum.Contains("s")) { if (wbll.ExistsMyMissonWork(Int32.Parse(Mid), Snum)) { Filename = Owner + " " + Filename; } } else { Owner = "老师"; } } } }
private void ReadWork() { if (Request.QueryString["Snum"] != null) { string Snum = Request.QueryString["Snum"].ToString(); LearnSite.Model.Students smodel = new LearnSite.Model.Students(); LearnSite.BLL.Students sbll = new LearnSite.BLL.Students(); smodel = sbll.SnumGetModel(Snum); LabelSnum.Text = Snum; LabelSname.Text = smodel.Sname; LabelWscore.Text = smodel.Sscore.ToString(); int wgrade = smodel.Sgrade.Value; if (Request.QueryString["Sgrade"] != null) { wgrade = Int32.Parse(Request.QueryString["Sgrade"].ToString()); } int wterm = Int32.Parse(LearnSite.Common.XmlHelp.GetTerm()); if (Request.QueryString["Sterm"] != null) { wterm = Int32.Parse(Request.QueryString["Sterm"].ToString()); } LearnSite.BLL.Works ws = new LearnSite.BLL.Works(); DDLstore.DataSource = ws.ShowThisTermWorksCircle(Snum, wgrade, wterm); DDLstore.DataTextField = "Mtitle"; DDLstore.DataValueField = "Wurl"; DDLstore.DataBind(); int curindex = Int32.Parse(lbcurindex.Text); if (DDLstore.Items.Count > 0) { int allindex = DDLstore.Items.Count - 1; if (curindex == allindex) { lbcurindex.Text = "0"; } if (curindex < allindex) { DDLstore.SelectedIndex = curindex; } } } }
protected void showScratch() { if (Request.QueryString["id"] != null) { int wid = Int32.Parse(Request.QueryString["id"].ToString()); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); LearnSite.Model.Works model = new LearnSite.Model.Works(); model = wbll.GetModel(wid); Id = wid.ToString(); LabelTitle.Text = model.Wtitle + " 作者:" + model.Wname; Owner = Owner + " 作者:" + model.Wname; Pic = "http://" + Request.Url.Host + model.Wthumbnail.Replace("~", ""); Titles = model.Wtitle; } else { Pic = Request.ApplicationPath + "Images/thumbnail.png"; } }
private void ShowMission() { if (Request.QueryString["id"] != null) { int wid = Int32.Parse(Request.QueryString["id"].ToString()); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); LearnSite.Model.Works model = new LearnSite.Model.Works(); string ipwid = "ip" + LearnSite.Common.Computer.MyIp().Replace('.', 'a') + "_" + wid.ToString(); if (Session[ipwid] == null) { wbll.UpdateWhit(wid); Session[ipwid] = wid; } model = wbll.GetModel(wid); Id = wid.ToString(); Owner = model.Wname; Titles = model.Wtitle; } }
protected void GVCourse_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { int Wcid = Int32.Parse(e.Row.Cells[0].Text); int Sgrade = Int32.Parse(DDLgrade.SelectedValue); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); HyperLink hl = (HyperLink)e.Row.FindControl("HlNoCheck"); hl.Text = wbll.ShowNotCheckCounts(Wcid, Sgrade); if (hl.Text != "0") { hl.NavigateUrl = "worknoscore.aspx?Cid=" + Wcid.ToString(); } //当鼠标放上去的时候 先保存当前行的背景颜色 并给附一颜色 e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#E1E8E1',this.style.fontWeight='';"); //当鼠标离开的时候 将背景颜色还原的以前的颜色 e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';"); //单击行改变行背景颜色 e.Row.Attributes.Add("onclick", "this.style.backgroundColor='#D8E0D8'; this.style.color='buttontext';this.style.cursor='default';"); } }
private void Readwork() { if (Request.QueryString["Sg"] != null && Request.QueryString["Sc"] != null && Request.QueryString["Ci"] != null && Request.QueryString["Mi"] != null) { int Sgrade = Int32.Parse(Request.QueryString["Sg"].ToString()); int Sclass = Int32.Parse(Request.QueryString["Sc"].ToString()); int Cid = Int32.Parse(Request.QueryString["Ci"].ToString()); int Mid = Int32.Parse(Request.QueryString["Mi"].ToString()); int Wscore = 0; if (CkselectG.Checked) { Wscore = 12; } if (CheckselectA.Checked) { Wscore = 10; } LearnSite.BLL.Works ws = new LearnSite.BLL.Works(); DDLstore.DataSource = ws.ShowCircleWorksSelect(Sgrade, Sclass, Cid, Mid, Wscore); DDLstore.DataTextField = "Sname"; DDLstore.DataValueField = "Wurl"; DDLstore.DataBind(); int curindex = Int32.Parse(lbcurindex.Text); if (DDLstore.Items.Count > 0) { int allindex = DDLstore.Items.Count - 1; if (curindex == allindex) { lbcurindex.Text = "0"; } if (curindex < allindex) { DDLstore.SelectedIndex = curindex; } } } }
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); }
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 ShowWork() { string Wfiletype, Wurl; string Wid = Request.QueryString["Wid"].ToString(); if (LearnSite.Common.WordProcess.IsNum(Wid)) { LearnSite.Model.Works wmodel = new LearnSite.Model.Works(); LearnSite.BLL.Works ws = new LearnSite.BLL.Works(); wmodel = ws.GetModel(Int32.Parse(Wid)); string workfilename = wmodel.Wfilename; WorkSnum = wmodel.Wnum; Wurl = wmodel.Wurl; Wfiletype = wmodel.Wtype; int worklength = wmodel.Wlength.Value; decimal kblen = worklength / 1024; LbWscore.Text = wmodel.Wscore.ToString(); LbWfscore.Text = wmodel.Wfscore.ToString(); LabelWdate.Text = wmodel.Wdate.ToString(); LbWself.Text = HttpUtility.HtmlDecode(wmodel.Wself); LbWdscore.Text = wmodel.Wdscore.ToString(); bool Wflash = wmodel.Wflash.Value; DateTime workdate = wmodel.Wdate.Value; TimeSpan ts = DateTime.Now - workdate; int days = Int32.Parse(LearnSite.Common.XmlHelp.GetWorkDowntime());//获取作品查看天数 int wgrade = wmodel.Wgrade.Value; int wterm = wmodel.Wterm.Value; string Wip = wmodel.Wip; ShowSelf(Int32.Parse(Wid), WorkSnum); ShowFeedback(Int32.Parse(Wid)); ShowGauge(wmodel.Wmid.Value); LearnSite.BLL.Students stbll = new LearnSite.BLL.Students(); string mySname = stbll.GetSnameBySnum(WorkSnum); if (mySname != "") { HLfile.Text = mySname + "." + Wfiletype; } else { HLfile.Text = "模拟学生" + WorkSnum + "." + Wfiletype; } Labelsize.Text = kblen.ToString("N2") + "kb"; Labelgood.Text = "推荐" + LearnSite.Common.WordProcess.StrCountNew(MyFeedback, "T,").ToString() + "次"; Labelwid.Text = Wid; Labeltype.Text = Wfiletype; Labelwurl.Text = Wurl; if (isOffice(Wfiletype)) { if (ws.ExistsMyMissonWork(wmodel.Wmid.Value, cook.Snum)) { Buttonpreview.Visible = true;//是office文档则显示预览查看按钮,以防止因为控件下载而卡页面 } else { Buttonpreview.Visible = false;//如果未交作品的,则无法查看 } } else { Buttonpreview.Visible = false;//不是office文档则直接预览 Literal1.Text = LearnSite.Common.WordProcess.SelectEvaluateShow(Wid, Wfiletype, Wurl, false); } ImageType.ImageUrl = "~/Images/FileType/" + Wfiletype.ToLower() + ".gif"; if (ts.Days < days) { int waitdays = days - ts.Days; if (LearnSite.Common.XmlHelp.GetWorkIpLimit())///如果作品提交IP限制 { if (cook.Snum == WorkSnum && cook.LoginIp == Wip) { HLfile.Visible = true; } else { HLfile.Visible = false; Labelmsg.Text = waitdays.ToString() + "天后可下载"; } } else { if (cook.Snum == WorkSnum) { HLfile.Visible = true; } else { HLfile.Visible = false;//否则 IP没限制或IP不同则限制几天后下载 Labelmsg.Text = waitdays.ToString() + "天后可下载"; } } } else { if (cook.Sgrade == wgrade && cook.ThisTerm == wterm) { if (cook.Snum == WorkSnum) { HLfile.Visible = true;//本学期的作品自己可见,别人不可下载 } else { HLfile.Visible = false;//如果是本学期的作品,则无法下载,呵呵 Labelmsg.Text = "隐藏下载"; Labelmsg.ToolTip = "该作品在版权保护期内,暂时无法下载."; } } else { HLfile.Visible = true;//超过,都可下载 } } HLfile.NavigateUrl = "~/Plugins/download.aspx?Id=" + LearnSite.Common.EnDeCode.Encrypt(Wurl, "ls"); LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); Labelmission.Text = mbll.GetMissionTitle(wmodel.Wmid.Value); } }