public void ViewSelectedRecord()
        {
            var member         = (Member)dgMember.SelectedItem;
            var viewMemberForm = new frmAccount(member);
            var result         = viewMemberForm.ShowDialog();

            if (result == true)
            {
                try
                {
                    _currentMembers = null;
                    _members        = _memberManager.RetrieveAllMembers();

                    if (_currentMembers == null)
                    {
                        _currentMembers = _members;
                    }
                    dgMember.ItemsSource = _currentMembers;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }
Beispiel #2
0
        private void BtnViewMemberDetails_Click(object sender, RoutedEventArgs e)
        {
            frmAccount memberDetail = new frmAccount(_member);
            var        formResult   = memberDetail.ShowDialog();

            if (formResult == true)
            {
                // If the member form was edited, refresh the guest.
                try
                {
                    _member = _memberManager.RetrieveMember(_member.MemberID);
                }
                catch (Exception)
                {
                    throw;
                }
                populateMemberTextBoxes();
            }
        }
        /// <summary>
        /// Author: Ramesh Adhikari
        /// Created On: 02/22/2019
        /// when click on add member a new empty form will displays
        /// </summary>

        private void btnAddMember_Click(object sender, RoutedEventArgs e)
        {
            var createMemberForm = new frmAccount();
            var formResult       = createMemberForm.ShowDialog();

            if (formResult == true)
            {
                try
                {
                    _currentMembers = null;
                    _members        = _memberManager.RetrieveAllMembers();

                    if (_currentMembers == null)
                    {
                        _currentMembers = _members;
                    }
                    dgMember.ItemsSource = _currentMembers;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }