public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtNewsTypeTitle.Text.Trim().Length == 0) { strErr += "NewsTypeTitle不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int NewsTypeID = int.Parse(this.lblNewsTypeID.Text); string NewsTypeTitle = this.txtNewsTypeTitle.Text; Maticsoft.Model.NewsTypeInfo model = new Maticsoft.Model.NewsTypeInfo(); model.NewsTypeID = NewsTypeID; model.NewsTypeTitle = NewsTypeTitle; Maticsoft.BLL.NewsTypeInfo bll = new Maticsoft.BLL.NewsTypeInfo(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }