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

            // Create a new item
            var setting = new Settings
            {
                //Text = textNewToDo.Text

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

                Complete = false
            };

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

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

            //textNewToDo.Text = "";
        }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CaaPa.Settings"/> class.
 /// </summary>
 /// <param name="SettingsId">=SettingsId .</param>
 public SettingsWrapper(Settings settings)
 {
     Settings = settings;
 }
Exemplo n.º 3
0
        public async Task CheckSettings(Settings setting)
        {
            if (client == null) {
                return;
            }

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

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

            } catch (Exception e) {
                CreateAndShowDialog (e, "Error");
            }
        }