private void ShowTxtForm() { string Mid = Request.QueryString["Mid"].ToString(); LearnSite.Model.Cook cook = new LearnSite.Model.Cook(); int Wsid = cook.Sid; if (LearnSite.Common.WordProcess.IsNum(Mid)) { LearnSite.Model.TxtForm tmodel = new LearnSite.Model.TxtForm(); LearnSite.BLL.TxtForm tbll = new LearnSite.BLL.TxtForm(); tmodel = tbll.GetModel(Int32.Parse(Mid)); if (tmodel != null) { LabelMtitle.Text = tmodel.Mtitle; LearnSite.Model.TxtFormBack rmodel = new LearnSite.Model.TxtFormBack(); LearnSite.BLL.TxtFormBack rbll = new LearnSite.BLL.TxtFormBack(); int Rid = rbll.GetRid(Wsid.ToString(), Mid); if (Rid > 0) { rmodel = rbll.GetModel(Rid); Mcontent.InnerHtml = HttpUtility.HtmlDecode(rmodel.Rwords); } else { Mcontent.InnerHtml = HttpUtility.HtmlDecode(tmodel.Mcontent); } } Hlresult.NavigateUrl = "~/Student/txtformresult.aspx?Mid=" + Mid; } }
protected void Btnedit_Click(object sender, EventArgs e) { string fckstr = mcontent.InnerText; string mtitle = Texttitle.Text.Trim(); if (mtitle != "" && fckstr != "") { if (Request.QueryString["Mcid"] != null && Request.QueryString["Mid"] != null) { Labelmsg.Text = "无"; string Mcid = Request.QueryString["Mcid"].ToString(); string Mid = Request.QueryString["Mid"].ToString(); LearnSite.Model.TxtForm tmode = new LearnSite.Model.TxtForm(); tmode.Mid = Int32.Parse(Mid); tmode.Mcid = Int32.Parse(Mcid); tmode.Mtitle = mtitle; tmode.Mpublish = CheckPublish.Checked; tmode.Mcontent = HttpUtility.HtmlEncode(fckstr); tmode.Mdate = DateTime.Now; tmode.Mhit = 0; tmode.Mdelete = false; LearnSite.BLL.TxtForm tfmbll = new LearnSite.BLL.TxtForm(); tfmbll.Update(tmode); //string msg = tmode.Mtitle + "<br>\r\n" + tmode.Mcontent + "<br>\r\n" + tmode.Mdate.ToString() + "<br>\r\n" + tmode.Mpublish.ToString() + "<br>\r\n" + Mid; // Labelmsg.Text = msg; 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 = 4; lmodel.Lshow = CheckPublish.Checked; lmodel.Ltitle = mtitle; lbll.UpdateMenuThree(lmodel); System.Threading.Thread.Sleep(500); string url = "~/Teacher/txtformshow.aspx?Mcid=" + Mcid + "&Mid=" + Mid; Response.Redirect(url, false); } else { Labelmsg.Text = "取不到表单编号Mid!"; } } else { Labelmsg.Text = "内容及标题不能为空!"; } }
private void txtformview() { if (Request.QueryString["Mid"] != null) { int Mid = Int32.Parse(Request.QueryString["Mid"].ToString()); LearnSite.Model.TxtForm tmodel = new LearnSite.Model.TxtForm(); LearnSite.BLL.TxtForm tbll = new LearnSite.BLL.TxtForm(); tmodel = tbll.GetModel(Mid); mcontent.InnerText = HttpUtility.HtmlDecode(tmodel.Mcontent); CheckPublish.Checked = tmodel.Mpublish; Texttitle.Text = tmodel.Mtitle; } }
private void showtxtform() { string Mcid = Request.QueryString["Mcid"].ToString(); string Mid = Request.QueryString["Mid"].ToString(); LearnSite.Model.TxtForm tmodel = new LearnSite.Model.TxtForm(); LearnSite.BLL.TxtForm tbll = new LearnSite.BLL.TxtForm(); tmodel = tbll.GetModel(Int32.Parse(Mid)); if (tmodel != null) { LabelMtitle.Text = tmodel.Mtitle; CheckPublish.Checked = tmodel.Mpublish; Mcontent.InnerHtml = HttpUtility.HtmlDecode(tmodel.Mcontent); LabelMdate.Text = tmodel.Mdate.ToString(); } }
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.TxtForm tbll = new LearnSite.BLL.TxtForm(); LearnSite.Model.TxtForm tmode = new LearnSite.Model.TxtForm(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); int maxSort = lbll.GetMaxLsort(Mcid) + 1; tmode.Mcid = Mcid; tmode.Mtitle = Texttitle.Text.Trim(); tmode.Mpublish = CheckPublish.Checked; tmode.Mcontent = HttpUtility.HtmlEncode(fckstr); tmode.Mdate = DateTime.Now; tmode.Mhit = 0; int mid = tbll.Add(tmode); 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 = 4;//表单类型为4 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 = "内容及标题不能为空!"; } }
/// <summary> /// 更新一条数据 Mtitle,Mcontent,Mdate,Mpublish,Mid /// </summary> public bool Update(LearnSite.Model.TxtForm model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(LearnSite.Model.TxtForm model) { return(dal.Add(model)); }