Esempio n. 1
0
        /// <summary>
        /// Finds the first account.
        /// </summary>
        /// <returns></returns>
        private FinancialAccount FindFirstAccount()
        {
            var accounts = new FinancialAccountService(new RockContext());

            var qry = accounts.GetChildren(0, !tglHideInactiveAccounts.Checked);

            foreach (var account in qry.OrderBy(g => g.Order).ThenBy(g => g.Name))
            {
                // return first account they are authorized to view
                if (account.IsAuthorized(Authorization.VIEW, CurrentPerson))
                {
                    return(account);
                }
            }

            return(null);
        }