public virtual EmployeeContract IsContain(long emplid, DateTime date)
        {
            ListEmployeeContracts lst = GetById(emplid);

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

            return(lst.GetContract(date));
        }
        public int GetContractHours(long emplid, DateTime date, DateTime date1)
        {
            ListEmployeeContracts lst = GetById(emplid);

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

            return(lst.GetContractHoursByWeekRange(date, date1));
        }
        protected virtual ListEmployeeContracts GetById(long emplid, bool bCreate)
        {
            ListEmployeeContracts list = GetById(emplid);

            if ((list == null) && bCreate)
            {
                list             = CreateDictionItem(emplid);
                _lstUsing        = list;
                _lastId          = emplid;
                _diction[emplid] = list;
            }

            return(list);
        }
        protected ListEmployeeContracts GetById(long emplid)
        {
            if (_lstUsing != null && _lastId == emplid)
            {
                return(_lstUsing);
            }

            ListEmployeeContracts list = null;

            if (_diction.TryGetValue(emplid, out list))
            {
                _lstUsing = list;
                _lastId   = emplid;
            }
            return(list);
        }
        public void BuildDiction(List <EmployeeContract> lst)
        {
            _diction.Clear();
            _lastId   = 0;
            _lstUsing = null;

            if (lst == null)
            {
                return;
            }


            foreach (EmployeeContract rel in lst)
            {
                GetById(rel.EmployeeID, true).Add(rel);
            }
        }
 public void SyncWithContract(ListEmployeeContracts contracts)
 {
 }