This commit is contained in:
adri 2019-01-18 13:08:55 +01:00
parent 8f7992622c
commit 63ac321e2f
67 changed files with 3449 additions and 6 deletions

View File

@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ProjetTheAlone" xmlns:local="clr-namespace:ProjetTheAlone"
StartupUri="MainWindow.xaml"> StartupUri="/View/DashBoard.xaml">
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>

View File

@ -0,0 +1,44 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media.Imaging;
//https://cromwellhaus.com/2007/07/binding-to-the-byte-of-an-image-in-wpf/
namespace ProjetTheAlone.Converter
{
public class BinaryImageConverter : IValueConverter
{
object IValueConverter.Convert(object value,
Type targetType,
object parameter,
System.Globalization.CultureInfo culture)
{
if (value != null && value is byte[])
{
byte[] bytes = value as byte[];
MemoryStream stream = new MemoryStream(bytes);
BitmapImage image = new BitmapImage();
image.BeginInit();
image.StreamSource = stream;
image.EndInit();
return image;
}
return null;
}
object IValueConverter.ConvertBack(object value,
Type targetType,
object parameter,
System.Globalization.CultureInfo culture)
{
throw new Exception("The method or operation is not implemented.");
}
}
}

View File

@ -15,8 +15,6 @@
Background="{DynamicResource MaterialDesignPaper}" Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}"> FontFamily="{DynamicResource MaterialDesignFont}">
<Grid> <Grid>
<materialDesign:Card Padding="32" Margin="16">
<TextBlock Style="{DynamicResource MaterialDesignTitleTextBlock}">My First Material Design App</TextBlock>
</materialDesign:Card>
</Grid> </Grid>
</Window> </Window>

View File

@ -12,14 +12,13 @@ using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
using System.Windows.Navigation; using System.Windows.Navigation;
using System.Windows.Shapes; using System.Windows.Shapes;
using MahApps.Metro.Controls;
namespace ProjetTheAlone namespace ProjetTheAlone
{ {
/// <summary> /// <summary>
/// Interaction logic for MainWindow.xaml /// Interaction logic for MainWindow.xaml
/// </summary> /// </summary>
public partial class MainWindow : MetroWindow public partial class MainWindow : Window
{ {
public MainWindow() public MainWindow()
{ {

View 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
}
}

View File

@ -0,0 +1,112 @@
#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, string 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", Convert.DBNull);
else Commande.Parameters.AddWithValue("@B_img", 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, string 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());
tmp.B_img = dr["B_img"].ToString();
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());
res.B_img = dr["B_img"].ToString();
}
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;
}
}
}

View File

@ -0,0 +1,106 @@
#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, string 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);
if(E_point == null) Commande.Parameters.AddWithValue("@E_point", Convert.DBNull);
else 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, string 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);
if(E_point == null) Commande.Parameters.AddWithValue("@E_point", Convert.DBNull);
else 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 = 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 = 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;
}
}
}

View File

@ -0,0 +1,118 @@
#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)
{
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.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)
{
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.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());
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());
}
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;
}
}
}

View 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;
}
}
}

View 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;
}
}
}

View 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_listPlat : ADBase
{
#region Constructeurs
public A_T_listPlat(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(int ID_repa, int ID_plat)
{
CreerCommande("AjouterT_listPlat");
int res = 0;
Commande.Parameters.Add("ID_listPlat", SqlDbType.Int);
Direction("ID_listPlat", ParameterDirection.Output);
Commande.Parameters.AddWithValue("@ID_repa", ID_repa);
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, int ID_repa, int ID_plat)
{
CreerCommande("ModifierT_listPlat");
int res = 0;
Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat);
Commande.Parameters.AddWithValue("@ID_repa", ID_repa);
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 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;
}
}
}

View File

@ -0,0 +1,106 @@
#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
{
#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", 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", 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 = Encoding.ASCII.GetBytes(dr["P_img"].ToString());
if(dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = int.Parse(dr["ID_typePlat"].ToString());
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
public C_T_plat Lire_ID(int ID_plat)
{
CreerCommande("SelectionnerT_plat_ID");
Commande.Parameters.AddWithValue("@ID_plat", ID_plat);
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 = Encoding.ASCII.GetBytes(dr["P_img"].ToString());
if(dr["ID_typePlat"] != DBNull.Value) res.ID_typePlat = 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;
}
}
}

