Пример #1
0
        /// <summary>
        /// 保存修改信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSave_Click(object sender, EventArgs e)
        {
            // 创建添加的对象
            BookInfo book = new BookInfo();

            book.BookId     = txtBookId.Text.Trim();
            book.BookName   = txtBookName.Text.Trim();
            book.TimeIn     = TimeIn.Value;
            book.BookTypeId = (int)cboBookTypeId.SelectedValue;
            book.Author     = txtAuthor.Text.Trim();
            book.PinYinCode = txtPinYinCode.Text.Trim();
            book.Translator = txtTranslator.Text.Trim();
            book.Language   = txtLanguge.Text.Trim();
            book.BookNumber = txtBookNumber.Text.Trim();
            book.Price      = txtPrice.Text.Trim();
            book.Layout     = txtLayout.Text.Trim();
            book.Address    = txtAddress.Text.Trim();
            book.ISBS       = txtISBS.Text.Trim();
            book.Versions   = txtVersions.Text.Trim();
            book.BookRemark = txtBookRemark.Text.Trim();

            if (bookInfo.ExitBookInfo(book) > 0)
            {
                MessageBox.Show("修改信息成功!");
                // 单击查询
                manager.btnSelect_Click(null, null);
                // 自动找到刚刚修改成功的行,并选中
                com.AutoFindRow(txtBookId.Text.Trim(), this.manager.dataGridView1);
            }
            else
            {
                MessageBox.Show("修改信息失败!");
            }
        }
Пример #2
0
 //窗口关闭时为了刷新前一个窗体的下拉菜单
 private void Add_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (bookInfoExit != null)
     {
         bookInfoExit.BookInfoExit_UI_Load(null, null);
     }
     if (readerExit != null)
     {
         readerExit.ReaderExit_UI_Load(null, null);
     }
     if (Manager != null)
     {
         Manager.treeView1.Nodes.Clear();
         Manager.TreeViewBand();
         Manager.btnSelect_Click(null, null);
     }
     if (bookInfoAdd != null)
     {
         bookInfoAdd.BookInfoAdd_UI_Load(null, null);
     }
     if (readerManager != null)
     {
         readerManager.treeView1.Nodes.Clear();
         readerManager.TreeViewBand();
         readerManager.btnSelect_Click(null, null);
     }
 }