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


C# FinancialAccountService.IsAuthorized方法代码示例

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


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

示例1: ShowDetail

        /// <summary>
        /// Shows the detail.
        /// </summary>
        /// <param name="accountId">The account identifier.</param>
        public void ShowDetail( int accountId )
        {
            FinancialAccount account = null;

            bool editAllowed = UserCanEdit;

            if ( !accountId.Equals( 0 ) )
            {
                account = new FinancialAccountService( new RockContext() ).Get( accountId );
                editAllowed = editAllowed || account.IsAuthorized( Authorization.EDIT, CurrentPerson );
                pdAuditDetails.SetEntity( account, ResolveRockUrl( "~" ) );
            }

            if ( account == null )
            {
                account = new FinancialAccount { Id = 0, IsActive = true };
                // hide the panel drawer that show created and last modified dates
                pdAuditDetails.Visible = false;
            }

            hfAccountId.Value = account.Id.ToString();

            nbEditModeMessage.Text = string.Empty;
            if (editAllowed)
            {
                ShowEditDetails(account);
            }
            else
            {
                nbEditModeMessage.Text = EditModeMessage.ReadOnlyEditActionNotAllowed(FinancialAccount.FriendlyTypeName);
                ShowReadonlyDetails(account);
            }
        }
开发者ID:NewSpring,项目名称:Rock,代码行数:37,代码来源:AccountDetail.ascx.cs

示例2: ShowDetail

        /// <summary>
        /// Shows the detail.
        /// </summary>
        /// <param name="itemKey">The item key.</param>
        /// <param name="itemKeyValue">The item key value.</param>
        public void ShowDetail( string itemKey, int itemKeyValue )
        {
            pnlDetails.Visible = false;

            if ( !itemKey.Equals( "accountId" ) )
            {
                return;
            }

            bool editAllowed = true;

            FinancialAccount account = null;

            if ( !itemKeyValue.Equals( 0 ) )
            {
                account = new FinancialAccountService( new RockContext() ).Get( itemKeyValue );
                editAllowed = account.IsAuthorized( Authorization.EDIT, CurrentPerson );
            }
            else
            {
                account = new FinancialAccount { Id = 0, IsActive = true };
            }

            if ( account == null )
            {
                return;
            }

            pnlDetails.Visible = true;
            hfAccountId.Value = account.Id.ToString();

            bool readOnly = false;

            nbEditModeMessage.Text = string.Empty;
            if ( !editAllowed || !IsUserAuthorized( Authorization.EDIT ) )
            {
                readOnly = true;
                nbEditModeMessage.Text = EditModeMessage.ReadOnlyEditActionNotAllowed( FinancialAccount.FriendlyTypeName );
            }

            if ( readOnly )
            {
                ShowReadonlyDetails( account );
            }
            else
            {
                ShowEditDetails( account );
            }
        }
开发者ID:CentralAZ,项目名称:Rockit-CentralAZ,代码行数:54,代码来源:AccountDetail.ascx.cs

示例3: ShowDetail

        /// <summary>
        /// Shows the detail.
        /// </summary>
        /// <param name="accountId">The account identifier.</param>
        public void ShowDetail( int accountId )
        {
            FinancialAccount account = null;

            bool editAllowed = UserCanEdit;

            if ( !accountId.Equals( 0 ) )
            {
                account = new FinancialAccountService( new RockContext() ).Get( accountId );
                editAllowed = editAllowed || account.IsAuthorized( Authorization.EDIT, CurrentPerson );
            }

            if ( account == null )
            {
                account = new FinancialAccount { Id = 0, IsActive = true };
            }

            hfAccountId.Value = account.Id.ToString();

            bool readOnly = false;

            nbEditModeMessage.Text = string.Empty;
            if ( !editAllowed || !editAllowed )
            {
                readOnly = true;
                nbEditModeMessage.Text = EditModeMessage.ReadOnlyEditActionNotAllowed( FinancialAccount.FriendlyTypeName );
            }

            if ( readOnly )
            {
                ShowReadonlyDetails( account );
            }
            else
            {
                ShowEditDetails( account );
            }
        }
开发者ID:tcavaletto,项目名称:Rock-CentralAZ,代码行数:41,代码来源:AccountDetail.ascx.cs


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