当前位置: 首页>>代码示例>>C#>>正文


C# FinancialTransactionService.Any方法代码示例

本文整理汇总了C#中Rock.Model.FinancialTransactionService.Any方法的典型用法代码示例。如果您正苦于以下问题:C# FinancialTransactionService.Any方法的具体用法?C# FinancialTransactionService.Any怎么用?C# FinancialTransactionService.Any使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Rock.Model.FinancialTransactionService的用法示例。


在下文中一共展示了FinancialTransactionService.Any方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowReadOnlyDetails

        /// <summary>
        /// Shows the read only details.
        /// </summary>
        /// <param name="txn">The TXN.</param>
        private void ShowReadOnlyDetails( FinancialTransaction txn )
        {
            SetEditMode( false );

            if ( txn != null && txn.Id > 0 )
            {
                hfTransactionId.Value = txn.Id.ToString();

                SetHeadingInfo( txn );

                string rockUrlRoot = ResolveRockUrl( "/" );

                var detailsLeft = new DescriptionList()
                    .Add( "Person", ( txn.AuthorizedPersonAlias != null && txn.AuthorizedPersonAlias.Person != null ) ? txn.AuthorizedPersonAlias.Person.GetAnchorTag( rockUrlRoot ) : string.Empty )
                    .Add( "Date/Time", txn.TransactionDateTime.HasValue ? txn.TransactionDateTime.Value.ToString( "g" ) : string.Empty );

                if ( txn.Batch != null )
                {
                    var qryParam = new Dictionary<string, string>();
                    qryParam.Add( "BatchId", txn.Batch.Id.ToString() );
                    string url = LinkedPageUrl( "BatchDetailPage", qryParam );
                    detailsLeft.Add( "Batch", !string.IsNullOrWhiteSpace( url ) ?
                        string.Format( "<a href='{0}'>{1}</a>", url, txn.Batch.Name ) :
                        txn.Batch.Name );
                }

                detailsLeft.Add( "Source", txn.SourceTypeValue != null ? txn.SourceTypeValue.Value : string.Empty );

                if ( txn.FinancialGateway != null )
                {
                    detailsLeft.Add( "Payment Gateway", Rock.Financial.GatewayContainer.GetComponentName( txn.FinancialGateway.Name ) );
                }

                detailsLeft.Add( "Transaction Code", txn.TransactionCode );

                if ( txn.ScheduledTransaction != null )
                {
                    var qryParam = new Dictionary<string, string>();
                    qryParam.Add( "ScheduledTransactionId", txn.ScheduledTransaction.Id.ToString() );
                    string url = LinkedPageUrl( "ScheduledTransactionDetailPage", qryParam );
                    detailsLeft.Add( "Scheduled Transaction Id", !string.IsNullOrWhiteSpace( url ) ?
                        string.Format( "<a href='{0}'>{1}</a>", url, txn.ScheduledTransaction.GatewayScheduleId ) :
                        txn.ScheduledTransaction.GatewayScheduleId );
                }

                if ( txn.FinancialPaymentDetail != null )
                {
                    detailsLeft.Add( "Account #", txn.FinancialPaymentDetail.AccountNumberMasked );
                    if ( txn.FinancialPaymentDetail.CurrencyTypeValue != null )
                    {
                        string currencyType = txn.FinancialPaymentDetail.CurrencyTypeValue.Value;
                        if ( txn.FinancialPaymentDetail.CurrencyTypeValue.Guid.Equals( Rock.SystemGuid.DefinedValue.CURRENCY_TYPE_CREDIT_CARD.AsGuid() ) )
                        {
                            currencyType += txn.FinancialPaymentDetail.CreditCardTypeValue != null ? ( " - " + txn.FinancialPaymentDetail.CreditCardTypeValue.Value ) : string.Empty;
                        }
                        detailsLeft.Add( "Currency Type", currencyType );
                    }
                }

                var registrationEntityType = EntityTypeCache.Read( typeof( Rock.Model.Registration ) );
                if ( registrationEntityType != null )
                {
                    var registrationIds = txn.TransactionDetails
                        .Where( d => d.EntityTypeId == registrationEntityType.Id )
                        .Select( d => d.EntityId )
                        .Distinct()
                        .ToList();

                    if ( registrationIds.Any() )
                    {
                        var registrationLinks = new List<string>();
                        using ( var rockContext = new RockContext() )
                        {
                            foreach ( var registration in new RegistrationService(rockContext)
                                .Queryable().AsNoTracking()
                                .Where( r =>
                                    r.RegistrationInstance != null &&
                                    r.RegistrationInstance.RegistrationTemplate != null &&
                                    registrationIds.Contains( r.Id ) ) )
                            {
                                var qryParam = new Dictionary<string, string>();
                                qryParam.Add("RegistrationId", registration.Id.ToString() );
                                registrationLinks.Add( string.Format( "<a href='{0}'>{1} - {2}</a>",
                                    LinkedPageUrl( "RegistrationDetailPage", qryParam ),
                                    registration.RegistrationInstance.RegistrationTemplate.Name,
                                    registration.RegistrationInstance.Name ) );
                            }
                        }
                        if ( registrationLinks.Any() )
                        {
                            detailsLeft.Add( "Registration", registrationLinks.AsDelimited( "<br/>" ) );
                        }
                    }
                }

                detailsLeft.Add( "Summary", txn.Summary.ConvertCrLfToHtmlBr() );
//.........这里部分代码省略.........
开发者ID:NewSpring,项目名称:Rock,代码行数:101,代码来源:TransactionDetail.ascx.cs


注:本文中的Rock.Model.FinancialTransactionService.Any方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。