private bool TryInsertNewDonationTransaction(DonorSimpleEntryViewModel vm)
        {
            bool success = false;

            try
            {
                AccountingTransaction transaction = new AccountingTransaction();
                transaction.AccountTransactionID = Guid.NewGuid();
                transaction.Amount = vm.Amount.GetValueOrDefault();
                transaction.TransactionDate = vm.TransactionDate.GetValueOrDefault();
                transaction.AccountingTransactionSource = new AccountingTransactionSource() { DonationDonorEntityID = vm.DonationDonorEntityID };
                transaction.Description = "Donation Entry (" + vm.DonorEntryTitle + ")";

                IEnumerable<AccountingTransactionAccount> accounts = unitOfWork.AccountingTransactionAccountRepository.Get(x => x.Active && x.IsDonation && (x.IsDefaultCredit || x.IsDefaultDebit));

                foreach (var account in accounts)
                {
                    transaction.AccountingTransactionAccountingTransactionAccounts.Add(new AccountingTransactionAccountingTransactionAccount()
                    {
                        AccountingTransactionAccount = account,
                        IsTransactionCredit = account.IsDefaultCredit
                    });
                }

                unitOfWork.AccountingTransactionRepository.Insert(transaction);
                unitOfWork.Save();
                success = true;
            }
            catch (Exception e)
            {
                e.LogException();
            }

            return success;
        }
        public ActionResult Index(int donationDonorEntityID, string donorEntryTitle = null)
        {
            DonorSimpleEntryViewModel vm = new DonorSimpleEntryViewModel();
            vm.DonationDonorEntityID = donationDonorEntityID;
            vm.DonorEntryTitle = donorEntryTitle;

            return View(vm);
        }
        public ActionResult AddDonationTransaction(DonorSimpleEntryViewModel vm)
        {
            if (ModelState.IsValid)
            {
                if (TryInsertNewDonationTransaction(vm))
                {

                }
                return RedirectToAction("Index", "Donor");
            }

            return View("Index", vm);
        }