Example #1
0
        private void btnLoanDetails_Click(object sender, RoutedEventArgs e)
        {
            // must have a selected row
            if (dgTransactionDetails.SelectedItem == null)
            {
                return;
            }

            var currentItem = (CashVoucher)dgTransactionDetails.SelectedItem;

            // must be loan account
            if (!currentItem.AccountCode.Contains(GlobalSettings.CodeOfLoanReceivables))
            {
                return;
            }

            // display loan details
            if (currentItem.LoanDetails == null)
            {
                return;
            }
            var loanDetailsWindow = new LoanDetailsWindow(currentItem.LoanDetails);

            loanDetailsWindow.ShowDialog();
        }
        private void ShowLoanDetails()
        {
            if (_viewModel.SelectedItem == null)
            {
                return;
            }
            if (!_listLoanReceivableCode.Contains(_viewModel.SelectedItem.AccountCode))
            {
                return;
            }

            if (_viewModel.SelectedItem.LoanDetails == null)
            {
                _viewModel.SelectedItem.LoanDetails = new LoanDetails();
            }
            var view = new LoanDetailsWindow(_viewModel.SelectedItem.LoanDetails);

            view.ShowDialog();
        }