protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtttype.Text)) { strErr += "ttype格式错误!\\n"; } if (this.txttcontent.Text.Trim().Length == 0) { strErr += "tcontent不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int ttype = int.Parse(this.txtttype.Text); string tcontent = this.txttcontent.Text; myhouse.Model.Housetype model = new myhouse.Model.Housetype(); model.ttype = ttype; model.tcontent = tcontent; myhouse.BLL.HousetypeService bll = new myhouse.BLL.HousetypeService(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
private void ShowInfo(int tid) { myhouse.BLL.HousetypeService bll = new myhouse.BLL.HousetypeService(); myhouse.Model.Housetype model = bll.GetModel(tid); this.lbltid.Text = model.tid.ToString(); this.lblttype.Text = model.ttype.ToString(); this.lbltcontent.Text = model.tcontent; }