Beispiel #1
0
        public static SequenceRegistry FindOrCreateSequ(Account _account)
        {
            var filter = new BinaryOperator(new OperandProperty("SequenceRegistry"), new OperandValue(_account), BinaryOperatorType.Equal);
            SequenceRegistry squeVal = _account.Session.FindObject <SequenceRegistry>(filter);

            if (squeVal == null)
            {
                Sequence appliedSequ = AccountSequenceRule.GetAppliedSequence(_account.Session, _account);
                squeVal = new SequenceRegistry(_account.Session)
                {
                };
            }
            return(squeVal);
        }
Beispiel #2
0
 public static Sequence GetAppliedSequence(Session _uOW, Account _account)
 {
     //Check for primary group
     if (_account.GroupId != null)
     {
         var ruleLines = AccountSequenceRule.DeAssemblyDefinitionId(_uOW, MyEnums.DefinitionType.Group);
         var rLine     = ruleLines.Where(x => x.LineId.Equals(_account.GroupId)).FirstOrDefault();
         if (rLine != null)
         {
             var rule = _uOW.GetObjectByKey <AccountSequenceRule>(rLine.LineId);
             return(rule.AccountSequence);
         }
     }
     return(null);
 }