/// <summary> /// 添加 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnAdd_Click(object sender, EventArgs e) { //获取当前dgv选择中的行图书编号 frmBookDetail objfrm = new frmBookDetail(); objfrm.actionflag = 1; DialogResult dr = objfrm.ShowDialog(); if (dr == DialogResult.OK) { List <BookExtModel> data = bkbll.GetAllBooks(); BindBook(data); } }
/// <summary> /// 修改 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnUpdate_Click(object sender, EventArgs e) { //获取当前dgv选择中的行图书编号 string bkid = dgvBook.CurrentRow.Cells[0].Value.ToString(); frmBookDetail objfrm = new frmBookDetail(); objfrm.bookid = bkid; objfrm.actionflag = 2; DialogResult dr = objfrm.ShowDialog(); if (dr == DialogResult.OK) { List <BookExtModel> data = bkbll.GetAllBooks(); BindBook(data); } }