Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CaaPa.Prompt"/> class.
 /// </summary>
 /// <param name="promptName">promptName .</param>
 /// <param name="promptDesc">promptDesc .</param>
 /// <param name="userId">userId .</param>
 public PromptWrapper(Prompt prompt)
 {
     Prompt = prompt;
 }
Ejemplo n.º 2
0
        public async Task CheckPrompt(Prompt prompt)
        {
            if (client == null) {
                return;
            }

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

                if (prompt.Complete)
                    adapter.Remove (prompt);

            } catch (Exception e) {
                CreateAndShowDialog (e, "Error");
            }
        }
Ejemplo n.º 3
0
        public async void AddPrompt(View view) {
      
            if (client == null || string.IsNullOrWhiteSpace (textNewToDo.Text)) {
                return;
            }

            // Create a new item
            var prompt = new Prompt
            {
                //Text = textNewToDo.Text

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

                Complete = false
            };

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

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

            //textNewToDo.Text = "";
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CaaPa.Prompt"/> class.
 /// </summary>
 /// <param name="promptName">promptName .</param>
 /// <param name="promptDesc">promptDesc .</param>
 /// <param name="userId">userId .</param>
 public PromptWrapper(Prompt prompt)
 {
     Prompt = prompt;
 }