Gestion repa Ok
This commit is contained in:
86
ProjetTheAlone/Model - Copie/A_Base.cs
Normal file
86
ProjetTheAlone/Model - Copie/A_Base.cs
Normal file
@@ -0,0 +1,86 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Configuration;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Acces
|
||||
{
|
||||
public class ADBase
|
||||
{
|
||||
#region Données membres
|
||||
protected SqlCommand _commande;
|
||||
#endregion
|
||||
#region Constructeurs (étendus)
|
||||
/// <summary>
|
||||
/// Constructeur par défaut
|
||||
/// </summary>
|
||||
/// <remarks>La chaîne de connexion est récupérée en argument</remarks>
|
||||
public ADBase(string sChaineConnexion)
|
||||
{
|
||||
_commande = new SqlCommand();
|
||||
_commande.Connection = new SqlConnection(sChaineConnexion);
|
||||
}
|
||||
/// <summary>
|
||||
/// Méthode assignant une procédure stockée
|
||||
/// </summary>
|
||||
/// <param name="sCommande">Nom de la procédure stockée</param>
|
||||
public void CreerCommande(string sCommande)
|
||||
{
|
||||
_commande.CommandType = CommandType.StoredProcedure;
|
||||
_commande.CommandText = sCommande;
|
||||
}
|
||||
/// <summary>
|
||||
/// Méthode assignant une procédure stockée ET une chaîne de connexion
|
||||
/// </summary>
|
||||
/// <param name="sCommande">Nom de la procédure stockée</param>
|
||||
/// <param name="sConnexion">Chaîne de connexion à utiliser</param>
|
||||
public void CreerCommande(string sCommande, string sConnexion)
|
||||
{
|
||||
_commande.Connection = new SqlConnection(sConnexion);
|
||||
_commande.CommandType = CommandType.StoredProcedure;
|
||||
_commande.CommandText = sCommande;
|
||||
}
|
||||
/// <summary>
|
||||
/// Méthode assignant une procédure stockée et le type de requête
|
||||
/// </summary>
|
||||
/// <param name="sCommande">Nom de la procédure stockée</param>
|
||||
/// <param name="bTypeProcedures">Type de requête (Vrai=stockée, Faux=Texte)</param>
|
||||
public void CreerCommande(string sCommande, bool bTypeRequete)
|
||||
{
|
||||
if (bTypeRequete) _commande.CommandType = CommandType.StoredProcedure;
|
||||
else _commande.CommandType = CommandType.Text;
|
||||
_commande.CommandText = sCommande;
|
||||
}
|
||||
/// <summary>
|
||||
/// Méthode assignant une procédure stockée, une chaîne de connexion et le type de requête
|
||||
/// </summary>
|
||||
/// <param name="sCommande">Nom de la procédure stockée</param>
|
||||
/// <param name="sConnexion">Chaîne de connexion à utiliser</param>
|
||||
/// <param name="bTypeProcedures">Type de requête (Vrai=stockée, Faux=Texte)</param>
|
||||
public void CreerCommande(string sCommande, bool bTypeRequete, string sConnexion)
|
||||
{
|
||||
_commande.Connection = new SqlConnection(sConnexion);
|
||||
if (bTypeRequete) _commande.CommandType = CommandType.StoredProcedure;
|
||||
else _commande.CommandType = CommandType.Text;
|
||||
_commande.CommandText = sCommande;
|
||||
}
|
||||
#endregion
|
||||
#region Accesseurs
|
||||
public SqlCommand Commande
|
||||
{
|
||||
get { return _commande; }
|
||||
set { _commande = value; }
|
||||
}
|
||||
#endregion
|
||||
#region Utilitaires
|
||||
public void Direction(string sParam, ParameterDirection dParam)
|
||||
{ Commande.Parameters[sParam].Direction = dParam; }
|
||||
public string LireParametre(string sParam)
|
||||
{ return Commande.Parameters[sParam].Value.ToString(); }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
113
ProjetTheAlone/Model - Copie/A_T_beneficiaire.cs
Normal file
113
ProjetTheAlone/Model - Copie/A_T_beneficiaire.cs
Normal file
@@ -0,0 +1,113 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using ProjetTheAlone.Classes;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Acces
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche d'accès aux données (Data Access Layer)
|
||||
/// </summary>
|
||||
public class A_T_beneficiaire : ADBase
|
||||
{
|
||||
#region Constructeurs
|
||||
public A_T_beneficiaire(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string B_nom, string B_prenom, DateTime? B_anniversaire, byte?[] B_img)
|
||||
{
|
||||
CreerCommande("AjouterT_beneficiaire");
|
||||
int res = 0;
|
||||
Commande.Parameters.Add("ID_beneficiaire", SqlDbType.Int);
|
||||
Direction("ID_beneficiaire", ParameterDirection.Output);
|
||||
if (B_nom == null) Commande.Parameters.AddWithValue("@B_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@B_nom", B_nom);
|
||||
if (B_prenom == null) Commande.Parameters.AddWithValue("@B_prenom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@B_prenom", B_prenom);
|
||||
if (B_anniversaire == null) Commande.Parameters.AddWithValue("@B_anniversaire", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@B_anniversaire", B_anniversaire);
|
||||
if (B_img == null) Commande.Parameters.AddWithValue("@B_img", SqlDbType.Image).Value = Convert.DBNull;
|
||||
else Commande.Parameters.AddWithValue("@B_img", SqlDbType.Image).Value = Outil.toByteArray.Convert(B_img);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
res = int.Parse(LireParametre("ID_beneficiaire"));
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Modifier(int ID_beneficiaire, string B_nom, string B_prenom, DateTime? B_anniversaire, byte?[] B_img)
|
||||
{
|
||||
CreerCommande("ModifierT_beneficiaire");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_beneficiaire", ID_beneficiaire);
|
||||
if (B_nom == null) Commande.Parameters.AddWithValue("@B_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@B_nom", B_nom);
|
||||
if (B_prenom == null) Commande.Parameters.AddWithValue("@B_prenom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@B_prenom", B_prenom);
|
||||
if (B_anniversaire == null) Commande.Parameters.AddWithValue("@B_anniversaire", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@B_anniversaire", B_anniversaire);
|
||||
if (B_img == null) Commande.Parameters.AddWithValue("@B_img", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@B_img", B_img);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_beneficiaire> Lire(string Index)
|
||||
{
|
||||
CreerCommande("SelectionnerT_beneficiaire");
|
||||
Commande.Parameters.AddWithValue("@Index", Index);
|
||||
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");
|
||||
Commande.Parameters.AddWithValue("@ID_beneficiaire", ID_beneficiaire);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
C_T_beneficiaire res = new C_T_beneficiaire();
|
||||
while (dr.Read())
|
||||
{
|
||||
res.ID_beneficiaire = int.Parse(dr["ID_beneficiaire"].ToString());
|
||||
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());
|
||||
if (dr["B_img"] != DBNull.Value) res.B_img = Outil.toNullableByteArray.Convert((byte[])dr["B_img"]);
|
||||
res.B_img = (byte?[])dr["B_img"];
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Supprimer(int ID_beneficiaire)
|
||||
{
|
||||
CreerCommande("SupprimerT_beneficiaire");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_beneficiaire", ID_beneficiaire);
|
||||
Commande.Connection.Open();
|
||||
res = Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
104
ProjetTheAlone/Model - Copie/A_T_equipe.cs
Normal file
104
ProjetTheAlone/Model - Copie/A_T_equipe.cs
Normal file
@@ -0,0 +1,104 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using ProjetTheAlone.Classes;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Acces
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche d'accès aux données (Data Access Layer)
|
||||
/// </summary>
|
||||
public class A_T_equipe : ADBase
|
||||
{
|
||||
#region Constructeurs
|
||||
public A_T_equipe(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string E_nom, int E_point, int? ID_evenement)
|
||||
{
|
||||
CreerCommande("AjouterT_equipe");
|
||||
int res = 0;
|
||||
Commande.Parameters.Add("ID_equipe", SqlDbType.Int);
|
||||
Direction("ID_equipe", ParameterDirection.Output);
|
||||
if(E_nom == null) Commande.Parameters.AddWithValue("@E_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_nom", E_nom);
|
||||
Commande.Parameters.AddWithValue("@E_point", E_point);
|
||||
if(ID_evenement == null) Commande.Parameters.AddWithValue("@ID_evenement", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_evenement", ID_evenement);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
res = int.Parse(LireParametre("ID_equipe"));
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Modifier(int ID_equipe, string E_nom, int E_point, int? ID_evenement)
|
||||
{
|
||||
CreerCommande("ModifierT_equipe");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_equipe", ID_equipe);
|
||||
if(E_nom == null) Commande.Parameters.AddWithValue("@E_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_nom", E_nom);
|
||||
Commande.Parameters.AddWithValue("@E_point", E_point);
|
||||
if(ID_evenement == null) Commande.Parameters.AddWithValue("@ID_evenement", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_evenement", ID_evenement);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_equipe> Lire(string Index)
|
||||
{
|
||||
CreerCommande("SelectionnerT_equipe");
|
||||
Commande.Parameters.AddWithValue("@Index", Index);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
List<C_T_equipe> res = new List<C_T_equipe>();
|
||||
while (dr.Read())
|
||||
{
|
||||
C_T_equipe tmp = new C_T_equipe();
|
||||
tmp.ID_equipe = int.Parse(dr["ID_equipe"].ToString());
|
||||
tmp.E_nom = dr["E_nom"].ToString();
|
||||
tmp.E_point = int.Parse(dr["E_point"].ToString());
|
||||
if(dr["ID_evenement"] != DBNull.Value) tmp.ID_evenement = int.Parse(dr["ID_evenement"].ToString());
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public C_T_equipe Lire_ID(int ID_equipe)
|
||||
{
|
||||
CreerCommande("SelectionnerT_equipe_ID");
|
||||
Commande.Parameters.AddWithValue("@ID_equipe", ID_equipe);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
C_T_equipe res = new C_T_equipe();
|
||||
while (dr.Read())
|
||||
{
|
||||
res.ID_equipe = int.Parse(dr["ID_equipe"].ToString());
|
||||
res.E_nom = dr["E_nom"].ToString();
|
||||
res.E_point = int.Parse(dr["E_point"].ToString());
|
||||
if(dr["ID_evenement"] != DBNull.Value) res.ID_evenement = int.Parse(dr["ID_evenement"].ToString());
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Supprimer(int ID_equipe)
|
||||
{
|
||||
CreerCommande("SupprimerT_equipe");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_equipe", ID_equipe);
|
||||
Commande.Connection.Open();
|
||||
res = Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
122
ProjetTheAlone/Model - Copie/A_T_event-Comp-Hugues.cs
Normal file
122
ProjetTheAlone/Model - Copie/A_T_event-Comp-Hugues.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using ProjetTheAlone.Classes;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Acces
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche d'accès aux données (Data Access Layer)
|
||||
/// </summary>
|
||||
public class A_T_event : ADBase
|
||||
{
|
||||
#region Constructeurs
|
||||
public A_T_event(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement,string E_description, int? ID_lieu, Byte?[] E_Pic)
|
||||
{
|
||||
CreerCommande("AjouterT_event");
|
||||
int res = 0;
|
||||
Commande.Parameters.Add("ID_event", SqlDbType.Int);
|
||||
Direction("ID_event", ParameterDirection.Output);
|
||||
if(E_date == null) Commande.Parameters.AddWithValue("@E_date", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_date", E_date);
|
||||
if(E_duree == null) Commande.Parameters.AddWithValue("@E_duree", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_duree", E_duree);
|
||||
if(ID_typeEvenement == null) Commande.Parameters.AddWithValue("@ID_typeEvenement", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_typeEvenement", ID_typeEvenement);
|
||||
if(E_description == null) Commande.Parameters.AddWithValue("@E_description", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_description", E_description);
|
||||
if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
|
||||
Commande.Parameters.AddWithValue("@E_Pic", E_Pic ?? Convert.DBNull);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
res = int.Parse(LireParametre("ID_event"));
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Modifier(int ID_event, DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement, string E_description, int? ID_lieu, Byte?[] E_Pic)
|
||||
{
|
||||
CreerCommande("ModifierT_event");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_event", ID_event);
|
||||
if(E_date == null) Commande.Parameters.AddWithValue("@E_date", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_date", E_date);
|
||||
if(E_duree == null) Commande.Parameters.AddWithValue("@E_duree", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_duree", E_duree);
|
||||
if(ID_typeEvenement == null) Commande.Parameters.AddWithValue("@ID_typeEvenement", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_typeEvenement", ID_typeEvenement);
|
||||
if(E_description == null) Commande.Parameters.AddWithValue("@E_description", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_description", E_description);
|
||||
if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
|
||||
Commande.Parameters.AddWithValue("@E_Pic", E_Pic ?? Convert.DBNull);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_event> Lire(string Index)
|
||||
{
|
||||
CreerCommande("SelectionnerT_event");
|
||||
Commande.Parameters.AddWithValue("@Index", Index);
|
||||
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 = (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);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
C_T_event res = new C_T_event();
|
||||
while (dr.Read())
|
||||
{
|
||||
res.ID_event = int.Parse(dr["ID_event"].ToString());
|
||||
if(dr["E_date"] != DBNull.Value) res.E_date = DateTime.Parse(dr["E_date"].ToString());
|
||||
if(dr["E_duree"] != DBNull.Value) res.E_duree = DateTime.Parse(dr["E_duree"].ToString());
|
||||
if(dr["ID_typeEvenement"] != DBNull.Value) res.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].ToString());
|
||||
if(dr["E_description"] != DBNull.Value) res.E_description = (dr["E_description"].ToString());
|
||||
if(dr["ID_lieu"] != DBNull.Value) res.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
|
||||
if (dr["E_Pic"] != DBNull.Value) res.E_Pic = (byte?[])dr["E_Pic"];
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Supprimer(int ID_event)
|
||||
{
|
||||
CreerCommande("SupprimerT_event");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_event", ID_event);
|
||||
Commande.Connection.Open();
|
||||
res = Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
122
ProjetTheAlone/Model - Copie/A_T_event.cs
Normal file
122
ProjetTheAlone/Model - Copie/A_T_event.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using ProjetTheAlone.Classes;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Acces
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche d'accès aux données (Data Access Layer)
|
||||
/// </summary>
|
||||
public class A_T_event : ADBase
|
||||
{
|
||||
#region Constructeurs
|
||||
public A_T_event(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement,string E_description, int? ID_lieu, Byte?[] E_Pic)
|
||||
{
|
||||
CreerCommande("AjouterT_event");
|
||||
int res = 0;
|
||||
Commande.Parameters.Add("ID_event", SqlDbType.Int);
|
||||
Direction("ID_event", ParameterDirection.Output);
|
||||
if(E_date == null) Commande.Parameters.AddWithValue("@E_date", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_date", E_date);
|
||||
if(E_duree == null) Commande.Parameters.AddWithValue("@E_duree", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_duree", E_duree);
|
||||
if(ID_typeEvenement == null) Commande.Parameters.AddWithValue("@ID_typeEvenement", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_typeEvenement", ID_typeEvenement);
|
||||
if(E_description == null) Commande.Parameters.AddWithValue("@E_description", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_description", E_description);
|
||||
if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
|
||||
Commande.Parameters.AddWithValue("@E_Pic", SqlDbType.Image).Value = (E_Pic==null ?Convert.DBNull:Outil.toByteArray.Convert(E_Pic));
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
res = int.Parse(LireParametre("ID_event"));
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Modifier(int ID_event, DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement, string E_description, int? ID_lieu, Byte?[] E_Pic)
|
||||
{
|
||||
CreerCommande("ModifierT_event");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_event", ID_event);
|
||||
if(E_date == null) Commande.Parameters.AddWithValue("@E_date", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_date", E_date);
|
||||
if(E_duree == null) Commande.Parameters.AddWithValue("@E_duree", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_duree", E_duree);
|
||||
if(ID_typeEvenement == null) Commande.Parameters.AddWithValue("@ID_typeEvenement", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_typeEvenement", ID_typeEvenement);
|
||||
if(E_description == null) Commande.Parameters.AddWithValue("@E_description", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@E_description", E_description);
|
||||
if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
|
||||
Commande.Parameters.AddWithValue("@E_Pic", SqlDbType.Image).Value = (E_Pic == null ? Convert.DBNull : Outil.toByteArray.Convert(E_Pic));
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_event> Lire(string Index)
|
||||
{
|
||||
CreerCommande("SelectionnerT_event");
|
||||
Commande.Parameters.AddWithValue("@Index", Index);
|
||||
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);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
C_T_event res = new C_T_event();
|
||||
while (dr.Read())
|
||||
{
|
||||
res.ID_event = int.Parse(dr["ID_event"].ToString());
|
||||
if(dr["E_date"] != DBNull.Value) res.E_date = DateTime.Parse(dr["E_date"].ToString());
|
||||
if(dr["E_duree"] != DBNull.Value) res.E_duree = DateTime.Parse(dr["E_duree"].ToString());
|
||||
if(dr["ID_typeEvenement"] != DBNull.Value) res.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].ToString());
|
||||
if(dr["E_description"] != DBNull.Value) res.E_description = (dr["E_description"].ToString());
|
||||
if(dr["ID_lieu"] != DBNull.Value) res.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
|
||||
if (dr["E_Pic"] != DBNull.Value) res.E_Pic = Outil.toNullableByteArray.Convert((byte[])dr["E_Pic"]);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Supprimer(int ID_event)
|
||||
{
|
||||
CreerCommande("SupprimerT_event");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_event", ID_event);
|
||||
Commande.Connection.Open();
|
||||
res = Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
94
ProjetTheAlone/Model - Copie/A_T_lieu.cs
Normal file
94
ProjetTheAlone/Model - Copie/A_T_lieu.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using ProjetTheAlone.Classes;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Acces
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche d'accès aux données (Data Access Layer)
|
||||
/// </summary>
|
||||
public class A_T_lieu : ADBase
|
||||
{
|
||||
#region Constructeurs
|
||||
public A_T_lieu(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string L_nom)
|
||||
{
|
||||
CreerCommande("AjouterT_lieu");
|
||||
int res = 0;
|
||||
Commande.Parameters.Add("ID_lieu", SqlDbType.Int);
|
||||
Direction("ID_lieu", ParameterDirection.Output);
|
||||
if(L_nom == null) Commande.Parameters.AddWithValue("@L_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@L_nom", L_nom);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
res = int.Parse(LireParametre("ID_lieu"));
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Modifier(int ID_lieu, string L_nom)
|
||||
{
|
||||
CreerCommande("ModifierT_lieu");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
|
||||
if(L_nom == null) Commande.Parameters.AddWithValue("@L_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@L_nom", L_nom);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_lieu> Lire(string Index)
|
||||
{
|
||||
CreerCommande("SelectionnerT_lieu");
|
||||
Commande.Parameters.AddWithValue("@Index", Index);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
List<C_T_lieu> res = new List<C_T_lieu>();
|
||||
while (dr.Read())
|
||||
{
|
||||
C_T_lieu tmp = new C_T_lieu();
|
||||
tmp.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
|
||||
if(dr["L_nom"] != DBNull.Value) tmp.L_nom = (dr["L_nom"].ToString());
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public C_T_lieu Lire_ID(int ID_lieu)
|
||||
{
|
||||
CreerCommande("SelectionnerT_lieu_ID");
|
||||
Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
C_T_lieu res = new C_T_lieu();
|
||||
while (dr.Read())
|
||||
{
|
||||
res.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
|
||||
if(dr["L_nom"] != DBNull.Value) res.L_nom = (dr["L_nom"].ToString());
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Supprimer(int ID_lieu)
|
||||
{
|
||||
CreerCommande("SupprimerT_lieu");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
|
||||
Commande.Connection.Open();
|
||||
res = Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
100
ProjetTheAlone/Model - Copie/A_T_listParticipant.cs
Normal file
100
ProjetTheAlone/Model - Copie/A_T_listParticipant.cs
Normal file
@@ -0,0 +1,100 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using ProjetTheAlone.Classes;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Acces
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche d'accès aux données (Data Access Layer)
|
||||
/// </summary>
|
||||
public class A_T_listParticipant : ADBase
|
||||
{
|
||||
#region Constructeurs
|
||||
public A_T_listParticipant(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(int? ID_equipe, int? ID_benificiaire)
|
||||
{
|
||||
CreerCommande("AjouterT_listParticipant");
|
||||
int res = 0;
|
||||
Commande.Parameters.Add("ID_LP", SqlDbType.Int);
|
||||
Direction("ID_LP", ParameterDirection.Output);
|
||||
if(ID_equipe == null) Commande.Parameters.AddWithValue("@ID_equipe", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_equipe", ID_equipe);
|
||||
if(ID_benificiaire == null) Commande.Parameters.AddWithValue("@ID_benificiaire", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_benificiaire", ID_benificiaire);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
res = int.Parse(LireParametre("ID_LP"));
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Modifier(int ID_LP, int? ID_equipe, int? ID_benificiaire)
|
||||
{
|
||||
CreerCommande("ModifierT_listParticipant");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_LP", ID_LP);
|
||||
if(ID_equipe == null) Commande.Parameters.AddWithValue("@ID_equipe", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_equipe", ID_equipe);
|
||||
if(ID_benificiaire == null) Commande.Parameters.AddWithValue("@ID_benificiaire", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_benificiaire", ID_benificiaire);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_listParticipant> Lire(string Index)
|
||||
{
|
||||
CreerCommande("SelectionnerT_listParticipant");
|
||||
Commande.Parameters.AddWithValue("@Index", Index);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
List<C_T_listParticipant> res = new List<C_T_listParticipant>();
|
||||
while (dr.Read())
|
||||
{
|
||||
C_T_listParticipant tmp = new C_T_listParticipant();
|
||||
tmp.ID_LP = int.Parse(dr["ID_LP"].ToString());
|
||||
if(dr["ID_equipe"] != DBNull.Value) tmp.ID_equipe = int.Parse(dr["ID_equipe"].ToString());
|
||||
if(dr["ID_benificiaire"] != DBNull.Value) tmp.ID_benificiaire = int.Parse(dr["ID_benificiaire"].ToString());
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public C_T_listParticipant Lire_ID(int ID_LP)
|
||||
{
|
||||
CreerCommande("SelectionnerT_listParticipant_ID");
|
||||
Commande.Parameters.AddWithValue("@ID_LP", ID_LP);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
C_T_listParticipant res = new C_T_listParticipant();
|
||||
while (dr.Read())
|
||||
{
|
||||
res.ID_LP = int.Parse(dr["ID_LP"].ToString());
|
||||
if(dr["ID_equipe"] != DBNull.Value) res.ID_equipe = int.Parse(dr["ID_equipe"].ToString());
|
||||
if(dr["ID_benificiaire"] != DBNull.Value) res.ID_benificiaire = int.Parse(dr["ID_benificiaire"].ToString());
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Supprimer(int ID_LP)
|
||||
{
|
||||
CreerCommande("SupprimerT_listParticipant");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_LP", ID_LP);
|
||||
Commande.Connection.Open();
|
||||
res = Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
117
ProjetTheAlone/Model - Copie/A_T_listPlat.cs
Normal file
117
ProjetTheAlone/Model - Copie/A_T_listPlat.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using ProjetTheAlone.Classes;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Acces
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche d'accès aux données (Data Access Layer)
|
||||
/// </summary>
|
||||
public class A_T_listPlat : ADBase
|
||||
{
|
||||
#region Constructeurs
|
||||
public A_T_listPlat(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(DateTime LP_DatePlat, int ID_plat)
|
||||
{
|
||||
CreerCommande("AjouterT_listPlat");
|
||||
int res = 0;
|
||||
Commande.Parameters.Add("ID_listPlat", SqlDbType.Int);
|
||||
Direction("ID_listPlat", ParameterDirection.Output);
|
||||
Commande.Parameters.AddWithValue("@LP_DatePlat", LP_DatePlat);
|
||||
Commande.Parameters.AddWithValue("@ID_plat", ID_plat);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
res = int.Parse(LireParametre("ID_listPlat"));
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Modifier(int ID_listPlat, DateTime LP_DatePlat, int ID_plat)
|
||||
{
|
||||
CreerCommande("ModifierT_listPlat");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat);
|
||||
Commande.Parameters.AddWithValue("@LP_DatePlat", LP_DatePlat);
|
||||
Commande.Parameters.AddWithValue("@ID_plat", ID_plat);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_listPlat> Lire(string Index)
|
||||
{
|
||||
CreerCommande("SelectionnerT_listPlat");
|
||||
Commande.Parameters.AddWithValue("@Index", Index);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
List<C_T_listPlat> res = new List<C_T_listPlat>();
|
||||
while (dr.Read())
|
||||
{
|
||||
C_T_listPlat tmp = new C_T_listPlat();
|
||||
tmp.ID_listPlat = int.Parse(dr["ID_listPlat"].ToString());
|
||||
tmp.ID_repa = int.Parse(dr["ID_repa"].ToString());
|
||||
tmp.ID_plat = int.Parse(dr["ID_plat"].ToString());
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public C_T_listPlat Lire_ID(int ID_listPlat)
|
||||
{
|
||||
CreerCommande("SelectionnerT_listPlat_ID");
|
||||
Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
C_T_listPlat res = new C_T_listPlat();
|
||||
while (dr.Read())
|
||||
{
|
||||
res.ID_listPlat = int.Parse(dr["ID_listPlat"].ToString());
|
||||
res.ID_repa = int.Parse(dr["ID_repa"].ToString());
|
||||
res.ID_plat = int.Parse(dr["ID_plat"].ToString());
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_plat> Lire(DateTime LP_DateRepas)
|
||||
{
|
||||
CreerCommande("SelectRepaByDate");
|
||||
Commande.Parameters.AddWithValue("@dateV", LP_DateRepas);
|
||||
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 = Outil.toNullableByteArray.Convert((byte[])dr["P_img"]);
|
||||
var x = dr["ID_typePlat"];
|
||||
if (dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = (C_T_plat.TypePlat_E)(int.Parse(dr["ID_typePlat"].ToString()));
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Supprimer(int ID_listPlat)
|
||||
{
|
||||
CreerCommande("SupprimerT_listPlat");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat);
|
||||
Commande.Connection.Open();
|
||||
res = Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
131
ProjetTheAlone/Model - Copie/A_T_plat.cs
Normal file
131
ProjetTheAlone/Model - Copie/A_T_plat.cs
Normal file
@@ -0,0 +1,131 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using ProjetTheAlone.Classes;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Acces
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche d'accès aux données (Data Access Layer)
|
||||
/// </summary>
|
||||
public class A_T_plat : ADBase
|
||||
{
|
||||
public enum TypePlat_E { soupe, plat, dessert}
|
||||
#region Constructeurs
|
||||
public A_T_plat(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string P_nom, byte?[] P_img, int? ID_typePlat)
|
||||
{
|
||||
CreerCommande("AjouterT_plat");
|
||||
int res = 0;
|
||||
Commande.Parameters.Add("ID_plat", SqlDbType.Int);
|
||||
Direction("ID_plat", ParameterDirection.Output);
|
||||
if(P_nom == null) Commande.Parameters.AddWithValue("@P_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@P_nom", P_nom);
|
||||
if(P_img == null) Commande.Parameters.AddWithValue("@P_img", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@P_img", SqlDbType.Image).Value = Outil.toByteArray.Convert(P_img);
|
||||
if(ID_typePlat == null) Commande.Parameters.AddWithValue("@ID_typePlat", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_typePlat", ID_typePlat);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
res = int.Parse(LireParametre("ID_plat"));
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Modifier(int ID_plat, string P_nom, byte?[] P_img, int? ID_typePlat)
|
||||
{
|
||||
CreerCommande("ModifierT_plat");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_plat", ID_plat);
|
||||
if(P_nom == null) Commande.Parameters.AddWithValue("@P_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@P_nom", P_nom);
|
||||
if(P_img == null) Commande.Parameters.AddWithValue("@P_img", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@P_img", SqlDbType.Image).Value = Outil.toByteArray.Convert(P_img);
|
||||
if (ID_typePlat == null) Commande.Parameters.AddWithValue("@ID_typePlat", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_typePlat", ID_typePlat);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_plat> Lire(string Index)
|
||||
{
|
||||
CreerCommande("SelectionnerT_plat");
|
||||
Commande.Parameters.AddWithValue("@Index", Index);
|
||||
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 = Outil.toNullableByteArray.Convert((byte[])dr["P_img"]);
|
||||
var x = dr["ID_typePlat"];
|
||||
if (dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = (C_T_plat.TypePlat_E)(int.Parse(dr["ID_typePlat"].ToString()));
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
/// <summary>
|
||||
/// Permet de récupérer la liste des plats d'un repas
|
||||
/// </summary>
|
||||
public List<C_T_plat> ListPlat(int ID_repa)
|
||||
{
|
||||
CreerCommande("ListPlat");
|
||||
Commande.Parameters.AddWithValue("@ID_repa", ID_repa);
|
||||
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 = (byte?[])(dr["P_img"]);
|
||||
if (dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = (C_T_plat.TypePlat_E)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);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
C_T_plat res = new C_T_plat();
|
||||
while (dr.Read())
|
||||
{
|
||||
res.ID_plat = int.Parse(dr["ID_plat"].ToString());
|
||||
if(dr["P_nom"] != DBNull.Value) res.P_nom = (dr["P_nom"].ToString());
|
||||
if(dr["P_img"] != DBNull.Value) res.P_img = Outil.toNullableByteArray.Convert((byte[])dr["P_img"]);
|
||||
if(dr["ID_typePlat"] != DBNull.Value) res.ID_typePlat = (C_T_plat.TypePlat_E)int.Parse(dr["ID_typePlat"].ToString());
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Supprimer(int ID_plat)
|
||||
{
|
||||
CreerCommande("SupprimerT_plat");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_plat", ID_plat);
|
||||
Commande.Connection.Open();
|
||||
res = Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
157
ProjetTheAlone/Model - Copie/A_T_repa.cs
Normal file
157
ProjetTheAlone/Model - Copie/A_T_repa.cs
Normal file
@@ -0,0 +1,157 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using ProjetTheAlone.Classes;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Acces
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche d'accès aux données (Data Access Layer)
|
||||
/// </summary>
|
||||
public class A_T_repa : ADBase
|
||||
{
|
||||
#region Constructeurs
|
||||
public A_T_repa(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(int? ID_listPlat, int? ID_typeRepa, DateTime R_Date)
|
||||
{
|
||||
CreerCommande("AjouterT_repa");
|
||||
int res = 0;
|
||||
Commande.Parameters.Add("ID_repa", SqlDbType.Int);
|
||||
Direction("ID_repa", ParameterDirection.Output);
|
||||
if(ID_listPlat == null) Commande.Parameters.AddWithValue("@ID_listPlat", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat);
|
||||
if(ID_typeRepa == null) Commande.Parameters.AddWithValue("@ID_typeRepa", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_typeRepa", ID_typeRepa);
|
||||
Commande.Parameters.AddWithValue("@R_Date", R_Date);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
res = int.Parse(LireParametre("ID_repa"));
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Modifier(int ID_repa, int? ID_listPlat, int? ID_typeRepa , DateTime R_Date)
|
||||
{
|
||||
CreerCommande("ModifierT_repa");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_repa", ID_repa);
|
||||
if(ID_listPlat == null) Commande.Parameters.AddWithValue("@ID_listPlat", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat);
|
||||
if(ID_typeRepa == null) Commande.Parameters.AddWithValue("@ID_typeRepa", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@ID_typeRepa", ID_typeRepa);
|
||||
Commande.Parameters.AddWithValue("@R_Date", R_Date);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_repa> Lire(string Index)
|
||||
{
|
||||
CreerCommande("SelectionnerT_repa");
|
||||
Commande.Parameters.AddWithValue("@Index", Index);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
List<C_T_repa> res = new List<C_T_repa>();
|
||||
while (dr.Read())
|
||||
{
|
||||
C_T_repa tmp = new C_T_repa();
|
||||
tmp.ID_repa = int.Parse(dr["ID_repa"].ToString());
|
||||
tmp.R_Date = DateTime.Parse(dr["R_Date"].ToString());
|
||||
if(dr["ID_listPlat"] != DBNull.Value) tmp.ID_listPlat = int.Parse(dr["ID_listPlat"].ToString());
|
||||
if(dr["ID_typeRepa"] != DBNull.Value) tmp.ID_typeRepa = int.Parse(dr["ID_typeRepa"].ToString());
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
|
||||
/// <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)
|
||||
{
|
||||
CreerCommande("SelectEventBetweenTwoDateTime");
|
||||
Commande.Parameters.AddWithValue("@dateStart", start);
|
||||
Commande.Parameters.AddWithValue("@dateEnd", end);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
List<C_T_repa> res = new List<C_T_repa>();
|
||||
while (dr.Read())
|
||||
{
|
||||
C_T_repa tmp = new C_T_repa();
|
||||
tmp.ID_repa = int.Parse(dr["ID_repa"].ToString());
|
||||
tmp.R_Date = DateTime.Parse(dr["R_Date"].ToString());
|
||||
if (dr["ID_listPlat"] != DBNull.Value) tmp.ID_listPlat = int.Parse(dr["ID_listPlat"].ToString());
|
||||
if (dr["ID_typeRepa"] != DBNull.Value) tmp.ID_typeRepa = int.Parse(dr["ID_typeRepa"].ToString());
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
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");
|
||||
Commande.Parameters.AddWithValue("@dateV", dateV);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
List<C_T_repa> res = new List<C_T_repa>();
|
||||
while (dr.Read())
|
||||
{
|
||||
C_T_repa tmp = new C_T_repa();
|
||||
tmp.ID_repa = int.Parse(dr["ID_repa"].ToString());
|
||||
tmp.R_Date = DateTime.Parse(dr["R_Date"].ToString());
|
||||
if (dr["ID_listPlat"] != DBNull.Value) tmp.ID_listPlat = int.Parse(dr["ID_listPlat"].ToString());
|
||||
if (dr["ID_typeRepa"] != DBNull.Value) tmp.ID_typeRepa = int.Parse(dr["ID_typeRepa"].ToString());
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public C_T_repa Lire_ID(int ID_repa)
|
||||
{
|
||||
CreerCommande("SelectionnerT_repa_ID");
|
||||
Commande.Parameters.AddWithValue("@ID_repa", ID_repa);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
C_T_repa res = new C_T_repa();
|
||||
while (dr.Read())
|
||||
{
|
||||
res.R_Date = DateTime.Parse(dr["R_Date"].ToString());
|
||||
res.ID_repa = int.Parse(dr["ID_repa"].ToString());
|
||||
if(dr["ID_listPlat"] != DBNull.Value) res.ID_listPlat = int.Parse(dr["ID_listPlat"].ToString());
|
||||
if(dr["ID_typeRepa"] != DBNull.Value) res.ID_typeRepa = int.Parse(dr["ID_typeRepa"].ToString());
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Supprimer(int ID_repa)
|
||||
{
|
||||
CreerCommande("SupprimerT_repa");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_repa", ID_repa);
|
||||
Commande.Connection.Open();
|
||||
res = Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
96
ProjetTheAlone/Model - Copie/A_T_typeEvenement.cs
Normal file
96
ProjetTheAlone/Model - Copie/A_T_typeEvenement.cs
Normal file
@@ -0,0 +1,96 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using ProjetTheAlone.Classes;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Acces
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche d'accès aux données (Data Access Layer)
|
||||
/// </summary>
|
||||
public class A_T_typeEvenement : ADBase
|
||||
{
|
||||
string _TE_Nom;
|
||||
public string TE_Nom { get => _TE_Nom; set => _TE_Nom = value; }
|
||||
#region Constructeurs
|
||||
public A_T_typeEvenement(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string TE_nom)
|
||||
{
|
||||
CreerCommande("AjouterT_typeEvenement");
|
||||
int res = 0;
|
||||
Commande.Parameters.Add("ID_typeEvenement", SqlDbType.Int);
|
||||
Direction("ID_typeEvenement", ParameterDirection.Output);
|
||||
if(TE_nom == null) Commande.Parameters.AddWithValue("@TE_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@TE_nom", TE_nom);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
res = int.Parse(LireParametre("ID_typeEvenement"));
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Modifier(int ID_typeEvenement,string TE_nom)
|
||||
{
|
||||
CreerCommande("ModifierT_typeEvenement");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_typeEvenement", ID_typeEvenement);
|
||||
if(TE_nom == null) Commande.Parameters.AddWithValue("@TE_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@TE_nom", TE_nom);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_typeEvenement> Lire(string Index)
|
||||
{
|
||||
CreerCommande("SelectionnerT_typeEvenement");
|
||||
Commande.Parameters.AddWithValue("@Index", Index);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
List<C_T_typeEvenement> res = new List<C_T_typeEvenement>();
|
||||
while (dr.Read())
|
||||
{
|
||||
C_T_typeEvenement tmp = new C_T_typeEvenement();
|
||||
tmp.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].ToString());
|
||||
if(dr["TE_nom"] != DBNull.Value) tmp.TE_nom = (dr["TE_nom"].ToString());
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public C_T_typeEvenement Lire_ID(int ID_typeEvenement)
|
||||
{
|
||||
CreerCommande("SelectionnerT_typeEvenement_ID");
|
||||
Commande.Parameters.AddWithValue("@ID_typeEvenement", ID_typeEvenement);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
C_T_typeEvenement res = new C_T_typeEvenement();
|
||||
while (dr.Read())
|
||||
{
|
||||
res.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].ToString());
|
||||
if(dr["TE_nom"] != DBNull.Value) res.TE_nom = (dr["TE_nom"].ToString());
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Supprimer(int ID_typeEvenement)
|
||||
{
|
||||
CreerCommande("SupprimerT_typeEvenement");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_typeEvenement", ID_typeEvenement);
|
||||
Commande.Connection.Open();
|
||||
res = Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
94
ProjetTheAlone/Model - Copie/A_T_typePlat.cs
Normal file
94
ProjetTheAlone/Model - Copie/A_T_typePlat.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using ProjetTheAlone.Classes;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Acces
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche d'accès aux données (Data Access Layer)
|
||||
/// </summary>
|
||||
public class A_T_typePlat : ADBase
|
||||
{
|
||||
#region Constructeurs
|
||||
public A_T_typePlat(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string TP_nom)
|
||||
{
|
||||
CreerCommande("AjouterT_typePlat");
|
||||
int res = 0;
|
||||
Commande.Parameters.Add("ID_typePlat", SqlDbType.Int);
|
||||
Direction("ID_typePlat", ParameterDirection.Output);
|
||||
if(TP_nom == null) Commande.Parameters.AddWithValue("@TP_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@TP_nom", TP_nom);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
res = int.Parse(LireParametre("ID_typePlat"));
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Modifier(int ID_typePlat, string TP_nom)
|
||||
{
|
||||
CreerCommande("ModifierT_typePlat");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_typePlat", ID_typePlat);
|
||||
if(TP_nom == null) Commande.Parameters.AddWithValue("@TP_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@TP_nom", TP_nom);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_typePlat> Lire(string Index)
|
||||
{
|
||||
CreerCommande("SelectionnerT_typePlat");
|
||||
Commande.Parameters.AddWithValue("@Index", Index);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
List<C_T_typePlat> res = new List<C_T_typePlat>();
|
||||
while (dr.Read())
|
||||
{
|
||||
C_T_typePlat tmp = new C_T_typePlat();
|
||||
tmp.ID_typePlat = int.Parse(dr["ID_typePlat"].ToString());
|
||||
tmp.TP_nom = dr["TP_nom"].ToString();
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public C_T_typePlat Lire_ID(int ID_typePlat)
|
||||
{
|
||||
CreerCommande("SelectionnerT_typePlat_ID");
|
||||
Commande.Parameters.AddWithValue("@ID_typePlat", ID_typePlat);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
C_T_typePlat res = new C_T_typePlat();
|
||||
while (dr.Read())
|
||||
{
|
||||
res.ID_typePlat = int.Parse(dr["ID_typePlat"].ToString());
|
||||
res.TP_nom = dr["TP_nom"].ToString();
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Supprimer(int ID_typePlat)
|
||||
{
|
||||
CreerCommande("SupprimerT_typePlat");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_typePlat", ID_typePlat);
|
||||
Commande.Connection.Open();
|
||||
res = Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
94
ProjetTheAlone/Model - Copie/A_T_typeRepa.cs
Normal file
94
ProjetTheAlone/Model - Copie/A_T_typeRepa.cs
Normal file
@@ -0,0 +1,94 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Data.SqlTypes;
|
||||
using ProjetTheAlone.Classes;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Acces
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche d'accès aux données (Data Access Layer)
|
||||
/// </summary>
|
||||
public class A_T_typeRepa : ADBase
|
||||
{
|
||||
#region Constructeurs
|
||||
public A_T_typeRepa(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string TR_nom)
|
||||
{
|
||||
CreerCommande("AjouterT_typeRepa");
|
||||
int res = 0;
|
||||
Commande.Parameters.Add("ID_typeRepa", SqlDbType.Int);
|
||||
Direction("ID_typeRepa", ParameterDirection.Output);
|
||||
if(TR_nom == null) Commande.Parameters.AddWithValue("@TR_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@TR_nom", TR_nom);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
res = int.Parse(LireParametre("ID_typeRepa"));
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Modifier(int ID_typeRepa, string TR_nom)
|
||||
{
|
||||
CreerCommande("ModifierT_typeRepa");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_typeRepa", ID_typeRepa);
|
||||
if(TR_nom == null) Commande.Parameters.AddWithValue("@TR_nom", Convert.DBNull);
|
||||
else Commande.Parameters.AddWithValue("@TR_nom", TR_nom);
|
||||
Commande.Connection.Open();
|
||||
Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public List<C_T_typeRepa> Lire(string Index)
|
||||
{
|
||||
CreerCommande("SelectionnerT_typeRepa");
|
||||
Commande.Parameters.AddWithValue("@Index", Index);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
List<C_T_typeRepa> res = new List<C_T_typeRepa>();
|
||||
while (dr.Read())
|
||||
{
|
||||
C_T_typeRepa tmp = new C_T_typeRepa();
|
||||
tmp.ID_typeRepa = int.Parse(dr["ID_typeRepa"].ToString());
|
||||
tmp.TR_nom = dr["TR_nom"].ToString();
|
||||
res.Add(tmp);
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public C_T_typeRepa Lire_ID(int ID_typeRepa)
|
||||
{
|
||||
CreerCommande("SelectionnerT_typeRepa_ID");
|
||||
Commande.Parameters.AddWithValue("@ID_typeRepa", ID_typeRepa);
|
||||
Commande.Connection.Open();
|
||||
SqlDataReader dr = Commande.ExecuteReader();
|
||||
C_T_typeRepa res = new C_T_typeRepa();
|
||||
while (dr.Read())
|
||||
{
|
||||
res.ID_typeRepa = int.Parse(dr["ID_typeRepa"].ToString());
|
||||
res.TR_nom = dr["TR_nom"].ToString();
|
||||
}
|
||||
dr.Close();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
public int Supprimer(int ID_typeRepa)
|
||||
{
|
||||
CreerCommande("SupprimerT_typeRepa");
|
||||
int res = 0;
|
||||
Commande.Parameters.AddWithValue("@ID_typeRepa", ID_typeRepa);
|
||||
Commande.Connection.Open();
|
||||
res = Commande.ExecuteNonQuery();
|
||||
Commande.Connection.Close();
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
65
ProjetTheAlone/Model - Copie/C_T_beneficiaire.cs
Normal file
65
ProjetTheAlone/Model - Copie/C_T_beneficiaire.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Classes
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe de définition des données
|
||||
/// </summary>
|
||||
public class C_T_beneficiaire
|
||||
{
|
||||
#region Données membres
|
||||
private int _ID_beneficiaire;
|
||||
private string _B_nom;
|
||||
private string _B_prenom;
|
||||
private DateTime? _B_anniversaire;
|
||||
private byte?[] _B_img;
|
||||
#endregion
|
||||
#region Constructeurs
|
||||
public C_T_beneficiaire()
|
||||
{ }
|
||||
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_, byte?[] B_img_)
|
||||
: this(B_nom_, B_prenom_, B_anniversaire_, B_img_)
|
||||
{
|
||||
ID_beneficiaire = ID_beneficiaire_;
|
||||
}
|
||||
#endregion
|
||||
#region Accesseurs
|
||||
public int ID_beneficiaire
|
||||
{
|
||||
get { return _ID_beneficiaire; }
|
||||
set { _ID_beneficiaire = value; }
|
||||
}
|
||||
public string B_nom
|
||||
{
|
||||
get { return _B_nom; }
|
||||
set { _B_nom = value; }
|
||||
}
|
||||
public string B_prenom
|
||||
{
|
||||
get { return _B_prenom; }
|
||||
set { _B_prenom = value; }
|
||||
}
|
||||
public DateTime? B_anniversaire
|
||||
{
|
||||
get { return _B_anniversaire; }
|
||||
set { _B_anniversaire = value; }
|
||||
}
|
||||
public byte?[] B_img
|
||||
{
|
||||
get { return _B_img; }
|
||||
set { _B_img = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
58
ProjetTheAlone/Model - Copie/C_T_equipe.cs
Normal file
58
ProjetTheAlone/Model - Copie/C_T_equipe.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Classes
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe de définition des données
|
||||
/// </summary>
|
||||
public class C_T_equipe
|
||||
{
|
||||
#region Données membres
|
||||
private int _ID_equipe;
|
||||
private string _E_nom;
|
||||
private int _E_point;
|
||||
private int? _ID_evenement;
|
||||
#endregion
|
||||
#region Constructeurs
|
||||
public C_T_equipe()
|
||||
{ }
|
||||
public C_T_equipe(string E_nom_, int E_point_, int? ID_evenement_)
|
||||
{
|
||||
E_nom = E_nom_;
|
||||
E_point = E_point_;
|
||||
ID_evenement = ID_evenement_;
|
||||
}
|
||||
public C_T_equipe(int ID_equipe_, string E_nom_, int E_point_, int? ID_evenement_)
|
||||
: this(E_nom_, E_point_, ID_evenement_)
|
||||
{
|
||||
ID_equipe = ID_equipe_;
|
||||
}
|
||||
#endregion
|
||||
#region Accesseurs
|
||||
public int ID_equipe
|
||||
{
|
||||
get { return _ID_equipe; }
|
||||
set { _ID_equipe = value; }
|
||||
}
|
||||
public string E_nom
|
||||
{
|
||||
get { return _E_nom; }
|
||||
set { _E_nom = value; }
|
||||
}
|
||||
public int E_point
|
||||
{
|
||||
get { return _E_point; }
|
||||
set { _E_point = value; }
|
||||
}
|
||||
public int? ID_evenement
|
||||
{
|
||||
get { return _ID_evenement; }
|
||||
set { _ID_evenement = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
70
ProjetTheAlone/Model - Copie/C_T_event.cs
Normal file
70
ProjetTheAlone/Model - Copie/C_T_event.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Classes
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe de définition des données
|
||||
/// </summary>
|
||||
public class C_T_event
|
||||
{
|
||||
#region Données membres
|
||||
private int _ID_event;
|
||||
private DateTime? _E_date;
|
||||
private DateTime? _E_duree;
|
||||
private int? _ID_typeEvenement;
|
||||
private string _E_description;
|
||||
private int? _ID_lieu;
|
||||
private byte?[] _E_Pic;
|
||||
#endregion
|
||||
#region Constructeurs
|
||||
public C_T_event()
|
||||
{ }
|
||||
public C_T_event(DateTime? E_date_, DateTime? E_duree_, int? ID_typeEvenement_, string E_description_, int? ID_lieu_, byte?[] E_Pic_)
|
||||
{
|
||||
E_date = E_date_;
|
||||
E_duree = E_duree_;
|
||||
ID_typeEvenement = ID_typeEvenement_;
|
||||
E_description = E_description_;
|
||||
ID_lieu = ID_lieu_;
|
||||
E_Pic = E_Pic_;
|
||||
}
|
||||
public C_T_event(int ID_event_, DateTime? E_date_, DateTime? E_duree_, int? ID_typeEvenement_, string E_description_, int? ID_lieu_, byte?[] E_Pic_)
|
||||
: this(E_date_, E_duree_, ID_typeEvenement_, E_description_, ID_lieu_, E_Pic_)
|
||||
{
|
||||
ID_event = ID_event_;
|
||||
}
|
||||
#endregion
|
||||
#region Accesseurs
|
||||
public int ID_event
|
||||
{
|
||||
get { return _ID_event; }
|
||||
set { _ID_event = value; }
|
||||
}
|
||||
public DateTime? E_date
|
||||
{
|
||||
get { return _E_date; }
|
||||
set { _E_date = value; }
|
||||
}
|
||||
public DateTime? E_duree
|
||||
{
|
||||
get { return _E_duree; }
|
||||
set { _E_duree = value; }
|
||||
}
|
||||
public int? ID_typeEvenement
|
||||
{
|
||||
get { return _ID_typeEvenement; }
|
||||
set { _ID_typeEvenement = value; }
|
||||
}
|
||||
|
||||
public string E_description { get => _E_description; set => _E_description = value; }
|
||||
public int? ID_lieu { get => _ID_lieu; set => _ID_lieu = value; }
|
||||
public byte?[] E_Pic { get => _E_Pic; set => _E_Pic = value; }
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
44
ProjetTheAlone/Model - Copie/C_T_lieu.cs
Normal file
44
ProjetTheAlone/Model - Copie/C_T_lieu.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Classes
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe de définition des données
|
||||
/// </summary>
|
||||
public class C_T_lieu
|
||||
{
|
||||
#region Données membres
|
||||
private int _ID_lieu;
|
||||
private string _L_nom;
|
||||
#endregion
|
||||
#region Constructeurs
|
||||
public C_T_lieu()
|
||||
{ }
|
||||
public C_T_lieu(string L_nom_)
|
||||
{
|
||||
L_nom = L_nom_;
|
||||
}
|
||||
public C_T_lieu(int ID_lieu_,string L_nom_)
|
||||
: this(L_nom_)
|
||||
{
|
||||
ID_lieu = ID_lieu_;
|
||||
}
|
||||
#endregion
|
||||
#region Accesseurs
|
||||
public int ID_lieu
|
||||
{
|
||||
get { return _ID_lieu; }
|
||||
set { _ID_lieu = value; }
|
||||
}
|
||||
public string L_nom
|
||||
{
|
||||
get { return _L_nom; }
|
||||
set { _L_nom = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
51
ProjetTheAlone/Model - Copie/C_T_listParticipant.cs
Normal file
51
ProjetTheAlone/Model - Copie/C_T_listParticipant.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Classes
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe de définition des données
|
||||
/// </summary>
|
||||
public class C_T_listParticipant
|
||||
{
|
||||
#region Données membres
|
||||
private int _ID_LP;
|
||||
private int? _ID_equipe;
|
||||
private int? _ID_benificiaire;
|
||||
#endregion
|
||||
#region Constructeurs
|
||||
public C_T_listParticipant()
|
||||
{ }
|
||||
public C_T_listParticipant(int? ID_equipe_, int? ID_benificiaire_)
|
||||
{
|
||||
ID_equipe = ID_equipe_;
|
||||
ID_benificiaire = ID_benificiaire_;
|
||||
}
|
||||
public C_T_listParticipant(int ID_LP_, int? ID_equipe_, int? ID_benificiaire_)
|
||||
: this(ID_equipe_, ID_benificiaire_)
|
||||
{
|
||||
ID_LP = ID_LP_;
|
||||
}
|
||||
#endregion
|
||||
#region Accesseurs
|
||||
public int ID_LP
|
||||
{
|
||||
get { return _ID_LP; }
|
||||
set { _ID_LP = value; }
|
||||
}
|
||||
public int? ID_equipe
|
||||
{
|
||||
get { return _ID_equipe; }
|
||||
set { _ID_equipe = value; }
|
||||
}
|
||||
public int? ID_benificiaire
|
||||
{
|
||||
get { return _ID_benificiaire; }
|
||||
set { _ID_benificiaire = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
51
ProjetTheAlone/Model - Copie/C_T_listPlat.cs
Normal file
51
ProjetTheAlone/Model - Copie/C_T_listPlat.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Classes
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe de définition des données
|
||||
/// </summary>
|
||||
public class C_T_listPlat
|
||||
{
|
||||
#region Données membres
|
||||
private int _ID_listPlat;
|
||||
private int _ID_repa;
|
||||
private int _ID_plat;
|
||||
#endregion
|
||||
#region Constructeurs
|
||||
public C_T_listPlat()
|
||||
{ }
|
||||
public C_T_listPlat(int ID_repa_, int ID_plat_)
|
||||
{
|
||||
ID_repa = ID_repa_;
|
||||
ID_plat = ID_plat_;
|
||||
}
|
||||
public C_T_listPlat(int ID_listPlat_, int ID_repa_, int ID_plat_)
|
||||
: this(ID_repa_, ID_plat_)
|
||||
{
|
||||
ID_listPlat = ID_listPlat_;
|
||||
}
|
||||
#endregion
|
||||
#region Accesseurs
|
||||
public int ID_listPlat
|
||||
{
|
||||
get { return _ID_listPlat; }
|
||||
set { _ID_listPlat = value; }
|
||||
}
|
||||
public int ID_repa
|
||||
{
|
||||
get { return _ID_repa; }
|
||||
set { _ID_repa = value; }
|
||||
}
|
||||
public int ID_plat
|
||||
{
|
||||
get { return _ID_plat; }
|
||||
set { _ID_plat = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
59
ProjetTheAlone/Model - Copie/C_T_plat.cs
Normal file
59
ProjetTheAlone/Model - Copie/C_T_plat.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Classes
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe de définition des données
|
||||
/// </summary>
|
||||
public class C_T_plat
|
||||
{
|
||||
public enum TypePlat_E { Soupe, Plat, Dessert}
|
||||
#region Données membres
|
||||
private int _ID_plat;
|
||||
private string _P_nom;
|
||||
private byte?[] _P_img;
|
||||
private TypePlat_E _ID_typePlat;
|
||||
#endregion
|
||||
#region Constructeurs
|
||||
public C_T_plat()
|
||||
{ }
|
||||
public C_T_plat(string P_nom_, byte?[] P_img_, int? ID_typePlat_)
|
||||
{
|
||||
P_nom = P_nom_;
|
||||
P_img = P_img_;
|
||||
ID_typePlat = (C_T_plat.TypePlat_E)ID_typePlat_;
|
||||
}
|
||||
public C_T_plat(int ID_plat_, string P_nom_, byte?[] P_img_, int? ID_typePlat_)
|
||||
: this(P_nom_, P_img_, ID_typePlat_)
|
||||
{
|
||||
ID_plat = ID_plat_;
|
||||
}
|
||||
#endregion
|
||||
#region Accesseurs
|
||||
public int ID_plat
|
||||
{
|
||||
get { return _ID_plat; }
|
||||
set { _ID_plat = value; }
|
||||
}
|
||||
public string P_nom
|
||||
{
|
||||
get { return _P_nom; }
|
||||
set { _P_nom = value; }
|
||||
}
|
||||
public byte?[] P_img
|
||||
{
|
||||
get { return _P_img; }
|
||||
set { _P_img = value; }
|
||||
}
|
||||
public TypePlat_E ID_typePlat
|
||||
{
|
||||
get { return _ID_typePlat; }
|
||||
set { _ID_typePlat = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
56
ProjetTheAlone/Model - Copie/C_T_repa.cs
Normal file
56
ProjetTheAlone/Model - Copie/C_T_repa.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Classes
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe de définition des données
|
||||
/// </summary>
|
||||
public class C_T_repa
|
||||
{
|
||||
#region Données membres
|
||||
private int _ID_repa;
|
||||
private int? _ID_listPlat;
|
||||
private int? _ID_typeRepa;
|
||||
private DateTime _R_Date;
|
||||
#endregion
|
||||
#region Constructeurs
|
||||
public C_T_repa()
|
||||
{ }
|
||||
public C_T_repa(int? ID_listPlat_, int? ID_typeRepa_, DateTime R_Date_)
|
||||
{
|
||||
ID_listPlat = ID_listPlat_;
|
||||
ID_typeRepa = ID_typeRepa_;
|
||||
R_Date = R_Date_;
|
||||
}
|
||||
public C_T_repa(int ID_repa_, int? ID_listPlat_, int? ID_typeRepa_, DateTime R_Date_)
|
||||
: this(ID_listPlat_, ID_typeRepa_, R_Date_)
|
||||
{
|
||||
ID_repa = ID_repa_;
|
||||
}
|
||||
#endregion
|
||||
#region Accesseurs
|
||||
public int ID_repa
|
||||
{
|
||||
get { return _ID_repa; }
|
||||
set { _ID_repa = value; }
|
||||
}
|
||||
public int? ID_listPlat
|
||||
{
|
||||
get { return _ID_listPlat; }
|
||||
set { _ID_listPlat = value; }
|
||||
}
|
||||
public int? ID_typeRepa
|
||||
{
|
||||
get { return _ID_typeRepa; }
|
||||
set { _ID_typeRepa = value; }
|
||||
}
|
||||
|
||||
|
||||
public DateTime R_Date { get => _R_Date; set => _R_Date = value; }
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
44
ProjetTheAlone/Model - Copie/C_T_typeEvenement.cs
Normal file
44
ProjetTheAlone/Model - Copie/C_T_typeEvenement.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Classes
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe de définition des données
|
||||
/// </summary>
|
||||
public class C_T_typeEvenement
|
||||
{
|
||||
#region Données membres
|
||||
private int _ID_typeEvenement;
|
||||
private string _TE_nom;
|
||||
#endregion
|
||||
#region Constructeurs
|
||||
public C_T_typeEvenement()
|
||||
{ }
|
||||
public C_T_typeEvenement(string TE_nom_)
|
||||
{
|
||||
TE_nom = TE_nom_;
|
||||
}
|
||||
public C_T_typeEvenement(int ID_typeEvenement_,string TE_nom_)
|
||||
: this(TE_nom_)
|
||||
{
|
||||
ID_typeEvenement = ID_typeEvenement_;
|
||||
}
|
||||
#endregion
|
||||
#region Accesseurs
|
||||
public int ID_typeEvenement
|
||||
{
|
||||
get { return _ID_typeEvenement; }
|
||||
set { _ID_typeEvenement = value; }
|
||||
}
|
||||
public string TE_nom
|
||||
{
|
||||
get { return _TE_nom; }
|
||||
set { _TE_nom = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
44
ProjetTheAlone/Model - Copie/C_T_typePlat.cs
Normal file
44
ProjetTheAlone/Model - Copie/C_T_typePlat.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Classes
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe de définition des données
|
||||
/// </summary>
|
||||
public class C_T_typePlat
|
||||
{
|
||||
#region Données membres
|
||||
private int _ID_typePlat;
|
||||
private string _TP_nom;
|
||||
#endregion
|
||||
#region Constructeurs
|
||||
public C_T_typePlat()
|
||||
{ }
|
||||
public C_T_typePlat(string TP_nom_)
|
||||
{
|
||||
TP_nom = TP_nom_;
|
||||
}
|
||||
public C_T_typePlat(int ID_typePlat_, string TP_nom_)
|
||||
: this(TP_nom_)
|
||||
{
|
||||
ID_typePlat = ID_typePlat_;
|
||||
}
|
||||
#endregion
|
||||
#region Accesseurs
|
||||
public int ID_typePlat
|
||||
{
|
||||
get { return _ID_typePlat; }
|
||||
set { _ID_typePlat = value; }
|
||||
}
|
||||
public string TP_nom
|
||||
{
|
||||
get { return _TP_nom; }
|
||||
set { _TP_nom = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
44
ProjetTheAlone/Model - Copie/C_T_typeRepa.cs
Normal file
44
ProjetTheAlone/Model - Copie/C_T_typeRepa.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Classes
|
||||
{
|
||||
/// <summary>
|
||||
/// Classe de définition des données
|
||||
/// </summary>
|
||||
public class C_T_typeRepa
|
||||
{
|
||||
#region Données membres
|
||||
private int _ID_typeRepa;
|
||||
private string _TR_nom;
|
||||
#endregion
|
||||
#region Constructeurs
|
||||
public C_T_typeRepa()
|
||||
{ }
|
||||
public C_T_typeRepa(string TR_nom_)
|
||||
{
|
||||
TR_nom = TR_nom_;
|
||||
}
|
||||
public C_T_typeRepa(int ID_typeRepa_, string TR_nom_)
|
||||
: this(TR_nom_)
|
||||
{
|
||||
ID_typeRepa = ID_typeRepa_;
|
||||
}
|
||||
#endregion
|
||||
#region Accesseurs
|
||||
public int ID_typeRepa
|
||||
{
|
||||
get { return _ID_typeRepa; }
|
||||
set { _ID_typeRepa = value; }
|
||||
}
|
||||
public string TR_nom
|
||||
{
|
||||
get { return _TR_nom; }
|
||||
set { _TR_nom = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
28
ProjetTheAlone/Model - Copie/G_Base.cs
Normal file
28
ProjetTheAlone/Model - Copie/G_Base.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Gestion
|
||||
{
|
||||
public class G_Base
|
||||
{
|
||||
#region Données membres
|
||||
string _ChaineConnexion;
|
||||
#endregion
|
||||
#region Constructeurs
|
||||
public G_Base()
|
||||
{ ChaineConnexion = ""; }
|
||||
public G_Base(string sChaineConnexion)
|
||||
{ ChaineConnexion = sChaineConnexion; }
|
||||
#endregion
|
||||
#region Accesseur
|
||||
public string ChaineConnexion
|
||||
{
|
||||
get { return _ChaineConnexion; }
|
||||
set { _ChaineConnexion = value; }
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
35
ProjetTheAlone/Model - Copie/G_T_beneficiaire.cs
Normal file
35
ProjetTheAlone/Model - Copie/G_T_beneficiaire.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ProjetTheAlone.Classes;
|
||||
using ProjetTheAlone.Acces;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Gestion
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche intermédiaire de gestion (Business Layer)
|
||||
/// </summary>
|
||||
public class G_T_beneficiaire : G_Base
|
||||
{
|
||||
#region Constructeurs
|
||||
public G_T_beneficiaire()
|
||||
: base()
|
||||
{ }
|
||||
public G_T_beneficiaire(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
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, 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); }
|
||||
public C_T_beneficiaire Lire_ID(int ID_beneficiaire)
|
||||
{ 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); }
|
||||
}
|
||||
}
|
||||
35
ProjetTheAlone/Model - Copie/G_T_equipe.cs
Normal file
35
ProjetTheAlone/Model - Copie/G_T_equipe.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ProjetTheAlone.Classes;
|
||||
using ProjetTheAlone.Acces;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Gestion
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche intermédiaire de gestion (Business Layer)
|
||||
/// </summary>
|
||||
public class G_T_equipe : G_Base
|
||||
{
|
||||
#region Constructeurs
|
||||
public G_T_equipe()
|
||||
: base()
|
||||
{ }
|
||||
public G_T_equipe(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string E_nom, int E_point, int? ID_evenement)
|
||||
{ return new A_T_equipe(ChaineConnexion).Ajouter(E_nom, E_point, ID_evenement); }
|
||||
public int Modifier(int ID_equipe, string E_nom, int E_point, int? ID_evenement)
|
||||
{ return new A_T_equipe(ChaineConnexion).Modifier(ID_equipe, E_nom, E_point, ID_evenement); }
|
||||
public List<C_T_equipe> Lire(string Index)
|
||||
{ return new A_T_equipe(ChaineConnexion).Lire(Index); }
|
||||
public C_T_equipe Lire_ID(int ID_equipe)
|
||||
{ return new A_T_equipe(ChaineConnexion).Lire_ID(ID_equipe); }
|
||||
public int Supprimer(int ID_equipe)
|
||||
{ return new A_T_equipe(ChaineConnexion).Supprimer(ID_equipe); }
|
||||
}
|
||||
}
|
||||
35
ProjetTheAlone/Model - Copie/G_T_event.cs
Normal file
35
ProjetTheAlone/Model - Copie/G_T_event.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ProjetTheAlone.Classes;
|
||||
using ProjetTheAlone.Acces;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Gestion
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche intermédiaire de gestion (Business Layer)
|
||||
/// </summary>
|
||||
public class G_T_event : G_Base
|
||||
{
|
||||
#region Constructeurs
|
||||
public G_T_event()
|
||||
: base()
|
||||
{ }
|
||||
public G_T_event(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement, string E_description, int? ID_lieu, byte?[] E_Pic_)
|
||||
{ return new A_T_event(ChaineConnexion).Ajouter(E_date, E_duree, ID_typeEvenement,E_description, ID_lieu, E_Pic_); }
|
||||
public int Modifier(int ID_event, DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement, string E_description, int? ID_lieu, byte?[] E_Pic_)
|
||||
{ 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)
|
||||
{ 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); }
|
||||
}
|
||||
}
|
||||
35
ProjetTheAlone/Model - Copie/G_T_lieu.cs
Normal file
35
ProjetTheAlone/Model - Copie/G_T_lieu.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ProjetTheAlone.Classes;
|
||||
using ProjetTheAlone.Acces;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Gestion
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche intermédiaire de gestion (Business Layer)
|
||||
/// </summary>
|
||||
public class G_T_lieu : G_Base
|
||||
{
|
||||
#region Constructeurs
|
||||
public G_T_lieu()
|
||||
: base()
|
||||
{ }
|
||||
public G_T_lieu(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string L_nom)
|
||||
{ return new A_T_lieu(ChaineConnexion).Ajouter(L_nom); }
|
||||
public int Modifier(int ID_lieu,string L_nom)
|
||||
{ return new A_T_lieu(ChaineConnexion).Modifier(ID_lieu, L_nom); }
|
||||
public List<C_T_lieu> Lire(string Index)
|
||||
{ return new A_T_lieu(ChaineConnexion).Lire(Index); }
|
||||
public C_T_lieu Lire_ID(int ID_lieu)
|
||||
{ return new A_T_lieu(ChaineConnexion).Lire_ID(ID_lieu); }
|
||||
public int Supprimer(int ID_lieu)
|
||||
{ return new A_T_lieu(ChaineConnexion).Supprimer(ID_lieu); }
|
||||
}
|
||||
}
|
||||
35
ProjetTheAlone/Model - Copie/G_T_listParticipant.cs
Normal file
35
ProjetTheAlone/Model - Copie/G_T_listParticipant.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ProjetTheAlone.Classes;
|
||||
using ProjetTheAlone.Acces;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Gestion
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche intermédiaire de gestion (Business Layer)
|
||||
/// </summary>
|
||||
public class G_T_listParticipant : G_Base
|
||||
{
|
||||
#region Constructeurs
|
||||
public G_T_listParticipant()
|
||||
: base()
|
||||
{ }
|
||||
public G_T_listParticipant(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(int? ID_equipe, int? ID_benificiaire)
|
||||
{ return new A_T_listParticipant(ChaineConnexion).Ajouter(ID_equipe, ID_benificiaire); }
|
||||
public int Modifier(int ID_LP, int? ID_equipe, int? ID_benificiaire)
|
||||
{ return new A_T_listParticipant(ChaineConnexion).Modifier(ID_LP, ID_equipe, ID_benificiaire); }
|
||||
public List<C_T_listParticipant> Lire(string Index)
|
||||
{ return new A_T_listParticipant(ChaineConnexion).Lire(Index); }
|
||||
public C_T_listParticipant Lire_ID(int ID_LP)
|
||||
{ return new A_T_listParticipant(ChaineConnexion).Lire_ID(ID_LP); }
|
||||
public int Supprimer(int ID_LP)
|
||||
{ return new A_T_listParticipant(ChaineConnexion).Supprimer(ID_LP); }
|
||||
}
|
||||
}
|
||||
38
ProjetTheAlone/Model - Copie/G_T_listPlat.cs
Normal file
38
ProjetTheAlone/Model - Copie/G_T_listPlat.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ProjetTheAlone.Classes;
|
||||
using ProjetTheAlone.Acces;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Gestion
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche intermédiaire de gestion (Business Layer)
|
||||
/// </summary>
|
||||
public class G_T_listPlat : G_Base
|
||||
{
|
||||
#region Constructeurs
|
||||
public G_T_listPlat()
|
||||
: base()
|
||||
{ }
|
||||
public G_T_listPlat(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(DateTime LP_DatePlat, int ID_plat)
|
||||
{ return new A_T_listPlat(ChaineConnexion).Ajouter(LP_DatePlat, ID_plat); }
|
||||
public int Modifier(int ID_listPlat, DateTime LP_DatePlat, int ID_plat)
|
||||
{ return new A_T_listPlat(ChaineConnexion).Modifier(ID_listPlat, LP_DatePlat, ID_plat); }
|
||||
public List<C_T_listPlat> Lire(string Index)
|
||||
{ return new A_T_listPlat(ChaineConnexion).Lire(Index); } //C_T_listPlat Lire(DateTime LP_DateRepas)
|
||||
public List<C_T_plat> Lire(DateTime dateV)
|
||||
{ return new A_T_listPlat(ChaineConnexion).Lire(dateV); } //C_T_listPlat Lire(DateTime LP_DateRepas)
|
||||
|
||||
public C_T_listPlat Lire_ID(int ID_listPlat)
|
||||
{ return new A_T_listPlat(ChaineConnexion).Lire_ID(ID_listPlat); }
|
||||
public int Supprimer(int ID_listPlat)
|
||||
{ return new A_T_listPlat(ChaineConnexion).Supprimer(ID_listPlat); }
|
||||
}
|
||||
}
|
||||
40
ProjetTheAlone/Model - Copie/G_T_plat.cs
Normal file
40
ProjetTheAlone/Model - Copie/G_T_plat.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ProjetTheAlone.Classes;
|
||||
using ProjetTheAlone.Acces;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Gestion
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche intermédiaire de gestion (Business Layer)
|
||||
/// </summary>
|
||||
public class G_T_plat : G_Base
|
||||
{
|
||||
#region Constructeurs
|
||||
public G_T_plat()
|
||||
: base()
|
||||
{ }
|
||||
public G_T_plat(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string P_nom, byte?[] P_img, int? ID_typePlat)
|
||||
{ return new A_T_plat(ChaineConnexion).Ajouter(P_nom, P_img, ID_typePlat); }
|
||||
public int Modifier(int ID_plat, string P_nom, byte?[] P_img, int? ID_typePlat)
|
||||
{ return new A_T_plat(ChaineConnexion).Modifier(ID_plat, P_nom, P_img, ID_typePlat); }
|
||||
public List<C_T_plat> Lire(string Index)
|
||||
{ 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); }
|
||||
/// <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); }
|
||||
}
|
||||
}
|
||||
48
ProjetTheAlone/Model - Copie/G_T_repa.cs
Normal file
48
ProjetTheAlone/Model - Copie/G_T_repa.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ProjetTheAlone.Classes;
|
||||
using ProjetTheAlone.Acces;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Gestion
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche intermédiaire de gestion (Business Layer)
|
||||
/// </summary>
|
||||
public class G_T_repa : G_Base
|
||||
{
|
||||
#region Constructeurs
|
||||
public G_T_repa()
|
||||
: base()
|
||||
{ }
|
||||
public G_T_repa(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(int? ID_listPlat, int? ID_typeRepa, DateTime R_Date)
|
||||
{ return new A_T_repa(ChaineConnexion).Ajouter(ID_listPlat, ID_typeRepa , R_Date); }
|
||||
public int Modifier(int ID_repa, int? ID_listPlat, int? ID_typeRepa, DateTime R_Date)
|
||||
{ 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)
|
||||
{ return new A_T_repa(ChaineConnexion).Supprimer(ID_repa); }
|
||||
}
|
||||
}
|
||||
35
ProjetTheAlone/Model - Copie/G_T_typeEvenement.cs
Normal file
35
ProjetTheAlone/Model - Copie/G_T_typeEvenement.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ProjetTheAlone.Classes;
|
||||
using ProjetTheAlone.Acces;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Gestion
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche intermédiaire de gestion (Business Layer)
|
||||
/// </summary>
|
||||
public class G_T_typeEvenement : G_Base
|
||||
{
|
||||
#region Constructeurs
|
||||
public G_T_typeEvenement()
|
||||
: base()
|
||||
{ }
|
||||
public G_T_typeEvenement(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string TE_nom)
|
||||
{ return new A_T_typeEvenement(ChaineConnexion).Ajouter(TE_nom); }
|
||||
public int Modifier(int ID_typeEvenement, string TE_nom)
|
||||
{ return new A_T_typeEvenement(ChaineConnexion).Modifier(ID_typeEvenement, TE_nom); }
|
||||
public List<C_T_typeEvenement> Lire(string Index)
|
||||
{ return new A_T_typeEvenement(ChaineConnexion).Lire(Index); }
|
||||
public C_T_typeEvenement Lire_ID(int ID_typeEvenement)
|
||||
{ return new A_T_typeEvenement(ChaineConnexion).Lire_ID(ID_typeEvenement); }
|
||||
public int Supprimer(int ID_typeEvenement)
|
||||
{ return new A_T_typeEvenement(ChaineConnexion).Supprimer(ID_typeEvenement); }
|
||||
}
|
||||
}
|
||||
35
ProjetTheAlone/Model - Copie/G_T_typePlat.cs
Normal file
35
ProjetTheAlone/Model - Copie/G_T_typePlat.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ProjetTheAlone.Classes;
|
||||
using ProjetTheAlone.Acces;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Gestion
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche intermédiaire de gestion (Business Layer)
|
||||
/// </summary>
|
||||
public class G_T_typePlat : G_Base
|
||||
{
|
||||
#region Constructeurs
|
||||
public G_T_typePlat()
|
||||
: base()
|
||||
{ }
|
||||
public G_T_typePlat(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string TP_nom)
|
||||
{ return new A_T_typePlat(ChaineConnexion).Ajouter(TP_nom); }
|
||||
public int Modifier(int ID_typePlat, string TP_nom)
|
||||
{ return new A_T_typePlat(ChaineConnexion).Modifier(ID_typePlat, TP_nom); }
|
||||
public List<C_T_typePlat> Lire(string Index)
|
||||
{ return new A_T_typePlat(ChaineConnexion).Lire(Index); }
|
||||
public C_T_typePlat Lire_ID(int ID_typePlat)
|
||||
{ return new A_T_typePlat(ChaineConnexion).Lire_ID(ID_typePlat); }
|
||||
public int Supprimer(int ID_typePlat)
|
||||
{ return new A_T_typePlat(ChaineConnexion).Supprimer(ID_typePlat); }
|
||||
}
|
||||
}
|
||||
35
ProjetTheAlone/Model - Copie/G_T_typeRepa.cs
Normal file
35
ProjetTheAlone/Model - Copie/G_T_typeRepa.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
#region Ressources extérieures
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using ProjetTheAlone.Classes;
|
||||
using ProjetTheAlone.Acces;
|
||||
#endregion
|
||||
|
||||
namespace ProjetTheAlone.Gestion
|
||||
{
|
||||
/// <summary>
|
||||
/// Couche intermédiaire de gestion (Business Layer)
|
||||
/// </summary>
|
||||
public class G_T_typeRepa : G_Base
|
||||
{
|
||||
#region Constructeurs
|
||||
public G_T_typeRepa()
|
||||
: base()
|
||||
{ }
|
||||
public G_T_typeRepa(string sChaineConnexion)
|
||||
: base(sChaineConnexion)
|
||||
{ }
|
||||
#endregion
|
||||
public int Ajouter(string TR_nom)
|
||||
{ return new A_T_typeRepa(ChaineConnexion).Ajouter(TR_nom); }
|
||||
public int Modifier(int ID_typeRepa, string TR_nom)
|
||||
{ return new A_T_typeRepa(ChaineConnexion).Modifier(ID_typeRepa, TR_nom); }
|
||||
public List<C_T_typeRepa> Lire(string Index)
|
||||
{ return new A_T_typeRepa(ChaineConnexion).Lire(Index); }
|
||||
public C_T_typeRepa Lire_ID(int ID_typeRepa)
|
||||
{ return new A_T_typeRepa(ChaineConnexion).Lire_ID(ID_typeRepa); }
|
||||
public int Supprimer(int ID_typeRepa)
|
||||
{ return new A_T_typeRepa(ChaineConnexion).Supprimer(ID_typeRepa); }
|
||||
}
|
||||
}
|
||||
56
ProjetTheAlone/Model - Copie/P_T_beneficiaire.sql
Normal file
56
ProjetTheAlone/Model - Copie/P_T_beneficiaire.sql
Normal file
@@ -0,0 +1,56 @@
|
||||
CREATE PROCEDURE AjouterT_beneficiaire
|
||||
@ID_beneficiaire int OUTPUT,
|
||||
@B_nom varchar(50),
|
||||
@B_prenom varchar(50),
|
||||
@B_anniversaire datetime,
|
||||
@B_img nchar(10)
|
||||
AS
|
||||
INSERT INTO T_beneficiaire(B_nom,B_prenom,B_anniversaire,B_img)
|
||||
VALUES(@B_nom,@B_prenom,@B_anniversaire,@B_img)
|
||||
SET @ID_beneficiaire=@@IDENTITY
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE ModifierT_beneficiaire
|
||||
@ID_beneficiaire int,
|
||||
@B_nom varchar(50),
|
||||
@B_prenom varchar(50),
|
||||
@B_anniversaire datetime,
|
||||
@B_img nchar(10)
|
||||
AS
|
||||
IF(@ID_beneficiaire IS NULL OR @ID_beneficiaire=0)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE UPDATE T_beneficiaire
|
||||
SET B_nom=@B_nom,B_prenom=@B_prenom,B_anniversaire=@B_anniversaire,B_img=@B_img
|
||||
WHERE ID_beneficiaire=@ID_beneficiaire
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_beneficiaire
|
||||
@Index VARCHAR(10)
|
||||
AS
|
||||
IF(@Index='B_nom') SELECT * FROM T_beneficiaire ORDER BY B_nom
|
||||
ELSE IF(@Index='B_prenom') SELECT * FROM T_beneficiaire ORDER BY B_prenom
|
||||
ELSE IF(@Index='B_anniversaire') SELECT * FROM T_beneficiaire ORDER BY B_anniversaire
|
||||
ELSE IF(@Index='B_img') SELECT * FROM T_beneficiaire ORDER BY B_img
|
||||
ELSE SELECT * FROM T_beneficiaire ORDER BY ID_beneficiaire
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_beneficiaire_ID
|
||||
@ID_beneficiaire int
|
||||
AS
|
||||
IF(@ID_beneficiaire IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
SELECT ID_beneficiaire,B_nom,B_prenom,B_anniversaire,B_img
|
||||
FROM T_beneficiaire
|
||||
WHERE @ID_beneficiaire=ID_beneficiaire
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SupprimerT_beneficiaire
|
||||
@ID_beneficiaire int
|
||||
AS
|
||||
IF(@ID_beneficiaire IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
DELETE FROM T_beneficiaire WHERE @ID_beneficiaire=ID_beneficiaire
|
||||
RETURN
|
||||
GO
|
||||
53
ProjetTheAlone/Model - Copie/P_T_equipe.sql
Normal file
53
ProjetTheAlone/Model - Copie/P_T_equipe.sql
Normal file
@@ -0,0 +1,53 @@
|
||||
CREATE PROCEDURE AjouterT_equipe
|
||||
@ID_equipe int OUTPUT,
|
||||
@E_nom nchar(10),
|
||||
@E_point nchar(10),
|
||||
@ID_evenement int
|
||||
AS
|
||||
INSERT INTO T_equipe(E_nom,E_point,ID_evenement)
|
||||
VALUES(@E_nom,@E_point,@ID_evenement)
|
||||
SET @ID_equipe=@@IDENTITY
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE ModifierT_equipe
|
||||
@ID_equipe int,
|
||||
@E_nom nchar(10),
|
||||
@E_point nchar(10),
|
||||
@ID_evenement int
|
||||
AS
|
||||
IF(@ID_equipe IS NULL OR @ID_equipe=0)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE UPDATE T_equipe
|
||||
SET E_nom=@E_nom,E_point=@E_point,ID_evenement=@ID_evenement
|
||||
WHERE ID_equipe=@ID_equipe
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_equipe
|
||||
@Index VARCHAR(10)
|
||||
AS
|
||||
IF(@Index='E_nom') SELECT * FROM T_equipe ORDER BY E_nom
|
||||
ELSE IF(@Index='E_point') SELECT * FROM T_equipe ORDER BY E_point
|
||||
ELSE IF(@Index='ID_evenement') SELECT * FROM T_equipe ORDER BY ID_evenement
|
||||
ELSE SELECT * FROM T_equipe ORDER BY ID_equipe
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_equipe_ID
|
||||
@ID_equipe int
|
||||
AS
|
||||
IF(@ID_equipe IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
SELECT ID_equipe,E_nom,E_point,ID_evenement
|
||||
FROM T_equipe
|
||||
WHERE @ID_equipe=ID_equipe
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SupprimerT_equipe
|
||||
@ID_equipe int
|
||||
AS
|
||||
IF(@ID_equipe IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
DELETE FROM T_equipe WHERE @ID_equipe=ID_equipe
|
||||
RETURN
|
||||
GO
|
||||
59
ProjetTheAlone/Model - Copie/P_T_event.sql
Normal file
59
ProjetTheAlone/Model - Copie/P_T_event.sql
Normal file
@@ -0,0 +1,59 @@
|
||||
CREATE PROCEDURE AjouterT_event
|
||||
@ID_event int OUTPUT,
|
||||
@E_date datetime,
|
||||
@E_duree datetime,
|
||||
@ID_typeEvenement int,
|
||||
@E_description text,
|
||||
@ID_lieu int
|
||||
AS
|
||||
INSERT INTO T_event(E_date,E_duree,ID_typeEvenement,E_description,ID_lieu)
|
||||
VALUES(@E_date,@E_duree,@ID_typeEvenement,@E_description,@ID_lieu)
|
||||
SET @ID_event=@@IDENTITY
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE ModifierT_event
|
||||
@ID_event int,
|
||||
@E_date datetime,
|
||||
@E_duree datetime,
|
||||
@ID_typeEvenement int,
|
||||
@E_description text,
|
||||
@ID_lieu int
|
||||
AS
|
||||
IF(@ID_event IS NULL OR @ID_event=0)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE UPDATE T_event
|
||||
SET E_date=@E_date,E_duree=@E_duree,ID_typeEvenement=@ID_typeEvenement,E_description=@E_description,ID_lieu=@ID_lieu
|
||||
WHERE ID_event=@ID_event
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_event
|
||||
@Index VARCHAR(10)
|
||||
AS
|
||||
IF(@Index='E_date') SELECT * FROM T_event ORDER BY E_date
|
||||
ELSE IF(@Index='E_duree') SELECT * FROM T_event ORDER BY E_duree
|
||||
ELSE IF(@Index='ID_typeEvenement') SELECT * FROM T_event ORDER BY ID_typeEvenement
|
||||
ELSE IF(@Index='E_description') SELECT * FROM T_event ORDER BY E_description
|
||||
ELSE IF(@Index='ID_lieu') SELECT * FROM T_event ORDER BY ID_lieu
|
||||
ELSE SELECT * FROM T_event ORDER BY ID_event
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_event_ID
|
||||
@ID_event int
|
||||
AS
|
||||
IF(@ID_event IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
SELECT ID_event,E_date,E_duree,ID_typeEvenement,E_description,ID_lieu
|
||||
FROM T_event
|
||||
WHERE @ID_event=ID_event
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SupprimerT_event
|
||||
@ID_event int
|
||||
AS
|
||||
IF(@ID_event IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
DELETE FROM T_event WHERE @ID_event=ID_event
|
||||
RETURN
|
||||
GO
|
||||
47
ProjetTheAlone/Model - Copie/P_T_lieu.sql
Normal file
47
ProjetTheAlone/Model - Copie/P_T_lieu.sql
Normal file
@@ -0,0 +1,47 @@
|
||||
CREATE PROCEDURE AjouterT_lieu
|
||||
@ID_lieu int OUTPUT,
|
||||
@L_nom text
|
||||
AS
|
||||
INSERT INTO T_lieu(L_nom)
|
||||
VALUES(@L_nom)
|
||||
SET @ID_lieu=@@IDENTITY
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE ModifierT_lieu
|
||||
@ID_lieu int,
|
||||
@L_nom text
|
||||
AS
|
||||
IF(@ID_lieu IS NULL OR @ID_lieu=0)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE UPDATE T_lieu
|
||||
SET L_nom=@L_nom
|
||||
WHERE ID_lieu=@ID_lieu
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_lieu
|
||||
@Index VARCHAR(10)
|
||||
AS
|
||||
IF(@Index='L_nom') SELECT * FROM T_lieu ORDER BY L_nom
|
||||
ELSE SELECT * FROM T_lieu ORDER BY ID_lieu
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_lieu_ID
|
||||
@ID_lieu int
|
||||
AS
|
||||
IF(@ID_lieu IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
SELECT ID_lieu,L_nom
|
||||
FROM T_lieu
|
||||
WHERE @ID_lieu=ID_lieu
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SupprimerT_lieu
|
||||
@ID_lieu int
|
||||
AS
|
||||
IF(@ID_lieu IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
DELETE FROM T_lieu WHERE @ID_lieu=ID_lieu
|
||||
RETURN
|
||||
GO
|
||||
50
ProjetTheAlone/Model - Copie/P_T_listParticipant.sql
Normal file
50
ProjetTheAlone/Model - Copie/P_T_listParticipant.sql
Normal file
@@ -0,0 +1,50 @@
|
||||
CREATE PROCEDURE AjouterT_listParticipant
|
||||
@ID_LP int OUTPUT,
|
||||
@ID_equipe int,
|
||||
@ID_benificiaire int
|
||||
AS
|
||||
INSERT INTO T_listParticipant(ID_equipe,ID_benificiaire)
|
||||
VALUES(@ID_equipe,@ID_benificiaire)
|
||||
SET @ID_LP=@@IDENTITY
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE ModifierT_listParticipant
|
||||
@ID_LP int,
|
||||
@ID_equipe int,
|
||||
@ID_benificiaire int
|
||||
AS
|
||||
IF(@ID_LP IS NULL OR @ID_LP=0)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE UPDATE T_listParticipant
|
||||
SET ID_equipe=@ID_equipe,ID_benificiaire=@ID_benificiaire
|
||||
WHERE ID_LP=@ID_LP
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_listParticipant
|
||||
@Index VARCHAR(10)
|
||||
AS
|
||||
IF(@Index='ID_equipe') SELECT * FROM T_listParticipant ORDER BY ID_equipe
|
||||
ELSE IF(@Index='ID_benificiaire') SELECT * FROM T_listParticipant ORDER BY ID_benificiaire
|
||||
ELSE SELECT * FROM T_listParticipant ORDER BY ID_LP
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_listParticipant_ID
|
||||
@ID_LP int
|
||||
AS
|
||||
IF(@ID_LP IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
SELECT ID_LP,ID_equipe,ID_benificiaire
|
||||
FROM T_listParticipant
|
||||
WHERE @ID_LP=ID_LP
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SupprimerT_listParticipant
|
||||
@ID_LP int
|
||||
AS
|
||||
IF(@ID_LP IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
DELETE FROM T_listParticipant WHERE @ID_LP=ID_LP
|
||||
RETURN
|
||||
GO
|
||||
50
ProjetTheAlone/Model - Copie/P_T_listPlat.sql
Normal file
50
ProjetTheAlone/Model - Copie/P_T_listPlat.sql
Normal file
@@ -0,0 +1,50 @@
|
||||
CREATE PROCEDURE AjouterT_listPlat
|
||||
@ID_listPlat int OUTPUT,
|
||||
@ID_repa int,
|
||||
@ID_plat int
|
||||
AS
|
||||
INSERT INTO T_listPlat(ID_repa,ID_plat)
|
||||
VALUES(@ID_repa,@ID_plat)
|
||||
SET @ID_listPlat=@@IDENTITY
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE ModifierT_listPlat
|
||||
@ID_listPlat int,
|
||||
@ID_repa int,
|
||||
@ID_plat int
|
||||
AS
|
||||
IF(@ID_listPlat IS NULL OR @ID_listPlat=0)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE UPDATE T_listPlat
|
||||
SET ID_repa=@ID_repa,ID_plat=@ID_plat
|
||||
WHERE ID_listPlat=@ID_listPlat
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_listPlat
|
||||
@Index VARCHAR(10)
|
||||
AS
|
||||
IF(@Index='ID_repa') SELECT * FROM T_listPlat ORDER BY ID_repa
|
||||
ELSE IF(@Index='ID_plat') SELECT * FROM T_listPlat ORDER BY ID_plat
|
||||
ELSE SELECT * FROM T_listPlat ORDER BY ID_listPlat
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_listPlat_ID
|
||||
@ID_listPlat int
|
||||
AS
|
||||
IF(@ID_listPlat IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
SELECT ID_listPlat,ID_repa,ID_plat
|
||||
FROM T_listPlat
|
||||
WHERE @ID_listPlat=ID_listPlat
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SupprimerT_listPlat
|
||||
@ID_listPlat int
|
||||
AS
|
||||
IF(@ID_listPlat IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
DELETE FROM T_listPlat WHERE @ID_listPlat=ID_listPlat
|
||||
RETURN
|
||||
GO
|
||||
53
ProjetTheAlone/Model - Copie/P_T_plat.sql
Normal file
53
ProjetTheAlone/Model - Copie/P_T_plat.sql
Normal file
@@ -0,0 +1,53 @@
|
||||
CREATE PROCEDURE AjouterT_plat
|
||||
@ID_plat int OUTPUT,
|
||||
@P_nom int,
|
||||
@P_img int,
|
||||
@ID_typePlat int
|
||||
AS
|
||||
INSERT INTO T_plat(P_nom,P_img,ID_typePlat)
|
||||
VALUES(@P_nom,@P_img,@ID_typePlat)
|
||||
SET @ID_plat=@@IDENTITY
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE ModifierT_plat
|
||||
@ID_plat int,
|
||||
@P_nom int,
|
||||
@P_img int,
|
||||
@ID_typePlat int
|
||||
AS
|
||||
IF(@ID_plat IS NULL OR @ID_plat=0)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE UPDATE T_plat
|
||||
SET P_nom=@P_nom,P_img=@P_img,ID_typePlat=@ID_typePlat
|
||||
WHERE ID_plat=@ID_plat
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_plat
|
||||
@Index VARCHAR(10)
|
||||
AS
|
||||
IF(@Index='P_nom') SELECT * FROM T_plat ORDER BY P_nom
|
||||
ELSE IF(@Index='P_img') SELECT * FROM T_plat ORDER BY P_img
|
||||
ELSE IF(@Index='ID_typePlat') SELECT * FROM T_plat ORDER BY ID_typePlat
|
||||
ELSE SELECT * FROM T_plat ORDER BY ID_plat
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_plat_ID
|
||||
@ID_plat int
|
||||
AS
|
||||
IF(@ID_plat IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
SELECT ID_plat,P_nom,P_img,ID_typePlat
|
||||
FROM T_plat
|
||||
WHERE @ID_plat=ID_plat
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SupprimerT_plat
|
||||
@ID_plat int
|
||||
AS
|
||||
IF(@ID_plat IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
DELETE FROM T_plat WHERE @ID_plat=ID_plat
|
||||
RETURN
|
||||
GO
|
||||
50
ProjetTheAlone/Model - Copie/P_T_repa.sql
Normal file
50
ProjetTheAlone/Model - Copie/P_T_repa.sql
Normal file
@@ -0,0 +1,50 @@
|
||||
CREATE PROCEDURE AjouterT_repa
|
||||
@ID_repa int OUTPUT,
|
||||
@ID_listPlat int,
|
||||
@ID_typeRepa int
|
||||
AS
|
||||
INSERT INTO T_repa(ID_listPlat,ID_typeRepa)
|
||||
VALUES(@ID_listPlat,@ID_typeRepa)
|
||||
SET @ID_repa=@@IDENTITY
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE ModifierT_repa
|
||||
@ID_repa int,
|
||||
@ID_listPlat int,
|
||||
@ID_typeRepa int
|
||||
AS
|
||||
IF(@ID_repa IS NULL OR @ID_repa=0)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE UPDATE T_repa
|
||||
SET ID_listPlat=@ID_listPlat,ID_typeRepa=@ID_typeRepa
|
||||
WHERE ID_repa=@ID_repa
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_repa
|
||||
@Index VARCHAR(10)
|
||||
AS
|
||||
IF(@Index='ID_listPlat') SELECT * FROM T_repa ORDER BY ID_listPlat
|
||||
ELSE IF(@Index='ID_typeRepa') SELECT * FROM T_repa ORDER BY ID_typeRepa
|
||||
ELSE SELECT * FROM T_repa ORDER BY ID_repa
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_repa_ID
|
||||
@ID_repa int
|
||||
AS
|
||||
IF(@ID_repa IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
SELECT ID_repa,ID_listPlat,ID_typeRepa
|
||||
FROM T_repa
|
||||
WHERE @ID_repa=ID_repa
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SupprimerT_repa
|
||||
@ID_repa int
|
||||
AS
|
||||
IF(@ID_repa IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
DELETE FROM T_repa WHERE @ID_repa=ID_repa
|
||||
RETURN
|
||||
GO
|
||||
47
ProjetTheAlone/Model - Copie/P_T_typeEvenement.sql
Normal file
47
ProjetTheAlone/Model - Copie/P_T_typeEvenement.sql
Normal file
@@ -0,0 +1,47 @@
|
||||
CREATE PROCEDURE AjouterT_typeEvenement
|
||||
@ID_typeEvenement int OUTPUT,
|
||||
@TE_nom text
|
||||
AS
|
||||
INSERT INTO T_typeEvenement(TE_nom)
|
||||
VALUES(@TE_nom)
|
||||
SET @ID_typeEvenement=@@IDENTITY
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE ModifierT_typeEvenement
|
||||
@ID_typeEvenement int,
|
||||
@TE_nom text
|
||||
AS
|
||||
IF(@ID_typeEvenement IS NULL OR @ID_typeEvenement=0)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE UPDATE T_typeEvenement
|
||||
SET TE_nom=@TE_nom
|
||||
WHERE ID_typeEvenement=@ID_typeEvenement
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_typeEvenement
|
||||
@Index VARCHAR(10)
|
||||
AS
|
||||
IF(@Index='TE_nom') SELECT * FROM T_typeEvenement ORDER BY TE_nom
|
||||
ELSE SELECT * FROM T_typeEvenement ORDER BY ID_typeEvenement
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_typeEvenement_ID
|
||||
@ID_typeEvenement int
|
||||
AS
|
||||
IF(@ID_typeEvenement IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
SELECT ID_typeEvenement,TE_nom
|
||||
FROM T_typeEvenement
|
||||
WHERE @ID_typeEvenement=ID_typeEvenement
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SupprimerT_typeEvenement
|
||||
@ID_typeEvenement int
|
||||
AS
|
||||
IF(@ID_typeEvenement IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
DELETE FROM T_typeEvenement WHERE @ID_typeEvenement=ID_typeEvenement
|
||||
RETURN
|
||||
GO
|
||||
48
ProjetTheAlone/Model - Copie/P_T_typePlat.sql
Normal file
48
ProjetTheAlone/Model - Copie/P_T_typePlat.sql
Normal file
@@ -0,0 +1,48 @@
|
||||
CREATE PROCEDURE AjouterT_typePlat
|
||||
@ID_typePlat int,
|
||||
@TP_nom varchar(50)
|
||||
AS
|
||||
IF EXISTS(SELECT * FROM T_typePlat WHERE ID_typePlat=@ID_typePlat)
|
||||
RAISERROR('Clé primaire existant !',16,1)
|
||||
ELSE INSERT INTO T_typePlat(ID_typePlat,TP_nom)
|
||||
VALUES(@ID_typePlat,@TP_nom)
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE ModifierT_typePlat
|
||||
@ID_typePlat int,
|
||||
@TP_nom varchar(50)
|
||||
AS
|
||||
IF(@ID_typePlat IS NULL OR @ID_typePlat=0)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE UPDATE T_typePlat
|
||||
SET TP_nom=@TP_nom
|
||||
WHERE ID_typePlat=@ID_typePlat
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_typePlat
|
||||
@Index VARCHAR(10)
|
||||
AS
|
||||
IF(@Index='TP_nom') SELECT * FROM T_typePlat ORDER BY TP_nom
|
||||
ELSE SELECT * FROM T_typePlat ORDER BY ID_typePlat
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_typePlat_ID
|
||||
@ID_typePlat int
|
||||
AS
|
||||
IF(@ID_typePlat IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
SELECT ID_typePlat,TP_nom
|
||||
FROM T_typePlat
|
||||
WHERE @ID_typePlat=ID_typePlat
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SupprimerT_typePlat
|
||||
@ID_typePlat int
|
||||
AS
|
||||
IF(@ID_typePlat IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
DELETE FROM T_typePlat WHERE @ID_typePlat=ID_typePlat
|
||||
RETURN
|
||||
GO
|
||||
47
ProjetTheAlone/Model - Copie/P_T_typeRepa.sql
Normal file
47
ProjetTheAlone/Model - Copie/P_T_typeRepa.sql
Normal file
@@ -0,0 +1,47 @@
|
||||
CREATE PROCEDURE AjouterT_typeRepa
|
||||
@ID_typeRepa int OUTPUT,
|
||||
@TR_nom varchar(50)
|
||||
AS
|
||||
INSERT INTO T_typeRepa(TR_nom)
|
||||
VALUES(@TR_nom)
|
||||
SET @ID_typeRepa=@@IDENTITY
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE ModifierT_typeRepa
|
||||
@ID_typeRepa int,
|
||||
@TR_nom varchar(50)
|
||||
AS
|
||||
IF(@ID_typeRepa IS NULL OR @ID_typeRepa=0)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE UPDATE T_typeRepa
|
||||
SET TR_nom=@TR_nom
|
||||
WHERE ID_typeRepa=@ID_typeRepa
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_typeRepa
|
||||
@Index VARCHAR(10)
|
||||
AS
|
||||
IF(@Index='TR_nom') SELECT * FROM T_typeRepa ORDER BY TR_nom
|
||||
ELSE SELECT * FROM T_typeRepa ORDER BY ID_typeRepa
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SelectionnerT_typeRepa_ID
|
||||
@ID_typeRepa int
|
||||
AS
|
||||
IF(@ID_typeRepa IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
SELECT ID_typeRepa,TR_nom
|
||||
FROM T_typeRepa
|
||||
WHERE @ID_typeRepa=ID_typeRepa
|
||||
RETURN
|
||||
GO
|
||||
CREATE PROCEDURE SupprimerT_typeRepa
|
||||
@ID_typeRepa int
|
||||
AS
|
||||
IF(@ID_typeRepa IS NULL)
|
||||
RAISERROR('Identifiant requis !',16,1)
|
||||
ELSE
|
||||
DELETE FROM T_typeRepa WHERE @ID_typeRepa=ID_typeRepa
|
||||
RETURN
|
||||
GO
|
||||
Reference in New Issue
Block a user