Beispiel #1
0
        private static void Start(JobContext context)
        {
            Stopwatch sw = new Stopwatch();

            Console.ForegroundColor = ConsoleColor.Green;
            WriteLog("************************************************");
            WriteLog("*");
            WriteLog("*  在没有提示可以安全退出时,不要人为退出程序。");
            WriteLog("*");
            WriteLog("************************************************");
            Console.ResetColor();
            ReportBP.ShowInfo = new ReportBP.ShowMsg(WriteLog);
            sw.Start();
            try
            {
                ReportBP.DoWork(context);
            }
            catch (Exception ex)
            {
                WriteLog(ex.ToString());
                ReportBP.SendMail(Settings.EmailAddressError, Settings.EmailSubjectError, ex.ToString(), 0);
            }
            sw.Stop();
            WriteLog("本轮结束!");
            WriteLog(string.Format("本次任务共耗时 {0} 秒", sw.Elapsed.TotalSeconds));
        }
        private void FormateETSReports(int type)
        {
            AppJournal.Write("Auctions List", "ETS reports formating", true);

            string sourceFileName = "";
            bool   errStatus      = false;

            try {
                sourceFileName = Service.GetFile("Выберите файл отчета", "(IPO_RPT*.xml) | *.xml").FullName;
            } catch (Exception ex) { AppJournal.Write("ETS Reports formating", "error :" + ex.ToString(), true); }

            if (!string.IsNullOrEmpty(sourceFileName))
            {
                try {
                    ReportBP.MakeNewReport(sourceFileName, type);
                    errStatus = false;
                } catch (Exception ex) {
                    errStatus = true;
                    AppJournal.Write("ETS Reports formating", "error :" + ex.ToString(), true);
                }

                if (errStatus)
                {
                    MessagesService.Show("Формирование отчетов", "При формировании произошла ошибка");
                }
                else
                {
                    MessagesService.Show("Формирование отчетов", "Отчеты сформированы");
                }
            }
        }
Beispiel #3
0
        private static void NewReportReaction(object p)
        {
            var e           = (NewReportEventArg)p;
            var reportCount = ReportBP.MakeNewReports(e.ReportDocument);

            AltaLog.AppJournal.Write(System.Reflection.MethodBase.GetCurrentMethod().Name, "Reports Count " + reportCount);

            Process.Start("explorer", ReportBP.GetReportsPath());
        }
Beispiel #4
0
        private static void OnReport()
        {
            var reportCount = ReportBP.MakeNewReports();

            if (reportCount == 0)
            {
                MessageBox.Show("Отчеты не найдены");
            }

            AppJournal.Write(System.Reflection.MethodBase.GetCurrentMethod().Name, "Reports Count = " + reportCount);
            //Debug.Write("ReportViewModel: Reports Count " + reportCount);

            Process.Start("explorer", ReportBP.GetReportsPath());
        }