2024-10-28 11:18:20 +04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace ProjectFamilyBudget.Entities;
|
|
|
|
|
|
|
|
|
|
public class Expense
|
|
|
|
|
{
|
|
|
|
|
public int Id { get; private set; }
|
2024-11-02 12:36:04 +04:00
|
|
|
|
public double Sum { get; private set; }
|
2024-10-28 11:18:20 +04:00
|
|
|
|
public DateTime Date { get; private set; }
|
|
|
|
|
public int ExpenseCategoryId { get; private set; }
|
|
|
|
|
|
2024-11-02 12:36:04 +04:00
|
|
|
|
public static Expense CreateExpense(int id, double sum, int expenseCategoryId)
|
2024-10-28 11:18:20 +04:00
|
|
|
|
{
|
|
|
|
|
return new Expense
|
|
|
|
|
{
|
|
|
|
|
Id = id,
|
|
|
|
|
Sum = sum,
|
|
|
|
|
Date = DateTime.Now,
|
|
|
|
|
ExpenseCategoryId = expenseCategoryId
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|