View 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_repa : ADBase
{
#region Constructeurs
public A_T_repa(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(int? ID_listPlat, int? ID_typeRepa)
{
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.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)
{
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.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());
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.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;
}
}
}

View 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;
}
}
}

View 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;
}
}
}

View 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;
}
}
}

View 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 string _B_img;
#endregion
#region Constructeurs
public C_T_beneficiaire()
{ }
public C_T_beneficiaire(string B_nom_, string B_prenom_, DateTime? B_anniversaire_, string B_img_)
{
B_nom = B_nom_;
B_prenom = B_prenom_;
B_anniversaire = B_anniversaire_;
B_img = B_img_;
}
public C_T_beneficiaire(int ID_beneficiaire_, string B_nom_, string B_prenom_, DateTime? B_anniversaire_, string B_img_)
: 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 string B_img
{
get { return _B_img; }
set { _B_img = value; }
}
#endregion
}
}

View 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 string _E_point;
private int? _ID_evenement;
#endregion
#region Constructeurs
public C_T_equipe()
{ }
public C_T_equipe(string E_nom_, string 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_, string 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 string E_point
{
get { return _E_point; }
set { _E_point = value; }
}
public int? ID_evenement
{
get { return _ID_evenement; }
set { _ID_evenement = value; }
}
#endregion
}
}

View File

@ -0,0 +1,67 @@
#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;
#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_)
{
E_date = E_date_;
E_duree = E_duree_;
ID_typeEvenement = ID_typeEvenement_;
E_description = E_description_;
ID_lieu = ID_lieu_;
}
public C_T_event(int ID_event_, DateTime? E_date_, DateTime? E_duree_, int? ID_typeEvenement_, string E_description_, int? ID_lieu_)
: this(E_date_, E_duree_, ID_typeEvenement_, E_description_, ID_lieu_)
{
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; }
#endregion
}
}

View 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
}
}

View 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
}
}

View 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
}
}

View 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_plat
{
#region Données membres
private int _ID_plat;
private string _P_nom;
private byte[] _P_img;
private int? _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 = 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 int? ID_typePlat
{
get { return _ID_typePlat; }
set { _ID_typePlat = value; }
}
#endregion
}
}

View 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_repa
{
#region Données membres
private int _ID_repa;
private int? _ID_listPlat;
private int? _ID_typeRepa;
#endregion
#region Constructeurs
public C_T_repa()
{ }
public C_T_repa(int? ID_listPlat_, int? ID_typeRepa_)
{
ID_listPlat = ID_listPlat_;
ID_typeRepa = ID_typeRepa_;
}
public C_T_repa(int ID_repa_, int? ID_listPlat_, int? ID_typeRepa_)
: this(ID_listPlat_, ID_typeRepa_)
{
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; }
}
#endregion
}
}

View 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
}
}

View 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
}
}

View 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
}
}

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjetTheAlone.Model
{
public class EventPasseModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
ObservableCollection<string> classement;
public ObservableCollection<string> Classement { get => classement; set { classement = value; OnPropertyChanged("Classement"); } }
public EventPasseModel(ObservableCollection<string> classement)
{
Classement = classement;
}
protected void OnPropertyChanged(string name)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(name));
}
}
}
}

View 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
}
}

View 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, string B_img)
{ return new A_T_beneficiaire(ChaineConnexion).Ajouter(B_nom, B_prenom, B_anniversaire, B_img); }
public int Modifier(int ID_beneficiaire, string B_nom, string B_prenom, DateTime? B_anniversaire, string B_img)
{ 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); }
}
}

View 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, string 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, string 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); }
}
}

View 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)
{ return new A_T_event(ChaineConnexion).Ajouter(E_date, E_duree, ID_typeEvenement,E_description, ID_lieu); }
public int Modifier(int ID_event, DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement, string E_description, int? ID_lieu)
{ return new A_T_event(ChaineConnexion).Modifier(ID_event, E_date, E_duree, ID_typeEvenement, E_description, ID_lieu); }
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); }
}
}

