|
|
|
@ -5,6 +5,7 @@ using System.Collections.ObjectModel;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
using System.Text.RegularExpressions;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace Model
|
|
|
|
|
{
|
|
|
|
@ -20,8 +21,7 @@ namespace Model
|
|
|
|
|
private string surname="";
|
|
|
|
|
private string mail = "";
|
|
|
|
|
private string picture = "";
|
|
|
|
|
private string password = "";
|
|
|
|
|
//private string defaultUserSavePath = "";
|
|
|
|
|
private int password ;
|
|
|
|
|
private List<Priority> priorities;
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
@ -79,16 +79,14 @@ namespace Model
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///<summary>
|
|
|
|
|
/// Property to initiate password, change it, and
|
|
|
|
|
/// </summary>
|
|
|
|
|
public string Password
|
|
|
|
|
public int Password
|
|
|
|
|
{
|
|
|
|
|
get { return password; }
|
|
|
|
|
|
|
|
|
|
set { password = value; }
|
|
|
|
|
get => password;
|
|
|
|
|
set => password = value;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// For now, we define the ProfilPict as a string which is "PhotoParDefaut"
|
|
|
|
|
/// when the value is null.
|
|
|
|
@ -111,19 +109,20 @@ namespace Model
|
|
|
|
|
set=> priorities = value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Equals(object? obj)
|
|
|
|
|
public override bool Equals(object? other)
|
|
|
|
|
{
|
|
|
|
|
if (obj == null) return false;
|
|
|
|
|
if (obj == this) return true;
|
|
|
|
|
return Equals(obj);
|
|
|
|
|
}
|
|
|
|
|
public bool Equals(User? other)
|
|
|
|
|
if (other == null) return false;
|
|
|
|
|
if (other == this) return true;
|
|
|
|
|
return Equals(other);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool Equals(User? other)
|
|
|
|
|
{
|
|
|
|
|
if (other == null ) return false;
|
|
|
|
|
if (other == null) return false;
|
|
|
|
|
return Name.Equals(other.Name) && Surname.Equals(other.Surname) && Mail.Equals(other.Mail);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -135,11 +134,12 @@ namespace Model
|
|
|
|
|
/// <param name="name">The name of the user</param>
|
|
|
|
|
/// <param name="surname">The surname of the user</param>
|
|
|
|
|
/// <param name="mail">The user needs an email to login. </param>
|
|
|
|
|
public User(string name, string surname, string mail)
|
|
|
|
|
public User(string name, string surname, string mail, int password)
|
|
|
|
|
{
|
|
|
|
|
Name = name;
|
|
|
|
|
Surname = surname;
|
|
|
|
|
Mail = mail;
|
|
|
|
|
Password = password;
|
|
|
|
|
priorities = new List<Priority> {
|
|
|
|
|
Priority.Gourmet,
|
|
|
|
|
Priority.Economic,
|
|
|
|
|