private void ShowFile() { if (Request.QueryString["Fid"] != null) { string Fidstr = Request.QueryString["Fid"].ToString(); if (LearnSite.Common.WordProcess.IsNum(Fidstr)) { LabelFid.Text = Fidstr; LabelSid.Text = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sid"].ToString(); int Fid = Int32.Parse(Fidstr); LearnSite.Model.Soft smodel = new LearnSite.Model.Soft(); LearnSite.BLL.Soft st = new LearnSite.BLL.Soft(); smodel = st.GetModel(Fid); Labeltitle.Text = smodel.Ftitle; Labelhit.Text = smodel.Fhit.ToString(); Labeldate.Text = smodel.Fdate.ToString(); Labelfiletype.Text = smodel.Ffiletype; string typestr = Labelfiletype.Text; if (typestr == "") { typestr = "read"; ImageDown.Visible = false; } ImageType.ImageUrl = "~/Images/FileType/" + typestr.ToLower() + ".gif"; Labelclass.Text = smodel.Fclass; HLurl.NavigateUrl = smodel.Furl; Labelopen.Text = smodel.Fopen.ToString(); Labelcontent.Text = HttpUtility.HtmlDecode(smodel.Fcontent); LabelFyid.Text = smodel.Fyid.ToString(); LBtnfile.Visible = false; st.UpdateFhit(Fid); } } }
private void ShowSoft() { string fid = Request.QueryString["Fid"].ToString(); LearnSite.Model.Soft model = new LearnSite.Model.Soft(); LearnSite.BLL.Soft bll = new LearnSite.BLL.Soft(); model = bll.GetModel(int.Parse(fid)); DDLclass.SelectedValue = model.Fclass; mcontent.InnerText = HttpUtility.HtmlDecode(model.Fcontent); Texttitle.Text = model.Ftitle; Linkold.CommandArgument = model.Furl; Linkold.Text = model.Furl.Substring(model.Furl.LastIndexOf("/") + 1); LabelFhit.Text = model.Fhit.ToString(); LabelFfiletype.Text = model.Ffiletype; CheckBoxFhide.Checked = model.Fhide; DDLopen.SelectedValue = model.Fopen.ToString(); ddlcategory.SelectedValue = model.Fyid.ToString(); if (model.Fhid > 0) { CheckBoxFhid.Checked = false; } else { CheckBoxFhid.Checked = true; } }
private void ShowFile() { if (Request.QueryString["Fid"] != null) { string Fidstr = Request.QueryString["Fid"].ToString(); if (LearnSite.Common.WordProcess.IsNum(Fidstr)) { int Fid = Int32.Parse(Fidstr); LearnSite.Model.Soft smodel = new LearnSite.Model.Soft(); LearnSite.BLL.Soft st = new LearnSite.BLL.Soft(); smodel = st.GetModel(Fid); Labeltitle.Text = smodel.Ftitle; Labelcontent.Text = HttpUtility.HtmlDecode(smodel.Fcontent); Labelhit.Text = smodel.Fhit.ToString(); Labeldate.Text = smodel.Fdate.ToString(); Labelfiletype.Text = smodel.Ffiletype; string typestr = Labelfiletype.Text; if (typestr == "") { typestr = "read"; ImageDown.Visible = false; } ImageType.ImageUrl = "~/Images/FileType/" + typestr.ToLower() + ".gif"; Labelclass.Text = smodel.Fclass; HLurl.NavigateUrl = smodel.Furl; LBtnfile.Visible = false; st.UpdateFhit(Fid); } } }
private void EditSoft() { if (Texttitle.Text != "" && ddlcategory.SelectedValue != "") { LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook(); string Fhid = tcook.Hid.ToString(); LearnSite.Model.Soft soft = new LearnSite.Model.Soft(); string fid = Request.QueryString["Fid"].ToString(); soft.Fid = Int32.Parse(fid); string fclass = DDLclass.SelectedValue; soft.Fclass = fclass; soft.Fup = false; if (fclass == "教程" || fclass == "微课" || fclass == "课程") { soft.Fup = true; } soft.Fcontent = HttpUtility.HtmlEncode(mcontent.InnerText); soft.Fdate = DateTime.Now; soft.Fhit = Int32.Parse(LabelFhit.Text); soft.Ftitle = Texttitle.Text.Trim(); soft.Ffiletype = LabelFfiletype.Text; soft.Furl = Linkold.CommandArgument; soft.Fhide = CheckBoxFhide.Checked; soft.Fopen = Int32.Parse(DDLopen.SelectedValue); soft.Fyid = Int32.Parse(ddlcategory.SelectedValue); if (!CheckBoxFhid.Checked) { soft.Fhid = Int32.Parse(Fhid); } else { soft.Fhid = -1; } if (soft.Ftitle != "" && soft.Fcontent != "") { if (FUsoft.PostedFile.FileName != "") { string uploadfile = FUsoft.PostedFile.FileName; soft.Ffiletype = uploadfile.Substring(uploadfile.LastIndexOf(".") + 1); soft.Furl = LearnSite.Common.Fileupload.Fupload(FUsoft); } LearnSite.BLL.Soft bll = new LearnSite.BLL.Soft(); bll.Update(soft); Labelmsg.Text = "修改资源成功!"; System.Threading.Thread.Sleep(500); string url = "~/Teacher/softview.aspx?Fid=" + fid; Response.Redirect(url, false); } else { Labelmsg.Text = "清添加资源内容介绍!"; } } else { Labelmsg.Text = "请添加资源标题!"; } }
private void showSoftcategory() { LearnSite.BLL.Soft fbll = new LearnSite.BLL.Soft(); DDLCategory.DataSource = fbll.GetListCategory(); DDLCategory.DataTextField = "Ytitle"; DDLCategory.DataValueField = "Yid"; DDLCategory.DataBind(); }
private void AddSoft() { if (Texttitle.Text != "" && ddlcategory.SelectedValue != "") { string Fhid = tcook.Hid.ToString(); LearnSite.Model.Soft soft = new LearnSite.Model.Soft(); soft.Fyid = Int32.Parse(ddlcategory.SelectedValue); string fclass = DDLclass.SelectedValue; soft.Fclass = fclass; soft.Fup = false; if (fclass == "教程" || fclass == "微课" || fclass == "课程") { soft.Fup = true; } soft.Fcontent = HttpUtility.HtmlEncode(Request.Form["textareaItem"].Trim()); soft.Fdate = DateTime.Now; soft.Ffiletype = ""; soft.Fhit = 0; soft.Ftitle = Texttitle.Text.Trim(); soft.Ffiletype = ""; soft.Furl = ""; soft.Fhide = CheckBoxFhide.Checked; soft.Fopen = Int32.Parse(DDLopen.SelectedValue); if (!CheckBoxFhid.Checked) { soft.Fhid = Int32.Parse(Fhid); } else { soft.Fhid = -1; } if (soft.Ftitle != "" && soft.Fcontent != "") { if (FUsoft.PostedFile.FileName != "") { string uploadfile = FUsoft.PostedFile.FileName; soft.Ffiletype = uploadfile.Substring(uploadfile.LastIndexOf(".") + 1); soft.Furl = LearnSite.Common.Fileupload.Fupload(FUsoft); } LearnSite.BLL.Soft bll = new LearnSite.BLL.Soft(); bll.Add(soft); Labelmsg.Text = "添加学案资源成功!"; System.Threading.Thread.Sleep(500); //Labelmsg.Text = Labelmsg.Text + soft.Furl; Response.Redirect("~/Teacher/soft.aspx", false); } else { Labelmsg.Text = "清添加学案资源内容介绍!"; } } else { Labelmsg.Text = "请添加学案资源标题或无资源分类!"; } }
private void ShowTime() { if (LearnSite.Common.CookieHelp.IsStudentLogin()) { string ch = Labelclass.Text; switch (ch) { case "微课": case "教程": case "资料": { LBtnfile.Visible = true; break; } case "软件": { LearnSite.BLL.Soft st = new LearnSite.BLL.Soft(); if (st.IsDownCan()) { LBtnfile.Visible = true; Labelmsg.Text = ""; } else { Labelcontent.Text = "<br/><br/><br/><div style='text-align: center'>隐藏内容</div><br/><br/><br/>"; Labelmsg.Text = "登录" + LearnSite.Common.XmlHelp.GetDowntime().ToString() + "分钟后可下载"; LBtnfile.Visible = false; } break; } case "游戏": { string Wnum = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Snum"].ToString(); LearnSite.BLL.Works wbll = new LearnSite.BLL.Works(); int todayScore = wbll.GetTodayWorkScores(Wnum); if (todayScore > Int32.Parse(Labelopen.Text) - 1) { LBtnfile.Visible = true; Labelmsg.Text = "你的作品平均得" + todayScore.ToString() + "分"; } else { Labelcontent.Text = "<br/><br/><br/><div style='text-align: center'>隐藏内容</div><br/><br/><br/>"; Labelmsg.Text = "今天作品赚取" + todayScore.ToString() + "学分不够使用!"; LBtnfile.Visible = false; } break; } } if (HLurl.NavigateUrl == "") { LBtnfile.Visible = false; } } }
protected void LinkBtnDel_Click(object sender, EventArgs e) { int Fid = Int32.Parse(Request.QueryString["Fid"].ToString()); LearnSite.BLL.Soft bll = new LearnSite.BLL.Soft(); bll.Delete(Fid); System.Threading.Thread.Sleep(1000); string url = "~/Teacher/soft.aspx"; Response.Redirect(url, false); }
protected void GVSource_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.Equals("Change")) { string myFid = e.CommandArgument.ToString(); LearnSite.BLL.Soft sbll = new LearnSite.BLL.Soft(); sbll.UpdateFhide(Int32.Parse(myFid)); System.Threading.Thread.Sleep(500); ShowSoftList(); } }
protected void GVCategory_RowCommand(object sender, GridViewCommandEventArgs e) { switch (e.CommandName) { case "Del": case "Top": case "Bottom": int RowIndex = Convert.ToInt32(e.CommandArgument); int yid = Convert.ToInt32(((Label)GVCategory.Rows[RowIndex].FindControl("LabelYid")).Text); LearnSite.BLL.SoftCategory ybll = new LearnSite.BLL.SoftCategory(); if (e.CommandName == "Del") { LearnSite.BLL.Soft fbll = new LearnSite.BLL.Soft(); if (!fbll.ExistYid(yid)) { ybll.Delete(yid); System.Threading.Thread.Sleep(200); showCategory(); } else { LearnSite.Common.WordProcess.Alert("无法删除该类别,因为有此类别的资源存在!", this.Page); } } if (e.CommandName == "Top") { if (RowIndex == 0) { ybll.initYsort(); //如果首行,初始化序号 } if (RowIndex > 0) { int topyid = Convert.ToInt32(((Label)GVCategory.Rows[RowIndex - 1].FindControl("LabelYid")).Text); //获取上个导航编号 ybll.UpdateYsort(yid, false); //当前导航减1向上 ybll.UpdateYsort(topyid, true); //上个导航增1向下 } System.Threading.Thread.Sleep(500); showCategory(); } if (e.CommandName == "Bottom") { int rowscount = GVCategory.Rows.Count; if (RowIndex < rowscount - 1) { int bottomyid = Convert.ToInt32(((Label)GVCategory.Rows[RowIndex + 1].FindControl("LabelYid")).Text); //获取下个导航编号 ybll.UpdateYsort(bottomyid, false); //下个导航减1向上 ybll.UpdateYsort(yid, true); //当前导航增1向下 System.Threading.Thread.Sleep(500); showCategory(); } } break; } }
private void listsoft() { string ayid = DDLCategory.SelectedValue; if (!string.IsNullOrEmpty(ayid)) { LearnSite.BLL.Soft fbll = new LearnSite.BLL.Soft(); DDLsoft.DataSource = fbll.GetListnomic(Int32.Parse(ayid)); DDLsoft.DataTextField = "Ftitle"; DDLsoft.DataValueField = "Fid"; DDLsoft.DataBind(); } }
private void ShowSoft() { LearnSite.Model.Cook cook = new LearnSite.Model.Cook(); LearnSite.BLL.Soft st = new LearnSite.BLL.Soft(); int yid = 0; if (Request.QueryString["Yid"] != null) { yid = Int32.Parse(Request.QueryString["Yid"].ToString()); } GVSoft.DataSource = st.GetShowSoftList(cook.Rhid.ToString(), yid); GVSoft.DataBind(); }
private void ShowList() { LearnSite.BLL.Soft st = new LearnSite.BLL.Soft(); string fyid = LabelFyid.Text; if (!string.IsNullOrEmpty(fyid)) { int yid = Int32.Parse(fyid); GVSoft.DataSource = st.GetShowSoftList(cook.Rhid.ToString(), yid); GVSoft.DataBind(); LearnSite.BLL.SoftCategory ybll = new LearnSite.BLL.SoftCategory(); GVSoft.HeaderRow.Cells[0].Text = ybll.GetTitle(yid); } }
private void ShowList() { string Rhid = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Rhid"].ToString(); LearnSite.BLL.Soft st = new LearnSite.BLL.Soft(); string fyid = LabelFyid.Text; if (!string.IsNullOrEmpty(fyid)) { int yid = Int32.Parse(fyid); GVSoft.DataSource = st.GetShowSoftList(Rhid, yid); GVSoft.DataBind(); LearnSite.BLL.SoftCategory ybll = new LearnSite.BLL.SoftCategory(); GVSoft.HeaderRow.Cells[0].Text = ybll.GetTitle(yid); } }
private void ShowSoft() { string mygrade = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sgrade"].ToString(); string myclass = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Sclass"].ToString(); string Rhid = Request.Cookies[LearnSite.Common.CookieHelp.stuCookieNname].Values["Rhid"].ToString(); LearnSite.BLL.Soft st = new LearnSite.BLL.Soft(); int yid = 1; if (Request.QueryString["Yid"] != null) { yid = Int32.Parse(Request.QueryString["Yid"].ToString()); } GVSoft.DataSource = st.GetShowSoftList(Rhid, yid); GVSoft.DataBind(); }
private void ShowSoftList() { if (Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname] != null) { string Hid = Request.Cookies[LearnSite.Common.CookieHelp.teaCookieNname].Values["Hid"].ToString(); if (Session[Hid + "SoftPageIndex"] != null) { GVSource.PageIndex = Int32.Parse(Session[Hid + "SoftPageIndex"].ToString()); } string Fyid = ddlcategory.SelectedValue; if (!string.IsNullOrEmpty(Fyid)) { LearnSite.BLL.Soft sf = new LearnSite.BLL.Soft(); GVSource.DataSource = sf.GetSoftList(Hid, Fyid); GVSource.DataBind(); } } }
private void AddSoft() { if (Texttitle.Text != "") { LearnSite.Model.Soft soft = new LearnSite.Model.Soft(); soft.Fclass = DDLclass.SelectedValue; soft.Fcontent = HttpUtility.HtmlEncode(FCKeditor1.Value); soft.Fdate = DateTime.Now; soft.Ffiletype = ""; soft.Fhit = 0; soft.Ftitle = Texttitle.Text.Trim(); soft.Ffiletype = ""; soft.Furl = ""; if (soft.Ftitle != "" && soft.Fcontent != "") { if (FUsoft.PostedFile.FileName != "") { string uploadfile = FUsoft.PostedFile.FileName; soft.Ffiletype = uploadfile.Substring(uploadfile.LastIndexOf(".") + 1); soft.Furl = LearnSite.Common.Fileupload.Fupload(FUsoft); } LearnSite.BLL.Soft bll = new LearnSite.BLL.Soft(); bll.Add(soft); Labelmsg.Text = "添加课程资源成功!"; System.Threading.Thread.Sleep(1500); Labelmsg.Text = Labelmsg.Text + soft.Furl; Response.Redirect("~/Teacher/soft.aspx", false); } else { Labelmsg.Text = "添加课程资源失败!"; } } else { Labelmsg.Text = "请添加课程资源标题!"; } }
private void ShowSoftList() { if (Request.Cookies["TeacherCookies"] != null) { string Hid = Request.Cookies["TeacherCookies"].Values["Hid"].ToString(); if (Session[Hid + "SoftPageIndex"] != null) GVSource.PageIndex = Int32.Parse(Session[Hid + "SoftPageIndex"].ToString()); LearnSite.BLL.Soft sf = new LearnSite.BLL.Soft(); GVSource.DataSource = sf.GetSoftList(); GVSource.DataBind(); } }
private void ShowSoft() { LearnSite.BLL.Soft st = new LearnSite.BLL.Soft(); GVSoft.DataSource = st.GetAllList(); GVSoft.DataBind(); }
private void ShowTime() { if (Request.Cookies["StudentCookies"] != null) { LabelLoginTime.Text = Request.Cookies["StudentCookies"].Values["LoginTime"].ToString(); LabelPassTime.Text =LearnSite.Common.Computer.TimePassed().ToString() + "分钟过去了"; if (HLurl.NavigateUrl == "" ) { LBtnfile.Visible = false; } else { if (Labelclass.Text == "资料") { LBtnfile.Visible = true; } else { LearnSite.BLL.Soft st = new LearnSite.BLL.Soft(); if (st.IsDownCan()) { LBtnfile.Visible = true; Labelmsg.Text = ""; } else { Labelmsg.Text = "登录" + LearnSite.Common.XmlHelp.GetDowntime().ToString() + "分钟后可下载"; LBtnfile.Visible = false; } } } } }
private void showCategory() { LearnSite.BLL.Soft fbll = new LearnSite.BLL.Soft(); DLCategory.DataSource = fbll.GetListCategory(); DLCategory.DataBind(); }