private void MemberButton_Click(object sender, EventArgs e) { MemberForm memberForm = new MemberForm(this); memberForm.Show(); this.Hide(); }
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); } }
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); } }
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); } }
private void btnNewMember_Click(object sender, EventArgs e) { MemberForm member = new MemberForm(_memberService); member.ShowDialog(); }