private void ShowInfo(int id) { Maticsoft.BLL.inv_option bll = new Maticsoft.BLL.inv_option(); Maticsoft.Model.inv_option model = bll.GetModel(id); this.lblid.Text = model.id.ToString(); this.lblque_id.Text = model.que_id.ToString(); this.lbltext.Text = model.text; this.lblstyle.Text = model.style; this.lblbeizhu.Text = model.beizhu; }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtque_id.Text)) { strErr += "que_id格式错误!\\n"; } if (this.txttext.Text.Trim().Length == 0) { strErr += "text不能为空!\\n"; } if (this.txtstyle.Text.Trim().Length == 0) { strErr += "style不能为空!\\n"; } if (this.txtbeizhu.Text.Trim().Length == 0) { strErr += "beizhu不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int id = int.Parse(this.lblid.Text); int que_id = int.Parse(this.txtque_id.Text); string text = this.txttext.Text; string style = this.txtstyle.Text; string beizhu = this.txtbeizhu.Text; Maticsoft.Model.inv_option model = new Maticsoft.Model.inv_option(); model.id = id; model.que_id = que_id; model.text = text; model.style = style; model.beizhu = beizhu; Maticsoft.BLL.inv_option bll = new Maticsoft.BLL.inv_option(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txttext.Text.Trim().Length == 0) { strErr += "text不能为空!\\n"; } if (this.txtstyle.Text.Trim().Length == 0) { strErr += "style不能为空!\\n"; } if (this.txtbeizhu.Text.Trim().Length == 0) { strErr += "beizhu不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int que_id = int.Parse(inv_que.SelectedValue); string text = this.txttext.Text; string style = this.txtstyle.Text; string beizhu = this.txtbeizhu.Text; Maticsoft.Model.inv_option model = new Maticsoft.Model.inv_option(); model.que_id = que_id; model.text = text; model.style = style; model.beizhu = beizhu; Maticsoft.BLL.inv_option bll = new Maticsoft.BLL.inv_option(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }