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); }
public virtual EmployeeRelation GetRelationEntity(long emplid, DateTime date) { ListEmployeeRelations lst = GetById(emplid, false); if (lst == null) { return(null); } return(lst.GetRelation(date)); }
public virtual bool IsContain(long emplid, DateTime date) { ListEmployeeRelations lst = GetById(emplid, false); if (lst == null) { return(false); } return(lst.GetRelation(date) != null); }
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); } }