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 = "内容及标题不能为空!"; } }
/// <summary> /// 获得数据列表 /// </summary> public List <LearnSite.Model.ListMenu> DataTableToList(DataTable dt) { List <LearnSite.Model.ListMenu> modelList = new List <LearnSite.Model.ListMenu>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { LearnSite.Model.ListMenu model; for (int n = 0; n < rowsCount; n++) { model = new LearnSite.Model.ListMenu(); if (dt.Rows[n]["Lid"] != null && dt.Rows[n]["Lid"].ToString() != "") { model.Lid = int.Parse(dt.Rows[n]["Lid"].ToString()); } if (dt.Rows[n]["Lcid"] != null && dt.Rows[n]["Lcid"].ToString() != "") { model.Lcid = int.Parse(dt.Rows[n]["Lcid"].ToString()); } if (dt.Rows[n]["Lsort"] != null && dt.Rows[n]["Lsort"].ToString() != "") { model.Lsort = int.Parse(dt.Rows[n]["Lsort"].ToString()); } if (dt.Rows[n]["Ltype"] != null && dt.Rows[n]["Ltype"].ToString() != "") { model.Ltype = int.Parse(dt.Rows[n]["Ltype"].ToString()); } if (dt.Rows[n]["Lxid"] != null && dt.Rows[n]["Lxid"].ToString() != "") { model.Lxid = int.Parse(dt.Rows[n]["Lxid"].ToString()); } if (dt.Rows[n]["Lshow"] != null && dt.Rows[n]["Lshow"].ToString() != "") { if ((dt.Rows[n]["Lshow"].ToString() == "1") || (dt.Rows[n]["Lshow"].ToString().ToLower() == "true")) { model.Lshow = true; } else { model.Lshow = false; } } if (dt.Rows[n]["Ltitle"] != null && dt.Rows[n]["Ltitle"].ToString() != "") { model.Ltitle = dt.Rows[n]["Ltitle"].ToString(); } modelList.Add(model); } } return(modelList); }
protected void Btnadd_Click(object sender, EventArgs e) { string fckstr = Request.Form["textareaItem"].Trim(); if (Texttitle.Text != "" && fckstr != "") { if (Request.QueryString["Mcid"] != null) { LearnSite.Model.TeaCook tcook = new LearnSite.Model.TeaCook(); string hidstr = tcook.Hid.ToString(); //string serverUrl = LearnSite.Common.WordProcess.ServerUrl(); //fckstr = fckstr.Replace(serverUrl, ""); int Mcid = Int32.Parse(Request.QueryString["Mcid"].ToString()); LearnSite.BLL.TopicDiscuss bll = new LearnSite.BLL.TopicDiscuss(); LearnSite.Model.TopicDiscuss model = new LearnSite.Model.TopicDiscuss(); model.Tcid = Mcid; model.Ttitle = Texttitle.Text.Trim(); model.Tcontent = HttpUtility.HtmlEncode(fckstr); model.Tcount = 0; model.Tteacher = Int32.Parse(hidstr); model.Tdate = DateTime.Now; model.Tclose = CheckPublish.Checked; model.Tresult = ""; int tid = bll.Add(model); LearnSite.Model.ListMenu lmodel = new LearnSite.Model.ListMenu(); LearnSite.BLL.ListMenu lbll = new LearnSite.BLL.ListMenu(); lmodel.Lcid = Mcid; lmodel.Lshow = true; lmodel.Lsort = lbll.GetMaxLsort(Mcid) + 1; lmodel.Ltitle = Texttitle.Text.Trim(); lmodel.Ltype = 3; lmodel.Lxid = tid; 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 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 = "内容及标题不能为空!"; } }
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 = "内容及标题不能为空!"; } } }
/// <summary> /// 条件联动更新一条部分数据 ///Lid,Lshow,Ltitle /// </summary> public bool UpdateMenu(LearnSite.Model.ListMenu model) { return(dal.UpdateMenu(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(LearnSite.Model.ListMenu model) { return(dal.Add(model)); }
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 = "内容及标题不能为空!"; } }
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 = "内容及标题不能为空!"; } }
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 = "内容及标题不能为空!"; } }
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 = "请填写标题或选择实例!"; } }
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 = "内容及标题不能为空!"; } }