private void buttonEditUser_Click(object sender, EventArgs e) { if (NoticeView.SelectedRows.Count == 0) { MessageBox.Show("请选择公告事项."); return; } int noticeId = Convert.ToInt32(NoticeView.SelectedRows[0].Cells["Id"].Value); BoardInfo noticeInfo = null; for (int i = 0; i < _NoticeList.Count; i++) { if (_NoticeList[i].Id == noticeId) { noticeInfo = _NoticeList[i]; break; } } AddNotice editNotice = new AddNotice(); editNotice._IsEditMode = true; editNotice._NoticeInfo = noticeInfo; editNotice.ShowDialog(); //if (editNotice.ShowDialog() == DialogResult.OK) //{ // MessageBox.Show("공지사항수정이 성공하였습니다."); // RefreshNoticeList(); //} }
private void buttonAddUser_Click(object sender, EventArgs e) { AddNotice addNotice = new AddNotice(); if (addNotice.ShowDialog() == DialogResult.OK) { MessageBox.Show("公告成功."); RefreshNoticeList(); } }