Esempio n. 1
0
        protected virtual ListEmployeeRelations GetById(long emplid, bool bCreate)
        {
            if (_lstUsing != null && _lastId == emplid)
            {
                return(_lstUsing);
            }

            ListEmployeeRelations list = null;

            if (_diction.TryGetValue(emplid, out list))
            {
                _lstUsing = list;
                _lastId   = emplid;
                return(list);
            }

            if (bCreate)
            {
                list             = new ListEmployeeRelations();
                _lstUsing        = list;
                _lastId          = emplid;
                _diction[emplid] = list;
            }

            return(list);
        }
Esempio n. 2
0
        public virtual EmployeeRelation GetRelationEntity(long emplid, DateTime date)
        {
            ListEmployeeRelations lst = GetById(emplid, false);

            if (lst == null)
            {
                return(null);
            }


            return(lst.GetRelation(date));
        }
Esempio n. 3
0
        public virtual bool IsContain(long emplid, DateTime date)
        {
            ListEmployeeRelations lst = GetById(emplid, false);

            if (lst == null)
            {
                return(false);
            }


            return(lst.GetRelation(date) != null);
        }
Esempio n. 4
0
        public void BuildDiction(List <EmployeeRelation> lst)
        {
            _diction.Clear();
            _lastId   = 0;
            _lstUsing = null;
            if (lst == null)
            {
                return;
            }


            foreach (EmployeeRelation rel in lst)
            {
                GetById(rel.EmployeeID, true).Add(rel);
            }
        }