View 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); }
}
}

View 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); }
}
}

View 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_listPlat : G_Base
{
#region Constructeurs
public G_T_listPlat()
: base()
{ }
public G_T_listPlat(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(int ID_repa, int ID_plat)
{ return new A_T_listPlat(ChaineConnexion).Ajouter(ID_repa, ID_plat); }
public int Modifier(int ID_listPlat, int ID_repa, int ID_plat)
{ return new A_T_listPlat(ChaineConnexion).Modifier(ID_listPlat, ID_repa, ID_plat); }
public List<C_T_listPlat> Lire(string Index)
{ return new A_T_listPlat(ChaineConnexion).Lire(Index); }
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); }
}
}

View 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_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); }
public int Supprimer(int ID_plat)
{ return new A_T_plat(ChaineConnexion).Supprimer(ID_plat); }
}
}

View 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_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)
{ return new A_T_repa(ChaineConnexion).Ajouter(ID_listPlat, ID_typeRepa); }
public int Modifier(int ID_repa, int? ID_listPlat, int? ID_typeRepa)
{ return new A_T_repa(ChaineConnexion).Modifier(ID_repa, ID_listPlat, ID_typeRepa); }
public List<C_T_repa> Lire(string Index)
{ return new A_T_repa(ChaineConnexion).Lire(Index); }
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); }
}
}

View 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); }
}
}

View 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); }
}
}

View 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); }
}
}

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View File

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using ProjetTheAlone.Classes;
using System.Collections.ObjectModel;
namespace ProjetTheAlone.Model
{
public class RepaModel : INotifyPropertyChanged
{
private ObservableCollection<C_T_plat> listPlat = new ObservableCollection<C_T_plat>();
public ObservableCollection<C_T_plat> ListPlat { get => listPlat; set { listPlat = value; OnPropertyChanged("ListPlat"); } }
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged(string name)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(name));
}
}
public RepaModel()
{
}
}
}

View File

@ -66,6 +66,60 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</ApplicationDefinition> </ApplicationDefinition>
<Compile Include="Converter\BinaryImageConverter.cs" />
<Compile Include="Model\A_Base.cs" />
<Compile Include="Model\A_T_beneficiaire.cs" />
<Compile Include="Model\A_T_equipe.cs" />
<Compile Include="Model\A_T_event.cs" />
<Compile Include="Model\A_T_lieu.cs" />
<Compile Include="Model\A_T_listParticipant.cs" />
<Compile Include="Model\A_T_listPlat.cs" />
<Compile Include="Model\A_T_plat.cs" />
<Compile Include="Model\A_T_repa.cs" />
<Compile Include="Model\A_T_typeEvenement.cs" />
<Compile Include="Model\A_T_typePlat.cs" />
<Compile Include="Model\A_T_typeRepa.cs" />
<Compile Include="Model\C_T_beneficiaire.cs" />
<Compile Include="Model\C_T_equipe.cs" />
<Compile Include="Model\C_T_event.cs" />
<Compile Include="Model\C_T_lieu.cs" />
<Compile Include="Model\C_T_listParticipant.cs" />
<Compile Include="Model\C_T_listPlat.cs" />
<Compile Include="Model\C_T_plat.cs" />
<Compile Include="Model\C_T_repa.cs" />
<Compile Include="Model\C_T_typeEvenement.cs" />
<Compile Include="Model\C_T_typePlat.cs" />
<Compile Include="Model\C_T_typeRepa.cs" />
<Compile Include="Model\EventPasseModel.cs" />
<Compile Include="Model\G_Base.cs" />
<Compile Include="Model\G_T_beneficiaire.cs" />
<Compile Include="Model\G_T_equipe.cs" />
<Compile Include="Model\G_T_event.cs" />
<Compile Include="Model\G_T_lieu.cs" />
<Compile Include="Model\G_T_listParticipant.cs" />
<Compile Include="Model\G_T_listPlat.cs" />
<Compile Include="Model\G_T_plat.cs" />
<Compile Include="Model\G_T_repa.cs" />
<Compile Include="Model\G_T_typeEvenement.cs" />
<Compile Include="Model\G_T_typePlat.cs" />
<Compile Include="Model\G_T_typeRepa.cs" />
<Compile Include="Model\RepaModel.cs" />
<Compile Include="UserControlDIY\EventFutur.xaml.cs">
<DependentUpon>EventFutur.xaml</DependentUpon>
</Compile>
<Compile Include="UserControlDIY\EventPasse.xaml.cs">
<DependentUpon>EventPasse.xaml</DependentUpon>
</Compile>
<Compile Include="UserControlDIY\Plat.xaml.cs">
<DependentUpon>Plat.xaml</DependentUpon>
</Compile>
<Compile Include="UserControlDIY\Repa.xaml.cs">
<DependentUpon>Repa.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModel\Base.cs" />
<Compile Include="View\DashBoard.xaml.cs">
<DependentUpon>DashBoard.xaml</DependentUpon>
</Compile>
<Page Include="MainWindow.xaml"> <Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@ -78,6 +132,26 @@
<DependentUpon>MainWindow.xaml</DependentUpon> <DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Page Include="UserControlDIY\EventFutur.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControlDIY\EventPasse.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControlDIY\Plat.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControlDIY\Repa.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\DashBoard.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs"> <Compile Include="Properties\AssemblyInfo.cs">
@ -106,5 +180,11 @@
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
</ItemGroup> </ItemGroup>
<ItemGroup />
<ItemGroup>
<Resource Include="img\desert.jpg" />
<Resource Include="img\entree.jpeg" />
<Resource Include="img\plat.jpg" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>

