public async void AddUsersettings(View view) {
      
            if (client == null || string.IsNullOrWhiteSpace (textNewToDo.Text)) {
                return;
            }

            // Create a new item
            var usersetting = new UserSettings
            {
                //Text = textNewToDo.Text

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

                Complete = false
            };

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

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

            //textNewToDo.Text = "";
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CaaPa.UserSettings"/> class.
 /// </summary>
 /// <param name="UserSettingsId ">serSettingsId .</param>
 /// <param name="UserId ">UserId .</param>
 /// /// <param name="GuiSettingsId ">GuiSettingsId .</param>
 /// /// <param name="UiSEttingsJSON ">UiSEttingsJSON  .</param>
 public UserSettingsWrapper(UserSettings usersetting)
 {
     UserSettings = usersetting;
 }
        public async Task CheckUserSettings(UserSettings usersetting)
        {
            if (client == null) {
                return;
            }

            // Set the item as completed and update it in the table
            usersetting.Complete = true;

            try {
                await usersettingsTable.UpdateAsync(usersetting); // update the new item in the local database
                await SyncAsync(); // send changes to the mobile service

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

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