コード例 #1
0
		private void CreateEntry()
		{
			if (editTextDate.Text.Equals ("") || editTextDesc.Text.Equals ("") || editTextTotal.Text.Equals ("")) {
				Toast.MakeText (this, Resource.String.input_fields_cannot_be_empty, ToastLength.Short).Show ();  
			} else {
				Entry createdEntry = new Entry ();
				createdEntry.IsIncome = TheIncome ();
				createdEntry.Date = TheDate ();
				createdEntry.Description = TheDescription ();
				createdEntry.TotalAmount = TheTotalAmount ();
				createdEntry.TypeAccount = TheAccount ("type");
				createdEntry.MoneyAccount = TheAccount ("money");
				createdEntry.TaxRate = TheTaxRate ();

				Toast.MakeText (this, Resource.String.entry_created, ToastLength.Short).Show ();  
				bkManager.AddEntry (createdEntry);
				ClearTextFields ();
			}
		}
コード例 #2
0
		/// <summary>
		/// Adds a new entry to the list and will also save it to the DB.
		/// </summary>
		/// <param name="entry">The new Entry that is collected in newEntryActivity and is added to the list.</param>
		public void AddEntry(Entry entry)
		{
			db.Insert (entry);
		}