View File

@ -0,0 +1,24 @@
<UserControl x:Class="ProjetTheAlone.UserControlDIY.EventFutur"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProjetTheAlone.UserControlDIY"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="450"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Grid.Column="2" Style="{StaticResource MaterialDesignTitleTextBlock}" HorizontalAlignment="Center" Height="Auto" Text="Evenement Futur" />
</Grid>
</UserControl>

View File

@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace ProjetTheAlone.UserControlDIY
{
/// <summary>
/// Interaction logic for EventFutur.xaml
/// </summary>
public partial class EventFutur : UserControl
{
public EventFutur()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,38 @@
<UserControl x:Class="ProjetTheAlone.UserControlDIY.EventPasse"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProjetTheAlone.UserControlDIY"
xmlns:models="clr-namespace:ProjetTheAlone.Model"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="450"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}"
Name="wnd2">
<UserControl.Resources>
<DataTemplate DataType="x:Type models:EventPasseModel">
<DockPanel Background="Yellow" />
</DataTemplate>
<local:DebugDummyConverter x:Key="DebugDummyConverter" />
</UserControl.Resources>
<Grid x:Name="GridPrinc">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TextBlock Style="{StaticResource MaterialDesignTitleTextBlock}" HorizontalAlignment="Center" Height="Auto" Text="Evenement Passe" />
<ListBox x:Name="MyListBox" ItemsSource="{Binding Classement}" Grid.Row="1">
<ListBox.ItemTemplate>
<DataTemplate>
<Label Content="{Binding Path=.}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
</UserControl>

View File

@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ProjetTheAlone.Model;
namespace ProjetTheAlone.UserControlDIY
{
/// <summary>
/// Interaction logic for EventPasse.xaml
/// </summary>
public partial class EventPasse : UserControl
{
public static readonly DependencyProperty ClassementProperty = DependencyProperty.Register("Classement", typeof(ObservableCollection<string>), typeof(EventPasse));
public ObservableCollection<string> Classement
{
get
{
var val = GetValue(ClassementProperty) as ObservableCollection<string>;
return val;
}
set
{
SetValue(ClassementProperty, value);
}
}
public EventPasse()
{
InitializeComponent();
GridPrinc.DataContext = this;
}
}
public class DebugDummyConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
Debugger.Break();
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
Debugger.Break();
return value;
}
}
}

View File

