} // end of Delete() // Send request to service with update public async void Update(TaskTodo task) { var status = await storageService.saveToDoTask(task); if (!status) { await new MessageDialog("Task You've edited wasn't saved to cloud storage! /n Maybe we are not connected?").ShowAsync(); } Debug.WriteLine("Updating Task (TodoCollection) STATUS => " + status.ToString()); } // end of Update()
// add task to local collection and send request to cloud service public async void Add(TaskTodo task) { TodoList.Add(task); var status = await storageService.saveToDoTask(task); if (!status) { await new MessageDialog("Your Task wasn't saved to cloud storage! /n Maybe we are not connected?").ShowAsync(); } Debug.WriteLine("Adding Task (TodoCollection) STATUS => " + status.ToString()); }
// delete from local collection and send request to cloud service public async void Delete(TaskTodo todoTask) { Debug.WriteLine("Testing DELETE from Model"); if (TodoList.Contains(todoTask)) { TodoList.Remove(todoTask); var status = storageService.deleteToDoTask(todoTask); if (status.Equals("FAIL")) { await new MessageDialog("Deletion failed to process on server! /n Check if you have Internet connecton...").ShowAsync(); } Debug.WriteLine("Deleting Task (TodoCollection) STATUS => " + status.ToString()); } } // end of Delete()