protected void btnSave_Click(object sender, EventArgs e) { string strErr=""; if(!PageValidate.IsNumber(txtpersonphoto_id.Text)) { strErr+="相片ID格式错误!\\n"; } if(!PageValidate.IsNumber(txtalbum_id.Text)) { strErr+="相册_id格式错误!\\n"; } if(this.txtpersonphoto_path.Text.Trim().Length==0) { strErr+="相片路径不能为空!\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } int personphoto_id=int.Parse(this.txtpersonphoto_id.Text); int album_id=int.Parse(this.txtalbum_id.Text); string personphoto_path=this.txtpersonphoto_path.Text; la.Model.personphoto model=new la.Model.personphoto(); model.personphoto_id=personphoto_id; model.album_id=album_id; model.personphoto_path=personphoto_path; la.BLL.personphoto bll=new la.BLL.personphoto(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx"); }
public void btnSave_Click(object sender, EventArgs e) { string strErr=""; if(this.txtpersonphoto_path.Text.Trim().Length==0) { strErr+="相片路径不能为空!\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } int personphoto_id=int.Parse(this.lblpersonphoto_id.Text); int album_id=int.Parse(this.lblalbum_id.Text); string personphoto_path=this.txtpersonphoto_path.Text; la.Model.personphoto model=new la.Model.personphoto(); model.personphoto_id=personphoto_id; model.album_id=album_id; model.personphoto_path=personphoto_path; la.BLL.personphoto bll=new la.BLL.personphoto(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","list.aspx"); }
private void ShowInfo(int personphoto_id,int album_id) { la.BLL.personphoto bll=new la.BLL.personphoto(); la.Model.personphoto model=bll.GetModel(personphoto_id,album_id); this.lblpersonphoto_id.Text=model.personphoto_id.ToString(); this.lblalbum_id.Text=model.album_id.ToString(); this.txtpersonphoto_path.Text=model.personphoto_path; }