Small updates

This commit is contained in:
Stedd 2022-01-16 16:45:43 +01:00
parent f3e8bc09e0
commit b6b4dc0cea
3 changed files with 4 additions and 6 deletions

View File

@ -7,7 +7,6 @@ namespace CryptoCalc
public interface IDBClasses
{
string DBVariables { get; set; }
string DBTableName { get; }
string DBSaveDataString { get; }
}
@ -16,7 +15,7 @@ namespace CryptoCalc
{
#region Publics
public virtual string DBVariables { get; set; }
public virtual string DBTableName => throw new NotImplementedException();
public virtual string DBTableName { get; }
public string DBSaveDataString => $"({Regex.Replace(DBVariables, "@", "")}) values ({DBVariables})";
public int Index { get; set; }
@ -140,10 +139,10 @@ namespace CryptoCalc
public Wallet() { SetDBStrings(); }
public Wallet(int year, int month, int day, string platform, string name, string currency, float balance, int defaultWallet, string note)
public Wallet(DateTime dateTime, string platform, string name, string currency, float balance, int defaultWallet, string note)
{
SaveUnixTimeNow();
UnixTimeCreated = GetUnixTime(new DateTime(year, month, day));
UnixTimeCreated = GetUnixTime(dateTime);
Platform = platform;
Name = name;
Currency = currency;

View File

@ -10,7 +10,6 @@ namespace CryptoCalc
{
public class DBInteraction
{
public static void SaveData<T>(ref T data) where T : DBClasses
{
if (data is null)

View File

@ -66,7 +66,7 @@ namespace CryptoCalc
{
Wallet w = new();
w.SaveUnixTimeNow();
w.UnixTimeCreated = w.GetUnixTime(new DateTime(2018, 10, 1));
w.UnixTimeCreated = w.GetUnixTime(new DateTime(rand.Next(2011, DateTime.Now.Year), rand.Next(1,12), rand.Next(1, 28)));
w.Platform = "Ledger";
w.Name = "TestWallet";
w.Currency = "SOL";