Ejemplo n.º 1
0
        public async void AddPromptStep(View view)
        {
            if (client == null || string.IsNullOrWhiteSpace(textNewToDo.Text))
            {
                return;
            }

            // Create a new item
            var promptstep = new PromptStep
            {
                //Text = textNewToDo.Text

                //add collum = value
                //for each collumn
                //leave complete it is nessecary for the localdb

                Complete = false
            };

            try {
                await promptstepTable.InsertAsync(promptstep); // insert the new item into the local database
                await SyncAsync();                             // send changes to the mobile service

                if (!promptstep.Complete)
                {
                    adapter.Add(promptstep);
                }
            } catch (Exception e) {
                CreateAndShowDialog(e, "Error");
            }

            //textNewToDo.Text = "";
        }
Ejemplo n.º 2
0
        public async Task CheckPromptStep(PromptStep promptstep)
        {
            if (client == null)
            {
                return;
            }

            // Set the item as completed and update it in the table
            promptstep.Complete = true;
            try {
                await promptstepTable.UpdateAsync(promptstep); // update the new item in the local database
                await SyncAsync();                             // send changes to the mobile service

                if (promptstep.Complete)
                {
                    adapter.Remove(promptstep);
                }
            } catch (Exception e) {
                CreateAndShowDialog(e, "Error");
            }
        }