コード例 #1
0
        private void ExceptionViewer_Loaded(object sender, RoutedEventArgs e)
        {
            if ((object)ExceptionMonitor.Default == null)
            {
                m_ExceptionMonitor = new ExceptionMonitor(true);
            }

            m_dataContext.Monitor = ExceptionMonitor.Default ?? m_ExceptionMonitor;

            TextBlockExceptionRefreshInterval.Text = m_dataContext.Monitor.RefreshInterval.ToString();
            TextBoxRefreshInterval.Text            = m_dataContext.Monitor.RefreshInterval.ToString();
            m_dataContext.Monitor.Start();
        }
コード例 #2
0
        /// <summary>
        /// Creates a new <see cref="DataFilter"/> object using the specified exception filter and compression filter settings.
        /// </summary>
        /// <param name="name">The name for the filter.</param>
        /// <param name="exceptionSettings">The exception filter settings.  If <see langword="null"/>, a default (disabled) exception filter will be assigned to the buffer.</param>
        /// <param name="compressionSettings">The compression filter settings.  If <see langword="null"/>, a default (disabled) compression filter will be assigned to the buffer.</param>
        /// <param name="loggerFactory">The <see cref="ILoggerFactory"/> to use for logging.</param>
        public DataFilter(string name, ExceptionFilterState exceptionSettings, CompressionFilterState compressionSettings, ILoggerFactory loggerFactory)
        {
            Log            = loggerFactory?.CreateLogger <DataFilter>();
            CanLogDebug    = Log?.IsEnabled(LogLevel.Debug) ?? false;
            CanLogTraceLog = Log?.IsEnabled(LogLevel.Trace) ?? false;

            Name                = name;
            ExceptionFilter     = exceptionSettings ?? throw new ArgumentNullException(nameof(exceptionSettings));
            CompressionFilter   = compressionSettings ?? throw new ArgumentNullException(nameof(compressionSettings));
            _exceptionMonitor   = new ExceptionMonitor(this);
            _compressionMonitor = new CompressionMonitor(this);
            IsEnabled           = true;
        }
コード例 #3
0
        /// <summary>
        /// 释放优惠券券(根据优惠券PKID),清空订单的PromotionMoney,清空OrderList PromotionCode.PromotionMoney
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="codePkid"></param>
        public void ReleasePromtionByPromotionId(int orderId, int codePkid)
        {
            using (var client = new PromotionClient())
            {
                var result = client.ReleasePromtionByOrderId(orderId, ThreadIdentity.Operator.Name);
                if (!result.Success)
                {
                    ExceptionMonitor.AddNewMonitor("Order", orderId.ToString(), result.Exception.ToString(),
                                                   ThreadIdentity.Operator.Name, "调用ReleasePromtionByPromotionId方法报错", MonitorLevel.Critial, MonitorModule.Order);
                }
            }

            new OprLogManager().AddOprLog("Order", orderId, codePkid + "已使用", codePkid + "未使用", "释放优惠卷,优惠券PKID为:" + codePkid);
        }
コード例 #4
0
        public List <TagConfigModel> GetAllPushTag(SqlConnection connection)
        {
            List <TagConfigModel> result = null;

            try
            {
                result = DalPush.GetAllPushTag(connection);
            }
            catch (Exception ex)
            {
                logger.Log(Level.Error, ex.Message);
                ExceptionMonitor.AddNewMonitor("Push", ex, "GetAllPushTag", MonitorLevel.Error);
            }

            return(result);
        }
コード例 #5
0
        public List <TagConfigModel> GetAllPushTag()
        {
            List <TagConfigModel> result = null;

            try
            {
                result = dbScopeManagerBI.Execute(conn => handler.GetAllPushTag(conn));
            }
            catch (Exception ex)
            {
                logger.Log(Level.Error, ex.Message);
                ExceptionMonitor.AddNewMonitor("Push", ex, "GetAllPushTag", MonitorLevel.Error);
            }

            return(result);
        }
コード例 #6
0
        private void ExceptionViewer_Loaded(object sender, RoutedEventArgs e)
        {
            if ((object)ExceptionMonitor.Default == null)
                m_ExceptionMonitor = new ExceptionMonitor(true);

            m_dataContext.Monitor = ExceptionMonitor.Default ?? m_ExceptionMonitor;

            TextBlockExceptionRefreshInterval.Text = m_dataContext.Monitor.RefreshInterval.ToString();
            TextBoxRefreshInterval.Text = m_dataContext.Monitor.RefreshInterval.ToString();
            m_dataContext.Monitor.Start();
        }