@ -0,0 +1,33 @@
<UserControl x:Class="ProjetTheAlone.UserControlDIY.Plat"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProjetTheAlone.UserControlDIY"
xmlns:models="clr-namespace:ProjetTheAlone.Classes"
xmlns:convert="clr-namespace:ProjetTheAlone.Converter"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}">
<UserControl.Resources>
<DataTemplate DataType="x:Type models:Plat">
<DockPanel Background="Yellow" />
</DataTemplate>
<convert:BinaryImageConverter x:Key="imgConverter" />
</UserControl.Resources>
<Grid x:Name="GridPrinc">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock x:Name="FoodDesc" Style="{StaticResource MaterialDesignTitleTextBlock}" HorizontalAlignment="Center" Height="Auto" Text="{Binding PlatV.P_nom}" />
<Image x:Name="FoodPic" Source="{Binding PlatV.P_img, Converter={StaticResource imgConverter}}" Grid.Column="1" Stretch="Uniform"/>
</Grid>
</UserControl>

View File

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ProjetTheAlone.Classes;
namespace ProjetTheAlone.UserControlDIY
{
/// <summary>
/// Interaction logic for Plat.xaml
/// </summary>
public partial class Plat : UserControl
{
public C_T_plat PlatV { get { return this.DataContext as C_T_plat; } }
public Plat()
{
InitializeComponent();
this.DataContextChanged += new DependencyPropertyChangedEventHandler((o, t) => this.UpdateLayout());
GridPrinc.DataContext = this ;
}
}
}

View File

@ -0,0 +1,34 @@
<UserControl x:Class="ProjetTheAlone.UserControlDIY.Repa"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProjetTheAlone.UserControlDIY"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}">
<Grid x:Name="GridPrinc">
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Style="{StaticResource MaterialDesignTitleTextBlock}" HorizontalAlignment="Center" Height="Auto" Text="Date Jour" Grid.ColumnSpan="2"/>
<TextBlock Grid.Row="1" Style="{StaticResource MaterialDesignTitleTextBlock}" HorizontalAlignment="Center" Height="Auto" Text="{Binding ListPlat[0].P_Nom}" />
<TextBlock Grid.Row="2" Style="{StaticResource MaterialDesignTitleTextBlock}" HorizontalAlignment="Center" Height="Auto" Text="Date Jour" />
<TextBlock Grid.Row="3" Style="{StaticResource MaterialDesignTitleTextBlock}" HorizontalAlignment="Center" Height="Auto" Text="Date Jour" />
</Grid>
</UserControl>

View File

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ProjetTheAlone.Classes;
using ProjetTheAlone.Model;
namespace ProjetTheAlone.UserControlDIY
{
/// <summary>
/// Interaction logic for Repa.xaml
/// </summary>
public partial class Repa : UserControl
{
public ObservableCollection<C_T_plat> ListPlat
{
get
{
return this.DataContext as ObservableCollection<C_T_plat>;
}
}
public Repa()
{
InitializeComponent();
}
}
}

View File

