private void Verifying(PXCache sender, object row) { PXSetPropertyException error = VerifyingAndGetError(this, sender, row); if (error != null) { throw error; } }
public static PXSetPropertyException VerifyingAndGetError <Field>(PXCache sender, object row) where Field : IBqlField { PXSetPropertyException err = null; foreach (PXSetPropertyException currentError in sender.GetAttributes <Field>(row).OfType <PXUIVerifyAttribute>() .Select(attr => VerifyingAndGetError(attr, sender, row)) .Where(currentError => currentError != null)) { switch (currentError.ErrorLevel) { case PXErrorLevel.RowError: return(currentError); case PXErrorLevel.Error: case PXErrorLevel.RowWarning: if (err == null || err.ErrorLevel != PXErrorLevel.Error) { err = currentError; } break; case PXErrorLevel.Warning: if (err == null || err.ErrorLevel != PXErrorLevel.RowWarning) { err = currentError; } break; case PXErrorLevel.RowInfo: if (err == null || err.ErrorLevel != PXErrorLevel.Warning) { err = currentError; } break; default: err = currentError; break; } } return(err); }