public void btnSave_Click(object sender, EventArgs e) { string strErr=""; if(!PageValidate.IsNumber(txtAreaID.Text)) { strErr+="AreaID格式错误!\\n"; } if(this.txtAreaName.Text.Trim().Length==0) { strErr+="AreaName不能为空!\\n"; } if(!PageValidate.IsNumber(txtSort.Text)) { strErr+="Sort格式错误!\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } int AreaID=int.Parse(this.txtAreaID.Text); string AreaName=this.txtAreaName.Text; int Sort=int.Parse(this.txtSort.Text); Maticsoft.Model.A_Area model=new Maticsoft.Model.A_Area(); model.AreaID=AreaID; model.AreaName=AreaName; model.Sort=Sort; Maticsoft.BLL.A_Area bll=new Maticsoft.BLL.A_Area(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","list.aspx"); }
private void ShowInfo() { Maticsoft.BLL.A_Area bll=new Maticsoft.BLL.A_Area(); Maticsoft.Model.A_Area model=bll.GetModel(); this.txtAreaID.Text=model.AreaID.ToString(); this.txtAreaName.Text=model.AreaName; this.txtSort.Text=model.Sort.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Maticsoft.BLL.A_Area bll=new Maticsoft.BLL.A_Area(); #warning 代码生成提示:删除页面,请检查确认传递过来的参数是否正确 // bll.Delete(); } }