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