Example #1
0
		public int SaveItem (TodoItem item) 
		{
			lock (locker) {
				if (item.ID != 0) {
					database.Update(item);
					return item.ID;
				} else {
					return database.Insert(item);
				}
			}
		}
Example #2
0
		protected void InsertPlace ()
		{
			var banco = new TodoItemDatabase ();
			var item = new TodoItem {
				Description = Place.Description,
				Latitude = Place.Latitude,
				Longitude = Place.Longitude
			};

			try {
				var id = banco.SaveItem (item);
				MyPage.Navigation.PopAsync();
			} catch (Exception ex) {
				Xamarin.Insights.Report (ex,Xamarin.Insights.Severity.Critical);
			}
	
		}