protected void Page_Load(object sender, EventArgs e) { Model.NovelNewsInfo item = new Model.NovelNewsInfo(); item.NewsTitle = Request["NewsTitle"]; item.NewsImages = Request.QueryString["img"].ToString(); item.FromWhere = Request["FromWhere"]; item.NewsContens = Request["NewsContens"]; item.NewsContens = Server.HtmlEncode(item.NewsContens); INovel novel = BllFactory.BllAccess.CreateINovelBLL(); try { novel.addNovelNews(item); Response.Write("{success:true,msg:'添加成功'}"); } catch (Exception ex) { string msg = ex.Message; Response.Write("{success:false,msg:'" + msg + "'}"); } }
protected void Page_Load(object sender, EventArgs e) { Model.NovelNewsInfo item = new Model.NovelNewsInfo(); item.NewsId = Convert.ToInt32(Request["NewsId"]); item.AddTime = DateTime.Now; item.NewsTitle = Request["NewsTitle"]; item.NewsImages = Request["NewsImages"]; item.FromWhere = Request["FromWhere"]; item.NewsContens = Request["NewsContens"]; INovel novel = BllFactory.BllAccess.CreateINovelBLL(); try { novel.updateNovelNews(item); Response.Write("{success:true,msg:'修改成功'}"); } catch (Exception ex) { string msg = ex.Message; Response.Write("{success:false,msg:'" + msg + "'}"); } }