56 lines
1.1 KiB
C#
56 lines
1.1 KiB
C#
using System;
|
|
using MySql.Data.MySqlClient;
|
|
|
|
namespace Nevyn.Models
|
|
{
|
|
public class Budget
|
|
{
|
|
public int Id { get; set; }
|
|
public List<Category> Categories { get; set; }
|
|
public Budget()
|
|
{
|
|
}
|
|
|
|
//public void getBudgetFromSQL()
|
|
//this = Classes.Mysql.getBudget();
|
|
|
|
//}
|
|
|
|
public void updateFromDatabase()
|
|
{
|
|
Classes.Mysql mysql = new Classes.Mysql();
|
|
|
|
this.Categories = mysql.getBudgetCategories();
|
|
}
|
|
}
|
|
|
|
public class Category
|
|
{
|
|
public int ID { get; set; }
|
|
public string? Name { get; set; }
|
|
public int parent { get; set; }
|
|
public List<BudgetItem> Items { get; set; }
|
|
}
|
|
|
|
public class BudgetItem
|
|
{
|
|
public int ID { get; set; }
|
|
public string? Name { get; set; }
|
|
//public user User { get; set; }
|
|
public int Amount { get; set; }
|
|
public string? Description { get; set; }
|
|
public bool Recurring { get; set; }
|
|
public int Month { get; set; }
|
|
public int Year { get; set; }
|
|
|
|
}
|
|
|
|
|
|
public class BudgetDTO
|
|
{
|
|
public List<Category> Categories { get; set; }
|
|
public string Debug { get; set; }
|
|
}
|
|
}
|
|
|