private void ShowMission() { string Mid = Request.QueryString["Mid"].ToString(); 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) { string sWcid = model.Mcid.ToString(); string sWmid = Mid; string sWmsort = model.Msort.ToString(); string sWfiletype = model.Mfiletype; LabelMtitle.Text = model.Mtitle; Mcontents.InnerHtml = HttpUtility.HtmlDecode(model.Mcontent); LabelMdate.Text = model.Mdate.Value.ToShortDateString(); LabelMfiletype.Text = sWfiletype; CkMupload.Checked = model.Mupload; CkMgroup.Checked = model.Mgroup; ImageType.ImageUrl = "~/Images/FileType/" + LabelMfiletype.Text.ToLower() + ".gif"; } else { Mcontents.InnerHtml = "此学案活动不存在!"; } } }
private void showmission() { string Mcid = Request.QueryString["Mcid"].ToString(); string Mid = Request.QueryString["Mid"].ToString(); 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) { LabelMtitle.Text = model.Mtitle; Mcontent.InnerHtml = HttpUtility.HtmlDecode(model.Mcontent); string sburl = model.Mexample; Hlexample.NavigateUrl = sburl; Hlexample.Text = LearnSite.Common.WordProcess.getshortfname(sburl); CheckPublish.Checked = model.Mpublish; CheckMicoWorld.Checked = model.Microworld; LabelMdate.Text = model.Mdate.ToString(); LabelMfiletype.Text = model.Mfiletype; ImageType.ImageUrl = "~/Images/FileType/" + LabelMfiletype.Text.ToLower() + ".gif"; int Mgid = model.Mgid.Value; if (Mgid != 0) { HLMgid.NavigateUrl = "~/Teacher/GaugeItem.aspx?Gid=" + Mgid.ToString(); } } }
private void showmission() { string Mcid = Request.QueryString["Mcid"].ToString(); string Mid = Request.QueryString["Mid"].ToString(); 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) { LabelMtitle.Text = model.Mtitle; CheckPublish.Checked = model.Mpublish; Mcontent.InnerHtml = HttpUtility.HtmlDecode(model.Mcontent); LabelMdate.Text = model.Mdate.ToString(); LabelMfiletype.Text = model.Mfiletype; ImageType.ImageUrl = "~/Images/FileType/" + LabelMfiletype.Text.ToLower() + ".gif"; CkMupload.Checked = model.Mupload; CheckGroup.Checked = model.Mgroup; int Mgid = model.Mgid.Value; if (Mgid != 0) { HLMgid.NavigateUrl = "~/Teacher/GaugeItem.aspx?Gid=" + Mgid.ToString(); } } }
private void ShowMission() { string Mid = Request.QueryString["Mid"].ToString(); 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) { LabelMtitle.Text = model.Mtitle; Mcontent.InnerHtml = HttpUtility.HtmlDecode(model.Mcontent); string exampleurl = model.Mexample; string ext = LearnSite.Common.WordProcess.getext(exampleurl); if (!ext.Contains("sb")) { BtnScratch.Visible = false; Labelmsg.Text = ext + "请检查学案的实例是否为Scratch格式(sb,sb2,sbx)"; } } else { Mcontent.InnerHtml = "此学案活动不存在!"; } } }
private void ReadMtitle() { if (Request.QueryString["Mi"] != null) { int Mid = Int32.Parse(Request.QueryString["Mi"].ToString()); LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); LabeMtitle.Text = "〖" + mbll.GetMissionTitle(Mid) + "〗"; } }
private void ListMission() { string Cid = Request.QueryString["Cid"].ToString(); if (LearnSite.Common.WordProcess.IsNum(Cid)) { LearnSite.BLL.Mission mn = new LearnSite.BLL.Mission(); GVmission.DataSource = mn.GetListMission(Int32.Parse(Cid)); GVmission.DataBind(); } }
protected void ButtonDel_Click(object sender, EventArgs e) { int Mid =Int32.Parse( Request.QueryString["Mid"]); LearnSite.BLL.Mission missionbll = new LearnSite.BLL.Mission(); missionbll.Delete(Mid); System.Threading.Thread.Sleep(1000); string Mcid = Request.QueryString["Mcid"].ToString(); string url = "~/Teacher/courseshow.aspx?Cid=" + Mcid; Response.Redirect(url, 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; } } }
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; } }
private void ShowUploadMsort() { string dcid = Request.QueryString["Cid"].ToString();//直接url传递 if (dcid != "") { LearnSite.BLL.Mission bll = new LearnSite.BLL.Mission(); DDLmid.DataSource = bll.GetUploadMidMtitle(Int32.Parse(dcid)); DDLmid.DataTextField = "Mstitle"; DDLmid.DataValueField = "Mid"; DDLmid.DataBind(); } }
private void ShowUploadMsort() { string dcid = DDLCid.SelectedValue; if (dcid != "") { LearnSite.BLL.Mission bll = new LearnSite.BLL.Mission(); DDLmid.DataSource = bll.GetUploadMidMtitle(Int32.Parse(dcid)); DDLmid.DataTextField = "Mstitle"; DDLmid.DataValueField = "Mid"; DDLmid.DataBind(); } }
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 ShowLessonDetails() { int Cid =Int32.Parse( Request.QueryString["Cid"].ToString()); LearnSite.BLL.Courses csbll = new LearnSite.BLL.Courses(); Repeater1.DataSource = csbll.GetCourseDetail(Cid); Repeater1.DataBind(); LearnSite.BLL.Mission msbll = new LearnSite.BLL.Mission(); Repeater2.DataSource = msbll.GetMissionDetails(Cid); Repeater2.DataBind(); LearnSite.BLL.Flection fcbll = new LearnSite.BLL.Flection(); Repeater3.DataSource = fcbll.GetListCid(Cid); Repeater3.DataBind(); }
private void showGroups() { if (Request.QueryString["Sg"] != null && Request.QueryString["Sc"] != null) { int sgrade = Int32.Parse(Request.QueryString["Sg"].ToString()); int sclass = Int32.Parse(Request.QueryString["Sc"].ToString()); LearnSite.BLL.Students sbll = new LearnSite.BLL.Students(); DLgroups.DataSource = sbll.ClassGroup(sgrade, sclass); DLgroups.DataBind(); int mid = Int32.Parse(Request.QueryString["Mi"].ToString()); LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); LabeMtitle.Text = "《" + mbll.GetMissionTitle(mid) + "》" + sgrade.ToString() + "." + sclass.ToString() + "班小组作品展示"; } }
private void ShowLessonDetails() { int Cid = Int32.Parse(Request.QueryString["Cid"].ToString()); LearnSite.BLL.Courses csbll = new LearnSite.BLL.Courses(); Repeater1.DataSource = csbll.GetCourseDetail(Cid); Repeater1.DataBind(); LearnSite.BLL.Mission msbll = new LearnSite.BLL.Mission(); Repeater2.DataSource = msbll.GetMissionDetails(Cid); Repeater2.DataBind(); LearnSite.BLL.Flection fcbll = new LearnSite.BLL.Flection(); Repeater3.DataSource = fcbll.GetListCid(Cid); Repeater3.DataBind(); }
protected void Btnadd_Click(object sender, EventArgs e) { string fckstr = FCKeditor1.Value; if (Texttitle.Text != "" && fckstr != "") { if (Request.QueryString["Mcid"] != null) { string serverUrl = LearnSite.Common.WordProcess.ServerUrl(); fckstr = fckstr.Replace(serverUrl, ""); int Mcid = Int32.Parse(Request.QueryString["Mcid"].ToString()); int Msort = Int32.Parse(DDLsort.SelectedValue); LearnSite.BLL.Mission missionbll = new LearnSite.BLL.Mission(); if (!missionbll.MsortExists(Mcid, Msort)) { LearnSite.Model.Mission mission = new LearnSite.Model.Mission(); mission.Mcid = Mcid; mission.Mtitle = Texttitle.Text.Trim(); mission.Msort = Msort; mission.Mupload = CheckUpload.Checked; mission.Mpublish = CheckPublish.Checked; mission.Mcontent = HttpUtility.HtmlEncode(fckstr); mission.Mfiletype = DDLmfiletype.SelectedValue; mission.Mdate = DateTime.Now; mission.Mhit = 0; missionbll.Add(mission); Texttitle.Text = ""; FCKeditor1.Value = ""; System.Threading.Thread.Sleep(1000); Labelmsg.Text = "添加课程活动成功"; string url = "~/Teacher/courseshow.aspx?Cid=" +Mcid.ToString(); Response.Redirect(url, false); } else { Labelmsg.Text = "该课程活动序号已经存在,请重新选择"; } } } else { Labelmsg.Text = "内容及标题不能为空!"; } }
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 ShowMission() { string Mid = Request.QueryString["Mid"].ToString(); 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) { LabelMtitle.Text = model.Mtitle; Mcontent.InnerHtml = HttpUtility.HtmlDecode(model.Mcontent); } else { Mcontent.InnerHtml = "此学案活动不存在!"; } } }
private void missionview() { if (Request.QueryString["Mid"] != null) { int Mid = Int32.Parse(Request.QueryString["Mid"].ToString()); LearnSite.Model.Mission mission = new LearnSite.Model.Mission(); LearnSite.BLL.Mission missionbll = new LearnSite.BLL.Mission(); mission = missionbll.GetModel(Mid); mcontent.InnerText = HttpUtility.HtmlDecode(mission.Mcontent); DDLmfiletype.SelectedValue = mission.Mfiletype; CheckPublish.Checked = mission.Mpublish; Texttitle.Text = mission.Mtitle; CheckUpload.Checked = mission.Mupload; CheckGroup.Checked = mission.Mgroup; string mgid = mission.Mgid.ToString(); if (DDLMgid.Items.FindByValue(mgid) != null) { DDLMgid.SelectedValue = mgid; } } }
protected void Btnedit_Click(object sender, EventArgs e) { string fckstr = FCKeditor1.Value; if (Texttitle.Text != "" && fckstr != "") { if (Request.QueryString["Mcid"] != null && Request.QueryString["Mid"] != null) { string serverUrl = LearnSite.Common.WordProcess.ServerUrl(); fckstr = fckstr.Replace(serverUrl, ""); string Mcid = Request.QueryString["Mcid"].ToString(); string Mid = Request.QueryString["Mid"].ToString(); LearnSite.Model.Mission mission = new LearnSite.Model.Mission(); mission.Mid = Int32.Parse(Mid); mission.Mtitle = Texttitle.Text.Trim(); mission.Msort = Int32.Parse(DDLsort.SelectedValue); mission.Mupload = CheckUpload.Checked; mission.Mpublish = CheckPublish.Checked; mission.Mcontent = HttpUtility.HtmlEncode(fckstr); mission.Mfiletype = DDLmfiletype.SelectedValue; mission.Mdate = DateTime.Now; mission.Mhit = 0; LearnSite.BLL.Mission missionbll = new LearnSite.BLL.Mission(); missionbll.Update(mission); Texttitle.Text = ""; FCKeditor1.Value = ""; System.Threading.Thread.Sleep(1000); Labelmsg.Text = "添加活动成功"; string url = "~/Teacher/missionshow.aspx?Mcid=" + Mcid + "&Mid=" + Mid; Response.Redirect(url, false); } else { Labelmsg.Text = "取不到活动编号Mid!"; } } else { Labelmsg.Text = "内容及标题不能为空!"; } }
private void showcourse(string Cid) { if (LearnSite.Common.WordProcess.IsNum(Cid)) { LearnSite.Model.Courses model = new LearnSite.Model.Courses(); LearnSite.BLL.Courses cs = new LearnSite.BLL.Courses(); model = cs.GetModel(Int32.Parse(Cid)); if (model != null) { LabelCtitle.Text = model.Ctitle; LabelCdate.Text = model.Cdate.ToString(); LabelCclass.Text = model.Cclass; LabelCobj.Text = model.Cobj.ToString(); LabelCterm.Text = model.Cterm.ToString(); LabelCks.Text = model.Cks.ToString(); Ccontent.InnerHtml = HttpUtility.HtmlDecode(model.Ccontent); LearnSite.BLL.Mission mission = new LearnSite.BLL.Mission(); GVmission.DataSource = mission.GetMissions(Int32.Parse(Cid)); GVmission.DataBind(); } } }
private void showmission() { string Mcid = Request.QueryString["Mcid"].ToString(); string Mid = Request.QueryString["Mid"].ToString(); 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) { LabelMtitle.Text = model.Mtitle; LabelMcid.Text = model.Mcid.ToString(); Mcontent.InnerHtml = HttpUtility.HtmlDecode(model.Mcontent); LabelMdate.Text = model.Mdate.ToString(); LabelMfiletype.Text = model.Mfiletype; ImageType.ImageUrl = "~/Images/FileType/" + LabelMfiletype.Text.ToLower() + ".gif"; CheckBoxMupload.Checked = model.Mupload; LabelMsort.Text = model.Msort.ToString(); GVmission.DataSource = mn.GetMissions(Int32.Parse(Mcid)); GVmission.DataBind(); } }
private void missionview() { if (Request.QueryString["Mid"] != null) { int Mid = Int32.Parse(Request.QueryString["Mid"].ToString()); LearnSite.Model.Mission mission = new LearnSite.Model.Mission(); LearnSite.BLL.Mission missionbll = new LearnSite.BLL.Mission(); mission = missionbll.GetModel(Mid); CheckPublish.Checked = mission.Mpublish; Texttitle.Text = mission.Mtitle; mcontent.InnerText = HttpUtility.HtmlDecode(mission.Mcontent); string sburl = mission.Mexample; CheckMicoWorld.Checked = mission.Microworld; string filename = LearnSite.Common.WordProcess.getshortfname(sburl); HlExample.Text = filename; HlExample.NavigateUrl = sburl; string mgid = mission.Mgid.ToString(); if (DDLMgid.Items.FindByValue(mgid) != null) { DDLMgid.SelectedValue = mgid; } } }
private void uploadgroupwork() { if (Request.Files["Filedata"] != null) { try { // Get the data HttpPostedFile group_upload = Request.Files["Filedata"]; string Gtype = group_upload.FileName.Substring(group_upload.FileName.LastIndexOf(".") + 1).ToLower(); string Gmid = Request.QueryString["mid"].ToString(); string Gnum = Request.QueryString["num"].ToString(); string info = HttpUtility.UrlDecode(Request.QueryString["info"].ToString()); LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); LearnSite.Model.Mission mmodel = new LearnSite.Model.Mission(); mmodel = mbll.GetModel(Int32.Parse(Gmid)); // string Gextention = mmodel.Mfiletype; string Gcid = mmodel.Mcid.ToString(); //Syear | Sgrade | Sclass | Sid | Sname | Wip | Sterm | LoginTime string[] infoarray = info.Split('|'); string Ggroup = infoarray[3];//取组长 string Gyear = infoarray[0]; string Ggrade = infoarray[1]; string Gclass = infoarray[2]; string Gip = infoarray[5]; string LoginTime = infoarray[7]; string Gterm = infoarray[6]; LearnSite.BLL.Signin sn = new LearnSite.BLL.Signin(); LearnSite.Model.Signin qmodel = sn.GetModelm(Gnum); if (qmodel != null) { Gyear = qmodel.Qsyear.ToString(); Ggrade = qmodel.Qgrade.ToString(); Gclass = qmodel.Qclass.ToString(); Gip = qmodel.Qip; LoginTime = qmodel.Qdate.ToString(); Gterm = qmodel.Qterm.ToString(); } int Glengh = group_upload.ContentLength; DateTime Gdate = DateTime.Now; LearnSite.BLL.GroupWork gbll = new LearnSite.BLL.GroupWork(); bool gdone = gbll.DoneGroupWork(Gnum, Int32.Parse(Gmid)); string MySavePath = LearnSite.Common.WorkUpload.GetWurl(Gyear, Ggrade, Gclass, Gcid, Gmid);//获得作品保存路径(如果不存在,自动创建) string NewFileName = "g" + Gnum + Gcid + "_" + Gmid + "." + Gtype; string Gurl = MySavePath + "/" + NewFileName; string saveFilename = Server.MapPath(Gurl); //如果作品未提交,提交作品 if (!gdone) { int Gtime = LearnSite.Common.Computer.TimePassed(); LearnSite.Model.GroupWork gmodel = new LearnSite.Model.GroupWork(); gmodel.Gcheck = false; gmodel.Gcid = Int32.Parse(Gcid); gmodel.Gclass = Int32.Parse(Gclass); gmodel.Gdate = DateTime.Now; gmodel.Gfilename = NewFileName; gmodel.Ggrade = Int32.Parse(Ggrade); gmodel.Ghit = 0; gmodel.Gip = Gip; gmodel.Glengh = Glengh; gmodel.Gmid = Int32.Parse(Gmid); gmodel.Gnote = ""; gmodel.Gnum = Gnum; gmodel.Grank = -1; gmodel.Gscore = 0; LearnSite.BLL.Students sbll = new LearnSite.BLL.Students(); gmodel.Gstudents = sbll.GroupSnum(Gnum); gmodel.Gterm = Int32.Parse(Gterm); gmodel.Gtime = Gtime; gmodel.Gtype = Gtype; gmodel.Gurl = Gurl; gmodel.Gvote = 0; gmodel.Ggroup = Int32.Parse(Ggroup); gbll.Add(gmodel);//添加小组作品提交记录 } else { //已交则不更新记录 } try { group_upload.SaveAs(saveFilename);//保存提交作品 Response.StatusCode = 200; Response.Write(NewFileName); } catch (Exception ex) { Response.StatusCode = 200; Response.Write(ex); } } catch (Exception ex) { Response.StatusCode = 200; Response.Write(ex); } finally { Response.End(); } } }
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(); }
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 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 = "内容及标题不能为空!"; } }
private void ShowWork() { string Studentnum = Request.Cookies["StudentCookies"].Values["Snum"].ToString(); string Wfilename, Wfiletype, Wurl, Wip; 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)); LabelWnum.Text = wmodel.Wnum; Wfilename = wmodel.Wfilename; Wurl = wmodel.Wurl; Wfiletype = LearnSite.Common.FileDown.FileNameExtension(Wurl); string typestr = Wfiletype.Substring(1, Wfiletype.Length - 1); ImageType.ImageUrl = "~/Images/FileType/" + typestr.ToLower() + ".gif"; Labelself.Text = HttpUtility.HtmlDecode(wmodel.Wself); Labelsdate.Text = wmodel.Wdate.ToString(); Labellength.Text = wmodel.Wlength.ToString() + "字节"; Labelfilename.Text = wmodel.Wfilename; LabelWscore.Text = wmodel.Wscore.ToString()+"分"; Wip = wmodel.Wip; TimeSpan ts = DateTime.Now - DateTime.Parse(Labelsdate.Text); Labelspan.Text = ts.Days.ToString() + " 天 "; Session[Studentnum+"Wurl"] = Wurl; string worknum = wmodel.Wnum; string LoginIp = Request.Cookies["StudentCookies"].Values["LoginIp"].ToString(); int days =Int32.Parse( LearnSite.Common.XmlHelp.GetWorkDowntime());//获取作品查看天数 HyperLinkreturn.NavigateUrl = "~/Student/myvote.aspx?Wid=" + Wid + "&Wcid=" + wmodel.Wcid.ToString() + "&Wmsort="+wmodel.Wmsort.ToString(); LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); Labelmission.Text = mbll.GetMissionTitle(wmodel.Wmid.Value); if (Wip == LoginIp && worknum==Studentnum) { LBtnfile.Visible = true; if (Labelself.Text != "") { Btnword.Text = "修改自评"; } else { Btnword.Text = "添加自评"; } } else { if (ts.Days > days) { Btnword.Text = "添加互评"; LBtnfile.Visible = true; } else { Labelmsg.Text = days.ToString()+"天后可查看"; LBtnfile.Visible = false; } } //Labelmsg.Text = Wurl; } }
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 ShowMission() { string Mid = Request.QueryString["Mid"].ToString(); 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) { LabelMtitle.Text = model.Mtitle; LabelMcid.Text = model.Mcid.ToString(); Mcontent.InnerHtml = HttpUtility.HtmlDecode(model.Mcontent); LabelMdate.Text = model.Mdate.ToString(); LabelMfiletype.Text = model.Mfiletype; CheckBoxMupload.Checked = model.Mupload; LabelMsort.Text = model.Msort.ToString(); Btnupload.Enabled = model.Mupload; if (LabelMfiletype.Text == "html") { Labelmsg.Text = "远程网站连接设置"; string ftpstr = "ftp://" + LearnSite.Common.Computer.GetServerIp(); TextFtp.Text = ftpstr; string userstr = Request.Cookies["StudentCookies"].Values["Snum"].ToString(); TextUser.Text = userstr; string pwdstr = Request.Cookies["StudentCookies"].Values["Ftppwd"].ToString(); TextPwd.Text = pwdstr; PanelFtp.Visible = true; Panelworks.Visible = false; } else { if (!CheckBoxMupload.Checked) { Panelworks.Visible = false; } } ImageType.ImageUrl = "~/Images/FileType/"+LabelMfiletype.Text.ToLower()+".gif"; } else { Mcontent.InnerHtml = "此课程活动不存在!"; } } }
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 = "内容及标题不能为空!"; } }
private void uploadgroupwork() { HttpPostedFile group_upload = Request.Files["imgFilegroup"]; int maxSize = 104857600;//定义上传最大值为100MB if (group_upload != null) { // Get the data string Gtype = group_upload.FileName.Substring(group_upload.FileName.LastIndexOf(".") + 1).ToLower(); string Gmid = Request.QueryString["mid"].ToString(); string Gnum = Request.QueryString["num"].ToString(); LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); LearnSite.Model.Mission mmodel = new LearnSite.Model.Mission(); mmodel = mbll.GetModel(Int32.Parse(Gmid)); string Gextention = mmodel.Mfiletype; string Gcid = mmodel.Mcid.ToString(); string limitext = Gextention;//初始化,随意 switch (Gextention) { case "doc": limitext = "*.doc;*.docx"; break; case "ppt": limitext = "*.ppt;*.pptx"; break; case "xls": limitext = "*.xls;*.xlsx"; break; case "office": limitext = "*.doc;*.docx;*.ppt;*.pptx;*.xls;*.xlsx"; break; case "sb": limitext = "*.sb;*.sb2"; break; default: limitext = "*." + Gextention; break; } if (Gtype == Gextention || limitext.Contains(Gtype)) { if (group_upload.InputStream != null || group_upload.InputStream.Length < maxSize) { LearnSite.BLL.Signin sn = new LearnSite.BLL.Signin(); LearnSite.Model.Signin qmodel = sn.GetModelm(Gnum); LearnSite.Model.Cook cook = new LearnSite.Model.Cook(); string Ggroup = cook.Sid.ToString();//取组长 string Gyear = cook.Syear.ToString(); string Ggrade = cook.Sgrade.ToString(); string Gclass = cook.Sclass.ToString(); string Gip = cook.LoginIp; string LoginTime = cook.LoginTime; string Gterm = cook.ThisTerm.ToString(); if (qmodel != null) { Gyear = qmodel.Qsyear.ToString(); Ggrade = qmodel.Qgrade.ToString(); Gclass = qmodel.Qclass.ToString(); Gip = qmodel.Qip; LoginTime = qmodel.Qdate.ToString(); Gterm = qmodel.Qterm.ToString(); } int Glengh = group_upload.ContentLength; DateTime Gdate = DateTime.Now; LearnSite.BLL.GroupWork gbll = new LearnSite.BLL.GroupWork(); bool gdone = gbll.DoneGroupWork(Gnum, Int32.Parse(Gmid)); string MySavePath = LearnSite.Common.WorkUpload.GetWurl(Gyear, Ggrade, Gclass, Gcid, Gmid);//获得作品保存路径(如果不存在,自动创建) string NewFileName = "g" + Gnum + Gcid + "_" + Gmid + "." + Gtype; string Gurl = MySavePath + "/" + NewFileName; string saveFilename = Server.MapPath(Gurl); //如果作品未提交,提交作品 if (!gdone) { int Gtime = LearnSite.Common.Computer.TimePassed(); LearnSite.Model.GroupWork gmodel = new LearnSite.Model.GroupWork(); gmodel.Gcheck = false; gmodel.Gcid = Int32.Parse(Gcid); gmodel.Gclass = Int32.Parse(Gclass); gmodel.Gdate = DateTime.Now; gmodel.Gfilename = NewFileName; gmodel.Ggrade = Int32.Parse(Ggrade); gmodel.Ghit = 0; gmodel.Gip = Gip; gmodel.Glengh = Glengh; gmodel.Gmid = Int32.Parse(Gmid); gmodel.Gnote = ""; gmodel.Gnum = Gnum; gmodel.Grank = -1; gmodel.Gscore = 0; LearnSite.BLL.Students sbll = new LearnSite.BLL.Students(); gmodel.Gstudents = sbll.GroupSnum(Gnum); gmodel.Gterm = Int32.Parse(Gterm); gmodel.Gtime = Gtime; gmodel.Gtype = Gtype; gmodel.Gurl = Gurl; gmodel.Gvote = 0; gmodel.Ggroup = Int32.Parse(Ggroup); gbll.Add(gmodel);//添加小组作品提交记录 } else { //已交则不更新记录 } group_upload.SaveAs(saveFilename);//保存或更新提交作品 Hashtable hash = new Hashtable(); hash["error"] = 0; Response.AddHeader("Content-Type", "text/html; charset=UTF-8"); Response.Write(JsonMapper.ToJson(hash)); Response.End(); } else { showError("选择的文件大小超过限制!(最大为10MB)"); } } else { showError("选择的文件类型错误!"); } } else { showError("请选择文件!"); } }
private void uploadthiswork() { if (Request.Files["Filedata"] != null) { try { HttpPostedFile work_upload = Request.Files["Filedata"]; string Wmid = Request.QueryString["mid"].ToString(); string Wnum = Request.QueryString["num"].ToString(); string info = HttpUtility.UrlDecode(Request.QueryString["info"].ToString()); LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); LearnSite.Model.Mission mmodel = new LearnSite.Model.Mission(); mmodel = mbll.GetModel(Int32.Parse(Wmid)); string Wcid = mmodel.Mcid.ToString(); string Wmsort = mmodel.Msort.ToString(); string Wfiletype = work_upload.FileName.Substring(work_upload.FileName.LastIndexOf(".") + 1).ToLower(); // string Wextention = mmodel.Mfiletype; int Wlength = work_upload.ContentLength; //Syear | Sgrade | Sclass | Sid | Sname | Wip | Sterm | LoginTime string[] infoarray = info.Split('|'); string Syear = infoarray[0]; string Sgrade = infoarray[1]; string Sclass = infoarray[2]; string Wsid = infoarray[3]; string Sname = infoarray[4]; string Wip = infoarray[5]; string Wterm = infoarray[6]; string Logintime = infoarray[7]; DateTime Wdate = DateTime.Now; bool checkcan = true; LearnSite.BLL.Works ws = new LearnSite.BLL.Works(); string Wid = ws.WorkDone(Wnum, Int32.Parse(Wcid), Int32.Parse(Wmid));//返回空字符表示不存在该记录 if (Wid != "") { if (!ws.IsChecked(Int32.Parse(Wid))) { //如果未评价,则重新提交修改作品 string MySavePath = LearnSite.Common.WorkUpload.GetWurl(Syear, Sgrade, Sclass, Wcid, Wmid);//获得作品保存路径(如果不存在,自动创建) string RndTime = LearnSite.Common.WordProcess.GetRandomNum(99).ToString(); string OnlyFileName = Wnum + "_" + Wcid + "_" + Wmid + "_" + RndTime; string NewFileName = OnlyFileName + "." + Wfiletype; string Wurl = MySavePath + "/" + NewFileName; string resaveFilename = Server.MapPath(Wurl); try { ws.UpdateWorkUp(Int32.Parse(Wid), Wurl, NewFileName, Wlength, Wdate, checkcan, "");//更新Wfilename, Wurl,Wlength, Wdate //LearnSite.BLL.Signin sn = new LearnSite.BLL.Signin(); //sn.UpdateQwork(Int32.Parse(Wsid), Int32.Parse(Wcid));//更新今天签到表中的作品数量 work_upload.SaveAs(resaveFilename);//保存提交作品 Response.StatusCode = 200; Response.Write(NewFileName); } catch (Exception ex) { Response.StatusCode = 200; Response.Write(ex); } finally { Response.End(); } } else { Response.StatusCode = 200; Response.Write("老师已经评价了!"); Response.End(); } } else { //如果作品未提交,提交作品(Wnum, Wcid,Wmid,Wmsort, Wfilename, Wurl,Wlength, Wdate, Wip, Wtime) string MySavePath = LearnSite.Common.WorkUpload.GetWurl(Syear, Sgrade, Sclass, Wcid, Wmid);//获得作品保存路径(如果不存在,自动创建) string RndTime = LearnSite.Common.WordProcess.GetRandomNum(99).ToString(); string OnlyFileName = Wnum + "_" + Wcid + "_" + Wmid + "_" + RndTime; string NewFileName = OnlyFileName + "." + Wfiletype; string Wurl = MySavePath + "/" + NewFileName; string Wtime = LearnSite.Common.Computer.TimePassed(Logintime).ToString(); LearnSite.Model.Works wmodel = new LearnSite.Model.Works(); wmodel.Wnum = Wnum; wmodel.Wcid = Int32.Parse(Wcid); wmodel.Wmid = Int32.Parse(Wmid); wmodel.Wmsort = Int32.Parse(Wmsort); wmodel.Wfilename = NewFileName; wmodel.Wtype = Wfiletype; wmodel.Wurl = Wurl; wmodel.Wlength = Wlength; wmodel.Wdate = Wdate; wmodel.Wip = Wip; wmodel.Wtime = Wtime; wmodel.Wcan = checkcan; wmodel.Wcheck = false; wmodel.Wegg = 12;//设定票数为12张 wmodel.Whit = 0; wmodel.Wgrade = Int32.Parse(Sgrade); wmodel.Wterm = Int32.Parse(Wterm); wmodel.Wsid = Int32.Parse(Wsid); wmodel.Wclass = Int32.Parse(Sclass); wmodel.Wname = HttpUtility.UrlDecode(Sname); wmodel.Wyear = Int32.Parse(Syear); switch (Wfiletype) { case "doc": case "ppt": case "xls": case "docx": case "pptx": case "xlsx": case "wps": case "dps": case "et": wmodel.Woffice = true; break; default: wmodel.Woffice = false; break; } wmodel.Wflash = false; wmodel.Werror = false; string saveFilename = Server.MapPath(Wurl); try { ws.AddWorkUp(wmodel); //添加作品提交记录 LearnSite.BLL.Signin sn = new LearnSite.BLL.Signin(); sn.UpdateQwork(Int32.Parse(Wsid), Int32.Parse(Wcid)); //更新今天签到表中的作品数量 work_upload.SaveAs(saveFilename); //保存提交作品 Response.StatusCode = 200; Response.Write(NewFileName); } catch (Exception ex) { Response.StatusCode = 200; Response.Write(ex); } finally { Response.End(); } } } catch (Exception ex) { Response.StatusCode = 200; Response.Write(ex); } finally { Response.End(); } } }
private void missionview() { if (Request.QueryString["Mid"] != null) { int Mid = Int32.Parse(Request.QueryString["Mid"].ToString()); LearnSite.Model.Mission mission = new LearnSite.Model.Mission(); LearnSite.BLL.Mission missionbll = new LearnSite.BLL.Mission(); mission = missionbll.GetModel(Mid); FCKeditor1.Value = HttpUtility.HtmlDecode(mission.Mcontent); DDLmfiletype.SelectedValue = mission.Mfiletype; CheckPublish.Checked = mission.Mpublish; DDLsort.SelectedValue = mission.Msort.ToString(); Texttitle.Text = mission.Mtitle; CheckUpload.Checked = mission.Mupload; } }
private void GetMsort() { int Mcid = Int32.Parse(Request.QueryString["Cid"].ToString()); LearnSite.BLL.Mission mission = new LearnSite.BLL.Mission(); DDLmission.DataSource = mission.GetMsort(Mcid); DDLmission.DataTextField = "Msort"; DDLmission.DataValueField = "Msort"; DDLmission.DataBind(); string Hid = Request.Cookies["TeacherCookies"].Values["Hid"].ToString(); if (Session[Hid+"mission"] != null) { DDLmission.SelectedValue = Session[Hid+"mission"].ToString(); } }
private void uploadthiswork() { HttpPostedFile work_upload = Request.Files["imgFile"]; int maxSize = 104857600;//定义上传最大值为100MB if (work_upload != null) { string Wmid = Request.QueryString["mid"].ToString(); string Wnum = Request.QueryString["num"].ToString(); LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); LearnSite.Model.Mission mmodel = new LearnSite.Model.Mission(); mmodel = mbll.GetModel(Int32.Parse(Wmid)); string Wcid = mmodel.Mcid.ToString(); string Wmsort = mmodel.Msort.ToString(); string Wfiletype = work_upload.FileName.Substring(work_upload.FileName.LastIndexOf(".") + 1).ToLower(); string Wextention = mmodel.Mfiletype; string limitext = Wextention;//初始化,随意 switch (Wextention) { case "doc": limitext = "*.doc;*.docx"; break; case "ppt": limitext = "*.ppt;*.pptx"; break; case "xls": limitext = "*.xls;*.xlsx"; break; case "office": limitext = "*.doc;*.docx;*.ppt;*.pptx;*.xls;*.xlsx"; break; case "sb": limitext = "*.sb;*.sb2"; break; default: limitext = "*." + Wextention; break; } if (Wfiletype == Wextention || limitext.Contains(Wfiletype)) { if (work_upload.InputStream != null || work_upload.InputStream.Length < maxSize) { int Wlength = work_upload.ContentLength; string Syear = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Syear"].ToString(); string Sgrade = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString(); string Sclass = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString(); string Wsid = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sid"].ToString(); string Wip = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["LoginIp"].ToString(); string Sname = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sname"].ToString(); string Wterm = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["ThisTerm"].ToString(); DateTime Wdate = DateTime.Now; bool checkcan = true; LearnSite.BLL.Works ws = new LearnSite.BLL.Works(); string Wid = ws.WorkDone(Wnum, Int32.Parse(Wcid), Int32.Parse(Wmid));//返回空字符表示不存在该记录 if (Wid != "") { if (!ws.IsChecked(Int32.Parse(Wid))) { //如果未评价,则重新提交修改作品 string MySavePath = LearnSite.Common.WorkUpload.GetWurl(Syear, Sgrade, Sclass, Wcid, Wmid);//获得作品保存路径(如果不存在,自动创建) string RndTime = LearnSite.Common.WordProcess.GetRandomNum(99).ToString(); string OnlyFileName = Wnum + "_" + Wcid + "_" + Wmid + "_" + RndTime; string NewFileName = OnlyFileName + "." + Wfiletype; string Wurl = MySavePath + "/" + NewFileName; string resaveFilename = Server.MapPath(Wurl); ws.UpdateWorkUp(Int32.Parse(Wid), Wurl, NewFileName, Wlength, Wdate, checkcan, ""); //更新Wfilename, Wurl,Wlength, Wdate LearnSite.BLL.Signin sn = new LearnSite.BLL.Signin(); sn.UpdateQwork(Int32.Parse(Wsid), Int32.Parse(Wcid)); //更新今天签到表中的作品数量 work_upload.SaveAs(resaveFilename); //保存提交作品 Hashtable hash = new Hashtable(); hash["error"] = 0; Response.AddHeader("Content-Type", "text/html; charset=UTF-8"); Response.Write(JsonMapper.ToJson(hash)); Response.End(); } else { showError("老师已经评价了!"); } } else { //如果作品未提交,提交作品(Wnum, Wcid,Wmid,Wmsort, Wfilename, Wurl,Wlength, Wdate, Wip, Wtime) string MySavePath = LearnSite.Common.WorkUpload.GetWurl(Syear, Sgrade, Sclass, Wcid, Wmid);//获得作品保存路径(如果不存在,自动创建) string RndTime = LearnSite.Common.WordProcess.GetRandomNum(99).ToString(); string OnlyFileName = Wnum + "_" + Wcid + "_" + Wmid + "_" + RndTime; string NewFileName = OnlyFileName + "." + Wfiletype; string Wurl = MySavePath + "/" + NewFileName; string Wtime = LearnSite.Common.Computer.TimePassed().ToString(); LearnSite.Model.Works wmodel = new LearnSite.Model.Works(); wmodel.Wnum = Wnum; wmodel.Wcid = Int32.Parse(Wcid); wmodel.Wmid = Int32.Parse(Wmid); wmodel.Wmsort = Int32.Parse(Wmsort); wmodel.Wfilename = NewFileName; wmodel.Wtype = Wextention; wmodel.Wurl = Wurl; wmodel.Wlength = Wlength; wmodel.Wdate = Wdate; wmodel.Wip = Wip; wmodel.Wtime = Wtime; wmodel.Wcan = checkcan; wmodel.Wcheck = false; wmodel.Wegg = 12;//设定票数为12张 wmodel.Whit = 0; wmodel.Wgrade = Int32.Parse(Sgrade); wmodel.Wterm = Int32.Parse(Wterm); wmodel.Wsid = Int32.Parse(Wsid); wmodel.Wclass = Int32.Parse(Sclass); wmodel.Wname = HttpUtility.UrlDecode(Sname); wmodel.Wyear = Int32.Parse(Syear); switch (Wfiletype) { case "doc": case "ppt": case "xls": case "docx": case "pptx": case "xlsx": case "wps": case "dps": case "et": wmodel.Woffice = true; break; default: wmodel.Woffice = false; break; } wmodel.Wflash = false; wmodel.Werror = false; string saveFilename = Server.MapPath(Wurl); ws.AddWorkUp(wmodel); //添加作品提交记录 LearnSite.BLL.Signin sn = new LearnSite.BLL.Signin(); sn.UpdateQwork(Int32.Parse(Wsid), Int32.Parse(Wcid)); //更新今天签到表中的作品数量 work_upload.SaveAs(saveFilename); //保存提交作品 Hashtable hash = new Hashtable(); hash["error"] = 0; Response.AddHeader("Content-Type", "text/html; charset=UTF-8"); Response.Write(JsonMapper.ToJson(hash)); Response.End(); } } else { showError("选择的文件大小超过限制!(最大为100MB)"); } } else { showError("选择的文件类型错误!"); } } else { showError("请选择文件!"); } }
private void ShowIpWorkDone() { string Sname = cook.Sname; int Sgrade = cook.Sgrade; int Sclass = cook.Sclass; string Snum = cook.Snum; string Wip = cook.LoginIp; string Wcid = Request.QueryString["Cid"].ToString(); string Wmid = Request.QueryString["Mid"].ToString(); LearnSite.BLL.Works ws = new LearnSite.BLL.Works(); string Wid = ws.WorkDone(Snum, Int32.Parse(Wcid), Int32.Parse(Wmid));//返回空字符表示不存在该记录 string SnumDone = ws.IpWorkDoneSnum(Sgrade, Sclass, Int32.Parse(Wcid), Int32.Parse(Wmid), Wip); string retureUrl = ws.WorkUrl(Snum, Int32.Parse(Wmid)); VoteLink.NavigateUrl = "~/Student/myevaluate.aspx?Mid=" + Wmid + "&Cid=" + Wcid; if (LearnSite.Common.XmlHelp.GetWorkIpLimit())//判断有无进行IP限制 { if (Snum == SnumDone || isTeacher(Wid, Snum)) { if (retureUrl != "") { upFileUrl.Visible = true; upFileType.Visible = true; upFileType.ImageUrl = "~/Images/FileType/" + LabelMfiletype.Text.ToLower() + ".gif"; upFileUrl.Text = Server.UrlDecode(Sname); upFileUrl.NavigateUrl = "~/Plugins/download.aspx?Id=" + LearnSite.Common.EnDeCode.Encrypt(retureUrl, "ls"); } } } else { if (retureUrl != "") { upFileUrl.Visible = true; upFileType.Visible = true; upFileType.ImageUrl = "~/Images/FileType/" + LabelMfiletype.Text.ToLower() + ".gif"; upFileUrl.Text = Server.UrlDecode(Sname); upFileUrl.NavigateUrl = "~/Plugins/download.aspx?Id=" + LearnSite.Common.EnDeCode.Encrypt(retureUrl, "ls"); } } if (Wid != "")//判断有无作品提交 { bool ischeck = ws.IsChecked(Int32.Parse(Wid)); if (ischeck)//判断作品有无评价 { Labelmsg.Text = "该作品已经评分!<br/>你不可以重新提交!"; Panelswfupload.Visible = false; } else { if (LearnSite.Common.XmlHelp.GetWorkIpLimit())//判断有无进行IP限制 { if (Snum == SnumDone || isTeacher(Wid, Snum)) { Labelmsg.Text = "你已经提交该活动作品.!<br/>你可以修改作品后重新提交!"; Panelswfupload.Visible = true; } else { Panelswfupload.Visible = false; if (LabelMfiletype.Text != "htm") { Labelmsg.Text = SnumDone + "学号<br/>已经在该IP提交本活动作品.!"; } } } else { Labelmsg.Text = "你已经提交该活动作品.!!<br/>你可以修改作品后重新提交!"; Panelswfupload.Visible = true; } } } else { LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); int minMsort = mbll.GetLastMaxMsort(Int32.Parse(Wcid), Int32.Parse(LabelMsort.Text));//任务活动中查询 bool isExitFirstWork = ws.ExistsMyFirstWork(Int32.Parse(Wcid), Snum, minMsort); if (LearnSite.Common.XmlHelp.GetWorkIpLimit())//判断有无进行IP限制 { if (SnumDone == "") { if (isExitFirstWork || minMsort == 0)//如果是上个任务已经提交或是第一个任务,则显示提交按钮 { DateTime dt = DateTime.Now; string today = dt.Year.ToString() + "-" + dt.Month.ToString() + "-" + dt.Day; Labelmsg.Text = today; Panelswfupload.Visible = true; } else { Labelmsg.Text = "请先提交前面活动作品!"; } } else { Panelswfupload.Visible = false; if (LabelMfiletype.Text != "htm") { Labelmsg.Text = SnumDone + "学号<br/>已经在该IP提交本活动作品!"; } } } else { if (isExitFirstWork || minMsort == 0)//如果是上个任务已经提交或是第一个任务,则显示提交按钮 { DateTime dt = DateTime.Now; string today = dt.Year.ToString() + "-" + dt.Month.ToString() + "-" + dt.Day; Labelmsg.Text = today; Panelswfupload.Visible = true; } else { Labelmsg.Text = "请先提交前面的活动作品!"; } } } }
private void ShowMission() { string Mid = Request.QueryString["Mid"].ToString(); 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) { int sSyear = cook.Syear; int sSclass = cook.Sclass; string sSnum = cook.Snum; string sLoginIp = cook.LoginIp; string sWcid = model.Mcid.ToString(); string sWmid = Mid; string sWmsort = model.Msort.ToString(); string sWfiletype = model.Mfiletype; LabelMtitle.Text = model.Mtitle; LabelMcid.Text = model.Mcid.ToString(); Mcontent.InnerHtml = HttpUtility.HtmlDecode(model.Mcontent); LabelSnum.Text = sSnum; LabelMfiletype.Text = sWfiletype; bool isupload = model.Mupload; CkMupload.Checked = isupload; if (isupload) { VoteLink.Visible = true; } else { VoteLink.Visible = false; } CkMgroup.Checked = model.Mgroup; LabelMsort.Text = sWmsort; LabelMid.Text = Mid; upFileTypeGroup.ImageUrl = "~/Images/FileType/" + LabelMfiletype.Text.ToLower() + ".gif"; upFileUrlGroup.Text = "小组作品"; switch (sWfiletype) { case "doc": LabelUploadType.Text = "*.doc;*.docx"; break; case "ppt": LabelUploadType.Text = "*.ppt;*.pptx"; break; case "xls": LabelUploadType.Text = "*.xls;*.xlsx"; break; case "office": LabelUploadType.Text = "*.doc;*.docx;*.ppt;*.pptx;*.xls;*.xlsx"; break; case "sb": LabelUploadType.Text = "*.sb;*.sb2"; break; case "flash": LabelUploadType.Text = "*.swf;*.fla"; break; default: LabelUploadType.Text = "*." + sWfiletype; break; } if (model.Mgroup) { LearnSite.BLL.GroupWork gbll = new LearnSite.BLL.GroupWork(); string gurl = gbll.DoneGroupWorkUrl(sSnum, Int32.Parse(Mid)); upFileTypeGroup.Visible = true; upFileUrlGroup.Visible = true; upFileUrlGroup.NavigateUrl = "~/Plugins/download.aspx?Id=" + LearnSite.Common.EnDeCode.Encrypt(gurl, "ls"); LearnSite.BLL.Students sbll = new LearnSite.BLL.Students(); if (sbll.IsLeader(sSnum))//如果是组长则显示小组面板 { Panelgroup.Visible = true; showgroupWork(); if (gurl != "") { if (gbll.CheckGroupWork(sSnum, Int32.Parse(Mid))) { PanelGroupUp.Visible = false; Labelgroupmsg.Text = "小组作品已经评价!<br/>你不可以再重新提交!"; } else { Labelgroupmsg.Text = "小组作品已提交但未评价!<br/>你可以修改后重新提交!"; } } else { upFileTypeGroup.Visible = false; upFileUrlGroup.Visible = false; } } else { Panelgroup.Visible = false; upFileTypeGroup.Visible = false; } } else { Panelgroup.Visible = false; upFileTypeGroup.Visible = false; } if (!CkMupload.Checked) { Panelworks.Visible = false; } ImageType.ImageUrl = "~/Images/FileType/" + LabelMfiletype.Text.ToLower() + ".gif"; } else { Mcontent.InnerHtml = "此学案活动不存在!"; Panelworks.Visible = false; } } }
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); } }
/// <summary> /// 显示信息 /// </summary> private void ShowInfo() { string Studentnum = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Snum"].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 MySyear = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Syear"].ToString()); int MySgroup = Int32.Parse(Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgroup"].ToString()); if (MySgroup == 0) { Labelscope.Text = "全班"; } else { Labelscope.Text = "组内"; } string Mid = Request.QueryString["Mid"].ToString(); if (LearnSite.Common.WordProcess.IsNum(Mid)) { LearnSite.Model.Works wmodel = new LearnSite.Model.Works(); LearnSite.BLL.Works ws = new LearnSite.BLL.Works(); LearnSite.BLL.Mission mbll = new LearnSite.BLL.Mission(); LearnSite.Model.Mission mModel = new LearnSite.Model.Mission(); mModel = mbll.GetModel(Int32.Parse(Mid)); ImageWtype.ImageUrl = "~/Images/FileType/" + mModel.Mfiletype + ".gif"; Labelmtitle.Text = "〖" + mModel.Mtitle + "〗"; LabelMgid.Text = mModel.Mgid.ToString(); Labelwmid.Text = Mid; LabelWtype.Text = mModel.Mfiletype; wmodel = ws.GetModelByStu(Int32.Parse(Mid), Studentnum); if (wmodel != null) { DataListvote.DataSource = ws.ShowMissionWorksGroup(MySgrade, MySclass, Int32.Parse(Mid), MySgroup); DataListvote.DataBind(); Labelhow.Text = DataListvote.Items.Count.ToString(); Labelme.Text = wmodel.Wvote.ToString(); string workIp = wmodel.Wip; string worknum = wmodel.Wnum; DateTime workdate = wmodel.Wdate.Value; DateTime nowdate = DateTime.Now; bool worklimit = LearnSite.Common.XmlHelp.GetWorkIpLimit(); Labelegg.Text = wmodel.Wegg.ToString(); Labelwfscore.Text = wmodel.Wfscore.ToString(); TimeSpan ts = nowdate - workdate; int lastday = ts.Days; Labelwdate.Text = lastday.ToString();///取短日期 if (lastday < 30) { if (showRgaugeSet()) { LimitVote();//限制为可预览的投票 } else { Labelmsg.Text = "当前作品互评暂停!"; BtnVote.Enabled = false; } } else { Labelmsg.Text = "一个月前的作品不能再投票了!"; BtnVote.Enabled = false; } } else { if (Studentnum.StartsWith("s")) { DataListvote.DataSource = ws.ShowMissionWorksGroup(MySgrade, MySclass, Int32.Parse(Mid), MySgroup); DataListvote.DataBind(); Labelhow.Text = DataListvote.Items.Count.ToString(); BtnVote.Enabled = true; } else { Labelmsg.Text = "您未提交作品,无法互评!"; BtnVote.Enabled = false; } } } }