Ejemplo n.º 1
0
        public void Process(Monaco.Classroom.Ordering.ProductProcessor processor)
        {
            bool inserted = false;

            try
            {
                inserted = ClassroomController.InsertEnrollment(processor.Order.CustomerID, processor.Order.Sku);
            }
            catch (SqlException ex)
            {
                WebExceptionEvent evnt = new WebExceptionEvent("Critical SQL Error", this, WebEventCodes.WebExtendedBase + 1230235, ex);
                evnt.Raise();
            }
            catch (Exception ex)
            {
                WebExceptionEvent evnt = new WebExceptionEvent("Critical Unknown Error", this, WebEventCodes.WebExtendedBase + 1230236, ex);
                evnt.Raise();
            }

            if (inserted)
            {
                //processor.Order.OnOrderSucceeded(EventArgs.Empty);
                processor.Order.UpdateStatus(processor.Order.Status + 1);
                processor.ContinueNow = true;
            }
            else
            {
                processor.OnOrderFailure(new OrderFailureEventArgs("Unable to create enrollment"));
                processor.ContinueNow = false;
            }
        }
Ejemplo n.º 2
0
        public override void Raise()
        {
            if (!_raised)
            {
                // store the item in the database
                try
                {
                    this.Insert();
                }
                catch (NotImplementedException)
                {
                    // do nothing
                }
                catch (SqlException ex)
                {
                    WebExceptionEvent evnt = new WebExceptionEvent
                        (
                              "Sql Exception while trying to raise 'UserAuditEvent' event"
                            , this, WebEventCodes.WebExtendedBase + 124023 // this will not change...
                            , ex
                       );
                    evnt.Raise();
                }
                catch (Exception ex)
                {
                    WebExceptionEvent evnt = new WebExceptionEvent
                        (
                              "Unknown Exception while trying to raise 'UserAuditEvent' event"
                            , this, WebEventCodes.WebExtendedBase + 293485 // this will not change...
                            , ex
                       );
                    evnt.Raise();
                }

                base.Raise();
                _raised = true;
            }
            
        }