Example #1
0
        private void FillDiction(List <EmployeeAllIn> lst)
        {
            if (lst != null && lst.Count > 0)
            {
                ListEmployeeAllIn lastUsed = null;
                foreach (EmployeeAllIn entity in lst)
                {
                    ListEmployeeAllIn manager = null;

                    if (lastUsed != null && lastUsed.EmployeeId == entity.EmployeeID)
                    {
                        manager = lastUsed;
                    }
                    else
                    {
                        lastUsed = null;
                        if (!_diction.TryGetValue(entity.EmployeeID, out manager))
                        {
                            manager                      = new ListEmployeeAllIn();
                            manager.EmployeeId           = entity.EmployeeID;
                            _diction[manager.EmployeeId] = manager;
                        }
                    }
                    manager.Add(entity);
                    lastUsed = manager;
                }
            }
        }
Example #2
0
        public bool GetAllIn(long emplid, DateTime date)
        {
            ListEmployeeAllIn manager = GetManager(emplid);;

            bool bAllIn = false;

            if (manager != null)
            {
                bAllIn = manager.GetAllIn(date);
            }
            return(bAllIn);
        }
Example #3
0
        public CacheEmployeesAllIn LoadByEmployee(long emplid)
        {
            if (_service != null)
            {
                ListEmployeeAllIn manager = null;
                if (!_diction.TryGetValue(emplid, out manager))
                {
                    manager = new ListEmployeeAllIn();

                    manager.SetEmployee(emplid);
                    _diction[emplid] = manager;
                }
            }
            return(this);
        }
Example #4
0
        public bool GetAllIn(long emplid, DateTime monday, DateTime sunday)
        {
            Debug.Assert((monday.DayOfWeek == DayOfWeek.Monday) &&
                         (sunday.DayOfWeek == DayOfWeek.Sunday));


            ListEmployeeAllIn manager = GetManager(emplid);

            bool bAllIn = false;

            if (manager != null)
            {
                bAllIn = manager.GetAllIn(monday, sunday);
            }
            return(bAllIn);
        }
Example #5
0
        public ListEmployeeAllIn GetManager(long emplid)
        {
            ListEmployeeAllIn manager = null;

            if (_lastUsed != null && _lastUsed.EmployeeId == emplid)
            {
                manager = _lastUsed;
            }
            else
            {
                _diction.TryGetValue(emplid, out manager);
            }
            if (manager != null)
            {
                _lastUsed = manager;
            }

            return(manager);
        }