public void BankAccount_accessNextCheckNumber_Compute(BankAccount entity, AccessComputeEventArgs e)
 {
     if (entity.Type != BankAccountType.Checking)
     {
         e.NewValue = new AccessValue(BLPropertyAccess.Hidden, "account type is not 'Checking'");
     }
 }
        public void SalesInvoice_accesscmdProcess_ChargeIsNotAllowed_Compute(SalesInvoice entity, AccessComputeEventArgs e)
        {
            var customer = entity.BillingCustomer;

            if (customer != null)
            {
                bool isChargeAllowed = customer.AllowedPaymentTypes.Any(pt => pt.Name == "Charge");
                if (!isChargeAllowed && entity.Balance > 0 && !entity.IsChargeTemporaryAllowed)
                {
                    e.NewValue = new AccessValue(BLPropertyAccess.HiddenAndNotApplicable, "charge is not allowed");
                }
            }
        }