Example #1
0
        public override void ViewAppearing()
        {
            if (UserInstagramId.GetUserId() == string.Empty)
            {
                return;
            }
            User user = _userService.GetUser(UserInstagramId.GetUserId());

            if (user != null)
            {
                UserId = user.UserId;
            }
        }
Example #2
0
        public void CreateNewUser()
        {
            UserId = UserInstagramId.GetUserId();
            List <User> users = _userService.GetAllUsers();
            User        user  = new User(UserId);

            for (int i = 0; i < users.Count; i++)
            {
                if (users[i].UserId == user.UserId)
                {
                    return;
                }
            }
            _userService.InsertUser(user);
        }
Example #3
0
 public override void Prepare(TaskItem parameter)
 {
     if (parameter != null)
     {
         EnableStatusNameTask = false;
         IdTask                = parameter.Id;
         NameTask              = parameter.NameTask;
         UserId                = parameter.UserId;
         DescriptionTask       = parameter.DescriptionTask;
         StatusTask            = parameter.StatusTask;
         LalitudeMarkerResult  = parameter.LalitudeMarker;
         LongitudeMarkerResult = parameter.LongitudeMarker;
         return;
     }
     _userId = UserInstagramId.GetUserId();
     EnableStatusNameTask = true;
 }
Example #4
0
        public async Task <List <TaskItem> > RefreshDataAsync()
        {
            List <TaskItem> items         = null;
            var             currentUserId = UserInstagramId.GetUserId();
            var             uri           = new Uri(string.Format("{0}{1}", _wepApiAddressServer, currentUserId));

            _taskService.DeleteAllUserTask(UserInstagramId.GetUserId());
            var response = await _client.GetAsync(uri);

            if (response.IsSuccessStatusCode)
            {
                var content = await response.Content.ReadAsStringAsync();

                items = JsonConvert.DeserializeObject <List <TaskItem> >(content);
                _taskService.InsertAllUserTasks(items);
            }
            return(items);
        }
Example #5
0
        private void LoadData()
        {
            var list = _taskService.GetUserTasks(UserInstagramId.GetUserId());

            Items = new MvxObservableCollection <TaskItem>(list);
        }