Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            TxtFileLogger logger = LoggerManager.GetLogger();

            try
            {
                new TopItemBP().Process();
                logger.WriteLog("置顶商品缺货通知完成!");
            }
            catch (Exception ex)
            {
                JobHelper.SendExceptionMail(ex.ToString());
                logger.WriteLog(ex.ToString());
            }
        }
Ejemplo n.º 2
0
        public static void SendEmail(MailEntity mailEntity)
        {
            TxtFileLogger logger = LoggerManager.GetLogger();

            try
            {
                var mailService = ServiceBroker.FindService <IPP.Oversea.CN.ServiceCommon.ServiceInterfaces.ServiceContracts.ISendMail>();
                var mail        = new MailBodyV31
                {
                    Body = new MailBodyMsg
                    {
                        MailTo        = mailEntity.To,
                        CCMailAddress = mailEntity.CC,
                        Subjuect      = mailEntity.Subject,
                        MailBody      = mailEntity.Body,
                        Status        = 0, //0:未发送,1:已经发送
                        CreateDate    = DateTime.Now,
                        Priority      = 1  // Normal
                    }
                };

                mail.Header             = new MessageHeader();
                mail.Header.CompanyCode = ConfigurationManager.AppSettings["CompanyCode"];
                DefaultDataContract result = mailService.SendMail2IPP3Internal(mail);
                if (result.Faults != null && result.Faults.Count > 0)
                {
                    throw new Exception(result.Faults[0].ErrorDescription);
                }
            }
            catch (Exception ex)
            {
                logger.WriteLog("邮件发送失败!\r\n" + ex.ToString());
            }
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            TxtFileLogger logger = LoggerManager.GetLogger();

            try
            {
                logger.WriteLog("任务开始。");

                BaiduBPV2 bp = new BaiduBPV2(logger);
                bp.Process();

                logger.WriteLog("任务结束。");

                //BaiduBP processor = new BaiduBP();
                //processor.Init();
                //processor.Process();
            }
            catch (Exception ex)
            {
                logger.WriteLog(ex.ToString());
                JobHelper.SendMail(ex.ToString());
                logger.WriteLog("百度搜索Datafeed处理完成!");
            }
        }
Ejemplo n.º 4
0
        public void Process()
        {
            txtFileLogger.WriteLog("开始准备数据。");
            this.Init();
            txtFileLogger.WriteLog("准备数据结束。");

            txtFileLogger.WriteLog("开始写XML文件。");
            this.WriteXml();
            txtFileLogger.WriteLog("写XML文件结束。");
        }
 public void BatchPrint(List<EntityBase> arr)
 {
     //System.AppDomain.CurrentDomain.BaseDirectory
     TxtFileLogger log = new TxtFileLogger(HttpContext.Current.Server.MapPath(@"\Batch"), "");
     log.WriteLog("序号\tProcessID\t\t\t\tWorkItemID\t\t\t\t步骤\t文号\t\t\t标题");
     for (int i = 0; i < arr.Count; i++)
     {
         m_CurrEntity = arr[i];
         string sFileName = "";
         if (BackGroundPrint(this, out sFileName, "",
             "",
             ""))
         {
             log.WriteLog((i + 1).ToString() + "\t"
                 + m_CurrEntity.ProcessID + "\t"
                 + m_CurrEntity.WorkItemID + "\t"
                 + m_CurrEntity.StepName + "\t"
                 + m_CurrEntity.DocumentNo + "\t"
                 + m_CurrEntity.DocumentTitle + "\t成功 " + sFileName);
         }
         else
         {
             log.WriteLog((i + 1).ToString() + "\t"
                 + m_CurrEntity.ProcessID + "\t"
                 + m_CurrEntity.WorkItemID + "\t"
                 + m_CurrEntity.StepName + "\t"
                 + m_CurrEntity.DocumentNo + "\t"
                 + m_CurrEntity.DocumentTitle + "\t失败");
         }
     }
 }
Ejemplo n.º 6
0
 static void Main(string[] args)
 {
     try
     {
         logger.WriteLog(DateTime.Now + "****************************job start ********************************");
         RunNowActive();
         RunNowDisable();
         logger.WriteLog(DateTime.Now + "***************************job end****************************\r\n");
     }
     catch (Exception ex)
     {
         logger.WriteLog(ex.ToString());
         logger.WriteLog("时效促销语JOB处理完成!");
     }
 }