Get() public method

Gets the specified bank account record.
public Get ( string routingNumber, string accountNumber ) : FinancialPersonBankAccount
routingNumber string The routing number.
accountNumber string The account number.
return FinancialPersonBankAccount
Ejemplo n.º 1
0
        /// <summary>
        /// Handles the Delete event of the gList control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RowEventArgs"/> instance containing the event data.</param>
        protected void gList_Delete( object sender, RowEventArgs e )
        {
            var rockContext = new RockContext();
            var financialPersonBankAccountService = new FinancialPersonBankAccountService( rockContext );
            var financialPersonBankAccount = financialPersonBankAccountService.Get( e.RowKeyId );

            if ( financialPersonBankAccount != null )
            {
                string errorMessage;
                if ( !financialPersonBankAccountService.CanDelete( financialPersonBankAccount, out errorMessage ) )
                {
                    mdGridWarning.Show( errorMessage, ModalAlertType.Information );
                    return;
                }

                financialPersonBankAccountService.Delete( financialPersonBankAccount );
                rockContext.SaveChanges();
            }

            BindGrid();
        }