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


C# IPersistenceContext.BeginTransaction方法代码示例

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


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

示例1: WebSferaService

        public WebSferaService() 
        {
            _persistenceContext = _container.Resolve<IPersistenceContext>();
            _persistenceContext.BeginTransaction(Security.Login.Instance.CurrentLogin().LoginName, System.Data.IsolationLevel.Unspecified);
            var parameters = new Dictionary<string,object>(1) {{"deleted", "Y"}};
            _persistenceContext.EnableFilter("excludeDeletedCondominio", parameters);
            _persistenceContext.EnableFilter("excludeDeletedUnitaImmobiliari", parameters);

            var parametersRate = new Dictionary<string, object>(1) {{"stato", StatoRataEnum.Richiamata.ToString()}};
            _persistenceContext.EnableFilter("excludeRateRichiamate", parametersRate);
        }
开发者ID:gipasoft,项目名称:Sfera,代码行数:11,代码来源:WebSferaService.cs

示例2: BeginTransaction

		public LogTransazione BeginTransaction(UserInfo info, System.Data.IsolationLevel isolationLevel, bool isTransazioneLog = false, bool? flushOnCommit = null)
		{
		    try
		    {
		        var daoFactory = GetDaoFactory(info.Azienda);
		        var utenti = daoFactory.GetUtenteDao().GetByAzienda(info.Azienda);

		        _container = GetContainer(info.Azienda);
		        _persistenceContext = _container.Resolve<IPersistenceContext>();

		        var singleOrDefault = utenti.SingleOrDefault(item => item.ID == info.Utente);
		        if (singleOrDefault != null)
                    _utente = singleOrDefault.Referente != null ? singleOrDefault.Referente.PersonaRiferimento.Nome : singleOrDefault.Nome;

                _persistenceContext.BeginTransaction(_utente, isolationLevel, flushOnCommit);
                var parameters = new Dictionary<string, object>(1) {{"deleted", "Y"}};
                _persistenceContext.EnableFilter("excludeDeletedCondominio", parameters);
                _persistenceContext.EnableFilter("excludeDeletedUnitaImmobiliari", parameters);
                _persistenceContext.EnableFilter("excludeDeletedSottoconto", parameters);

                var parametersRate = new Dictionary<string, object>(1) {{"stato", StatoRataEnum.Richiamata.ToString()}};
                _persistenceContext.EnableFilter("excludeRateRichiamate", parametersRate);

                LogTransazione logTransazione = null;
                if (isTransazioneLog)
                {
                    _logTransazioneService = _container.Resolve<ILogTransazioneService>();
                    logTransazione = _logTransazioneService.AddLog(info.Utente, AzioneUtente.TransazioneContabile);
                }

                return logTransazione;
            }
            catch (Exception ex)
            {
                var log = LogManager.GetLogger("Sfera");
                log.FatalFormat("Errore durante la inizializzazione della transazione - {0} - idAzienda:{1} - utente:{2}", ex, Library.Utility.GetMethodDescription(), info.Azienda, info.Utente);
                throw;
            }
		}
开发者ID:gipasoft,项目名称:Sfera,代码行数:39,代码来源:WindsorConfigRepository.cs


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