新闻模块之新闻修改-使用FreeboxText模块修改新闻数据-页面表示层(Linq方式)-1...

mac2022-06-30  23

----------------------最终效果---------------------------

 

 -----------FreeTextBox使用方式---------------------

-----------中文汉化FreeTextBox相册-----------------

 

----------CS代码-----------------------------------------

1 protected void Page_Load(object sender, EventArgs e) 2 { 3 if (!IsPostBack) 4 { 5 int aritcleId = int.Parse(Request.QueryString["articleId"]); 6 ArticleBLL artsystem = new ArticleBLL(); 7 Article artdata = artsystem.GetNewInfo(aritcleId); 8 this.lblId.Text = artdata.ArticleId.ToString(); 9 this.txtTitle.Text = artdata.Title;10 this.txtClassId.Text = artdata.ClassId.ToString();11 this.FreeTextBox1.Text = artdata.Content;12 this.lblDateTime.Text = artdata.DateTime.ToString();13 }14 }15 16 protected void btnEdit_Click(object sender, EventArgs e)17 {18 Article artdata = new Article();19 artdata.ArticleId = int.Parse(this.lblId.Text);20 artdata.Title = this.txtTitle.Text;21 artdata.ClassId = int.Parse(this.txtClassId.Text);22 artdata.Content = this.FreeTextBox1.Text;23 artdata.DateTime = DateTime.Now;24 ArticleBLL artsystem = new ArticleBLL();25 artsystem.Edit(artdata);26 this.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('修改成功!')</script>");27 }

-----------BLL-----------------------------

-----------DAL----------------------------

 

转载于:https://www.cnblogs.com/dzj007/archive/2012/02/13/2350135.html

最新回复(0)