Example #1
0
        public void GetRankGroup()
        {
            Employee currentEmployee = Session.GetObjectByKey <Employee>(Oid);

            if (currentEmployee.StructuralPosition != null)
            {
                _rankGroup = Session.GetObjectByKey <RankGroup>(currentEmployee.StructuralPosition.RankGroup.Oid);
            }
            else
            {
                _rankGroup = Session.FindObject <RankGroup>(CriteriaOperator.Parse("GroupIndex=?", 1));
            }
        }
Example #2
0
        public void UpdateAuthorizationLevel(bool forceChangeEvents)
        {
            RankGroup oldAuthorizationlevel = _authorizationLevel;
            RankGroup tempRankGroup         = Session.FindObject <RankGroup>(CriteriaOperator.Parse("[GroupIndex] <= ?", 0)); //(CriteriaOperator.Parse("[<RankGroup>].Min([GroupIndex]) <= ?", 0))

            foreach (LogisticRequisitionItem detail in Items)
            {
                if (detail.InventoryItem.AuthorizationLevel.GroupIndex > tempRankGroup.GroupIndex)
                {
                    tempRankGroup = detail.InventoryItem.AuthorizationLevel;
                }
            }
            _authorizationLevel = tempRankGroup;
            if (forceChangeEvents)
            {
                OnChanged("AuthorizationLevel", oldAuthorizationlevel, _authorizationLevel);
            }
        }