1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
[NHibernate.Mapping.Attributes.Class(Table = "GF__UTILISATEUR")]
public class Utilisateur
{
private int m_Id;
private string m_Login;
private string m_MotPasse;
private string m_Mail;
private Departement m_Departement;
private IList<Profil> m_RoleCollection;
public Utilisateur()
{
this.Login = "";
this.MotPasse = "";
this.Mail = "";
this.Departement = null;
this.RoleCollection = null;
}
public Utilisateur(string pLogin, string pMotPasse, string pNom, string pPrenom, string pMatricule, string pMail, bool pAlerte, string pPopulation)
{
this.Login = pLogin;
this.MotPasse = pMotPasse;
this.Mail = pMail;
}
[NHibernate.Mapping.Attributes.Id(Name = "Id", Column = "ID_UTILISATEUR")]
[NHibernate.Mapping.Attributes.Generator(1, Class = "native")]
public int Id
{
get
{
return (m_Id);
}
set
{
m_Id = value;
}
}
[NHibernate.Mapping.Attributes.Property(Column = "LOGIN")]
public string Login
{
get
{
return (m_Login);
}
set
{
m_Login = value;
}
}
[NHibernate.Mapping.Attributes.Property(Column = "MOT_PASSE")]
public string MotPasse
{
get
{
return (m_MotPasse);
}
set
{
m_MotPasse = value;
}
}
[NHibernate.Mapping.Attributes.Property(Column = "MAIL")]
public string Mail
{
get
{
return (m_Mail);
}
set
{
m_Mail = value;
}
}
[NHibernate.Mapping.Attributes.ManyToOne(1, Name = "Departement", ClassType = typeof(Departement), Column = "PTR_DEPARTEMENT")]
public Departement Departement
{
get
{
return (m_Departement);
}
set
{
m_Departement = value;
}
}
[NHibernate.Mapping.Attributes.Bag(1, Name = "ListeRole", Inverse = true, Lazy = false, Cascade = NHibernate.Mapping.Attributes.CascadeStyle.AllDeleteOrphan)]
[NHibernate.Mapping.Attributes.Key(2, Column = "PTR_UTILISATEUR")]
[NHibernate.Mapping.Attributes.OneToMany(3, ClassType = typeof(Profil))]
public IList<Profil> ListeRole
{
get
{
return (m_RoleCollection);
}
set
{
m_RoleCollection = value;
}
}
public override string ToString()
{
string l_Message;
l_Message = "";
l_Message += "UTILISATEUR [(ID, " + Id.ToString() + "), (LOGIN, " + Login + "), (MAIL, " + Mail + "), (DEPARTEMENT, " + Departement.ToString() + ")]";
return (l_Message);
//return base.ToString();
}
} |
Partager