示例#1
0
 private void btnLoadBook_Click(object sender, EventArgs e)
 {
     book = BookManage.getBookByISBN(txtISBN.Text);
     if (book != null)
     {
         BookInfo();
     }
 }
示例#2
0
        private void lvSale_Click(object sender, EventArgs e)
        {
            this.txtISBN.Text = lvSale.SelectedItems[0].Text;
            //this.nudCount.Value = int.Parse(lvSale.SelectedItems[0].Tag.ToString());
            int id = (int)lvSale.SelectedItems[0].Tag;

            foreach (SaleItems item in items)
            {
                if (id == item.Id)
                {
                    this.nudCount.Value = item.Count;
                    break;
                }
            }
            book = BookManage.getBookByISBN(txtISBN.Text);
            if (book != null)
            {
                BookInfo();
            }
        }
示例#3
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     book = BookManage.getBookByISBN(txtISBN.Text);
     if (book != null)
     {
         if (this.nudCount.Value > book.Stock)
         {
             MessageBox.Show("库存不足!");
         }
         else
         {
             BookInfo();
             addSaleItem();
             loadlvSale();
             this.nudCount.Value = 1;
             this.txtISBN.Text   = "";
         }
     }
     else
     {
         MessageBox.Show("ISBN码错误!");
     }
 }