protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtname.Text.Trim().Length == 0) { strErr += "name不能为空!\\n"; } if (this.txtqita.Text.Trim().Length == 0) { strErr += "qita不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string name = this.txtname.Text; string qita = this.txtqita.Text; Maticsoft.Model.kecheng_neirong model = new Maticsoft.Model.kecheng_neirong(); model.name = name; model.qita = qita; Maticsoft.BLL.kecheng_neirong bll = new Maticsoft.BLL.kecheng_neirong(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
private void ShowInfo(int id) { Maticsoft.BLL.kecheng_neirong bll = new Maticsoft.BLL.kecheng_neirong(); Maticsoft.Model.kecheng_neirong model = bll.GetModel(id); this.lblid.Text = model.id.ToString(); this.lblname.Text = model.name; this.lblqita.Text = model.qita; }