From eb7ef0821f9e3f64e18cb01d1d959a1f6e2dd884 Mon Sep 17 00:00:00 2001 From: Stedd Date: Sat, 19 Feb 2022 12:43:39 +0100 Subject: [PATCH] Selectable date for manual transactions --- DBClasses.cs | 14 ++++++++++++++ MainWindow.xaml.cs | 2 ++ 2 files changed, 16 insertions(+) diff --git a/DBClasses.cs b/DBClasses.cs index 2693ab6..560f1aa 100644 --- a/DBClasses.cs +++ b/DBClasses.cs @@ -107,6 +107,20 @@ namespace CryptoCalc SetDBStrings(); } + public Transaction(DateTime dateTime, long walletID, string currency, decimal amount, string type) + { + UnixTime = GetUnixTime(dateTime); + WalletID = walletID; + Currency = currency; + (Amount, AmountDecimal) = Util.SplitDecimal(amount); + TransactionType = type; + + Platform = ""; + Note = ""; + + SetDBStrings(); + } + public Transaction(string currency, decimal amount, string type, string feeCurrency, decimal feeAmount) { SaveUnixTimeNow(); diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index 31c5891..e1ee460 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -44,10 +44,12 @@ namespace CryptoCalc } private void saveButtonFromInput_Click(object sender, RoutedEventArgs e) + private void SaveTransactionButton_Click(object sender, RoutedEventArgs e) { transactionDB.SaveData ( new Transaction( + (DateTime)insertTransactionDatePicker.SelectedDate, selectedWallet.Index, inputCurrency.Text, Convert.ToDecimal(inputAmount.Text, CultureInfo.InvariantCulture),