//修改读者信息 private void tsbUpdateReader_Click(object sender, EventArgs e) { CtbReaderInformation updateReader = new CtbReaderInformation(); _delegateRefreshAllReader _dlg = new _delegateRefreshAllReader(RefreshAllReader); if (dgvAllReader.CurrentRow != null) { updateReader.readerID = int.Parse(dgvAllReader.CurrentRow.Cells["readerID"].Value.ToString()); updateReader.readerName = dgvAllReader.CurrentRow.Cells["readerName"].Value.ToString(); updateReader.readerSex = dgvAllReader.CurrentRow.Cells["readerSex"].Value.ToString(); updateReader.readerOffice = dgvAllReader.CurrentRow.Cells["readerOffice"].Value.ToString(); updateReader.readerDept = dgvAllReader.CurrentRow.Cells["readerDept"].Value.ToString(); updateReader.readerPhone = dgvAllReader.CurrentRow.Cells["readerPhone"].Value.ToString(); updateReader.readerHAddress = dgvAllReader.CurrentRow.Cells["readerHAddress"].Value.ToString(); updateReader.readerEmail = dgvAllReader.CurrentRow.Cells["readerEmail"].Value.ToString(); updateReader.readerResDate = DateTime.Parse(dgvAllReader.CurrentRow.Cells["readerResDate"].Value.ToString()); //打开修改窗体 frmReaderAddOrUpdate updateFrm = new frmReaderAddOrUpdate(updateReader, _dlg); updateFrm.MdiParent = this.MdiParent; updateFrm.Show(); } else { MessageBox.Show("没有要修改的信息,请选中你要修改的信息再执行修改操作!", "操作提示"); } }
/// <summary> /// 添加读者 /// </summary> private void tsbAddNewReader_Click(object sender, EventArgs e) { _delegateRefreshAllReader _dlg = new _delegateRefreshAllReader(RefreshAllReader); frmReaderAddOrUpdate frmAdd = new frmReaderAddOrUpdate(_dlg); frmAdd.MdiParent = this.MdiParent; frmAdd.Show(); }