Ejemplo n.º 1
0
 private void ShowInfo()
 {
     ZhangWei.BLL.LeaveStock_Detail   bll   = new ZhangWei.BLL.LeaveStock_Detail();
     ZhangWei.Model.LeaveStock_Detail model = bll.GetModel();
     this.txtLeaveStock_ID.Text = model.LeaveStock_ID.ToString();
     this.txtProduct_ID.Text    = model.Product_ID.ToString();
     this.txtQuantity.Text      = model.Quantity.ToString();
     this.txtPrice.Text         = model.Price.ToString();
 }
Ejemplo n.º 2
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtLeaveStock_ID.Text))
            {
                strErr += "LeaveStock_ID格式错误!\\n";
            }
            if (!PageValidate.IsNumber(txtProduct_ID.Text))
            {
                strErr += "Product_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     LeaveStock_ID = int.Parse(this.txtLeaveStock_ID.Text);
            int     Product_ID    = int.Parse(this.txtProduct_ID.Text);
            int     Quantity      = int.Parse(this.txtQuantity.Text);
            decimal Price         = decimal.Parse(this.txtPrice.Text);


            ZhangWei.Model.LeaveStock_Detail model = new ZhangWei.Model.LeaveStock_Detail();
            model.LeaveStock_ID = LeaveStock_ID;
            model.Product_ID    = Product_ID;
            model.Quantity      = Quantity;
            model.Price         = Price;

            ZhangWei.BLL.LeaveStock_Detail bll = new ZhangWei.BLL.LeaveStock_Detail();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }