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


C# ApplicationException.Create方法代码示例

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


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

示例1: CreateObjectFromOwner

        public void CreateObjectFromOwner(ApplicationException _ApplicationException, Services.Packages.Security.ModelUser _Owner, string SessionToken)
        {
            ModelSession session = ApplicationExceptionSecureService.CheckSessionImp(SessionToken);

            //if (!Services.Packages.Security.Security.ModelUserSecureService.CheckAccessImp(_Owner, SessionToken, "Create ApplicationExceptionOwning"))
            //	throw new UnauthorizedAccessException("Access Denied");

            _ApplicationException.Reload();

            if (!_ApplicationException.Exists && !Services.Packages.Security.Security.ModelUserSecureService.CheckAccessImp(_Owner, SessionToken, "Create ApplicationExceptionOwning"))
                throw new UnauthorizedAccessException("Access Denied");
            else if (_ApplicationException.Exists && !ApplicationExceptionSecureService.CheckAccessImp(_ApplicationException, SessionToken, "Update"))
                throw new UnauthorizedAccessException("Access Denied");

            _ApplicationException.Owner = session.User;
            _ApplicationException.Owner = _Owner;
            _ApplicationException.Create();
        }
开发者ID:phaetto,项目名称:services-update,代码行数:18,代码来源:Services.Packages.Log.Security.ApplicationExceptionSecureService.cs

示例2: CreateObjectFromParentException

        public void CreateObjectFromParentException(ApplicationException _ApplicationException, Services.Packages.Log.ApplicationException _ParentException, string SessionToken)
        {
            ModelSession session = ApplicationExceptionSecureService.CheckSessionImp(SessionToken);

            //if (!Services.Packages.Log.Security.ApplicationExceptionSecureService.CheckAccessImp(_ParentException, SessionToken, "Create InnerExceptions"))
            //	throw new UnauthorizedAccessException("Access Denied");

            _ApplicationException.Reload();

            if (!_ApplicationException.Exists && !Services.Packages.Log.Security.ApplicationExceptionSecureService.CheckAccessImp(_ParentException, SessionToken, "Create InnerExceptions"))
                throw new UnauthorizedAccessException("Access Denied");
            else if (_ApplicationException.Exists && !ApplicationExceptionSecureService.CheckAccessImp(_ApplicationException, SessionToken, "Update"))
                throw new UnauthorizedAccessException("Access Denied");

            _ApplicationException.Owner = session.User;
            _ApplicationException.ParentException = _ParentException;
            _ApplicationException.Create();
        }
开发者ID:phaetto,项目名称:services-update,代码行数:18,代码来源:Services.Packages.Log.Security.ApplicationExceptionSecureService.cs

示例3: CreateObject

        public void CreateObject(ApplicationException _ApplicationException, string SessionToken)
        {
            ModelSession session = ApplicationExceptionSecureService.CheckSessionImp(SessionToken);

            if (!ApplicationExceptionSecureService.CheckUserRightsImp(session.User.Name, "Create " + typeof(ApplicationException).FullName))
                throw new UnauthorizedAccessException("Access Denied");

            _ApplicationException.Owner = session.User;
            _ApplicationException.Create();
        }
开发者ID:phaetto,项目名称:services-update,代码行数:10,代码来源:Services.Packages.Log.Security.ApplicationExceptionSecureService.cs


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