Example #1
0
        private void timerBuildPerformance_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            try
            {
                timerBuildPerformance.Stop();
                LogHelper.WriteLog("计算业绩", "开始计算业绩", true);
                string yearMonthString = DateTime.Now.ToString("yyyyMM");
                int    yearMonth       = Convert.ToInt32(yearMonthString);
                bllDis.BuildMonthPerformance(yearMonth, websiteOwner);

                string lastyearMonthString = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
                int    curLastyearMonth    = Convert.ToInt32(lastyearMonthString);
                if (curLastyearMonth != lastYearMonth)
                {
                    bllDis.BuildMonthPerformance(curLastyearMonth, websiteOwner);
                    lastYearMonth = curLastyearMonth;
                }

                LogHelper.WriteLog("计算业绩", "完成计算业绩", true);
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog("计算业绩", "计算业绩出错:" + ex.Message, true);
            }
            finally
            {
                timerBuildPerformance.Start();
            }
        }