Exemple #1
0
        public void Process()
        {
            // configure processor
            ContinueNow = true;

            // log start of execution
            CreateAudit("Order Processor started.", 10000);

            // process pipeline section
            try
            {
                while (ContinueNow)
                {
                    ContinueNow = false;
                    GetCurrentPipelineSection();
                    CurrentPipelineSection.Process(this);
                }
            }
            catch (OrderProcessorException ex)
            {
                MailAdmin("Order Processing error occurred.",
                          ex.Message, ex.SourceStage);
                CreateAudit("Order Processing error occurred.", 10002);
                throw new OrderProcessorException(
                          "Error occurred, order aborted. "
                          + "Details mailed to administrator.", 100);
            }
            catch (Exception ex)
            {
                MailAdmin("Order Processing error occurred.", ex.Message,
                          100);
                CreateAudit("Order Processing error occurred.", 10002);
                throw new OrderProcessorException(
                          "Unknown error, order aborted. "
                          + "Details mailed to administrator.", 100);
            }
            finally
            {
                CommerceLibAccess.CreateAudit(Order.OrderID,
                                              "Order Processor finished.", 10001);
            }
        }
Exemple #2
0
 public void CreateAudit(string message, int messageNumber)
 {
     CommerceLibAccess.CreateAudit(Order.OrderID, message,
                                   messageNumber);
 }