@ -0,0 +1,86 @@
<Window x:Class="ProjetTheAlone.View.DashBoard"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProjetTheAlone.View"
xmlns:control="clr-namespace:ProjetTheAlone.UserControlDIY"
xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"
xmlns:classes="clr-namespace:ProjetTheAlone.Classes"
mc:Ignorable="d"
Title="DashBoard" Height="495.378" Width="1014.286" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
TextOptions.TextFormattingMode="Ideal"
TextOptions.TextRenderingMode="Auto"
Background="{DynamicResource MaterialDesignPaper}"
FontFamily="{DynamicResource MaterialDesignFont}"
Name="wnd">
<Window.Resources>
<local:DebugDummyConverter x:Key="DebugDummyConverter" />
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="5*" />
<RowDefinition Height="5*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<DockPanel>
<ItemsControl x:Name="RepasMatin">
<!-- Set the Template for each row to a TextBlock and another ItemsControl -->
<ItemsControl.ItemTemplate>
<DataTemplate DataType="classes:C_T_plat">
<control:Plat ></control:Plat>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<!-- <ListView x:Name="RepasMatin" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ListView.ItemTemplate>
<DataTemplate DataType="classes:C_T_plat">
<control:Plat></control:Plat>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>-->
</DockPanel>
<!---->
<materialDesign:PackIcon Kind="Build" Grid.Column="2" HorizontalAlignment="Right" Cursor="Hand"/>
</Grid>
<Grid Grid.Row="1" >
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<control:EventPasse x:Name="EventPasse1" Classement="{Binding Classement}"></control:EventPasse>
<control:EventPasse x:Name="EventPasse2" Classement="{Binding Classement}" Grid.Column="1"></control:EventPasse>
<control:EventFutur Grid.Column="2"></control:EventFutur>
<control:EventFutur Grid.Column="3"></control:EventFutur>
</Grid>
<Grid Grid.Row="2" Visibility="Visible">
<Border>
<Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="OrangeRed" Offset="0" />
<GradientStop Color="DarkOrange" Offset="1" />
</LinearGradientBrush>
</Border.Background>
</Border>
<TextBlock Grid.Column="1" Style="{StaticResource MaterialDesignTitleTextBlock}" VerticalAlignment="Center" Height="Auto" Text="Absentéisme ou alerte" />
</Grid>
</Grid>
</Window>

View File

@ -0,0 +1,92 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using ProjetTheAlone.Model;
using ProjetTheAlone.Classes;
namespace ProjetTheAlone.View
{
/// <summary>
/// Interaction logic for DashBoard.xaml
/// </summary>
///
public partial class DashBoard : Window
{
ObservableCollection<string> cl = new ObservableCollection<string>();
RepaModel rm = new RepaModel();
public ObservableCollection<string> Cl
{
get
{
if (cl.Count <= 0)
{
cl.Add("1) Minou");
cl.Add("2) Minette");
cl.Add("3) Miaw");
cl.Add("4) Chat");
}
return cl;
}
set
{
cl = value;
}
}
public EventPasseModel Epm { get => epm; set => epm = value; }
internal RepaModel Rm { get => rm; set => rm = value; }
ProjetTheAlone.Model.EventPasseModel epm;
public DashBoard()
{
InitializeComponent();
Epm = new ProjetTheAlone.Model.EventPasseModel(Cl);
EventPasse2.DataContext = EventPasse1.DataContext = Epm;
Epm.Classement = Cl;
FileStream fs = new System.IO.FileStream(@"C:\Users\adrie\Nextcloud\ecole\3IS\POO\ProjetTheAlone\ProjetTheAlone\img\desert.jpg", FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
byte[] result = br.ReadBytes((int)fs.Length);
br.Close();
fs.Close();
Rm.ListPlat.Add(new C_T_plat("Desert", result, null));
Rm.ListPlat.Add(new C_T_plat("Desert", result, null));
Rm.ListPlat.Add(new C_T_plat("Desert", result, null));
Rm.ListPlat.Add(new C_T_plat("Desert", result, null));
Console.WriteLine($"~~~~~~{Rm.ListPlat[0].P_nom}~~~~~~");
RepasMatin.ItemsSource = Rm.ListPlat;
}
}
public class DebugDummyConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
Debugger.Break();
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
Debugger.Break();
return value;
}
}
}

View File

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;
using System.Windows.Input;
namespace ProjetTheAlone.ViewModel
{
public class BasePropriete : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
protected void NotifyPropertyChanged(String propertyName)
{ PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); }
protected bool AssignerChamp<T>(ref T field, T value, string propertyName)
{
if (EqualityComparer<T>.Default.Equals(field, value)) return false;
PropertyChangedEventHandler handler = PropertyChanged;
field = value;
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName.Substring(4)));
//OnPropertyChanged();
return true;
}
}
public class BaseCommande : ICommand
{
private Action _Action;
public BaseCommande(Action Action_)
{ _Action = Action_; }
public event EventHandler CanExecuteChanged;
public bool CanExecute(object parameter)
{ return true; }
public void Execute(object parameter)
{ if (_Action != null) _Action(); }
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
ProjetTheAlone/img/plat.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB