Example #1
0
 // Update
 public static void Update(long id, String title, Double amount, String currency, String pm, DateTime dateTime)
 {
     Data.Finances entryToUpdate = Data.Finances.ReadID(id);
     entryToUpdate.TitleProduct      = title;
     entryToUpdate.AmountSpent       = amount;
     entryToUpdate.Currency          = currency;
     entryToUpdate.PaymentMethod     = pm;
     entryToUpdate.DateTimePurchased = dateTime;
     entryToUpdate.Edited            = true;
     entryToUpdate.Update();
 }
Example #2
0
        // Create
        public static void Create(String title, Double amount, String currency, String pm, DateTime DateTime)
        {
            Data.Finances newEntry = new Data.Finances();
            newEntry.TitleProduct      = title;
            newEntry.AmountSpent       = amount;
            newEntry.Currency          = currency;
            newEntry.PaymentMethod     = pm;
            newEntry.DateTimePurchased = DateTime;
            newEntry.Edited            = false;
            Int64 newEntryID = newEntry.Create();

            Debug.Print("Artikel erstellt mit Id:" + newEntryID);
        }
Example #3
0
 private void DeleteBtn_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (financesContainer.SelectedIndex != -1)
         {
             Data.Finances financeEntry = financesContainer.SelectedItem as Data.Finances;
             Console.WriteLine(financeEntry.EntryID);
             financeEntry.Delete();
             refreshFinances();
         }
         else
         {
             Console.WriteLine("No entry selected");
         }
     }
     catch (Exception ex)
     {
         Debug.Print(ex.ToString());
     }
 }
Example #4
0
 public void setEntry(Data.Finances entry)
 {
     this.entryToEdit = entry;
 }
Example #5
0
 public EditView(Data.Finances entry)
 {
     InitializeComponent();
     this.entryToEdit = entry;
 }