Exemplo n.º 1
0
 public void Process(OrderProcessor processor)
 {
     // set processor reference
     orderProcessor = processor;
     // audit
     orderProcessor.CreateAudit("PSFinalNotification started.",
                                20700);
     try
     {
         // send mail to customer
         orderProcessor.MailCustomer("BalloonShop order dispatched.",
                                     GetMailBody());
         // audit
         orderProcessor.CreateAudit(
             "Dispatch e-mail sent to customer.", 20702);
         // update order status
         orderProcessor.Order.UpdateStatus(8);
     }
     catch
     {
         // mail sending failure
         throw new OrderProcessorException(
                   "Unable to send e-mail to customer.", 7);
     }
     // audit
     processor.CreateAudit("PSFinalNotification finished.", 20701);
 }
        public void Process(OrderProcessor processor)
        {
            // set processor reference
              orderProcessor = processor;
              // audit
              orderProcessor.CreateAudit("PSInitialNotification started.",
            20000);

              try
              {
            // send mail to customer
            orderProcessor.MailCustomer("BalloonShop order received.",
              GetMailBody());
            // audit
            orderProcessor.CreateAudit(
              "Notification e-mail sent to customer.", 20002);
            // update order status
            orderProcessor.Order.UpdateStatus(1);
            // continue processing
            orderProcessor.ContinueNow = true;
              }
              catch
              {
            // mail sending failure
            throw new OrderProcessorException(
              "Unable to send e-mail to customer.", 0);
              }
              // audit
              processor.CreateAudit("PSInitialNotification finished.", 20001);
        }
        public void Process(OrderProcessor processor)
        {
            // set processor reference
            orderProcessor = processor;
            // audit
            orderProcessor.CreateAudit("PSInitialNotification started.",
                                       20000);

            try
            {
                // send mail to customer
                orderProcessor.MailCustomer("BalloonShop order received.",
                                            GetMailBody());
                // audit
                orderProcessor.CreateAudit(
                    "Notification e-mail sent to customer.", 20002);
                // update order status
                orderProcessor.Order.UpdateStatus(1);
                // continue processing
                orderProcessor.ContinueNow = true;
            }
            catch
            {
                // mail sending failure
                throw new OrderProcessorException(
                          "Unable to send e-mail to customer.", 0);
            }
            // audit
            processor.CreateAudit("PSInitialNotification finished.", 20001);
        }
 public void Process(OrderProcessor processor)
 {
     // set processor reference
       orderProcessor = processor;
       // audit
       orderProcessor.CreateAudit("PSFinalNotification started.",
     20700);
       try
       {
     // send mail to customer
     orderProcessor.MailCustomer("BalloonShop order dispatched.",
       GetMailBody());
     // audit
     orderProcessor.CreateAudit(
       "Dispatch e-mail sent to customer.", 20702);
     // update order status
     orderProcessor.Order.UpdateStatus(8);
       }
       catch
       {
     // mail sending failure
     throw new OrderProcessorException(
       "Unable to send e-mail to customer.", 7);
       }
       // audit
       processor.CreateAudit("PSFinalNotification finished.", 20701);
 }