private void ShowInfo(int areaid) { myhouse.BLL.AreaService bll = new myhouse.BLL.AreaService(); myhouse.Model.Area model = bll.GetModel(areaid); this.lblareaid.Text = model.areaid.ToString(); this.txtareaname.Text = model.areaname; }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtareaname.Text.Trim().Length == 0) { strErr += "areaname不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int areaid = int.Parse(this.lblareaid.Text); string areaname = this.txtareaname.Text; myhouse.Model.Area model = new myhouse.Model.Area(); model.areaid = areaid; model.areaname = areaname; myhouse.BLL.AreaService bll = new myhouse.BLL.AreaService(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtareaname.Text.Trim().Length == 0) { strErr += "areaname不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string areaname = this.txtareaname.Text; myhouse.Model.Area model = new myhouse.Model.Area(); model.areaname = areaname; myhouse.BLL.AreaService bll = new myhouse.BLL.AreaService(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }