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