private void ShowInfo(int Id) { Maticsoft.BLL.NewsType bll = new Maticsoft.BLL.NewsType(); Maticsoft.Model.NewsType model = bll.GetModel(Id); this.lblId.Text = model.Id.ToString(); this.lblName.Text = model.Name; }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (strErr != "") { MessageBox.Show(this, strErr); return; } String Name = this.txtName.Text; Maticsoft.Model.NewsType model = new Maticsoft.Model.NewsType(); model.Name = Name; Maticsoft.BLL.NewsType bll = new Maticsoft.BLL.NewsType(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "Add.aspx"); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (strErr != "") { MessageBox.Show(this, strErr); return; } int Id = int.Parse(this.lblId.Text); String Name = this.txtName.Text; Maticsoft.Model.NewsType model = new Maticsoft.Model.NewsType(); model.Id = Id; model.Name = Name; Maticsoft.BLL.NewsType bll = new Maticsoft.BLL.NewsType(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }