You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ConsEco/Sources/Modele/Operation.cs

74 lines
2.3 KiB

using System;
using System.Collections.Generic;
2 years ago
using System.ComponentModel;
using System.Linq;
using System.Text;
2 years ago
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace Model
{
public class Operation
{
2 years ago
/* public string Nom { get; private set; }
public string Type { get; private set; }
public string Tag { get; private set; }
public double Montant { get; private set; }
public string Date { get; private set; }
public Operation(string nom, string type, string tag, string date, double montant)
{
Nom = nom;
Type = type;
Tag = tag;
Date = DateTime.Now.ToString("dd/MM/yyyy");
Montant = montant;
}*/
public event PropertyChangedEventHandler PropertyChanged;
public string IntituleOperation
{
get => intituleOperation;
set
{
if (intituleOperation != value)
{
intituleOperation = value;
OnPropertyChanged(nameof(IntituleOperation));
}
}
}
private string intituleOperation;
public double Montant { get; private set; }
2 years ago
public DateTime DateOperation { get; private set; }
public MethodePayement ModePayement { get; private set; }
2 years ago
public bool IsDebit { get; private set; }
public TagOperation Tag { get; private set; }
[JsonConstructor]
public Operation(string intituleOperation, double montant, DateTime dateOperation, MethodePayement modePayement, TagOperation tag, bool isDebit = true)
{
2 years ago
IntituleOperation = intituleOperation;
Montant = montant;
2 years ago
DateOperation = dateOperation;
ModePayement = modePayement;
IsDebit = isDebit;
Tag = tag;
}
2 years ago
void OnPropertyChanged(string propertyName) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
2 years ago
public override string ToString()
{
return IntituleOperation + " " + DateOperation + " " + Montant + " " + ModePayement + " " + IsDebit;
}
}
}