Beispiel #1
0
        void AddViewModel(UserTasks userTask)
        {
            UserTasksVM fooUserTasksVM = new UserTasksVM
            {
                Account           = userTask.Account,
                CheckinDatetime   = userTask.CheckinDatetime,
                CheckinId         = userTask.CheckinId,
                Checkin_Latitude  = userTask.Checkin_Latitude,
                Checkin_Longitude = userTask.Checkin_Longitude,
                Condition1_Result = userTask.Condition1_Result,
                Condition1_Ttile  = userTask.Condition1_Ttile,
                Condition2_Result = userTask.Condition2_Result,
                Condition2_Ttile  = userTask.Condition2_Ttile,
                Condition3_Result = userTask.Condition3_Result,
                Condition3_Ttile  = userTask.Condition3_Ttile,
                Description       = userTask.Description,
                Id               = userTask.Id,
                PhotoURL         = userTask.PhotoURL,
                Reported         = userTask.Reported,
                ReportedDatetime = userTask.ReportedDatetime,
                Status           = userTask.Status,
                TaskDateTime     = userTask.TaskDateTime,
                Title            = userTask.Title,
            };

            UserTasksList.Add(fooUserTasksVM);
        }
        protected async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }
            IsBusy = true;
            try
            {
                if (UserTasksList == null)
                {
                    UserTasksList = new ObservableCollection <UserTaskViewModel>();
                }
                else
                {
                    UserTasksList.Clear();
                }

                int[] status =
                {
                    UserTaskStatus.Active, UserTaskStatus.Pending, UserTaskStatus.Paused, UserTaskStatus.Aborted
                };

                var userTasks = await _userTaskService.GetAllUserTaskByUserID(App.CurrentLogInUser.Email, status);

                foreach (var usertask in userTasks)
                {
                    var userTaskTime = await _userTaskService.GetUserTaskTimeByUserTaskId(usertask.UserTaskID);

                    UserTasksList.Add(new UserTaskViewModel(usertask, userTaskTime));
                }
            }
            finally
            {
                IsBusy = false;
            }
        }
Beispiel #3
0
 void AddViewModel(UserTasks userTask)
 {
     UserTasksList.Add(userTask);
 }