Changed List to Set

pull/46/head
Titouan LOUVET 2 years ago
parent 02d36d7cee
commit 69a2945a16

@ -10,7 +10,9 @@ namespace Banquale.DataContractPersistance
{ {
public class DataContractPers : IPersistenceManager public class DataContractPers : IPersistenceManager
{ {
public string FilePath { get; set; } = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/datbase.xml"; //public string FilePath { get; set; } = Environment.GetFolderPath(Environment.SpecialFolder.Personal) + "/datbase.xml";
public string FilePath { get; set; } = FileSystem.Current.AppDataDirectory;
public string FileName { get; set; } = "CustomerList.xml"; public string FileName { get; set; } = "CustomerList.xml";
public List<Customer> DataLoad() public List<Customer> DataLoad()

@ -10,7 +10,7 @@ using System.Threading.Tasks;
namespace Banquale.Model namespace Banquale.Model
{ {
[DataContract] [DataContract]
public class Account : INotifyPropertyChanged public class Account : INotifyPropertyChanged, IEquatable<Account>
{ {
public event PropertyChangedEventHandler PropertyChanged; public event PropertyChangedEventHandler PropertyChanged;
@ -87,6 +87,8 @@ namespace Banquale.Model
Debug.WriteLine(iban); Debug.WriteLine(iban);
Debug.WriteLine(sum); Debug.WriteLine(sum);
Debug.WriteLine("Transaction successed !"); Debug.WriteLine("Transaction successed !");
} }
//public bool DoRequest(string name, string IBAN, float sum) //public bool DoRequest(string name, string IBAN, float sum)
@ -114,5 +116,16 @@ namespace Banquale.Model
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public bool Equals(Account other)
{
if(other == null) return false;
else return other.IBAN.Equals(IBAN);
}
public override int GetHashCode()
{
return IBAN.GetHashCode();
}
} }
} }

@ -9,7 +9,6 @@ namespace Banquale.Model
[DataMember] [DataMember]
public List<Customer> CustomersList { get; private set; } public List<Customer> CustomersList { get; private set; }
[DataMember]
public List<Transactions> TransactionsList { get; private set; } public List<Transactions> TransactionsList { get; private set; }
public List<Account> AccountList { get; private set; } public List<Account> AccountList { get; private set; }

Loading…
Cancel
Save