CryptoCalc/DB_Classes.cs

187 lines
7.0 KiB
C#

using System;
namespace CryptoCalc
{
public interface IDBClasses
{
string DBTableName { get; }
string DBVariables { get; }
}
public class DB_Classes
{
public class Transaction : IDBClasses
{
#region Constructors
public Transaction() { }
public Transaction(string _currency, float _amount, string _type, string _feeCurrency, float _feeAmount)
{
tYear = DateTime.Now.Year;
tMonth = DateTime.Now.Month;
tDay = DateTime.Now.Day;
tHour = DateTime.Now.Hour;
tMinute = DateTime.Now.Minute;
tSecond = DateTime.Now.Second;
tDateTimeString = DateTime.Now.ToString();
tCurrency = _currency;
tAmount = _amount;
tTransactionType = _type;
tFeeCurrency = _feeCurrency;
tFeeAmount = _feeAmount;
tPlatform = "";
tNote = "";
}
#endregion
#region Publics
public string DBTableName => "Transactions";
public string DBVariables => "(Date_Year, Date_Month, Date_Day, Time_Hour, Time_Minute, Time_Second, DateTimeString, CryptoCurrency, Amount, TransactionType, Service, Comment) values (@Date_Year, @Date_Month, @Date_Day, @Time_Hour, @Time_Minute, @Time_Second, @DateTimeString, @CryptoCurrency, @Amount, @TransactionType, @Service, @Comment)";
public int Index { get; set; }
public int tYear { get; set; }
public int tMonth { get; set; }
public int tDay { get; set; }
public int tHour { get; set; }
public int tMinute { get; set; }
public int tSecond { get; set; }
public string tDateTimeString { get; set; }
public string tCurrency { get; set; }
public float tAmount { get; set; }
public string tTransactionType { get; set; }
public string tFeeCurrency { get; set; }
public float tFeeAmount { get; set; }
public string tPlatform { get; set; }
public string tNote { get; set; }
#endregion
#region Functions
public string FullInfo => $"{ Index.ToString() } { tDateTimeString } { tCurrency } { tAmount } { tTransactionType }";
#endregion
}
public class RawData : IDBClasses
{
#region Contructors
public RawData() { }
public RawData(string _currency, float _amount, string _type)
{
Date_Year = DateTime.Now.Year;
Date_Month = DateTime.Now.Month;
Date_Day = DateTime.Now.Day;
Time_Hour = DateTime.Now.Hour;
Time_Minute = DateTime.Now.Minute;
Time_Second = DateTime.Now.Second;
DateTimeString = DateTime.Now.ToString();
CryptoCurrency = _currency;
Amount = _amount;
TransactionType = _type;
Service = "";
Comment = "";
}
#endregion
#region Publics
public string DBTableName => "RawData";
public string DBVariables => "(Date_Year, Date_Month, Date_Day, Time_Hour, Time_Minute, Time_Second, DateTimeString, CryptoCurrency, Amount, TransactionType, Service, Comment) values (@Date_Year, @Date_Month, @Date_Day, @Time_Hour, @Time_Minute, @Time_Second, @DateTimeString, @CryptoCurrency, @Amount, @TransactionType, @Service, @Comment)";
public int Index { get; set; }
public int Date_Year { get; set; }
public int Date_Month { get; set; }
public int Date_Day { get; set; }
public int Time_Hour { get; set; }
public int Time_Minute { get; set; }
public int Time_Second { get; set; }
public string DateTimeString { get; set; }
public string CryptoCurrency { get; set; }
public float Amount { get; set; }
public string TransactionType { get; set; }
public string Service { get; set; }
public string Comment { get; set; }
#endregion
#region Functions
public string FullInfo => $"{ Index.ToString() } { DateTimeString } { CryptoCurrency } { Amount } { TransactionType }";
#endregion
}
public class Wallet : IDBClasses
{
#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 string DBTableName => "Wallets";
public string DBVariables => "(wCreationYear, wCreationMonth, wCreationDay, wPlatform, wName, wCurrency, wBalance, wDefaultWallet, wNotes) values (@wCreationYear, @wCreationMonth, @wCreationDay, @wPlatform, @wName, @wCurrency, @wBalance, @wDefaultWallet, @wNotes)";
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
}
}
}