61 lines
1.7 KiB
C#
61 lines
1.7 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace GestionDeCommerceInfoClasseBDDNCouches
|
|
{
|
|
public class Utilisateur
|
|
{
|
|
public enum Type_E { Commercant, Client, Fournisseur };
|
|
public enum Tri_E { NONE, NOM, PRENOM };
|
|
public string Nom, Prenom, Adresse, NCompte, Email;
|
|
public DateTime? DateDeNaisance;
|
|
public bool Actif;
|
|
public Type_E TypeUtilisateur;
|
|
private int? id;
|
|
|
|
public int ID {
|
|
get
|
|
{
|
|
if (id != null)
|
|
return id.Value;
|
|
else
|
|
return -1;
|
|
}
|
|
set
|
|
{
|
|
if (id == null)
|
|
id = value;
|
|
}
|
|
}
|
|
|
|
public Utilisateur()
|
|
{
|
|
|
|
}
|
|
public Utilisateur(string nom, string pre, string addr, string nCompte, string email, Type_E type)
|
|
{
|
|
Nom = nom; Prenom = pre; Adresse = addr; NCompte = nCompte; Email = email; TypeUtilisateur = type;
|
|
Actif = true;
|
|
id = null;
|
|
}
|
|
public Utilisateur(int id, string nom, string pre, string addr, string nCompte, string email, Type_E type)
|
|
{
|
|
this.id = id;
|
|
Nom = nom; Prenom = pre; Adresse = addr; NCompte = nCompte; Email = email; TypeUtilisateur = type;
|
|
Actif = true;
|
|
}
|
|
public override string ToString()
|
|
{
|
|
return $"{Nom} {Prenom}";
|
|
}
|
|
public static implicit operator string(Utilisateur lSTArticle)
|
|
{
|
|
return lSTArticle.ToString();
|
|
}
|
|
|
|
}
|
|
}
|