private void ShowInfo() { ZhangWei.BLL.Buy_Detail bll = new ZhangWei.BLL.Buy_Detail(); ZhangWei.Model.Buy_Detail model = bll.GetModel(); this.lblBuy_ID.Text = model.Buy_ID.ToString(); this.lblProduct_ID.Text = model.Product_ID.ToString(); this.lblBuyOrder_ID.Text = model.BuyOrder_ID.ToString(); this.lblQuantity.Text = model.Quantity.ToString(); this.lblPrice.Text = model.Price.ToString(); }
public void btnSave_Click(object sender, EventArgs e) { string strErr = ""; if (!PageValidate.IsNumber(txtBuy_ID.Text)) { strErr += "Buy_ID格式错误!\\n"; } if (!PageValidate.IsNumber(txtProduct_ID.Text)) { strErr += "Product_ID格式错误!\\n"; } if (!PageValidate.IsNumber(txtBuyOrder_ID.Text)) { strErr += "BuyOrder_ID格式错误!\\n"; } if (!PageValidate.IsNumber(txtQuantity.Text)) { strErr += "Quantity格式错误!\\n"; } if (!PageValidate.IsDecimal(txtPrice.Text)) { strErr += "Price格式错误!\\n"; } if (strErr != "") { MessageBox.Show(this, strErr); return; } int Buy_ID = int.Parse(this.txtBuy_ID.Text); int Product_ID = int.Parse(this.txtProduct_ID.Text); int BuyOrder_ID = int.Parse(this.txtBuyOrder_ID.Text); int Quantity = int.Parse(this.txtQuantity.Text); decimal Price = decimal.Parse(this.txtPrice.Text); ZhangWei.Model.Buy_Detail model = new ZhangWei.Model.Buy_Detail(); model.Buy_ID = Buy_ID; model.Product_ID = Product_ID; model.BuyOrder_ID = BuyOrder_ID; model.Quantity = Quantity; model.Price = Price; ZhangWei.BLL.Buy_Detail bll = new ZhangWei.BLL.Buy_Detail(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx"); }