Beispiel #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;
 }
        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)
                    promptadapter.Remove(prompt);

            }
            catch (Exception e)
            {
                CreateAndShowDialog(e, "Error");
            }
        }
        public async void AddPrompt(Prompt prompt)
        {
            if (client == null)
            {
                return;
            }

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

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

        }
Beispiel #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;
 }