Beispiel #1
0
 private void btn_editMember_Click(object sender, EventArgs e)
 {
     MemberForm form = new MemberForm(pMemberService, pMember);
     try
     {
         if (DialogResult.OK == form.ShowDialog())
         {
             pMemberService.EditMember(form.Member);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #2
0
        private void msp_file_add_member_Click(object sender, EventArgs e)
        {
            MemberForm form = new MemberForm(memberService);

            try
            {
                if (DialogResult.OK == form.ShowDialog())
                {
                    memberService.AddMember(form.Member);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #3
0
        private void msp_edit_member_Click(object sender, EventArgs e)
        {
            if (null == SelectedMember) // Unknown state, crash application deliberately
            {
                throw new InvalidOperationException("Should not be able to click disabled controls.");
            }
            MemberForm form = new MemberForm(memberService, SelectedMember);

            try
            {
                if (DialogResult.OK == form.ShowDialog())
                {
                    memberService.EditMember(form.Member);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Beispiel #4
0
        private void btnNewMember_Click(object sender, EventArgs e)
        {
            MemberForm member = new MemberForm(_memberService);

            member.ShowDialog();
        }