/// <summary> /// Adds a new member. /// </summary> private void addToolStripMenuItem_Click(object sender, EventArgs e) { using (var form = new FormMember()) { if (form.ShowDialog() == DialogResult.OK) { // Redisplay list of members _membersPresenter.Display(); } } }
/// <summary> /// Edits an existing member record. /// </summary> private void editToolStripMenuItem_Click(object sender, EventArgs e) { // Check if a node is selected (and not the root) if (treeViewMember.SelectedNode == null || treeViewMember.SelectedNode.Text == "Members") { MessageBox.Show("No member is currently selected", "Edit Member", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } using (var form = new FormMember()) { var member = treeViewMember.SelectedNode.Tag as MemberModel; form.MemberId = member.MemberId; if (form.ShowDialog() == DialogResult.OK) { // Redisplay list of members _membersPresenter.Display(); } } }
/// <summary> /// Edits an existing member record. /// </summary> private void editToolStripMenuItem_Click(object sender, EventArgs e) { // Check if a node is selected (and not the root) if (treeViewMember.SelectedNode == null || treeViewMember.SelectedNode.Text == "Members") { MessageBox.Show("No member is currently selected", "Edit Member", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } using (var form = new FormMember()) { var member = treeViewMember.SelectedNode.Tag as MemberModel; form.MemberId = member.MemberId; if (form.ShowDialog() == DialogResult.OK) { // Redisplay list of members _membersPresenter.Display(); } } }
/// <summary> /// Adds a new member. /// </summary> private void addToolStripMenuItem_Click(object sender, EventArgs e) { using (var form = new FormMember()) { if (form.ShowDialog() == DialogResult.OK) { // Redisplay list of members _membersPresenter.Display(); } } }