コード例 #1
0
        /// <summary>
        /// Gets the account participants state from database.
        /// </summary>
        /// <param name="purposeKeys">The purpose keys.</param>
        /// <returns>List&lt;AccountParticipantInfo&gt;.</returns>
        private List <AccountParticipant> GetAccountParticipantStateFromDatabase()
        {
            var accountId = hfAccountId.Value.AsInteger();

            var financialAccountService  = new FinancialAccountService(new RockContext());
            var accountParticipantsQuery = financialAccountService.GetAccountParticipantsAndPurpose(accountId);

            var participantsState = accountParticipantsQuery
                                    .ToList()
                                    .Select(a => new AccountParticipant
            {
                PersonAliasId  = a.PersonAlias.Id,
                PersonFullName = a.PersonAlias.Person.FullName,
                PurposeKey     = a.PurposeKey
            }).ToList();

            return(participantsState);
        }