void _prjClient_GetEmployeeWorkCompleted(object sender, GetEmployeeWorkCompletedEventArgs e)
        {
            DateTime _today = DateTime.Today;
            DateTime _yesterday = DateTime.Today.AddDays(-1);
            List<int> _recentUsedTaskID = new List<int>();
            Dictionary<int, string> _recentUsedComments = new Dictionary<int, string>();
            foreach (WorkUnit u in e.Result.GetEmployeeWorkResult.Return.OrderBy(w => w.StartDateTime))
            {
                _recentUsedTaskID.Add(u.TaskID);
                if (!String.IsNullOrWhiteSpace(u.Description))
                {
                    _recentUsedComments[u.TaskID] = u.Description;
                }

                if (u.StartDateTime.Date == _today) {
                    App.RegistrationViewModel.TodayRegistrations.Add(u);
                }
                if (u.StartDateTime.Date == _yesterday)
                {
                    App.RegistrationViewModel.YesterdayRegistrations.Add(u);
                }

            }

            _RecentTasks.Clear();
            foreach (int taskID in _recentUsedTaskID.Distinct())
            {
                var _task = this._allTasks.FirstOrDefault(t => t.ID == taskID);
                if (_task != null) _RecentTasks.Add(_task);
            }
            using (Database db = new Database())
            {
                if (db.DatabaseExists() == false)
                {
                    // Create the database.
                    db.CreateDatabase();
                }

                foreach (var _usedTask in _RecentTasks) 
                { 
                    var taskInDB = from WPTask t in db.tasksTable where t.ID == _usedTask.ID 
                                   select t;

                    foreach (var t in taskInDB) {
                        t.RecentUsed = true;
                        string _comment;
                        if (_recentUsedComments.TryGetValue(t.ID, out _comment))
                        {
                            t.RecentComment = _comment;
                        }                         
                    }
                }
                db.SubmitChanges(System.Data.Linq.ConflictMode.ContinueOnConflict);
            }
            
            IsDataLoaded = true;
            LoadInProgress = false;
        }
        void _prjClient_GetTasksAllocatedToEmployeeCompleted(object sender, GetTasksAllocatedToEmployeeCompletedEventArgs e)
        {
            // get all task that is not parent task
            var _childTasks = e.Result.GetTasksAllocatedToEmployeeResult.Return.Where(t => !t.IsParent);

            // construct the all Task list
            this._allTasks.Clear();
            Tasks.Clear();
            foreach (var _T in _childTasks.OrderBy(t => t.Details.CustomerHeader.Name).ThenBy(t => t.Details.ProjectHeader.Name).ThenBy(t => t.SortOrder))
            {
                var _t = FromAPItoDomain(_T);
                this._allTasks.Add(_t);
                Tasks.Add(_t);
            }

            using (Database db = new Database())
            {
                if (db.DatabaseExists() == false)
                {
                    // Create the database.
                    db.CreateDatabase();
                }
                else {
                    db.tasksTable.DeleteAllOnSubmit(db.tasksTable);
                }

                db.tasksTable.InsertAllOnSubmit(this._allTasks);
                db.SubmitChanges(System.Data.Linq.ConflictMode.ContinueOnConflict);
            }

            _NewestTasks.Clear();
            // constuct the list of the 7 newest task
            foreach (var _T in _childTasks.OrderByDescending(t => t.StartDate).Take(7).OrderBy(t => t.Details.CustomerHeader.Name).ThenBy(t => t.Details.ProjectHeader.Name).ThenBy(t => t.SortOrder))
            {
                _NewestTasks.Add(FromAPItoDomain(_T));
            }
            
            IsDataLoaded = true;
            LoadInProgress = false;
            LoadLastWeeksRegistrationsFromServer();
        }