Beispiel #1
0
 public static void Edit(Weblog_Notice WN)
 {
     BlogDataDataContext BD = new BlogDataDataContext();
     Weblog_Notice notice = BD.Weblog_Notices.Where(p => p.Notice_Type == 1).First();
     notice.Notice_Content = System.Web.HttpContext.Current.Server.HtmlEncode(WN.Notice_Content).Replace("\n", "<br />");
     notice.Notice_CreateTime = DateTime.Now;
     BD.SubmitChanges();
 }
Beispiel #2
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     Weblog_Notice wn = new Weblog_Notice();
     
     //myself:加上Encode
     wn.Notice_Content = System.Web.HttpContext.Current.Server.HtmlEncode(txtContent.Text).Replace("\n", "<br />");
     wn.Notice_CreateTime = DateTime.Now;
     BWeblog_Notice.Insert(wn);
     Context.Response.Write("<script>alert('修改成功');window.location='Admin_BlogNotice.aspx'</script>");
 }
Beispiel #3
0
 /// <summary>
 /// myself:更改方法名
 /// </summary>
 /// <param name="wn"></param>
 public static void Insert(Weblog_Notice wn)
 {
     BlogDataDataContext BD = new BlogDataDataContext();
     BD.Weblog_Notices.InsertOnSubmit(wn);
     BD.SubmitChanges();
 }
 /// <summary>Called before a Weblog_Notice is deleted.</summary>
 /// <param name="instance">The instance.</param>
 partial void DeleteWeblog_Notice(Weblog_Notice instance);
 /// <summary>Called before a Weblog_Notice is updated.</summary>
 /// <param name="instance">The instance.</param>
 partial void UpdateWeblog_Notice(Weblog_Notice instance);
 /// <summary>Called before a Weblog_Notice is inserted.</summary>
 /// <param name="instance">The instance.</param>
 partial void InsertWeblog_Notice(Weblog_Notice instance);