Пример #1
0
 /// <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();
         }
     }
 }
Пример #2
0
        /// <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();
                }
            }
        }
Пример #3
0
        /// <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();
                }
            }
        }
Пример #4
0
 /// <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();
         }
     }
 }