protected void Btnedit_Click(object sender, EventArgs e) { if (Request.QueryString["Tcid"] != null) { string fckstr = mcontent.InnerText; if (Texttitle.Text != "" && fckstr != "") { LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook(); string hidstr = tcook.Hid.ToString(); int Tcid = Int32.Parse(Request.QueryString["Tcid"].ToString()); int Tid = Int32.Parse(Request.QueryString["Tid"].ToString()); LearnSite.BLL.TopicDiscuss bll = new LearnSite.BLL.TopicDiscuss(); string Ttitle = Texttitle.Text.Trim(); string Tcontent = HttpUtility.HtmlEncode(fckstr); bool Tclose = CheckClose.Checked; bll.UpdateTopic(Tid, Ttitle, Tcontent, Tclose); LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); lmodel.Lcid = Tcid; lmodel.Lxid = Tid; lmodel.Ltype = 3; lmodel.Ltitle = Texttitle.Text.Trim(); lbll.UpdateLtitle(lmodel); System.Threading.Thread.Sleep(200); string url = "~/Teacher/topicshow.aspx?Tid=" + Tid; Response.Redirect(url, false); } else { Labelmsg.Text = "内容及标题不能为空!"; } } }
protected void Btnadd_Click(object sender, EventArgs e) { string fckstr = mcontent.InnerText; if (Texttitle.Text != "" && fckstr != "") { if (Request.QueryString["Cid"] != null) { LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook(); string hidstr = tcook.Hid.ToString(); int Vcid = Int32.Parse(Request.QueryString["Cid"].ToString()); LearnSite.BLL.Survey vbll = new LearnSite.BLL.Survey(); LearnSite.Model.Survey vmodel = new LearnSite.Model.Survey(); vmodel.Vcid = Vcid; vmodel.Vclose = CheckClose.Checked; vmodel.Vcontent = HttpUtility.HtmlEncode(fckstr); vmodel.Vdate = DateTime.Now; vmodel.Vhid = Int32.Parse(hidstr); bool vp = false; vmodel.Vpoint = vp; vmodel.Vtitle = Texttitle.Text.Trim(); int Vtype = Int32.Parse(DDLvtype.SelectedValue); vmodel.Vtype = Vtype; //Vcid,Vhid,Vtitle,Vcontent,Vtype,Vclose,Vpoint,Vdate string url = ""; LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); lmodel.Lcid = Vcid; lmodel.Lshow = true; lmodel.Lsort = lbll.GetMaxLsort(Vcid) + 1; lmodel.Ltitle = Texttitle.Text.Trim(); lmodel.Ltype = 2; if (Request.QueryString["Vid"] != null) { int vid = Int32.Parse(Request.QueryString["Vid"].ToString()); vmodel.Vid = vid; vbll.UpdateSurvey(vmodel); //更新到调查表中 lmodel.Lxid = vid; lbll.UpdateLtitle(lmodel); //更新到导航中 LearnSite.BLL.SurveyFeedback fkbll = new LearnSite.BLL.SurveyFeedback(); fkbll.UpdateFvtype(vid, Vtype); //2014-3-15修订,如果调查类型改变的话,同时也改变调查结果记录中的类型 url = "~/Survey/survey.aspx?Cid=" + Vcid + "&Vid=" + vid; System.Threading.Thread.Sleep(500); } else { int newvid = vbll.Addsurvey(vmodel); //增加到调查表中 lmodel.Lxid = newvid; lbll.Add(lmodel); //增加到导航中 System.Threading.Thread.Sleep(500); url = "~/Survey/survey.aspx?Cid=" + Vcid + "&Vid=" + newvid; } Response.Redirect(url, false); } } else { Labelmsg.Text = "内容及标题不能为空!"; } }