protected void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtBoxSn.Text.Trim().Length == 0) { strErr += "BoxSn不能为空!\\n"; } if (this.txtQty.Text.Trim().Length == 0) { strErr += "Qty不能为空!\\n"; } if (this.txtType.Text.Trim().Length == 0) { strErr += "Type不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } string BoxSn = this.txtBoxSn.Text; string Qty = this.txtQty.Text; string Type = this.txtType.Text; Maticsoft.Model.tb_BoxInfo model = new Maticsoft.Model.tb_BoxInfo(); model.BoxSn = BoxSn; model.Qty = Qty; model.Type = Type; Maticsoft.BLL.tb_BoxInfo bll = new Maticsoft.BLL.tb_BoxInfo(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "add.aspx"); }
private void ShowInfo(decimal ID) { Maticsoft.BLL.tb_BoxInfo bll = new Maticsoft.BLL.tb_BoxInfo(); Maticsoft.Model.tb_BoxInfo model = bll.GetModel(ID); this.lblID.Text = model.ID.ToString(); this.lblBoxSn.Text = model.BoxSn; this.lblQty.Text = model.Qty; this.lblType.Text = model.Type; }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (this.txtBoxSn.Text.Trim().Length == 0) { strErr += "BoxSn不能为空!\\n"; } if (this.txtQty.Text.Trim().Length == 0) { strErr += "Qty不能为空!\\n"; } if (this.txtType.Text.Trim().Length == 0) { strErr += "Type不能为空!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } decimal ID = decimal.Parse(this.lblID.Text); string BoxSn = this.txtBoxSn.Text; string Qty = this.txtQty.Text; string Type = this.txtType.Text; Maticsoft.Model.tb_BoxInfo model = new Maticsoft.Model.tb_BoxInfo(); model.ID = ID; model.BoxSn = BoxSn; model.Qty = Qty; model.Type = Type; Maticsoft.BLL.tb_BoxInfo bll = new Maticsoft.BLL.tb_BoxInfo(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }