Selectable date for manual transactions

This commit is contained in:
Stedd 2022-02-19 12:43:39 +01:00
parent 64a1334f1e
commit eb7ef0821f
2 changed files with 16 additions and 0 deletions

View File

@ -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();

View File

@ -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),