//修改卡片信息 private void tsbUpdateInfo_Click(object sender, EventArgs e) { CtbBookInformation updateBook = new CtbBookInformation(); _delegateRefreshAllInfo dlg = new _delegateRefreshAllInfo(RefreshAllInfo); if (dgvAllBookInfo.CurrentRow != null) { updateBook.bookID = int.Parse(dgvAllBookInfo.CurrentRow.Cells["bookID"].Value.ToString()); updateBook.bookSortID = int.Parse(dgvAllBookInfo.CurrentRow.Cells["bookSortID"].Value.ToString()); updateBook.bookName = dgvAllBookInfo.CurrentRow.Cells["bookName"].Value.ToString(); updateBook.bookAutor = dgvAllBookInfo.CurrentRow.Cells["bookAutor"].Value.ToString(); updateBook.bookPublish = dgvAllBookInfo.CurrentRow.Cells["bookPublish"].Value.ToString(); updateBook.bookPubDate = DateTime.Parse(dgvAllBookInfo.CurrentRow.Cells["bookPubDate"].Value.ToString()); updateBook.bookPrice = Decimal.Parse(dgvAllBookInfo.CurrentRow.Cells["bookPrice"].Value.ToString()); updateBook.bookSummary = dgvAllBookInfo.CurrentRow.Cells["bookSummary"].Value.ToString(); updateBook.bookRealNum = int.Parse(dgvAllBookInfo.CurrentRow.Cells["bookRealNum"].Value.ToString()); updateBook.bookLendNum = int.Parse(dgvAllBookInfo.CurrentRow.Cells["bookLendNum"].Value.ToString()); updateBook.bookResDate = DateTime.Parse(dgvAllBookInfo.CurrentRow.Cells["bookResDate"].Value.ToString()); frmBookInfoAddOrUpdate frmUpdate = new frmBookInfoAddOrUpdate(updateBook, dlg);//打开修改窗体 frmUpdate.Show(); } else { MessageBox.Show("请选中你要修改的信息再执行修改!", "操作提示"); } }
/// <summary> /// 添加图书卡片信息 /// </summary> private void toolStripButton2_Click(object sender, EventArgs e) { _delegateRefreshAllInfo dlg = new _delegateRefreshAllInfo(RefreshAllInfo); frmBookInfoAddOrUpdate fia = new frmBookInfoAddOrUpdate(dlg); fia.MdiParent = this.MdiParent; fia.Show(); }