From fdd96c6ffb466d46c564178b29fe48d719cd17a2 Mon Sep 17 00:00:00 2001 From: "titouan.louvet" Date: Tue, 6 Jun 2023 11:35:50 +0200 Subject: [PATCH] Changed transactions to transactions --- .../Banquale/Views/BalancePage.xaml.cs | 2 +- src/Banquale/Model/Transactions.cs | 110 ------------------ 2 files changed, 1 insertion(+), 111 deletions(-) delete mode 100644 src/Banquale/Model/Transactions.cs diff --git a/src/Banquale/Banquale/Views/BalancePage.xaml.cs b/src/Banquale/Banquale/Views/BalancePage.xaml.cs index 2cc3e1a..d091ebd 100644 --- a/src/Banquale/Banquale/Views/BalancePage.xaml.cs +++ b/src/Banquale/Banquale/Views/BalancePage.xaml.cs @@ -37,7 +37,7 @@ public partial class BalancePage : ContentPage return; } - Transactions transactions = Mgr.SelectedAccount.TransactionsList.FirstOrDefault(u => u.Id == TransactionId); + Transaction transactions = Mgr.SelectedAccount.TransactionsList.FirstOrDefault(u => u.Id == TransactionId); if (transactions == null) { await DisplayAlert("Erreur", "La transaction n'éxiste pas !", "OK"); diff --git a/src/Banquale/Model/Transactions.cs b/src/Banquale/Model/Transactions.cs deleted file mode 100644 index 96645d1..0000000 --- a/src/Banquale/Model/Transactions.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System.ComponentModel; -using System.Runtime.Serialization; - -namespace Model -{ - [DataContract(IsReference = true)] - public class Transactions : INotifyPropertyChanged - { - - void OnPropertyChanged(string propertyName) - { - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); - } - [DataMember(Order = 1)] - public int Id { get; private set; } - - [DataMember(Order = 2)] - public bool Type - { - get => type; - set - { - if(type == value) - return; - type = value; - OnPropertyChanged(nameof(Type)); - } - } - [DataMember] - - private bool type; - - [DataMember(Order = 3)] - public double Sum - { - get => sum; - set - { - if (sum == value) - return; - sum = value; - OnPropertyChanged(nameof(Sum)); - } - } - [DataMember] - private double sum; - - [DataMember(Order = 4)] - public Account InvolvedAccounts - { - get => involvedAccounts; - set - { - if (involvedAccounts == value) - return; - involvedAccounts = value; - OnPropertyChanged(nameof(InvolvedAccounts)); - } - } - [DataMember] - private Account involvedAccounts; - - [DataMember(Order = 5)] - public string Category - { - get => category; - set - { - if (category == value) - return; - category = value; - OnPropertyChanged(nameof(Category)); - } - } - [DataMember] - private string? category; - - [DataMember(Order = 6)] - public DateTime Date - { - get => date; - set - { - if (date == value) - return; - date = value; - OnPropertyChanged(nameof(Date)); - } - } - [DataMember] - private DateTime date; - - public Transactions(bool type, double sum, Account involvedAccounts/*, string category*/, int id, DateTime date) - { - Type = type; - Sum = sum; - Id = id; - InvolvedAccounts = involvedAccounts; - //Category = category; - Date = date; - } - - public void ChangeCategory(string newCateg) - { - Category = newCateg; - } - - public event PropertyChangedEventHandler? PropertyChanged; - } -}