Exemplo n.º 1
0
        protected virtual void SOLine_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            SOLine invoiceLine = e.Row as SOLine;

            switch (Mode)
            {
            case 0:
                throw new PXRowPersistedException(typeof(SOLine.refNbr).Name, invoiceLine.RefNbr, "Persist error");                                                                                               //No diagnostic

            case 1:
                throw new PXLockViolationException(typeof(SOLine), PXDBOperation.Insert, new object[] { invoiceLine.RefNbr, invoiceLine.LineNbr });                           //No diagnostic

            case 2:
                throw new PXException("Something bad happened");                                //Should report diagnostic

            case 3:
                throw new ArgumentOutOfRangeException(nameof(Mode));                            //No diagnostic

            case 4:
                throw new ArgumentNullException(nameof(Mode));                                  //No diagnostic

            case 5:
                throw new ArgumentException("Something bad happened");                          //No diagnostic

            case 6:
                throw new NotImplementedException();                                            //No diagnostic

            default:
                throw new NotSupportedException();                                              //No diagnostic
            }
        }
        protected virtual void SOLine_RowPersisted(PXCache sender, PXRowPersistedEventArgs e)
        {
            SOLine invoiceLine = e.Row as SOLine;

            switch (Mode)
            {
            case 0:
                throw new PXRowPersistedException(typeof(SOLine.refNbr).Name, invoiceLine.RefNbr, "Persist error");                                                                                               //No diagnostic

            case 1:
                throw new PXLockViolationException(typeof(SOLine), PXDBOperation.Insert, new object[] { invoiceLine.RefNbr, invoiceLine.LineNbr });                           //No diagnostic

            default:
                throw new PXException("Something bad happened");                                //No diagnostic in processing graph
            }
        }