Exemplo n.º 1
0
        public static void SaveTask(TodoItem task)
        {
            MobileServiceTable <TodoItem> todoItemTable = App.MobileServiceClient.GetTable <TodoItem>();

            if (task.Id >= 0)
            {
                var update = new JObject();
                update["id"]       = task.Id;
                update["text"]     = task.Text;
                update["complete"] = task.Complete;
                todoItemTable.Update(update, err => {
                    if (err != null)
                    {
                        Console.WriteLine("UPDATE FAILED");
                    }
                });
            }
            else
            {
                todoItemTable.Insert(task, (res, err) => {
                    if (err != null)
                    {
                        Console.WriteLine("INSERT FAILED");
                        return;
                    }
                    Console.WriteLine("SAVED " + res);
                });
            }
        }
 public void UpdateFlag(MobileServiceTable <SpawnFlag> table, SpawnFlag item)
 {
     // Updates item in the table
     if (Validate(item))
     {
         table.Update <SpawnFlag>(item, OnUpdateFlagCompleted);
     }
 }
    public void UpdateScore()
    {
        Highscore score = GetScore();

        if (Validate(score))
        {
            StartCoroutine(_table.Update <Highscore> (score, OnUpdateScoreCompleted));
        }
    }
Exemplo n.º 4
0
        /**
         * Mark an item as completed
         *
         * @param item
         *            The item to mark
         */
        public void CheckItem(ToDoItem item)
        {
            if (mClient == null)
            {
                return;
            }

            // Set the item as completed and update it in the table
            item.SetComplete(true);

            mToDoTable.Update(item, new MyUpdateTableOperationCallback(this));
        }
Exemplo n.º 5
0
 private void UpdateInventory()
 {
     RecalculateInventoryItems();
     Debug.Log("Update:" + _inventory.ToString());
     StartCoroutine(_table.Update <Inventory> (_inventory, OnUpdateCompleted));
 }