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(); 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) public Transaction(string currency, decimal amount, string type, string feeCurrency, decimal feeAmount)
{ {
SaveUnixTimeNow(); SaveUnixTimeNow();

View File

@ -44,10 +44,12 @@ namespace CryptoCalc
} }
private void saveButtonFromInput_Click(object sender, RoutedEventArgs e) private void saveButtonFromInput_Click(object sender, RoutedEventArgs e)
private void SaveTransactionButton_Click(object sender, RoutedEventArgs e)
{ {
transactionDB.SaveData transactionDB.SaveData
( (
new Transaction( new Transaction(
(DateTime)insertTransactionDatePicker.SelectedDate,
selectedWallet.Index, selectedWallet.Index,
inputCurrency.Text, inputCurrency.Text,
Convert.ToDecimal(inputAmount.Text, CultureInfo.InvariantCulture), Convert.ToDecimal(inputAmount.Text, CultureInfo.InvariantCulture),