private void NewButton_Click( object sender, EventArgs e ) { var member = Member.Create(); using( var dlg = new EditMemberForm( member, members ) ) { if( dlg.ShowDialog( this ) != DialogResult.OK ) return; try { MemberDAL.Insert( member ); Push( member ); LoadMembers(); Bind(); UpdateView(); Pop(); } catch( ApplicationException exc ) { MessageBox.Show( this, "Error : " + exc.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error ); } } }
private void EditButton_Click( object sender, EventArgs e ) { var member = CurrentMember; if( member == null ) return; using( var dlg = new EditMemberForm( member, members ) ) { var result = dlg.ShowDialog( this ); try { if( result == DialogResult.OK ) MemberDAL.Update( member ); Push( member ); LoadMembers(); Bind(); UpdateView(); Pop(); } catch( ApplicationException exc ) { MessageBox.Show( this, "Error : " + exc.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error ); } } }