procédure ListPlat
This commit is contained in:
@@ -20,7 +20,7 @@ namespace ProjetTheAlone.Acces
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string B_nom, string B_prenom, DateTime? B_anniversaire, string B_img)
|
||||
public int Ajouter(string B_nom, string B_prenom, DateTime? B_anniversaire, byte?[] B_img)
|
||||
{
|
||||
CreerCommande("AjouterT_beneficiaire");
|
||||
int res = 0;
|
||||
@@ -40,7 +40,7 @@ namespace ProjetTheAlone.Acces
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Modifier(int ID_beneficiaire, string B_nom, string B_prenom, DateTime? B_anniversaire, string B_img)
|
||||
public int Modifier(int ID_beneficiaire, string B_nom, string B_prenom, DateTime? B_anniversaire, byte?[] B_img)
|
||||
{
|
||||
CreerCommande("ModifierT_beneficiaire");
|
||||
int res = 0;
|
||||
@@ -72,7 +72,7 @@ namespace ProjetTheAlone.Acces
|
||||
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());
|
||||
tmp.B_img = dr["B_img"].ToString();
|
||||
tmp.B_img = dr["B_img"];
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
@@ -92,7 +92,7 @@ namespace ProjetTheAlone.Acces
|
||||
res.B_nom = dr["B_nom"].ToString();
|
||||
res.B_prenom = dr["B_prenom"].ToString();
|
||||
if(dr["B_anniversaire"] != DBNull.Value) res.B_anniversaire = DateTime.Parse(dr["B_anniversaire"].ToString());
|
||||
res.B_img = dr["B_img"].ToString();
|
||||
res.B_img = (byte?[])dr["B_img"];
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
|
||||
@@ -74,7 +74,30 @@ namespace ProjetTheAlone.Acces
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public C_T_plat Lire_ID(int ID_plat)
|
||||
/// <summary>
|
||||
/// Permet de récupérer la liste des plats d'un repas
|
||||
/// </summary>
|
||||
public List<C_T_plat> ListPlat(int ID_listPlat)
|
||||
{
|
||||
CreerCommande("ListPlat");
|
||||
Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
List<C_T_plat> res = new List<C_T_plat>();
|
||||
while (dr.Read())
|
||||
{
|
||||
C_T_plat tmp = new C_T_plat();
|
||||
tmp.ID_plat = int.Parse(dr["ID_plat"].ToString());
|
||||
if (dr["P_nom"] != DBNull.Value) tmp.P_nom = (dr["P_nom"].ToString());
|
||||
if (dr["P_img"] != DBNull.Value) tmp.P_img = Encoding.ASCII.GetBytes(dr["P_img"].ToString());
|
||||
if (dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = int.Parse(dr["ID_typePlat"].ToString());
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public C_T_plat Lire_ID(int ID_plat)
|
||||
{
|
||||
CreerCommande("SelectionnerT_plat_ID");
|
||||
Commande.Parameters.AddWithValue("@ID_plat", ID_plat);
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace ProjetTheAlone.Acces
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// resume de <c>Lire</c>
|
||||
/// Permet de récupérer les repas entre deux date
|
||||
/// </summary>
|
||||
/// <param name="start">Date filtre debut compris</param>
|
||||
/// <param name="end">Date fin non compris</param>
|
||||
@@ -100,6 +100,11 @@ namespace ProjetTheAlone.Acces
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
/// <summary>
|
||||
/// Permet de récupérer les repas d'une date donnée
|
||||
/// </summary>
|
||||
/// <param name="dateV">Date filtre</param>
|
||||
|
||||
public List<C_T_repa> Lire(DateTime dateV)
|
||||
{
|
||||
CreerCommande("SelectEventBetweenTwoDateTime");
|
||||
|
||||
@@ -16,19 +16,19 @@ namespace ProjetTheAlone.Classes
|
||||
private string _B_nom;
|
||||
private string _B_prenom;
|
||||
private DateTime? _B_anniversaire;
|
||||
private string _B_img;
|
||||
private byte?[] _B_img;
|
||||
#endregion
|
||||
#region Constructeurs
|
||||
public C_T_beneficiaire()
|
||||
{ }
|
||||
public C_T_beneficiaire(string B_nom_, string B_prenom_, DateTime? B_anniversaire_, string B_img_)
|
||||
public C_T_beneficiaire(string B_nom_, string B_prenom_, DateTime? B_anniversaire_, byte?[] B_img_)
|
||||
{
|
||||
B_nom = B_nom_;
|
||||
B_prenom = B_prenom_;
|
||||
B_anniversaire = B_anniversaire_;
|
||||
B_img = B_img_;
|
||||
}
|
||||
public C_T_beneficiaire(int ID_beneficiaire_, string B_nom_, string B_prenom_, DateTime? B_anniversaire_, string B_img_)
|
||||
public C_T_beneficiaire(int ID_beneficiaire_, string B_nom_, string B_prenom_, DateTime? B_anniversaire_, byte?[] B_img_)
|
||||
: this(B_nom_, B_prenom_, B_anniversaire_, B_img_)
|
||||
{
|
||||
ID_beneficiaire = ID_beneficiaire_;
|
||||
@@ -55,7 +55,7 @@ namespace ProjetTheAlone.Classes
|
||||
get { return _B_anniversaire; }
|
||||
set { _B_anniversaire = value; }
|
||||
}
|
||||
public string B_img
|
||||
public byte?[] B_img
|
||||
{
|
||||
get { return _B_img; }
|
||||
set { _B_img = value; }
|
||||
|
||||
@@ -21,9 +21,9 @@ namespace ProjetTheAlone.Gestion
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string B_nom, string B_prenom, DateTime? B_anniversaire, string B_img)
|
||||
public int Ajouter(string B_nom, string B_prenom, DateTime? B_anniversaire, byte?[] B_img)
|
||||
{ return new A_T_beneficiaire(ChaineConnexion).Ajouter(B_nom, B_prenom, B_anniversaire, B_img); }
|
||||
public int Modifier(int ID_beneficiaire, string B_nom, string B_prenom, DateTime? B_anniversaire, string B_img)
|
||||
public int Modifier(int ID_beneficiaire, string B_nom, string B_prenom, DateTime? B_anniversaire, byte?[] B_img)
|
||||
{ return new A_T_beneficiaire(ChaineConnexion).Modifier(ID_beneficiaire, B_nom, B_prenom, B_anniversaire, B_img); }
|
||||
public List<C_T_beneficiaire> Lire(string Index)
|
||||
{ return new A_T_beneficiaire(ChaineConnexion).Lire(Index); }
|
||||
|
||||
@@ -29,7 +29,12 @@ namespace ProjetTheAlone.Gestion
|
||||
{ return new A_T_plat(ChaineConnexion).Lire(Index); }
|
||||
public C_T_plat Lire_ID(int ID_plat)
|
||||
{ return new A_T_plat(ChaineConnexion).Lire_ID(ID_plat); }
|
||||
public int Supprimer(int ID_plat)
|
||||
/// <summary>
|
||||
/// Permet de récupérer la liste des plats d'un repas
|
||||
/// </summary>
|
||||
public List<C_T_plat> ListPlat(int ID_repa)
|
||||
{ return new A_T_plat(ChaineConnexion).ListPlat(ID_repa); }
|
||||
public int Supprimer(int ID_plat)
|
||||
{ return new A_T_plat(ChaineConnexion).Supprimer(ID_plat); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,19 @@ namespace ProjetTheAlone.Gestion
|
||||
{ return new A_T_repa(ChaineConnexion).Modifier(ID_repa, ID_listPlat, ID_typeRepa , R_Date); }
|
||||
public List<C_T_repa> Lire(string Index)
|
||||
{ return new A_T_repa(ChaineConnexion).Lire(Index); }
|
||||
/// <summary>
|
||||
/// Permet de récupérer les repas entre deux date
|
||||
/// </summary>
|
||||
/// <param name="start">Date filtre debut compris</param>
|
||||
/// <param name="end">Date fin non compris</param>
|
||||
public List<C_T_repa> Lire(DateTime start, DateTime end)
|
||||
{ return new A_T_repa(ChaineConnexion).Lire(start, end); }
|
||||
/// <summary>
|
||||
/// Permet de récupérer les repas d'une date donnée
|
||||
/// </summary>
|
||||
/// <param name="dateV">Date filtre</param>
|
||||
public List<C_T_repa> Lire(DateTime dateV)
|
||||
{ return new A_T_repa(ChaineConnexion).Lire(dateV); }
|
||||
public C_T_repa Lire_ID(int ID_repa)
|
||||
{ return new A_T_repa(ChaineConnexion).Lire_ID(ID_repa); }
|
||||
public int Supprimer(int ID_repa)
|
||||
|
||||
Reference in New Issue
Block a user