예제 #1
0
        public void btnSave_Click(object sender, EventArgs e)
        {
            string strErr = "";

            if (!PageValidate.IsNumber(txtquantity.Text))
            {
                strErr += "quantity格式错误!\\n";
            }
            if (this.txtboookState.Text.Trim().Length == 0)
            {
                strErr += "boookState不能为空!\\n";
            }

            if (strErr != "")
            {
                MessageBox.Show(this, strErr);
                return;
            }
            string orderNo    = this.lblorderNo.Text;
            string ISBN       = this.lblISBN.Text;
            int    quantity   = int.Parse(this.txtquantity.Text);
            string boookState = this.txtboookState.Text;


            BookShop.Model.Sale model = new BookShop.Model.Sale();
            model.orderNo    = orderNo;
            model.ISBN       = ISBN;
            model.quantity   = quantity;
            model.boookState = boookState;

            BookShop.BLL.Sale bll = new BookShop.BLL.Sale();
            bll.Update(model);
            Maticsoft.Common.MessageBox.ShowAndRedirect(this, "保存成功!", "list.aspx");
        }
예제 #2
0
 private void ShowInfo(string orderNo, string ISBN)
 {
     BookShop.BLL.Sale   bll   = new BookShop.BLL.Sale();
     BookShop.Model.Sale model = bll.GetModel(orderNo, ISBN);
     this.lblorderNo.Text    = model.orderNo;
     this.lblISBN.Text       = model.ISBN;
     this.txtquantity.Text   = model.quantity.ToString();
     this.txtboookState.Text = model.boookState;
 }