Added wallet DB code

This commit is contained in:
Stedd 2021-10-26 20:25:59 +02:00
parent 99f614734a
commit 26f711f60d
3 changed files with 85 additions and 3 deletions

View File

@ -6,7 +6,9 @@ namespace CryptoCalc
{ {
public class Transaction public class Transaction
{ {
#region Constructors
public Transaction() { } public Transaction() { }
public Transaction(string _currency, float _amount, string _type, string _feeCurrency, float _feeAmount) public Transaction(string _currency, float _amount, string _type, string _feeCurrency, float _feeAmount)
{ {
Year = DateTime.Now.Year; Year = DateTime.Now.Year;
@ -25,6 +27,10 @@ namespace CryptoCalc
Comment = ""; Comment = "";
} }
#endregion
#region Publics
public int Index { get; set; } public int Index { get; set; }
public int Year { get; set; } public int Year { get; set; }
public int Month { get; set; } public int Month { get; set; }
@ -41,13 +47,16 @@ namespace CryptoCalc
public string Service { get; set; } public string Service { get; set; }
public string Comment { get; set; } public string Comment { get; set; }
//Functions #endregion
#region Functions
public string FullInfo => $"{ Index.ToString() } { DateTimeString } { Currency } { Amount } { TransactionType }"; public string FullInfo => $"{ Index.ToString() } { DateTimeString } { Currency } { Amount } { TransactionType }";
#endregion
} }
public class RawData public class RawData
{ {
public RawData(){} #region Contructors
public RawData() { }
public RawData(string _currency, float _amount, string _type) public RawData(string _currency, float _amount, string _type)
{ {
Date_Year = DateTime.Now.Year; Date_Year = DateTime.Now.Year;
@ -64,6 +73,10 @@ namespace CryptoCalc
Comment = ""; Comment = "";
} }
#endregion
#region Publics
public int Index { get; set; } public int Index { get; set; }
public int Date_Year { get; set; } public int Date_Year { get; set; }
public int Date_Month { get; set; } public int Date_Month { get; set; }
@ -77,8 +90,77 @@ namespace CryptoCalc
public string TransactionType { get; set; } public string TransactionType { get; set; }
public string Service { get; set; } public string Service { get; set; }
public string Comment { get; set; } public string Comment { get; set; }
#endregion
#region Functions
public string FullInfo => $"{ Index.ToString() } { DateTimeString } { CryptoCurrency } { Amount } { TransactionType }"; public string FullInfo => $"{ Index.ToString() } { DateTimeString } { CryptoCurrency } { Amount } { TransactionType }";
#endregion
}
public class Wallet
{
#region Constructors
public Wallet()
{
//wCreationYear = 0;
//wCreationMonth = 0;
//wCreationDay = 0;
//wLastActivityYear = 0;
//wLastActivityMonth = 0;
//wLastActivityDay = 0;
//wLastActivityHour = 0;
//wLastActivityMinute = 0;
//wLastActivitySecond = 0;
//wPlatform = "";
//wName = "";
//wCurrency = "";
//wBalance = 0f;
//wDefaultWallet = "";
//wNotes = "";
}
public Wallet(int _year, int _month, int _day, string _platform, string _name, string _currency, float _balance, int _default, string _note)
{
wCreationYear = _year;
wCreationMonth = _month;
wCreationDay = _day;
wPlatform = _platform;
wName = _name;
wCurrency = _currency;
wBalance = _balance;
wDefaultWallet = _default;
wNotes = _note;
}
#endregion
#region Publics
public int Index { get; set; }
public int wCreationYear { get; set; }
public int wCreationMonth { get; set; }
public int wCreationDay { get; set; }
public int wLastActivityYear { get; set; }
public int wLastActivityMonth { get; set; }
public int wLastActivityDay { get; set; }
public int wLastActivityHour { get; set; }
public int wLastActivityMinute { get; set; }
public int wLastActivitySecond { get; set; }
public string wPlatform { get; set; }
public string wName { get; set; }
public string wCurrency { get; set; }
public float wBalance { get; set; }
public int wDefaultWallet { get; set; }
public string wNotes { get; set; }
#endregion
#region Functions
//public string FullInfo => $"{ Index.ToString() } { DateTimeString } { Currency } { Amount } { TransactionType }";
#endregion
} }
} }
} }

View File

@ -17,7 +17,7 @@
<Button x:Name="searchButton" Content="Search" HorizontalAlignment="Left" Margin="210,20,0,0" VerticalAlignment="Top" Click="searchButton_Click" Height="25"/> <Button x:Name="searchButton" Content="Search" HorizontalAlignment="Left" Margin="210,20,0,0" VerticalAlignment="Top" Click="searchButton_Click" Height="25"/>
<TextBox x:Name="inputCurrency" HorizontalAlignment="Left" Margin="578,550,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" Height="27" Text="BTC"/> <TextBox x:Name="inputCurrency" HorizontalAlignment="Left" Margin="578,550,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" Height="27" Text="BTC"/>
<Label x:Name="label" Content="Currency" HorizontalAlignment="Left" Margin="504,550,0,0" VerticalAlignment="Top" Height="27" Width="69"/> <Label x:Name="label" Content="Currency" HorizontalAlignment="Left" Margin="504,550,0,0" VerticalAlignment="Top" Height="27" Width="69"/>
<TextBox x:Name="inputAmount" HorizontalAlignment="Left" Margin="578,581,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" Height="27" Text="1"/> <TextBox x:Name="inputAmount" HorizontalAlignment="Left" Margin="578,581,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" Height="27" Text="1" LostFocus="inputAmount_LostFocus"/>
<Label x:Name="label_Copy" Content="Amount" HorizontalAlignment="Left" Margin="504,581,0,0" VerticalAlignment="Top" Height="27" Width="69"/> <Label x:Name="label_Copy" Content="Amount" HorizontalAlignment="Left" Margin="504,581,0,0" VerticalAlignment="Top" Height="27" Width="69"/>
<TextBox x:Name="inputType" HorizontalAlignment="Left" Margin="578,613,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" Height="27" Text="DEPOSIT"/> <TextBox x:Name="inputType" HorizontalAlignment="Left" Margin="578,613,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" Height="27" Text="DEPOSIT"/>
<Label x:Name="label_Copy1" Content="Type" HorizontalAlignment="Left" Margin="504,613,0,0" VerticalAlignment="Top" Height="27" Width="69"/> <Label x:Name="label_Copy1" Content="Type" HorizontalAlignment="Left" Margin="504,613,0,0" VerticalAlignment="Top" Height="27" Width="69"/>

BIN
wallet.db

Binary file not shown.