Gestion Alerte OK
This commit is contained in:
@@ -79,6 +79,26 @@ namespace ProjetTheAlone.Acces
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_beneficiaire> AnnifDuJour()
|
||||
{
|
||||
CreerCommande("AnifBene");
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
List<C_T_beneficiaire> res = new List<C_T_beneficiaire>();
|
||||
while (dr.Read())
|
||||
{
|
||||
C_T_beneficiaire tmp = new C_T_beneficiaire();
|
||||
tmp.ID_beneficiaire = int.Parse(dr["ID_beneficiaire"].ToString());
|
||||
tmp.B_nom = dr["B_nom"].ToString();
|
||||
tmp.B_prenom = dr["B_prenom"].ToString();
|
||||
if (dr["B_anniversaire"] != DBNull.Value) tmp.B_anniversaire = DateTime.Parse(dr["B_anniversaire"].ToString());
|
||||
if (dr["B_img"] != DBNull.Value) tmp.B_img = Outil.toNullableByteArray.Convert((byte[])dr["B_img"]);
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public C_T_beneficiaire Lire_ID(int ID_beneficiaire)
|
||||
{
|
||||
CreerCommande("SelectionnerT_beneficiaire_ID");
|
||||
|
||||
@@ -89,7 +89,35 @@ namespace ProjetTheAlone.Acces
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public C_T_event Lire_ID(int ID_event)
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="dateV">Date cible</param>
|
||||
/// <returns>List des évènement du jour</returns>
|
||||
public List<C_T_event> Lire(DateTime dateV)
|
||||
{
|
||||
CreerCommande("[SelectEventByDate]");
|
||||
Commande.Parameters.AddWithValue("@dateV", dateV);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
List<C_T_event> res = new List<C_T_event>();
|
||||
while (dr.Read())
|
||||
{
|
||||
C_T_event tmp = new C_T_event();
|
||||
tmp.ID_event = int.Parse(dr["ID_event"].ToString());
|
||||
if (dr["E_date"] != DBNull.Value) tmp.E_date = DateTime.Parse(dr["E_date"].ToString());
|
||||
if (dr["E_duree"] != DBNull.Value) tmp.E_duree = DateTime.Parse(dr["E_duree"].ToString());
|
||||
if (dr["ID_typeEvenement"] != DBNull.Value) tmp.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].ToString());
|
||||
if (dr["E_description"] != DBNull.Value) tmp.E_description = (dr["E_description"].ToString());
|
||||
if (dr["ID_lieu"] != DBNull.Value) tmp.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
|
||||
if (dr["E_Pic"] != DBNull.Value) tmp.E_Pic = Outil.toNullableByteArray.Convert((byte[])dr["E_Pic"]);
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public C_T_event Lire_ID(int ID_event)
|
||||
{
|
||||
CreerCommande("SelectionnerT_event_ID");
|
||||
Commande.Parameters.AddWithValue("@ID_event", ID_event);
|
||||
|
||||
@@ -46,9 +46,11 @@ namespace ProjetTheAlone.Classes
|
||||
}
|
||||
public DateTime? E_date
|
||||
{
|
||||
get { return _E_date; }
|
||||
get { return _E_date.Value; }
|
||||
set { _E_date = value; }
|
||||
}
|
||||
public string E_Date_string
|
||||
{ get => _E_date.Value.ToShortDateString(); }
|
||||
public DateTime? E_duree
|
||||
{
|
||||
get { return _E_duree; }
|
||||
|
||||
@@ -31,5 +31,9 @@ namespace ProjetTheAlone.Gestion
|
||||
{ return new A_T_beneficiaire(ChaineConnexion).Lire_ID(ID_beneficiaire); }
|
||||
public int Supprimer(int ID_beneficiaire)
|
||||
{ return new A_T_beneficiaire(ChaineConnexion).Supprimer(ID_beneficiaire); }
|
||||
public List<C_T_beneficiaire> AnnifDuJour()
|
||||
{
|
||||
return new A_T_beneficiaire(ChaineConnexion).AnnifDuJour();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,14 @@ namespace ProjetTheAlone.Gestion
|
||||
{ return new A_T_event(ChaineConnexion).Modifier(ID_event, E_date, E_duree, ID_typeEvenement, E_description, ID_lieu, E_Pic_); }
|
||||
public List<C_T_event> Lire(string Index)
|
||||
{ return new A_T_event(ChaineConnexion).Lire(Index); }
|
||||
public C_T_event Lire_ID(int ID_event)
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="dateV">Date cible</param>
|
||||
/// <returns>Liste des event de la date cible</returns>
|
||||
public List<C_T_event> Lire(DateTime dateV)
|
||||
{ return new A_T_event(ChaineConnexion).Lire(dateV); }
|
||||
public C_T_event Lire_ID(int ID_event)
|
||||
{ return new A_T_event(ChaineConnexion).Lire_ID(ID_event); }
|
||||
public int Supprimer(int ID_event)
|
||||
{ return new A_T_event(ChaineConnexion).Supprimer(ID_event); }
|
||||
|
||||
Reference in New Issue
Block a user