Gestion repa Ok

This commit is contained in:
adri 2019-01-24 22:24:05 +01:00
parent 9e06f31677
commit ceffc1446e
107 changed files with 5340 additions and 621 deletions

View File

@ -2,6 +2,8 @@
<configuration> <configuration>
<configSections> <configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="ProjetTheAlone.Config.Settings2" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="ProjetTheAlone.Config.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="ProjetTheAlone.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="ProjetTheAlone.Settings1" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup> </sectionGroup>
</configSections> </configSections>
@ -9,10 +11,25 @@
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup> </startup>
<userSettings> <userSettings>
<!--<ProjetTheAlone.Config.Settings1>
<setting name="schCon" serializeAs="String">
<value>Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename="C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\3is\poo\ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf";Integrated Security=True</value>
</setting>
</ProjetTheAlone.Config.Settings1>
<ProjetTheAlone.Settings1> <ProjetTheAlone.Settings1>
<setting name="schCon" serializeAs="String"> <setting name="schCon" serializeAs="String">
<value>Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True</value> <value>Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True</value>
</setting> </setting>
</ProjetTheAlone.Settings1> </ProjetTheAlone.Settings1>-->
<ProjetTheAlone.Config.Settings1>
<setting name="schCon" serializeAs="String">
<value>Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename="C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\3is\poo\ProjetTheAlone - Copie (9)\ProjetTheAlone\ProjetThe.mdf";Integrated Security=True</value>
</setting>
</ProjetTheAlone.Config.Settings1>
<ProjetTheAlone.Config.Settings2>
<setting name="schCon" serializeAs="String">
<value>Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename="C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\3is\poo\ProjetTheAlone - Copie (9)\ProjetTheAlone\ProjetThe.mdf";Integrated Security=True</value>
</setting>
</ProjetTheAlone.Config.Settings2>
</userSettings> </userSettings>
</configuration> </configuration>

View File

@ -8,7 +8,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace ProjetTheAlone { namespace ProjetTheAlone.Config {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
@ -25,9 +25,9 @@ namespace ProjetTheAlone {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=\'C:\\Users\\Hugues\\Haute Ecole " + [global::System.Configuration.DefaultSettingValueAttribute("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=\"C:\\Users\\adrie\\OneDrive - Ha" +
"de la ville de Liège\\Adrien VAN DAMME - ProjetTheAlone\\ProjetTheAlone\\ProjetThe." + "ute Ecole de la ville de Liège\\3is\\poo\\ProjetTheAlone - Copie (9)\\ProjetTheAlone" +
"mdf\';Integrated Security = True")] "\\ProjetThe.mdf\";Integrated Security=True")]
public string schCon { public string schCon {
get { get {
return ((string)(this["schCon"])); return ((string)(this["schCon"]));

View File

@ -1,9 +1,9 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="ProjetTheAlone" GeneratedClassName="Settings1"> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="ProjetTheAlone.Config" GeneratedClassName="Settings1">
<Profiles /> <Profiles />
<Settings> <Settings>
<Setting Name="schCon" Type="System.String" Scope="User"> <Setting Name="schCon" Type="System.String" Scope="User">
<Value Profile="(Default)">Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True</Value> <Value Profile="(Default)">Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename="C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\3is\poo\ProjetTheAlone - Copie (9)\ProjetTheAlone\ProjetThe.mdf";Integrated Security=True</Value>
</Setting> </Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -1,23 +1,23 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// Ce code a été généré par un outil. // This code was generated by a tool.
// Version du runtime :4.0.30319.42000 // Runtime Version:4.0.30319.42000
// //
// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si // Changes to this file may cause incorrect behavior and will be lost if
// le code est régénéré. // the code is regenerated.
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace ProjetTheAlone { namespace ProjetTheAlone.Config {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")]
internal sealed partial class Settings1 : global::System.Configuration.ApplicationSettingsBase { internal sealed partial class Settings2 : global::System.Configuration.ApplicationSettingsBase {
private static Settings1 defaultInstance = ((Settings1)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings1()))); private static Settings2 defaultInstance = ((Settings2)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings2())));
public static Settings1 Default { public static Settings2 Default {
get { get {
return defaultInstance; return defaultInstance;
} }
@ -25,9 +25,9 @@ namespace ProjetTheAlone {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=\'C:\\Users\\Hugues\\Haute Ecole " + [global::System.Configuration.DefaultSettingValueAttribute("Data Source=(LocalDB)\\MSSQLLocalDB;AttachDbFilename=\"C:\\Users\\adrie\\OneDrive - Ha" +
"de la ville de Liège\\Adrien VAN DAMME - ProjetTheAlone\\ProjetTheAlone\\ProjetThe." + "ute Ecole de la ville de Liège\\3is\\poo\\ProjetTheAlone - Copie (9)\\ProjetTheAlone" +
"mdf\';Integrated Security = True")] "\\ProjetThe.mdf\";Integrated Security=True")]
public string schCon { public string schCon {
get { get {
return ((string)(this["schCon"])); return ((string)(this["schCon"]));

View File

@ -1,9 +1,9 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="ProjetTheAlone" GeneratedClassName="Settings1"> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="ProjetTheAlone.Config" GeneratedClassName="Settings2">
<Profiles /> <Profiles />
<Settings> <Settings>
<Setting Name="schCon" Type="System.String" Scope="User"> <Setting Name="schCon" Type="System.String" Scope="User">
<Value Profile="(Default)">Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True</Value> <Value Profile="(Default)">Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename="C:\Users\adrie\OneDrive - Haute Ecole de la ville de Liège\3is\poo\ProjetTheAlone - Copie (9)\ProjetTheAlone\ProjetThe.mdf";Integrated Security=True</Value>
</Setting> </Setting>
</Settings> </Settings>
</SettingsFile> </SettingsFile>

View File

@ -16,11 +16,15 @@ namespace ProjetTheAlone.Converter
object parameter, object parameter,
System.Globalization.CultureInfo culture) System.Globalization.CultureInfo culture)
{ {
if (value != null && value is byte[]) if (value != null && value is byte?[])
{ {
byte[] bytes = value as byte[]; byte?[] bytes = value as byte?[];
byte[] bb = Array.ConvertAll<byte?, byte>(bytes,
MemoryStream stream = new MemoryStream(bytes); delegate (byte? b)
{
return b.Value;
});
MemoryStream stream = new MemoryStream(bb);
BitmapImage image = new BitmapImage(); BitmapImage image = new BitmapImage();
image.BeginInit(); image.BeginInit();
@ -38,7 +42,26 @@ namespace ProjetTheAlone.Converter
object parameter, object parameter,
System.Globalization.CultureInfo culture) System.Globalization.CultureInfo culture)
{ {
throw new Exception("The method or operation is not implemented."); if (value != null)
{
byte?[] data;
JpegBitmapEncoder encoder = new JpegBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create((BitmapImage)value));
using (MemoryStream ms = new MemoryStream())
{
encoder.Save(ms);
byte[] bb = ms.ToArray();
data = Array.ConvertAll<byte, byte?>(bb,
delegate (byte b)
{
return b;
});
return data;
}
}
return null;
} }
} }
} }

View File

@ -24,6 +24,8 @@ namespace ProjetTheAlone
{ {
InitializeComponent(); InitializeComponent();
} }
} }
} }

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,113 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using ProjetTheAlone.Classes;
#endregion
namespace ProjetTheAlone.Acces
{
/// <summary>
/// Couche d'accès aux données (Data Access Layer)
/// </summary>
public class A_T_beneficiaire : ADBase
{
#region Constructeurs
public A_T_beneficiaire(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(string B_nom, string B_prenom, DateTime? B_anniversaire, byte?[] B_img)
{
CreerCommande("AjouterT_beneficiaire");
int res = 0;
Commande.Parameters.Add("ID_beneficiaire", SqlDbType.Int);
Direction("ID_beneficiaire", ParameterDirection.Output);
if (B_nom == null) Commande.Parameters.AddWithValue("@B_nom", Convert.DBNull);
else Commande.Parameters.AddWithValue("@B_nom", B_nom);
if (B_prenom == null) Commande.Parameters.AddWithValue("@B_prenom", Convert.DBNull);
else Commande.Parameters.AddWithValue("@B_prenom", B_prenom);
if (B_anniversaire == null) Commande.Parameters.AddWithValue("@B_anniversaire", Convert.DBNull);
else Commande.Parameters.AddWithValue("@B_anniversaire", B_anniversaire);
if (B_img == null) Commande.Parameters.AddWithValue("@B_img", SqlDbType.Image).Value = Convert.DBNull;
else Commande.Parameters.AddWithValue("@B_img", SqlDbType.Image).Value = Outil.toByteArray.Convert(B_img);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
res = int.Parse(LireParametre("ID_beneficiaire"));
Commande.Connection.Close();
return res;
}
public int Modifier(int ID_beneficiaire, string B_nom, string B_prenom, DateTime? B_anniversaire, byte?[] B_img)
{
CreerCommande("ModifierT_beneficiaire");
int res = 0;
Commande.Parameters.AddWithValue("@ID_beneficiaire", ID_beneficiaire);
if (B_nom == null) Commande.Parameters.AddWithValue("@B_nom", Convert.DBNull);
else Commande.Parameters.AddWithValue("@B_nom", B_nom);
if (B_prenom == null) Commande.Parameters.AddWithValue("@B_prenom", Convert.DBNull);
else Commande.Parameters.AddWithValue("@B_prenom", B_prenom);
if (B_anniversaire == null) Commande.Parameters.AddWithValue("@B_anniversaire", Convert.DBNull);
else Commande.Parameters.AddWithValue("@B_anniversaire", B_anniversaire);
if (B_img == null) Commande.Parameters.AddWithValue("@B_img", Convert.DBNull);
else Commande.Parameters.AddWithValue("@B_img", B_img);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
public List<C_T_beneficiaire> Lire(string Index)
{
CreerCommande("SelectionnerT_beneficiaire");
Commande.Parameters.AddWithValue("@Index", Index);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_beneficiaire> res = new List<C_T_beneficiaire>();
while (dr.Read())
{
C_T_beneficiaire tmp = new C_T_beneficiaire();
tmp.ID_beneficiaire = int.Parse(dr["ID_beneficiaire"].ToString());
tmp.B_nom = dr["B_nom"].ToString();
tmp.B_prenom = dr["B_prenom"].ToString();
if (dr["B_anniversaire"] != DBNull.Value) tmp.B_anniversaire = DateTime.Parse(dr["B_anniversaire"].ToString());
if (dr["B_img"] != DBNull.Value) tmp.B_img = Outil.toNullableByteArray.Convert((byte[])dr["B_img"]);
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
public C_T_beneficiaire Lire_ID(int ID_beneficiaire)
{
CreerCommande("SelectionnerT_beneficiaire_ID");
Commande.Parameters.AddWithValue("@ID_beneficiaire", ID_beneficiaire);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
C_T_beneficiaire res = new C_T_beneficiaire();
while (dr.Read())
{
res.ID_beneficiaire = int.Parse(dr["ID_beneficiaire"].ToString());
res.B_nom = dr["B_nom"].ToString();
res.B_prenom = dr["B_prenom"].ToString();
if (dr["B_anniversaire"] != DBNull.Value) res.B_anniversaire = DateTime.Parse(dr["B_anniversaire"].ToString());
if (dr["B_img"] != DBNull.Value) res.B_img = Outil.toNullableByteArray.Convert((byte[])dr["B_img"]);
res.B_img = (byte?[])dr["B_img"];
}
dr.Close();
Commande.Connection.Close();
return res;
}
public int Supprimer(int ID_beneficiaire)
{
CreerCommande("SupprimerT_beneficiaire");
int res = 0;
Commande.Parameters.AddWithValue("@ID_beneficiaire", ID_beneficiaire);
Commande.Connection.Open();
res = Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
}
}

View File

@ -0,0 +1,104 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using ProjetTheAlone.Classes;
#endregion
namespace ProjetTheAlone.Acces
{
/// <summary>
/// Couche d'accès aux données (Data Access Layer)
/// </summary>
public class A_T_equipe : ADBase
{
#region Constructeurs
public A_T_equipe(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(string E_nom, int E_point, int? ID_evenement)
{
CreerCommande("AjouterT_equipe");
int res = 0;
Commande.Parameters.Add("ID_equipe", SqlDbType.Int);
Direction("ID_equipe", ParameterDirection.Output);
if(E_nom == null) Commande.Parameters.AddWithValue("@E_nom", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_nom", E_nom);
Commande.Parameters.AddWithValue("@E_point", E_point);
if(ID_evenement == null) Commande.Parameters.AddWithValue("@ID_evenement", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_evenement", ID_evenement);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
res = int.Parse(LireParametre("ID_equipe"));
Commande.Connection.Close();
return res;
}
public int Modifier(int ID_equipe, string E_nom, int E_point, int? ID_evenement)
{
CreerCommande("ModifierT_equipe");
int res = 0;
Commande.Parameters.AddWithValue("@ID_equipe", ID_equipe);
if(E_nom == null) Commande.Parameters.AddWithValue("@E_nom", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_nom", E_nom);
Commande.Parameters.AddWithValue("@E_point", E_point);
if(ID_evenement == null) Commande.Parameters.AddWithValue("@ID_evenement", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_evenement", ID_evenement);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
public List<C_T_equipe> Lire(string Index)
{
CreerCommande("SelectionnerT_equipe");
Commande.Parameters.AddWithValue("@Index", Index);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_equipe> res = new List<C_T_equipe>();
while (dr.Read())
{
C_T_equipe tmp = new C_T_equipe();
tmp.ID_equipe = int.Parse(dr["ID_equipe"].ToString());
tmp.E_nom = dr["E_nom"].ToString();
tmp.E_point = int.Parse(dr["E_point"].ToString());
if(dr["ID_evenement"] != DBNull.Value) tmp.ID_evenement = int.Parse(dr["ID_evenement"].ToString());
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
public C_T_equipe Lire_ID(int ID_equipe)
{
CreerCommande("SelectionnerT_equipe_ID");
Commande.Parameters.AddWithValue("@ID_equipe", ID_equipe);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
C_T_equipe res = new C_T_equipe();
while (dr.Read())
{
res.ID_equipe = int.Parse(dr["ID_equipe"].ToString());
res.E_nom = dr["E_nom"].ToString();
res.E_point = int.Parse(dr["E_point"].ToString());
if(dr["ID_evenement"] != DBNull.Value) res.ID_evenement = int.Parse(dr["ID_evenement"].ToString());
}
dr.Close();
Commande.Connection.Close();
return res;
}
public int Supprimer(int ID_equipe)
{
CreerCommande("SupprimerT_equipe");
int res = 0;
Commande.Parameters.AddWithValue("@ID_equipe", ID_equipe);
Commande.Connection.Open();
res = Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
}
}

View File

@ -0,0 +1,122 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using ProjetTheAlone.Classes;
#endregion
namespace ProjetTheAlone.Acces
{
/// <summary>
/// Couche d'accès aux données (Data Access Layer)
/// </summary>
public class A_T_event : ADBase
{
#region Constructeurs
public A_T_event(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement,string E_description, int? ID_lieu, Byte?[] E_Pic)
{
CreerCommande("AjouterT_event");
int res = 0;
Commande.Parameters.Add("ID_event", SqlDbType.Int);
Direction("ID_event", ParameterDirection.Output);
if(E_date == null) Commande.Parameters.AddWithValue("@E_date", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_date", E_date);
if(E_duree == null) Commande.Parameters.AddWithValue("@E_duree", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_duree", E_duree);
if(ID_typeEvenement == null) Commande.Parameters.AddWithValue("@ID_typeEvenement", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_typeEvenement", ID_typeEvenement);
if(E_description == null) Commande.Parameters.AddWithValue("@E_description", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_description", E_description);
if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
Commande.Parameters.AddWithValue("@E_Pic", E_Pic ?? Convert.DBNull);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
res = int.Parse(LireParametre("ID_event"));
Commande.Connection.Close();
return res;
}
public int Modifier(int ID_event, DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement, string E_description, int? ID_lieu, Byte?[] E_Pic)
{
CreerCommande("ModifierT_event");
int res = 0;
Commande.Parameters.AddWithValue("@ID_event", ID_event);
if(E_date == null) Commande.Parameters.AddWithValue("@E_date", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_date", E_date);
if(E_duree == null) Commande.Parameters.AddWithValue("@E_duree", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_duree", E_duree);
if(ID_typeEvenement == null) Commande.Parameters.AddWithValue("@ID_typeEvenement", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_typeEvenement", ID_typeEvenement);
if(E_description == null) Commande.Parameters.AddWithValue("@E_description", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_description", E_description);
if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
Commande.Parameters.AddWithValue("@E_Pic", E_Pic ?? Convert.DBNull);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
public List<C_T_event> Lire(string Index)
{
CreerCommande("SelectionnerT_event");
Commande.Parameters.AddWithValue("@Index", Index);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_event> res = new List<C_T_event>();
while (dr.Read())
{
C_T_event tmp = new C_T_event();
tmp.ID_event = int.Parse(dr["ID_event"].ToString());
if(dr["E_date"] != DBNull.Value) tmp.E_date = DateTime.Parse(dr["E_date"].ToString());
if(dr["E_duree"] != DBNull.Value) tmp.E_duree = DateTime.Parse(dr["E_duree"].ToString());
if(dr["ID_typeEvenement"] != DBNull.Value) tmp.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].ToString());
if(dr["E_description"] != DBNull.Value) tmp.E_description = (dr["E_description"].ToString());
if(dr["ID_lieu"] != DBNull.Value) tmp.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
if (dr["E_Pic"] != DBNull.Value) tmp.E_Pic = (byte?[])dr["E_Pic"];
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
public C_T_event Lire_ID(int ID_event)
{
CreerCommande("SelectionnerT_event_ID");
Commande.Parameters.AddWithValue("@ID_event", ID_event);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
C_T_event res = new C_T_event();
while (dr.Read())
{
res.ID_event = int.Parse(dr["ID_event"].ToString());
if(dr["E_date"] != DBNull.Value) res.E_date = DateTime.Parse(dr["E_date"].ToString());
if(dr["E_duree"] != DBNull.Value) res.E_duree = DateTime.Parse(dr["E_duree"].ToString());
if(dr["ID_typeEvenement"] != DBNull.Value) res.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].ToString());
if(dr["E_description"] != DBNull.Value) res.E_description = (dr["E_description"].ToString());
if(dr["ID_lieu"] != DBNull.Value) res.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
if (dr["E_Pic"] != DBNull.Value) res.E_Pic = (byte?[])dr["E_Pic"];
}
dr.Close();
Commande.Connection.Close();
return res;
}
public int Supprimer(int ID_event)
{
CreerCommande("SupprimerT_event");
int res = 0;
Commande.Parameters.AddWithValue("@ID_event", ID_event);
Commande.Connection.Open();
res = Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
}
}

View File

@ -0,0 +1,122 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using ProjetTheAlone.Classes;
#endregion
namespace ProjetTheAlone.Acces
{
/// <summary>
/// Couche d'accès aux données (Data Access Layer)
/// </summary>
public class A_T_event : ADBase
{
#region Constructeurs
public A_T_event(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement,string E_description, int? ID_lieu, Byte?[] E_Pic)
{
CreerCommande("AjouterT_event");
int res = 0;
Commande.Parameters.Add("ID_event", SqlDbType.Int);
Direction("ID_event", ParameterDirection.Output);
if(E_date == null) Commande.Parameters.AddWithValue("@E_date", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_date", E_date);
if(E_duree == null) Commande.Parameters.AddWithValue("@E_duree", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_duree", E_duree);
if(ID_typeEvenement == null) Commande.Parameters.AddWithValue("@ID_typeEvenement", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_typeEvenement", ID_typeEvenement);
if(E_description == null) Commande.Parameters.AddWithValue("@E_description", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_description", E_description);
if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
Commande.Parameters.AddWithValue("@E_Pic", SqlDbType.Image).Value = (E_Pic==null ?Convert.DBNull:Outil.toByteArray.Convert(E_Pic));
Commande.Connection.Open();
Commande.ExecuteNonQuery();
res = int.Parse(LireParametre("ID_event"));
Commande.Connection.Close();
return res;
}
public int Modifier(int ID_event, DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement, string E_description, int? ID_lieu, Byte?[] E_Pic)
{
CreerCommande("ModifierT_event");
int res = 0;
Commande.Parameters.AddWithValue("@ID_event", ID_event);
if(E_date == null) Commande.Parameters.AddWithValue("@E_date", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_date", E_date);
if(E_duree == null) Commande.Parameters.AddWithValue("@E_duree", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_duree", E_duree);
if(ID_typeEvenement == null) Commande.Parameters.AddWithValue("@ID_typeEvenement", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_typeEvenement", ID_typeEvenement);
if(E_description == null) Commande.Parameters.AddWithValue("@E_description", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_description", E_description);
if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
Commande.Parameters.AddWithValue("@E_Pic", SqlDbType.Image).Value = (E_Pic == null ? Convert.DBNull : Outil.toByteArray.Convert(E_Pic));
Commande.Connection.Open();
Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
public List<C_T_event> Lire(string Index)
{
CreerCommande("SelectionnerT_event");
Commande.Parameters.AddWithValue("@Index", Index);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_event> res = new List<C_T_event>();
while (dr.Read())
{
C_T_event tmp = new C_T_event();
tmp.ID_event = int.Parse(dr["ID_event"].ToString());
if(dr["E_date"] != DBNull.Value) tmp.E_date = DateTime.Parse(dr["E_date"].ToString());
if(dr["E_duree"] != DBNull.Value) tmp.E_duree = DateTime.Parse(dr["E_duree"].ToString());
if(dr["ID_typeEvenement"] != DBNull.Value) tmp.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].ToString());
if(dr["E_description"] != DBNull.Value) tmp.E_description = (dr["E_description"].ToString());
if(dr["ID_lieu"] != DBNull.Value) tmp.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
if (dr["E_Pic"] != DBNull.Value) tmp.E_Pic = Outil.toNullableByteArray.Convert((byte[])dr["E_Pic"]);
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
public C_T_event Lire_ID(int ID_event)
{
CreerCommande("SelectionnerT_event_ID");
Commande.Parameters.AddWithValue("@ID_event", ID_event);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
C_T_event res = new C_T_event();
while (dr.Read())
{
res.ID_event = int.Parse(dr["ID_event"].ToString());
if(dr["E_date"] != DBNull.Value) res.E_date = DateTime.Parse(dr["E_date"].ToString());
if(dr["E_duree"] != DBNull.Value) res.E_duree = DateTime.Parse(dr["E_duree"].ToString());
if(dr["ID_typeEvenement"] != DBNull.Value) res.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].ToString());
if(dr["E_description"] != DBNull.Value) res.E_description = (dr["E_description"].ToString());
if(dr["ID_lieu"] != DBNull.Value) res.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
if (dr["E_Pic"] != DBNull.Value) res.E_Pic = Outil.toNullableByteArray.Convert((byte[])dr["E_Pic"]);
}
dr.Close();
Commande.Connection.Close();
return res;
}
public int Supprimer(int ID_event)
{
CreerCommande("SupprimerT_event");
int res = 0;
Commande.Parameters.AddWithValue("@ID_event", ID_event);
Commande.Connection.Open();
res = Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
}
}

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,117 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using ProjetTheAlone.Classes;
#endregion
namespace ProjetTheAlone.Acces
{
/// <summary>
/// Couche d'accès aux données (Data Access Layer)
/// </summary>
public class A_T_listPlat : ADBase
{
#region Constructeurs
public A_T_listPlat(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(DateTime LP_DatePlat, int ID_plat)
{
CreerCommande("AjouterT_listPlat");
int res = 0;
Commande.Parameters.Add("ID_listPlat", SqlDbType.Int);
Direction("ID_listPlat", ParameterDirection.Output);
Commande.Parameters.AddWithValue("@LP_DatePlat", LP_DatePlat);
Commande.Parameters.AddWithValue("@ID_plat", ID_plat);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
res = int.Parse(LireParametre("ID_listPlat"));
Commande.Connection.Close();
return res;
}
public int Modifier(int ID_listPlat, DateTime LP_DatePlat, int ID_plat)
{
CreerCommande("ModifierT_listPlat");
int res = 0;
Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat);
Commande.Parameters.AddWithValue("@LP_DatePlat", LP_DatePlat);
Commande.Parameters.AddWithValue("@ID_plat", ID_plat);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
public List<C_T_listPlat> Lire(string Index)
{
CreerCommande("SelectionnerT_listPlat");
Commande.Parameters.AddWithValue("@Index", Index);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_listPlat> res = new List<C_T_listPlat>();
while (dr.Read())
{
C_T_listPlat tmp = new C_T_listPlat();
tmp.ID_listPlat = int.Parse(dr["ID_listPlat"].ToString());
tmp.ID_repa = int.Parse(dr["ID_repa"].ToString());
tmp.ID_plat = int.Parse(dr["ID_plat"].ToString());
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
public C_T_listPlat Lire_ID(int ID_listPlat)
{
CreerCommande("SelectionnerT_listPlat_ID");
Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
C_T_listPlat res = new C_T_listPlat();
while (dr.Read())
{
res.ID_listPlat = int.Parse(dr["ID_listPlat"].ToString());
res.ID_repa = int.Parse(dr["ID_repa"].ToString());
res.ID_plat = int.Parse(dr["ID_plat"].ToString());
}
dr.Close();
Commande.Connection.Close();
return res;
}
public List<C_T_plat> Lire(DateTime LP_DateRepas)
{
CreerCommande("SelectRepaByDate");
Commande.Parameters.AddWithValue("@dateV", LP_DateRepas);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_plat> res = new List<C_T_plat>();
while (dr.Read())
{
C_T_plat tmp = new C_T_plat();
tmp.ID_plat = int.Parse(dr["ID_plat"].ToString());
if (dr["P_nom"] != DBNull.Value) tmp.P_nom = (dr["P_nom"].ToString());
if (dr["P_img"] != DBNull.Value) tmp.P_img = Outil.toNullableByteArray.Convert((byte[])dr["P_img"]);
var x = dr["ID_typePlat"];
if (dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = (C_T_plat.TypePlat_E)(int.Parse(dr["ID_typePlat"].ToString()));
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
public int Supprimer(int ID_listPlat)
{
CreerCommande("SupprimerT_listPlat");
int res = 0;
Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat);
Commande.Connection.Open();
res = Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
}
}

View File

@ -0,0 +1,131 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using ProjetTheAlone.Classes;
#endregion
namespace ProjetTheAlone.Acces
{
/// <summary>
/// Couche d'accès aux données (Data Access Layer)
/// </summary>
public class A_T_plat : ADBase
{
public enum TypePlat_E { soupe, plat, dessert}
#region Constructeurs
public A_T_plat(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(string P_nom, byte?[] P_img, int? ID_typePlat)
{
CreerCommande("AjouterT_plat");
int res = 0;
Commande.Parameters.Add("ID_plat", SqlDbType.Int);
Direction("ID_plat", ParameterDirection.Output);
if(P_nom == null) Commande.Parameters.AddWithValue("@P_nom", Convert.DBNull);
else Commande.Parameters.AddWithValue("@P_nom", P_nom);
if(P_img == null) Commande.Parameters.AddWithValue("@P_img", Convert.DBNull);
else Commande.Parameters.AddWithValue("@P_img", SqlDbType.Image).Value = Outil.toByteArray.Convert(P_img);
if(ID_typePlat == null) Commande.Parameters.AddWithValue("@ID_typePlat", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_typePlat", ID_typePlat);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
res = int.Parse(LireParametre("ID_plat"));
Commande.Connection.Close();
return res;
}
public int Modifier(int ID_plat, string P_nom, byte?[] P_img, int? ID_typePlat)
{
CreerCommande("ModifierT_plat");
int res = 0;
Commande.Parameters.AddWithValue("@ID_plat", ID_plat);
if(P_nom == null) Commande.Parameters.AddWithValue("@P_nom", Convert.DBNull);
else Commande.Parameters.AddWithValue("@P_nom", P_nom);
if(P_img == null) Commande.Parameters.AddWithValue("@P_img", Convert.DBNull);
else Commande.Parameters.AddWithValue("@P_img", SqlDbType.Image).Value = Outil.toByteArray.Convert(P_img);
if (ID_typePlat == null) Commande.Parameters.AddWithValue("@ID_typePlat", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_typePlat", ID_typePlat);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
public List<C_T_plat> Lire(string Index)
{
CreerCommande("SelectionnerT_plat");
Commande.Parameters.AddWithValue("@Index", Index);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_plat> res = new List<C_T_plat>();
while (dr.Read())
{
C_T_plat tmp = new C_T_plat();
tmp.ID_plat = int.Parse(dr["ID_plat"].ToString());
if(dr["P_nom"] != DBNull.Value) tmp.P_nom = (dr["P_nom"].ToString());
if(dr["P_img"] != DBNull.Value) tmp.P_img = Outil.toNullableByteArray.Convert((byte[])dr["P_img"]);
var x = dr["ID_typePlat"];
if (dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = (C_T_plat.TypePlat_E)(int.Parse(dr["ID_typePlat"].ToString()));
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
/// <summary>
/// Permet de récupérer la liste des plats d'un repas
/// </summary>
public List<C_T_plat> ListPlat(int ID_repa)
{
CreerCommande("ListPlat");
Commande.Parameters.AddWithValue("@ID_repa", ID_repa);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_plat> res = new List<C_T_plat>();
while (dr.Read())
{
C_T_plat tmp = new C_T_plat();
tmp.ID_plat = int.Parse(dr["ID_plat"].ToString());
if (dr["P_nom"] != DBNull.Value) tmp.P_nom = (dr["P_nom"].ToString());
if (dr["P_img"] != DBNull.Value) tmp.P_img = (byte?[])(dr["P_img"]);
if (dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = (C_T_plat.TypePlat_E)int.Parse(dr["ID_typePlat"].ToString());
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
public C_T_plat Lire_ID(int ID_plat)
{
CreerCommande("SelectionnerT_plat_ID");
Commande.Parameters.AddWithValue("@ID_plat", ID_plat);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
C_T_plat res = new C_T_plat();
while (dr.Read())
{
res.ID_plat = int.Parse(dr["ID_plat"].ToString());
if(dr["P_nom"] != DBNull.Value) res.P_nom = (dr["P_nom"].ToString());
if(dr["P_img"] != DBNull.Value) res.P_img = Outil.toNullableByteArray.Convert((byte[])dr["P_img"]);
if(dr["ID_typePlat"] != DBNull.Value) res.ID_typePlat = (C_T_plat.TypePlat_E)int.Parse(dr["ID_typePlat"].ToString());
}
dr.Close();
Commande.Connection.Close();
return res;
}
public int Supprimer(int ID_plat)
{
CreerCommande("SupprimerT_plat");
int res = 0;
Commande.Parameters.AddWithValue("@ID_plat", ID_plat);
Commande.Connection.Open();
res = Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
}
}

View File

@ -0,0 +1,157 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using ProjetTheAlone.Classes;
#endregion
namespace ProjetTheAlone.Acces
{
/// <summary>
/// Couche d'accès aux données (Data Access Layer)
/// </summary>
public class A_T_repa : ADBase
{
#region Constructeurs
public A_T_repa(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(int? ID_listPlat, int? ID_typeRepa, DateTime R_Date)
{
CreerCommande("AjouterT_repa");
int res = 0;
Commande.Parameters.Add("ID_repa", SqlDbType.Int);
Direction("ID_repa", ParameterDirection.Output);
if(ID_listPlat == null) Commande.Parameters.AddWithValue("@ID_listPlat", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat);
if(ID_typeRepa == null) Commande.Parameters.AddWithValue("@ID_typeRepa", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_typeRepa", ID_typeRepa);
Commande.Parameters.AddWithValue("@R_Date", R_Date);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
res = int.Parse(LireParametre("ID_repa"));
Commande.Connection.Close();
return res;
}
public int Modifier(int ID_repa, int? ID_listPlat, int? ID_typeRepa , DateTime R_Date)
{
CreerCommande("ModifierT_repa");
int res = 0;
Commande.Parameters.AddWithValue("@ID_repa", ID_repa);
if(ID_listPlat == null) Commande.Parameters.AddWithValue("@ID_listPlat", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat);
if(ID_typeRepa == null) Commande.Parameters.AddWithValue("@ID_typeRepa", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_typeRepa", ID_typeRepa);
Commande.Parameters.AddWithValue("@R_Date", R_Date);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
public List<C_T_repa> Lire(string Index)
{
CreerCommande("SelectionnerT_repa");
Commande.Parameters.AddWithValue("@Index", Index);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_repa> res = new List<C_T_repa>();
while (dr.Read())
{
C_T_repa tmp = new C_T_repa();
tmp.ID_repa = int.Parse(dr["ID_repa"].ToString());
tmp.R_Date = DateTime.Parse(dr["R_Date"].ToString());
if(dr["ID_listPlat"] != DBNull.Value) tmp.ID_listPlat = int.Parse(dr["ID_listPlat"].ToString());
if(dr["ID_typeRepa"] != DBNull.Value) tmp.ID_typeRepa = int.Parse(dr["ID_typeRepa"].ToString());
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
/// <summary>
/// Permet de récupérer les repas entre deux date
/// </summary>
/// <param name="start">Date filtre debut compris</param>
/// <param name="end">Date fin non compris</param>
public List<C_T_repa> Lire(DateTime start, DateTime end)
{
CreerCommande("SelectEventBetweenTwoDateTime");
Commande.Parameters.AddWithValue("@dateStart", start);
Commande.Parameters.AddWithValue("@dateEnd", end);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_repa> res = new List<C_T_repa>();
while (dr.Read())
{
C_T_repa tmp = new C_T_repa();
tmp.ID_repa = int.Parse(dr["ID_repa"].ToString());
tmp.R_Date = DateTime.Parse(dr["R_Date"].ToString());
if (dr["ID_listPlat"] != DBNull.Value) tmp.ID_listPlat = int.Parse(dr["ID_listPlat"].ToString());
if (dr["ID_typeRepa"] != DBNull.Value) tmp.ID_typeRepa = int.Parse(dr["ID_typeRepa"].ToString());
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
/// <summary>
/// Permet de récupérer les repas d'une date donnée
/// </summary>
/// <param name="dateV">Date filtre</param>
public List<C_T_repa> Lire(DateTime dateV)
{
CreerCommande("SelectEventBetweenTwoDateTime");
Commande.Parameters.AddWithValue("@dateV", dateV);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_repa> res = new List<C_T_repa>();
while (dr.Read())
{
C_T_repa tmp = new C_T_repa();
tmp.ID_repa = int.Parse(dr["ID_repa"].ToString());
tmp.R_Date = DateTime.Parse(dr["R_Date"].ToString());
if (dr["ID_listPlat"] != DBNull.Value) tmp.ID_listPlat = int.Parse(dr["ID_listPlat"].ToString());
if (dr["ID_typeRepa"] != DBNull.Value) tmp.ID_typeRepa = int.Parse(dr["ID_typeRepa"].ToString());
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
public C_T_repa Lire_ID(int ID_repa)
{
CreerCommande("SelectionnerT_repa_ID");
Commande.Parameters.AddWithValue("@ID_repa", ID_repa);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
C_T_repa res = new C_T_repa();
while (dr.Read())
{
res.R_Date = DateTime.Parse(dr["R_Date"].ToString());
res.ID_repa = int.Parse(dr["ID_repa"].ToString());
if(dr["ID_listPlat"] != DBNull.Value) res.ID_listPlat = int.Parse(dr["ID_listPlat"].ToString());
if(dr["ID_typeRepa"] != DBNull.Value) res.ID_typeRepa = int.Parse(dr["ID_typeRepa"].ToString());
}
dr.Close();
Commande.Connection.Close();
return res;
}
public int Supprimer(int ID_repa)
{
CreerCommande("SupprimerT_repa");
int res = 0;
Commande.Parameters.AddWithValue("@ID_repa", ID_repa);
Commande.Connection.Open();
res = Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
}
}

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 byte?[] _B_img;
#endregion
#region Constructeurs
public C_T_beneficiaire()
{ }
public C_T_beneficiaire(string B_nom_, string B_prenom_, DateTime? B_anniversaire_, byte?[] B_img_)
{
B_nom = B_nom_;
B_prenom = B_prenom_;
B_anniversaire = B_anniversaire_;
B_img = B_img_;
}
public C_T_beneficiaire(int ID_beneficiaire_, string B_nom_, string B_prenom_, DateTime? B_anniversaire_, byte?[] B_img_)
: this(B_nom_, B_prenom_, B_anniversaire_, B_img_)
{
ID_beneficiaire = ID_beneficiaire_;
}
#endregion
#region Accesseurs
public int ID_beneficiaire
{
get { return _ID_beneficiaire; }
set { _ID_beneficiaire = value; }
}
public string B_nom
{
get { return _B_nom; }
set { _B_nom = value; }
}
public string B_prenom
{
get { return _B_prenom; }
set { _B_prenom = value; }
}
public DateTime? B_anniversaire
{
get { return _B_anniversaire; }
set { _B_anniversaire = value; }
}
public byte?[] B_img
{
get { return _B_img; }
set { _B_img = value; }
}
#endregion
}
}

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 int _E_point;
private int? _ID_evenement;
#endregion
#region Constructeurs
public C_T_equipe()
{ }
public C_T_equipe(string E_nom_, int E_point_, int? ID_evenement_)
{
E_nom = E_nom_;
E_point = E_point_;
ID_evenement = ID_evenement_;
}
public C_T_equipe(int ID_equipe_, string E_nom_, int E_point_, int? ID_evenement_)
: this(E_nom_, E_point_, ID_evenement_)
{
ID_equipe = ID_equipe_;
}
#endregion
#region Accesseurs
public int ID_equipe
{
get { return _ID_equipe; }
set { _ID_equipe = value; }
}
public string E_nom
{
get { return _E_nom; }
set { _E_nom = value; }
}
public int E_point
{
get { return _E_point; }
set { _E_point = value; }
}
public int? ID_evenement
{
get { return _ID_evenement; }
set { _ID_evenement = value; }
}
#endregion
}
}

View File

@ -0,0 +1,70 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
#endregion
namespace ProjetTheAlone.Classes
{
/// <summary>
/// Classe de définition des données
/// </summary>
public class C_T_event
{
#region Données membres
private int _ID_event;
private DateTime? _E_date;
private DateTime? _E_duree;
private int? _ID_typeEvenement;
private string _E_description;
private int? _ID_lieu;
private byte?[] _E_Pic;
#endregion
#region Constructeurs
public C_T_event()
{ }
public C_T_event(DateTime? E_date_, DateTime? E_duree_, int? ID_typeEvenement_, string E_description_, int? ID_lieu_, byte?[] E_Pic_)
{
E_date = E_date_;
E_duree = E_duree_;
ID_typeEvenement = ID_typeEvenement_;
E_description = E_description_;
ID_lieu = ID_lieu_;
E_Pic = E_Pic_;
}
public C_T_event(int ID_event_, DateTime? E_date_, DateTime? E_duree_, int? ID_typeEvenement_, string E_description_, int? ID_lieu_, byte?[] E_Pic_)
: this(E_date_, E_duree_, ID_typeEvenement_, E_description_, ID_lieu_, E_Pic_)
{
ID_event = ID_event_;
}
#endregion
#region Accesseurs
public int ID_event
{
get { return _ID_event; }
set { _ID_event = value; }
}
public DateTime? E_date
{
get { return _E_date; }
set { _E_date = value; }
}
public DateTime? E_duree
{
get { return _E_duree; }
set { _E_duree = value; }
}
public int? ID_typeEvenement
{
get { return _ID_typeEvenement; }
set { _ID_typeEvenement = value; }
}
public string E_description { get => _E_description; set => _E_description = value; }
public int? ID_lieu { get => _ID_lieu; set => _ID_lieu = value; }
public byte?[] E_Pic { get => _E_Pic; set => _E_Pic = value; }
#endregion
}
}

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,59 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
#endregion
namespace ProjetTheAlone.Classes
{
/// <summary>
/// Classe de définition des données
/// </summary>
public class C_T_plat
{
public enum TypePlat_E { Soupe, Plat, Dessert}
#region Données membres
private int _ID_plat;
private string _P_nom;
private byte?[] _P_img;
private TypePlat_E _ID_typePlat;
#endregion
#region Constructeurs
public C_T_plat()
{ }
public C_T_plat(string P_nom_, byte?[] P_img_, int? ID_typePlat_)
{
P_nom = P_nom_;
P_img = P_img_;
ID_typePlat = (C_T_plat.TypePlat_E)ID_typePlat_;
}
public C_T_plat(int ID_plat_, string P_nom_, byte?[] P_img_, int? ID_typePlat_)
: this(P_nom_, P_img_, ID_typePlat_)
{
ID_plat = ID_plat_;
}
#endregion
#region Accesseurs
public int ID_plat
{
get { return _ID_plat; }
set { _ID_plat = value; }
}
public string P_nom
{
get { return _P_nom; }
set { _P_nom = value; }
}
public byte?[] P_img
{
get { return _P_img; }
set { _P_img = value; }
}
public TypePlat_E ID_typePlat
{
get { return _ID_typePlat; }
set { _ID_typePlat = value; }
}
#endregion
}
}

View File

@ -0,0 +1,56 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
#endregion
namespace ProjetTheAlone.Classes
{
/// <summary>
/// Classe de définition des données
/// </summary>
public class C_T_repa
{
#region Données membres
private int _ID_repa;
private int? _ID_listPlat;
private int? _ID_typeRepa;
private DateTime _R_Date;
#endregion
#region Constructeurs
public C_T_repa()
{ }
public C_T_repa(int? ID_listPlat_, int? ID_typeRepa_, DateTime R_Date_)
{
ID_listPlat = ID_listPlat_;
ID_typeRepa = ID_typeRepa_;
R_Date = R_Date_;
}
public C_T_repa(int ID_repa_, int? ID_listPlat_, int? ID_typeRepa_, DateTime R_Date_)
: this(ID_listPlat_, ID_typeRepa_, R_Date_)
{
ID_repa = ID_repa_;
}
#endregion
#region Accesseurs
public int ID_repa
{
get { return _ID_repa; }
set { _ID_repa = value; }
}
public int? ID_listPlat
{
get { return _ID_listPlat; }
set { _ID_listPlat = value; }
}
public int? ID_typeRepa
{
get { return _ID_typeRepa; }
set { _ID_typeRepa = value; }
}
public DateTime R_Date { get => _R_Date; set => _R_Date = value; }
#endregion
}
}

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,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, byte?[] B_img)
{ return new A_T_beneficiaire(ChaineConnexion).Ajouter(B_nom, B_prenom, B_anniversaire, B_img); }
public int Modifier(int ID_beneficiaire, string B_nom, string B_prenom, DateTime? B_anniversaire, byte?[] B_img)
{ return new A_T_beneficiaire(ChaineConnexion).Modifier(ID_beneficiaire, B_nom, B_prenom, B_anniversaire, B_img); }
public List<C_T_beneficiaire> Lire(string Index)
{ return new A_T_beneficiaire(ChaineConnexion).Lire(Index); }
public C_T_beneficiaire Lire_ID(int ID_beneficiaire)
{ return new A_T_beneficiaire(ChaineConnexion).Lire_ID(ID_beneficiaire); }
public int Supprimer(int ID_beneficiaire)
{ return new A_T_beneficiaire(ChaineConnexion).Supprimer(ID_beneficiaire); }
}
}

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, int E_point, int? ID_evenement)
{ return new A_T_equipe(ChaineConnexion).Ajouter(E_nom, E_point, ID_evenement); }
public int Modifier(int ID_equipe, string E_nom, int E_point, int? ID_evenement)
{ return new A_T_equipe(ChaineConnexion).Modifier(ID_equipe, E_nom, E_point, ID_evenement); }
public List<C_T_equipe> Lire(string Index)
{ return new A_T_equipe(ChaineConnexion).Lire(Index); }
public C_T_equipe Lire_ID(int ID_equipe)
{ return new A_T_equipe(ChaineConnexion).Lire_ID(ID_equipe); }
public int Supprimer(int ID_equipe)
{ return new A_T_equipe(ChaineConnexion).Supprimer(ID_equipe); }
}
}

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, byte?[] E_Pic_)
{ return new A_T_event(ChaineConnexion).Ajouter(E_date, E_duree, ID_typeEvenement,E_description, ID_lieu, E_Pic_); }
public int Modifier(int ID_event, DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement, string E_description, int? ID_lieu, byte?[] E_Pic_)
{ return new A_T_event(ChaineConnexion).Modifier(ID_event, E_date, E_duree, ID_typeEvenement, E_description, ID_lieu, E_Pic_); }
public List<C_T_event> Lire(string Index)
{ return new A_T_event(ChaineConnexion).Lire(Index); }
public C_T_event Lire_ID(int ID_event)
{ return new A_T_event(ChaineConnexion).Lire_ID(ID_event); }
public int Supprimer(int ID_event)
{ return new A_T_event(ChaineConnexion).Supprimer(ID_event); }
}
}

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,38 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
using ProjetTheAlone.Classes;
using ProjetTheAlone.Acces;
#endregion
namespace ProjetTheAlone.Gestion
{
/// <summary>
/// Couche intermédiaire de gestion (Business Layer)
/// </summary>
public class G_T_listPlat : G_Base
{
#region Constructeurs
public G_T_listPlat()
: base()
{ }
public G_T_listPlat(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(DateTime LP_DatePlat, int ID_plat)
{ return new A_T_listPlat(ChaineConnexion).Ajouter(LP_DatePlat, ID_plat); }
public int Modifier(int ID_listPlat, DateTime LP_DatePlat, int ID_plat)
{ return new A_T_listPlat(ChaineConnexion).Modifier(ID_listPlat, LP_DatePlat, ID_plat); }
public List<C_T_listPlat> Lire(string Index)
{ return new A_T_listPlat(ChaineConnexion).Lire(Index); } //C_T_listPlat Lire(DateTime LP_DateRepas)
public List<C_T_plat> Lire(DateTime dateV)
{ return new A_T_listPlat(ChaineConnexion).Lire(dateV); } //C_T_listPlat Lire(DateTime LP_DateRepas)
public C_T_listPlat Lire_ID(int ID_listPlat)
{ return new A_T_listPlat(ChaineConnexion).Lire_ID(ID_listPlat); }
public int Supprimer(int ID_listPlat)
{ return new A_T_listPlat(ChaineConnexion).Supprimer(ID_listPlat); }
}
}

View File

@ -0,0 +1,40 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
using ProjetTheAlone.Classes;
using ProjetTheAlone.Acces;
#endregion
namespace ProjetTheAlone.Gestion
{
/// <summary>
/// Couche intermédiaire de gestion (Business Layer)
/// </summary>
public class G_T_plat : G_Base
{
#region Constructeurs
public G_T_plat()
: base()
{ }
public G_T_plat(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(string P_nom, byte?[] P_img, int? ID_typePlat)
{ return new A_T_plat(ChaineConnexion).Ajouter(P_nom, P_img, ID_typePlat); }
public int Modifier(int ID_plat, string P_nom, byte?[] P_img, int? ID_typePlat)
{ return new A_T_plat(ChaineConnexion).Modifier(ID_plat, P_nom, P_img, ID_typePlat); }
public List<C_T_plat> Lire(string Index)
{ return new A_T_plat(ChaineConnexion).Lire(Index); }
public C_T_plat Lire_ID(int ID_plat)
{ return new A_T_plat(ChaineConnexion).Lire_ID(ID_plat); }
/// <summary>
/// Permet de récupérer la liste des plats d'un repas
/// </summary>
public List<C_T_plat> ListPlat(int ID_repa)
{ return new A_T_plat(ChaineConnexion).ListPlat(ID_repa); }
public int Supprimer(int ID_plat)
{ return new A_T_plat(ChaineConnexion).Supprimer(ID_plat); }
}
}

View File

@ -0,0 +1,48 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
using ProjetTheAlone.Classes;
using ProjetTheAlone.Acces;
#endregion
namespace ProjetTheAlone.Gestion
{
/// <summary>
/// Couche intermédiaire de gestion (Business Layer)
/// </summary>
public class G_T_repa : G_Base
{
#region Constructeurs
public G_T_repa()
: base()
{ }
public G_T_repa(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(int? ID_listPlat, int? ID_typeRepa, DateTime R_Date)
{ return new A_T_repa(ChaineConnexion).Ajouter(ID_listPlat, ID_typeRepa , R_Date); }
public int Modifier(int ID_repa, int? ID_listPlat, int? ID_typeRepa, DateTime R_Date)
{ return new A_T_repa(ChaineConnexion).Modifier(ID_repa, ID_listPlat, ID_typeRepa , R_Date); }
public List<C_T_repa> Lire(string Index)
{ return new A_T_repa(ChaineConnexion).Lire(Index); }
/// <summary>
/// Permet de récupérer les repas entre deux date
/// </summary>
/// <param name="start">Date filtre debut compris</param>
/// <param name="end">Date fin non compris</param>
public List<C_T_repa> Lire(DateTime start, DateTime end)
{ return new A_T_repa(ChaineConnexion).Lire(start, end); }
/// <summary>
/// Permet de récupérer les repas d'une date donnée
/// </summary>
/// <param name="dateV">Date filtre</param>
public List<C_T_repa> Lire(DateTime dateV)
{ return new A_T_repa(ChaineConnexion).Lire(dateV); }
public C_T_repa Lire_ID(int ID_repa)
{ return new A_T_repa(ChaineConnexion).Lire_ID(ID_repa); }
public int Supprimer(int ID_repa)
{ return new A_T_repa(ChaineConnexion).Supprimer(ID_repa); }
}
}

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

@ -32,8 +32,8 @@ namespace ProjetTheAlone.Acces
else Commande.Parameters.AddWithValue("@B_prenom", B_prenom); else Commande.Parameters.AddWithValue("@B_prenom", B_prenom);
if (B_anniversaire == null) Commande.Parameters.AddWithValue("@B_anniversaire", Convert.DBNull); if (B_anniversaire == null) Commande.Parameters.AddWithValue("@B_anniversaire", Convert.DBNull);
else Commande.Parameters.AddWithValue("@B_anniversaire", B_anniversaire); else Commande.Parameters.AddWithValue("@B_anniversaire", B_anniversaire);
if(B_img == null) Commande.Parameters.AddWithValue("@B_img", Convert.DBNull); if (B_img == null) Commande.Parameters.AddWithValue("@B_img", SqlDbType.Image).Value = Convert.DBNull;
else Commande.Parameters.AddWithValue("@B_img", B_img); else Commande.Parameters.AddWithValue("@B_img", SqlDbType.Image).Value = Outil.toByteArray.Convert(B_img);
Commande.Connection.Open(); Commande.Connection.Open();
Commande.ExecuteNonQuery(); Commande.ExecuteNonQuery();
res = int.Parse(LireParametre("ID_beneficiaire")); res = int.Parse(LireParametre("ID_beneficiaire"));
@ -72,7 +72,7 @@ namespace ProjetTheAlone.Acces
tmp.B_nom = dr["B_nom"].ToString(); tmp.B_nom = dr["B_nom"].ToString();
tmp.B_prenom = dr["B_prenom"].ToString(); tmp.B_prenom = dr["B_prenom"].ToString();
if (dr["B_anniversaire"] != DBNull.Value) tmp.B_anniversaire = DateTime.Parse(dr["B_anniversaire"].ToString()); if (dr["B_anniversaire"] != DBNull.Value) tmp.B_anniversaire = DateTime.Parse(dr["B_anniversaire"].ToString());
tmp.B_img = dr["B_img"]; if (dr["B_img"] != DBNull.Value) tmp.B_img = Outil.toNullableByteArray.Convert((byte[])dr["B_img"]);
res.Add(tmp); res.Add(tmp);
} }
dr.Close(); dr.Close();
@ -92,6 +92,7 @@ namespace ProjetTheAlone.Acces
res.B_nom = dr["B_nom"].ToString(); res.B_nom = dr["B_nom"].ToString();
res.B_prenom = dr["B_prenom"].ToString(); res.B_prenom = dr["B_prenom"].ToString();
if (dr["B_anniversaire"] != DBNull.Value) res.B_anniversaire = DateTime.Parse(dr["B_anniversaire"].ToString()); if (dr["B_anniversaire"] != DBNull.Value) res.B_anniversaire = DateTime.Parse(dr["B_anniversaire"].ToString());
if (dr["B_img"] != DBNull.Value) res.B_img = Outil.toNullableByteArray.Convert((byte[])dr["B_img"]);
res.B_img = (byte?[])dr["B_img"]; res.B_img = (byte?[])dr["B_img"];
} }
dr.Close(); dr.Close();

View File

@ -20,7 +20,7 @@ namespace ProjetTheAlone.Acces
: base(sChaineConnexion) : base(sChaineConnexion)
{ } { }
#endregion #endregion
public int Ajouter(string E_nom, string E_point, int? ID_evenement) public int Ajouter(string E_nom, int E_point, int? ID_evenement)
{ {
CreerCommande("AjouterT_equipe"); CreerCommande("AjouterT_equipe");
int res = 0; int res = 0;
@ -28,8 +28,7 @@ namespace ProjetTheAlone.Acces
Direction("ID_equipe", ParameterDirection.Output); Direction("ID_equipe", ParameterDirection.Output);
if(E_nom == null) Commande.Parameters.AddWithValue("@E_nom", Convert.DBNull); if(E_nom == null) Commande.Parameters.AddWithValue("@E_nom", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_nom", E_nom); else Commande.Parameters.AddWithValue("@E_nom", E_nom);
if(E_point == null) Commande.Parameters.AddWithValue("@E_point", Convert.DBNull); Commande.Parameters.AddWithValue("@E_point", E_point);
else Commande.Parameters.AddWithValue("@E_point", E_point);
if(ID_evenement == null) Commande.Parameters.AddWithValue("@ID_evenement", Convert.DBNull); if(ID_evenement == null) Commande.Parameters.AddWithValue("@ID_evenement", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_evenement", ID_evenement); else Commande.Parameters.AddWithValue("@ID_evenement", ID_evenement);
Commande.Connection.Open(); Commande.Connection.Open();
@ -38,15 +37,14 @@ namespace ProjetTheAlone.Acces
Commande.Connection.Close(); Commande.Connection.Close();
return res; return res;
} }
public int Modifier(int ID_equipe, string E_nom, string E_point, int? ID_evenement) public int Modifier(int ID_equipe, string E_nom, int E_point, int? ID_evenement)
{ {
CreerCommande("ModifierT_equipe"); CreerCommande("ModifierT_equipe");
int res = 0; int res = 0;
Commande.Parameters.AddWithValue("@ID_equipe", ID_equipe); Commande.Parameters.AddWithValue("@ID_equipe", ID_equipe);
if(E_nom == null) Commande.Parameters.AddWithValue("@E_nom", Convert.DBNull); if(E_nom == null) Commande.Parameters.AddWithValue("@E_nom", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_nom", E_nom); else Commande.Parameters.AddWithValue("@E_nom", E_nom);
if(E_point == null) Commande.Parameters.AddWithValue("@E_point", Convert.DBNull); Commande.Parameters.AddWithValue("@E_point", E_point);
else Commande.Parameters.AddWithValue("@E_point", E_point);
if(ID_evenement == null) Commande.Parameters.AddWithValue("@ID_evenement", Convert.DBNull); if(ID_evenement == null) Commande.Parameters.AddWithValue("@ID_evenement", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_evenement", ID_evenement); else Commande.Parameters.AddWithValue("@ID_evenement", ID_evenement);
Commande.Connection.Open(); Commande.Connection.Open();
@ -66,7 +64,7 @@ namespace ProjetTheAlone.Acces
C_T_equipe tmp = new C_T_equipe(); C_T_equipe tmp = new C_T_equipe();
tmp.ID_equipe = int.Parse(dr["ID_equipe"].ToString()); tmp.ID_equipe = int.Parse(dr["ID_equipe"].ToString());
tmp.E_nom = dr["E_nom"].ToString(); tmp.E_nom = dr["E_nom"].ToString();
tmp.E_point = dr["E_point"].ToString(); tmp.E_point = int.Parse(dr["E_point"].ToString());
if(dr["ID_evenement"] != DBNull.Value) tmp.ID_evenement = int.Parse(dr["ID_evenement"].ToString()); if(dr["ID_evenement"] != DBNull.Value) tmp.ID_evenement = int.Parse(dr["ID_evenement"].ToString());
res.Add(tmp); res.Add(tmp);
} }
@ -85,7 +83,7 @@ namespace ProjetTheAlone.Acces
{ {
res.ID_equipe = int.Parse(dr["ID_equipe"].ToString()); res.ID_equipe = int.Parse(dr["ID_equipe"].ToString());
res.E_nom = dr["E_nom"].ToString(); res.E_nom = dr["E_nom"].ToString();
res.E_point = dr["E_point"].ToString(); res.E_point = int.Parse(dr["E_point"].ToString());
if(dr["ID_evenement"] != DBNull.Value) res.ID_evenement = int.Parse(dr["ID_evenement"].ToString()); if(dr["ID_evenement"] != DBNull.Value) res.ID_evenement = int.Parse(dr["ID_evenement"].ToString());
} }
dr.Close(); dr.Close();

View File

@ -0,0 +1,122 @@
#region Ressources extérieures
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using ProjetTheAlone.Classes;
#endregion
namespace ProjetTheAlone.Acces
{
/// <summary>
/// Couche d'accès aux données (Data Access Layer)
/// </summary>
public class A_T_event : ADBase
{
#region Constructeurs
public A_T_event(string sChaineConnexion)
: base(sChaineConnexion)
{ }
#endregion
public int Ajouter(DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement,string E_description, int? ID_lieu, Byte?[] E_Pic)
{
CreerCommande("AjouterT_event");
int res = 0;
Commande.Parameters.Add("ID_event", SqlDbType.Int);
Direction("ID_event", ParameterDirection.Output);
if(E_date == null) Commande.Parameters.AddWithValue("@E_date", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_date", E_date);
if(E_duree == null) Commande.Parameters.AddWithValue("@E_duree", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_duree", E_duree);
if(ID_typeEvenement == null) Commande.Parameters.AddWithValue("@ID_typeEvenement", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_typeEvenement", ID_typeEvenement);
if(E_description == null) Commande.Parameters.AddWithValue("@E_description", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_description", E_description);
if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
Commande.Parameters.AddWithValue("@E_Pic", E_Pic ?? Convert.DBNull);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
res = int.Parse(LireParametre("ID_event"));
Commande.Connection.Close();
return res;
}
public int Modifier(int ID_event, DateTime? E_date, DateTime? E_duree, int? ID_typeEvenement, string E_description, int? ID_lieu, Byte?[] E_Pic)
{
CreerCommande("ModifierT_event");
int res = 0;
Commande.Parameters.AddWithValue("@ID_event", ID_event);
if(E_date == null) Commande.Parameters.AddWithValue("@E_date", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_date", E_date);
if(E_duree == null) Commande.Parameters.AddWithValue("@E_duree", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_duree", E_duree);
if(ID_typeEvenement == null) Commande.Parameters.AddWithValue("@ID_typeEvenement", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_typeEvenement", ID_typeEvenement);
if(E_description == null) Commande.Parameters.AddWithValue("@E_description", Convert.DBNull);
else Commande.Parameters.AddWithValue("@E_description", E_description);
if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
Commande.Parameters.AddWithValue("@E_Pic", E_Pic ?? Convert.DBNull);
Commande.Connection.Open();
Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
public List<C_T_event> Lire(string Index)
{
CreerCommande("SelectionnerT_event");
Commande.Parameters.AddWithValue("@Index", Index);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_event> res = new List<C_T_event>();
while (dr.Read())
{
C_T_event tmp = new C_T_event();
tmp.ID_event = int.Parse(dr["ID_event"].ToString());
if(dr["E_date"] != DBNull.Value) tmp.E_date = DateTime.Parse(dr["E_date"].ToString());
if(dr["E_duree"] != DBNull.Value) tmp.E_duree = DateTime.Parse(dr["E_duree"].ToString());
if(dr["ID_typeEvenement"] != DBNull.Value) tmp.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].ToString());
if(dr["E_description"] != DBNull.Value) tmp.E_description = (dr["E_description"].ToString());
if(dr["ID_lieu"] != DBNull.Value) tmp.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
if (dr["E_Pic"] != DBNull.Value) tmp.E_Pic = (byte?[])dr["E_Pic"];
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
public C_T_event Lire_ID(int ID_event)
{
CreerCommande("SelectionnerT_event_ID");
Commande.Parameters.AddWithValue("@ID_event", ID_event);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
C_T_event res = new C_T_event();
while (dr.Read())
{
res.ID_event = int.Parse(dr["ID_event"].ToString());
if(dr["E_date"] != DBNull.Value) res.E_date = DateTime.Parse(dr["E_date"].ToString());
if(dr["E_duree"] != DBNull.Value) res.E_duree = DateTime.Parse(dr["E_duree"].ToString());
if(dr["ID_typeEvenement"] != DBNull.Value) res.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].ToString());
if(dr["E_description"] != DBNull.Value) res.E_description = (dr["E_description"].ToString());
if(dr["ID_lieu"] != DBNull.Value) res.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
if (dr["E_Pic"] != DBNull.Value) res.E_Pic = (byte?[])dr["E_Pic"];
}
dr.Close();
Commande.Connection.Close();
return res;
}
public int Supprimer(int ID_event)
{
CreerCommande("SupprimerT_event");
int res = 0;
Commande.Parameters.AddWithValue("@ID_event", ID_event);
Commande.Connection.Open();
res = Commande.ExecuteNonQuery();
Commande.Connection.Close();
return res;
}
}
}

View File

@ -36,7 +36,8 @@ namespace ProjetTheAlone.Acces
else Commande.Parameters.AddWithValue("@E_description", E_description); else Commande.Parameters.AddWithValue("@E_description", E_description);
if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull); if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu); else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
Commande.Parameters.AddWithValue("@E_Pic", E_Pic ?? Convert.DBNull); if (E_Pic != null) Commande.Parameters.AddWithValue("@E_Pic", SqlDbType.Image).Value = Outil.toByteArray.Convert(E_Pic);
else Commande.Parameters.AddWithValue("@E_Pic", SqlDbType.Image).Value = new byte[] {0};
Commande.Connection.Open(); Commande.Connection.Open();
Commande.ExecuteNonQuery(); Commande.ExecuteNonQuery();
res = int.Parse(LireParametre("ID_event")); res = int.Parse(LireParametre("ID_event"));
@ -58,7 +59,8 @@ namespace ProjetTheAlone.Acces
else Commande.Parameters.AddWithValue("@E_description", E_description); else Commande.Parameters.AddWithValue("@E_description", E_description);
if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull); if(ID_lieu == null) Commande.Parameters.AddWithValue("@ID_lieu", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu); else Commande.Parameters.AddWithValue("@ID_lieu", ID_lieu);
Commande.Parameters.AddWithValue("@E_Pic", E_Pic ?? Convert.DBNull); if (E_Pic != null) Commande.Parameters.AddWithValue("@E_Pic", SqlDbType.Image).Value = Outil.toByteArray.Convert(E_Pic);
else Commande.Parameters.AddWithValue("@E_Pic", SqlDbType.Image).Value = new byte[] { 0 };
Commande.Connection.Open(); Commande.Connection.Open();
Commande.ExecuteNonQuery(); Commande.ExecuteNonQuery();
Commande.Connection.Close(); Commande.Connection.Close();
@ -80,7 +82,7 @@ namespace ProjetTheAlone.Acces
if(dr["ID_typeEvenement"] != DBNull.Value) tmp.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].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["E_description"] != DBNull.Value) tmp.E_description = (dr["E_description"].ToString());
if(dr["ID_lieu"] != DBNull.Value) tmp.ID_lieu = int.Parse(dr["ID_lieu"].ToString()); if(dr["ID_lieu"] != DBNull.Value) tmp.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
if (dr["E_Pic"] != DBNull.Value) tmp.E_Pic = (byte?[])dr["E_Pic"]; if (dr["E_Pic"] != DBNull.Value) tmp.E_Pic = Outil.toNullableByteArray.Convert((byte[])dr["E_Pic"]);
res.Add(tmp); res.Add(tmp);
} }
dr.Close(); dr.Close();
@ -102,7 +104,7 @@ namespace ProjetTheAlone.Acces
if(dr["ID_typeEvenement"] != DBNull.Value) res.ID_typeEvenement = int.Parse(dr["ID_typeEvenement"].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["E_description"] != DBNull.Value) res.E_description = (dr["E_description"].ToString());
if(dr["ID_lieu"] != DBNull.Value) res.ID_lieu = int.Parse(dr["ID_lieu"].ToString()); if(dr["ID_lieu"] != DBNull.Value) res.ID_lieu = int.Parse(dr["ID_lieu"].ToString());
if (dr["E_Pic"] != DBNull.Value) res.E_Pic = (byte?[])dr["E_Pic"]; if (dr["E_Pic"] != DBNull.Value) res.E_Pic = Outil.toNullableByteArray.Convert((byte[])dr["E_Pic"]);
} }
dr.Close(); dr.Close();
Commande.Connection.Close(); Commande.Connection.Close();

View File

@ -69,6 +69,27 @@ namespace ProjetTheAlone.Acces
Commande.Connection.Close(); Commande.Connection.Close();
return res; return res;
} }
public List<C_T_beneficiaire> Lire(int ID_Equipe)
{
CreerCommande("ListParticipantEquipe");
Commande.Parameters.AddWithValue("@ID_equipe", ID_Equipe);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_beneficiaire> res = new List<C_T_beneficiaire>();
while (dr.Read())
{
C_T_beneficiaire tmp = new C_T_beneficiaire();
tmp.ID_beneficiaire = int.Parse(dr["ID_beneficiaire"].ToString());
tmp.B_nom = dr["B_nom"].ToString();
tmp.B_prenom = dr["B_prenom"].ToString();
if (dr["B_anniversaire"] != DBNull.Value) tmp.B_anniversaire = DateTime.Parse(dr["B_anniversaire"].ToString());
if (dr["B_img"] != DBNull.Value) tmp.B_img = Outil.toNullableByteArray.Convert((byte[])dr["B_img"]);
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
public C_T_listParticipant Lire_ID(int ID_LP) public C_T_listParticipant Lire_ID(int ID_LP)
{ {
CreerCommande("SelectionnerT_listParticipant_ID"); CreerCommande("SelectionnerT_listParticipant_ID");

View File

@ -20,13 +20,13 @@ namespace ProjetTheAlone.Acces
: base(sChaineConnexion) : base(sChaineConnexion)
{ } { }
#endregion #endregion
public int Ajouter(int ID_repa, int ID_plat) public int Ajouter(DateTime LP_DatePlat, int ID_plat)
{ {
CreerCommande("AjouterT_listPlat"); CreerCommande("AjouterT_listPlat");
int res = 0; int res = 0;
Commande.Parameters.Add("ID_listPlat", SqlDbType.Int); Commande.Parameters.Add("ID_listPlat", SqlDbType.Int);
Direction("ID_listPlat", ParameterDirection.Output); Direction("ID_listPlat", ParameterDirection.Output);
Commande.Parameters.AddWithValue("@ID_repa", ID_repa); Commande.Parameters.AddWithValue("@LP_DatePlat", LP_DatePlat);
Commande.Parameters.AddWithValue("@ID_plat", ID_plat); Commande.Parameters.AddWithValue("@ID_plat", ID_plat);
Commande.Connection.Open(); Commande.Connection.Open();
Commande.ExecuteNonQuery(); Commande.ExecuteNonQuery();
@ -34,12 +34,12 @@ namespace ProjetTheAlone.Acces
Commande.Connection.Close(); Commande.Connection.Close();
return res; return res;
} }
public int Modifier(int ID_listPlat, int ID_repa, int ID_plat) public int Modifier(int ID_listPlat, DateTime LP_DatePlat, int ID_plat)
{ {
CreerCommande("ModifierT_listPlat"); CreerCommande("ModifierT_listPlat");
int res = 0; int res = 0;
Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat); Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat);
Commande.Parameters.AddWithValue("@ID_repa", ID_repa); Commande.Parameters.AddWithValue("@LP_DatePlat", LP_DatePlat);
Commande.Parameters.AddWithValue("@ID_plat", ID_plat); Commande.Parameters.AddWithValue("@ID_plat", ID_plat);
Commande.Connection.Open(); Commande.Connection.Open();
Commande.ExecuteNonQuery(); Commande.ExecuteNonQuery();
@ -82,11 +82,33 @@ namespace ProjetTheAlone.Acces
Commande.Connection.Close(); Commande.Connection.Close();
return res; return res;
} }
public int Supprimer(int ID_listPlat) public List<C_T_plat> Lire(DateTime LP_DateRepas)
{
CreerCommande("SelectListPlatByDate");
Commande.Parameters.AddWithValue("@dateV", LP_DateRepas);
Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader();
List<C_T_plat> res = new List<C_T_plat>();
while (dr.Read())
{
C_T_plat tmp = new C_T_plat();
tmp.ID_plat = int.Parse(dr["ID_plat"].ToString());
if (dr["P_nom"] != DBNull.Value) tmp.P_nom = (dr["P_nom"].ToString());
if (dr["P_img"] != DBNull.Value) tmp.P_img = Outil.toNullableByteArray.Convert((byte[])dr["P_img"]);
var x = dr["ID_typePlat"];
if (dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = (C_T_plat.TypePlat_E)(int.Parse(dr["ID_typePlat"].ToString()));
res.Add(tmp);
}
dr.Close();
Commande.Connection.Close();
return res;
}
public int Supprimer(int ID_Plat, DateTime dateV)
{ {
CreerCommande("SupprimerT_listPlat"); CreerCommande("SupprimerT_listPlat");
int res = 0; int res = 0;
Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat); Commande.Parameters.AddWithValue("@ID_Plat", ID_Plat);
Commande.Parameters.AddWithValue("@dateV", SqlDbType.DateTime).Value = dateV;
Commande.Connection.Open(); Commande.Connection.Open();
res = Commande.ExecuteNonQuery(); res = Commande.ExecuteNonQuery();
Commande.Connection.Close(); Commande.Connection.Close();

View File

@ -15,12 +15,13 @@ namespace ProjetTheAlone.Acces
/// </summary> /// </summary>
public class A_T_plat : ADBase public class A_T_plat : ADBase
{ {
public enum TypePlat_E { soupe, plat, dessert}
#region Constructeurs #region Constructeurs
public A_T_plat(string sChaineConnexion) public A_T_plat(string sChaineConnexion)
: base(sChaineConnexion) : base(sChaineConnexion)
{ } { }
#endregion #endregion
public int Ajouter(string P_nom, byte[] P_img, int? ID_typePlat) public int Ajouter(string P_nom, byte?[] P_img, int? ID_typePlat)
{ {
CreerCommande("AjouterT_plat"); CreerCommande("AjouterT_plat");
int res = 0; int res = 0;
@ -29,7 +30,7 @@ namespace ProjetTheAlone.Acces
if(P_nom == null) Commande.Parameters.AddWithValue("@P_nom", Convert.DBNull); if(P_nom == null) Commande.Parameters.AddWithValue("@P_nom", Convert.DBNull);
else Commande.Parameters.AddWithValue("@P_nom", P_nom); else Commande.Parameters.AddWithValue("@P_nom", P_nom);
if(P_img == null) Commande.Parameters.AddWithValue("@P_img", Convert.DBNull); if(P_img == null) Commande.Parameters.AddWithValue("@P_img", Convert.DBNull);
else Commande.Parameters.AddWithValue("@P_img", P_img); else Commande.Parameters.AddWithValue("@P_img", SqlDbType.Image).Value = Outil.toByteArray.Convert(P_img);
if(ID_typePlat == null) Commande.Parameters.AddWithValue("@ID_typePlat", Convert.DBNull); if(ID_typePlat == null) Commande.Parameters.AddWithValue("@ID_typePlat", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_typePlat", ID_typePlat); else Commande.Parameters.AddWithValue("@ID_typePlat", ID_typePlat);
Commande.Connection.Open(); Commande.Connection.Open();
@ -38,7 +39,7 @@ namespace ProjetTheAlone.Acces
Commande.Connection.Close(); Commande.Connection.Close();
return res; return res;
} }
public int Modifier(int ID_plat, string P_nom, byte[] P_img, int? ID_typePlat) public int Modifier(int ID_plat, string P_nom, byte?[] P_img, int? ID_typePlat)
{ {
CreerCommande("ModifierT_plat"); CreerCommande("ModifierT_plat");
int res = 0; int res = 0;
@ -46,7 +47,7 @@ namespace ProjetTheAlone.Acces
if(P_nom == null) Commande.Parameters.AddWithValue("@P_nom", Convert.DBNull); if(P_nom == null) Commande.Parameters.AddWithValue("@P_nom", Convert.DBNull);
else Commande.Parameters.AddWithValue("@P_nom", P_nom); else Commande.Parameters.AddWithValue("@P_nom", P_nom);
if(P_img == null) Commande.Parameters.AddWithValue("@P_img", Convert.DBNull); if(P_img == null) Commande.Parameters.AddWithValue("@P_img", Convert.DBNull);
else Commande.Parameters.AddWithValue("@P_img", P_img); else Commande.Parameters.AddWithValue("@P_img", SqlDbType.Image).Value = Outil.toByteArray.Convert(P_img);
if (ID_typePlat == null) Commande.Parameters.AddWithValue("@ID_typePlat", Convert.DBNull); if (ID_typePlat == null) Commande.Parameters.AddWithValue("@ID_typePlat", Convert.DBNull);
else Commande.Parameters.AddWithValue("@ID_typePlat", ID_typePlat); else Commande.Parameters.AddWithValue("@ID_typePlat", ID_typePlat);
Commande.Connection.Open(); Commande.Connection.Open();
@ -66,8 +67,9 @@ namespace ProjetTheAlone.Acces
C_T_plat tmp = new C_T_plat(); C_T_plat tmp = new C_T_plat();
tmp.ID_plat = int.Parse(dr["ID_plat"].ToString()); 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_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["P_img"] != DBNull.Value) tmp.P_img = Outil.toNullableByteArray.Convert((byte[])dr["P_img"]);
if(dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = int.Parse(dr["ID_typePlat"].ToString()); var x = dr["ID_typePlat"];
if (dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = (C_T_plat.TypePlat_E)(int.Parse(dr["ID_typePlat"].ToString()));
res.Add(tmp); res.Add(tmp);
} }
dr.Close(); dr.Close();
@ -77,10 +79,10 @@ namespace ProjetTheAlone.Acces
/// <summary> /// <summary>
/// Permet de récupérer la liste des plats d'un repas /// Permet de récupérer la liste des plats d'un repas
/// </summary> /// </summary>
public List<C_T_plat> ListPlat(int ID_listPlat) public List<C_T_plat> ListPlat(int ID_repa)
{ {
CreerCommande("ListPlat"); CreerCommande("ListPlat");
Commande.Parameters.AddWithValue("@ID_listPlat", ID_listPlat); Commande.Parameters.AddWithValue("@ID_repa", ID_repa);
Commande.Connection.Open(); Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader(); SqlDataReader dr = Commande.ExecuteReader();
List<C_T_plat> res = new List<C_T_plat>(); List<C_T_plat> res = new List<C_T_plat>();
@ -89,8 +91,8 @@ namespace ProjetTheAlone.Acces
C_T_plat tmp = new C_T_plat(); C_T_plat tmp = new C_T_plat();
tmp.ID_plat = int.Parse(dr["ID_plat"].ToString()); 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_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["P_img"] != DBNull.Value) tmp.P_img = (byte?[])(dr["P_img"]);
if (dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = int.Parse(dr["ID_typePlat"].ToString()); if (dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = (C_T_plat.TypePlat_E)int.Parse(dr["ID_typePlat"].ToString());
res.Add(tmp); res.Add(tmp);
} }
dr.Close(); dr.Close();
@ -108,8 +110,8 @@ namespace ProjetTheAlone.Acces
{ {
res.ID_plat = int.Parse(dr["ID_plat"].ToString()); 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_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["P_img"] != DBNull.Value) res.P_img = Outil.toNullableByteArray.Convert((byte[])dr["P_img"]);
if(dr["ID_typePlat"] != DBNull.Value) res.ID_typePlat = int.Parse(dr["ID_typePlat"].ToString()); if(dr["ID_typePlat"] != DBNull.Value) res.ID_typePlat = (C_T_plat.TypePlat_E)int.Parse(dr["ID_typePlat"].ToString());
} }
dr.Close(); dr.Close();
Commande.Connection.Close(); Commande.Connection.Close();

View File

@ -105,20 +105,21 @@ namespace ProjetTheAlone.Acces
/// </summary> /// </summary>
/// <param name="dateV">Date filtre</param> /// <param name="dateV">Date filtre</param>
public List<C_T_repa> Lire(DateTime dateV) public List<C_T_plat> Lire(DateTime dateV)
{ {
CreerCommande("SelectEventBetweenTwoDateTime"); CreerCommande("SelectListPlatByDate");
Commande.Parameters.AddWithValue("@dateV", dateV); Commande.Parameters.AddWithValue("@dateV", dateV);
Commande.Connection.Open(); Commande.Connection.Open();
SqlDataReader dr = Commande.ExecuteReader(); SqlDataReader dr = Commande.ExecuteReader();
List<C_T_repa> res = new List<C_T_repa>(); List<C_T_plat> res = new List<C_T_plat>();
while (dr.Read()) while (dr.Read())
{ {
C_T_repa tmp = new C_T_repa(); C_T_plat tmp = new C_T_plat();
tmp.ID_repa = int.Parse(dr["ID_repa"].ToString()); tmp.ID_plat = int.Parse(dr["ID_plat"].ToString());
tmp.R_Date = DateTime.Parse(dr["R_Date"].ToString()); if (dr["P_nom"] != DBNull.Value) tmp.P_nom = (dr["P_nom"].ToString());
if (dr["ID_listPlat"] != DBNull.Value) tmp.ID_listPlat = int.Parse(dr["ID_listPlat"].ToString()); if (dr["P_img"] != DBNull.Value) tmp.P_img = Outil.toNullableByteArray.Convert((byte[])dr["P_img"]);
if (dr["ID_typeRepa"] != DBNull.Value) tmp.ID_typeRepa = int.Parse(dr["ID_typeRepa"].ToString()); var x = dr["ID_typePlat"];
if (dr["ID_typePlat"] != DBNull.Value) tmp.ID_typePlat = (C_T_plat.TypePlat_E)(int.Parse(dr["ID_typePlat"].ToString()));
res.Add(tmp); res.Add(tmp);
} }
dr.Close(); dr.Close();

View File

@ -14,19 +14,19 @@ namespace ProjetTheAlone.Classes
#region Données membres #region Données membres
private int _ID_equipe; private int _ID_equipe;
private string _E_nom; private string _E_nom;
private string _E_point; private int _E_point;
private int? _ID_evenement; private int? _ID_evenement;
#endregion #endregion
#region Constructeurs #region Constructeurs
public C_T_equipe() public C_T_equipe()
{ } { }
public C_T_equipe(string E_nom_, string E_point_, int? ID_evenement_) public C_T_equipe(string E_nom_, int E_point_, int? ID_evenement_)
{ {
E_nom = E_nom_; E_nom = E_nom_;
E_point = E_point_; E_point = E_point_;
ID_evenement = ID_evenement_; ID_evenement = ID_evenement_;
} }
public C_T_equipe(int ID_equipe_, string E_nom_, string E_point_, int? ID_evenement_) public C_T_equipe(int ID_equipe_, string E_nom_, int E_point_, int? ID_evenement_)
: this(E_nom_, E_point_, ID_evenement_) : this(E_nom_, E_point_, ID_evenement_)
{ {
ID_equipe = ID_equipe_; ID_equipe = ID_equipe_;
@ -43,7 +43,7 @@ namespace ProjetTheAlone.Classes
get { return _E_nom; } get { return _E_nom; }
set { _E_nom = value; } set { _E_nom = value; }
} }
public string E_point public int E_point
{ {
get { return _E_point; } get { return _E_point; }
set { _E_point = value; } set { _E_point = value; }

View File

@ -11,22 +11,23 @@ namespace ProjetTheAlone.Classes
/// </summary> /// </summary>
public class C_T_plat public class C_T_plat
{ {
public enum TypePlat_E { Soupe, Plat, Dessert}
#region Données membres #region Données membres
private int _ID_plat; private int _ID_plat;
private string _P_nom; private string _P_nom;
private byte[] _P_img; private byte?[] _P_img;
private int? _ID_typePlat; private TypePlat_E _ID_typePlat;
#endregion #endregion
#region Constructeurs #region Constructeurs
public C_T_plat() public C_T_plat()
{ } { }
public C_T_plat(string P_nom_, byte[] P_img_, int? ID_typePlat_) public C_T_plat(string P_nom_, byte?[] P_img_, int? ID_typePlat_)
{ {
P_nom = P_nom_; P_nom = P_nom_;
P_img = P_img_; P_img = P_img_;
ID_typePlat = ID_typePlat_; ID_typePlat = (C_T_plat.TypePlat_E)(ID_typePlat_==null?0:ID_typePlat_.Value);
} }
public C_T_plat(int ID_plat_, string P_nom_, byte[] P_img_, int? 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_) : this(P_nom_, P_img_, ID_typePlat_)
{ {
ID_plat = ID_plat_; ID_plat = ID_plat_;
@ -43,12 +44,12 @@ namespace ProjetTheAlone.Classes
get { return _P_nom; } get { return _P_nom; }
set { _P_nom = value; } set { _P_nom = value; }
} }
public byte[] P_img public byte?[] P_img
{ {
get { return _P_img; } get { return _P_img; }
set { _P_img = value; } set { _P_img = value; }
} }
public int? ID_typePlat public TypePlat_E ID_typePlat
{ {
get { return _ID_typePlat; } get { return _ID_typePlat; }
set { _ID_typePlat = value; } set { _ID_typePlat = value; }

View File

@ -21,9 +21,9 @@ namespace ProjetTheAlone.Gestion
: base(sChaineConnexion) : base(sChaineConnexion)
{ } { }
#endregion #endregion
public int Ajouter(string E_nom, string E_point, int? ID_evenement) public int Ajouter(string E_nom, int E_point, int? ID_evenement)
{ return new A_T_equipe(ChaineConnexion).Ajouter(E_nom, E_point, ID_evenement); } { 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) public int Modifier(int ID_equipe, string E_nom, int E_point, int? ID_evenement)
{ return new A_T_equipe(ChaineConnexion).Modifier(ID_equipe, E_nom, E_point, ID_evenement); } { return new A_T_equipe(ChaineConnexion).Modifier(ID_equipe, E_nom, E_point, ID_evenement); }
public List<C_T_equipe> Lire(string Index) public List<C_T_equipe> Lire(string Index)
{ return new A_T_equipe(ChaineConnexion).Lire(Index); } { return new A_T_equipe(ChaineConnexion).Lire(Index); }

View File

@ -25,8 +25,10 @@ namespace ProjetTheAlone.Gestion
{ return new A_T_listParticipant(ChaineConnexion).Ajouter(ID_equipe, 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) 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); } { return new A_T_listParticipant(ChaineConnexion).Modifier(ID_LP, ID_equipe, ID_benificiaire); }
public List<C_T_listParticipant> Lire(string Index) public List<C_T_listParticipant> Lire(string Index) //List<C_T_beneficiaire> Lire(string ID_Equipe)
{ return new A_T_listParticipant(ChaineConnexion).Lire(Index); } { return new A_T_listParticipant(ChaineConnexion).Lire(Index); }
public List<C_T_beneficiaire> Lire(int ID_Equipe) //List<C_T_beneficiaire> Lire(string ID_Equipe)
{ return new A_T_listParticipant(ChaineConnexion).Lire(ID_Equipe); }
public C_T_listParticipant Lire_ID(int ID_LP) public C_T_listParticipant Lire_ID(int ID_LP)
{ return new A_T_listParticipant(ChaineConnexion).Lire_ID(ID_LP); } { return new A_T_listParticipant(ChaineConnexion).Lire_ID(ID_LP); }
public int Supprimer(int ID_LP) public int Supprimer(int ID_LP)

View File

@ -21,15 +21,18 @@ namespace ProjetTheAlone.Gestion
: base(sChaineConnexion) : base(sChaineConnexion)
{ } { }
#endregion #endregion
public int Ajouter(int ID_repa, int ID_plat) public int Ajouter(DateTime LP_DatePlat, int ID_plat)
{ return new A_T_listPlat(ChaineConnexion).Ajouter(ID_repa, ID_plat); } { return new A_T_listPlat(ChaineConnexion).Ajouter(LP_DatePlat, ID_plat); }
public int Modifier(int ID_listPlat, int ID_repa, int ID_plat) public int Modifier(int ID_listPlat, DateTime LP_DatePlat, int ID_plat)
{ return new A_T_listPlat(ChaineConnexion).Modifier(ID_listPlat, ID_repa, ID_plat); } { return new A_T_listPlat(ChaineConnexion).Modifier(ID_listPlat, LP_DatePlat, ID_plat); }
public List<C_T_listPlat> Lire(string Index) public List<C_T_listPlat> Lire(string Index)
{ return new A_T_listPlat(ChaineConnexion).Lire(Index); } { return new A_T_listPlat(ChaineConnexion).Lire(Index); } //C_T_listPlat Lire(DateTime LP_DateRepas)
public List<C_T_plat> Lire(DateTime dateV)
{ return new A_T_listPlat(ChaineConnexion).Lire(dateV); } //C_T_listPlat Lire(DateTime LP_DateRepas)
public C_T_listPlat Lire_ID(int ID_listPlat) public C_T_listPlat Lire_ID(int ID_listPlat)
{ return new A_T_listPlat(ChaineConnexion).Lire_ID(ID_listPlat); } { return new A_T_listPlat(ChaineConnexion).Lire_ID(ID_listPlat); }
public int Supprimer(int ID_listPlat) public int Supprimer(int ID_Plat, DateTime dateV)
{ return new A_T_listPlat(ChaineConnexion).Supprimer(ID_listPlat); } { return new A_T_listPlat(ChaineConnexion).Supprimer(ID_Plat, dateV); }
} }
} }

View File

@ -21,9 +21,9 @@ namespace ProjetTheAlone.Gestion
: base(sChaineConnexion) : base(sChaineConnexion)
{ } { }
#endregion #endregion
public int Ajouter(string P_nom, byte[] P_img, int? ID_typePlat) 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); } { 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) 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); } { return new A_T_plat(ChaineConnexion).Modifier(ID_plat, P_nom, P_img, ID_typePlat); }
public List<C_T_plat> Lire(string Index) public List<C_T_plat> Lire(string Index)
{ return new A_T_plat(ChaineConnexion).Lire(Index); } { return new A_T_plat(ChaineConnexion).Lire(Index); }

View File

@ -38,7 +38,7 @@ namespace ProjetTheAlone.Gestion
/// Permet de récupérer les repas d'une date donnée /// Permet de récupérer les repas d'une date donnée
/// </summary> /// </summary>
/// <param name="dateV">Date filtre</param> /// <param name="dateV">Date filtre</param>
public List<C_T_repa> Lire(DateTime dateV) public List<C_T_plat> Lire(DateTime dateV)
{ return new A_T_repa(ChaineConnexion).Lire(dateV); } { return new A_T_repa(ChaineConnexion).Lire(dateV); }
public C_T_repa Lire_ID(int ID_repa) public C_T_repa Lire_ID(int ID_repa)
{ return new A_T_repa(ChaineConnexion).Lire_ID(ID_repa); } { return new A_T_repa(ChaineConnexion).Lire_ID(ID_repa); }

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjetTheAlone.Outil
{
class picToByteArray
{
public static byte[] Convert(string imgPath)
{
FileStream fs = new System.IO.FileStream(@".\desert.jpg", FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
byte[] result = br.ReadBytes((int)fs.Length);
br.Close();
fs.Close();
return result;
}
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjetTheAlone.Outil
{
class toByteArray
{
public static byte[] Convert(byte?[] bytes)
{
byte[] bb = Array.ConvertAll<byte?, byte>(bytes,
delegate (byte? b)
{
return b.Value;
});
return bb;
}
}
}

View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ProjetTheAlone.Outil
{
class toNullableByteArray
{
public static byte?[] Convert(byte[] bytes)
{
byte?[] bb = Array.ConvertAll<byte, byte?>(bytes,
delegate (byte b)
{
return b;
});
return bb;
}
}
}

View File

@ -81,8 +81,25 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</ApplicationDefinition> </ApplicationDefinition>
<Compile Include="Config\Settings2.Designer.cs">
<DependentUpon>Settings2.settings</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="Converter\BinaryImageConverter.cs" /> <Compile Include="Converter\BinaryImageConverter.cs" />
<Compile Include="ViewModel\PlatsEncode.cs" /> <Compile Include="Outil\picToByteArray.cs" />
<Compile Include="Outil\toByteArray.cs" />
<Compile Include="Outil\toNullableByteArray.cs" />
<Compile Include="ViewModel\EncodeEquipe.cs" />
<Compile Include="ViewModel\EncodeEvent.cs" />
<Compile Include="ViewModel\EncodeLieu.cs" />
<Compile Include="ViewModel\EncodeRepas.cs" />
<Compile Include="ViewModel\EncodeTypeEvent.cs" />
<Compile Include="ViewModel\EncodePlats.cs" />
<Compile Include="ViewModel\VM_DashBoard.cs" />
<Compile Include="View\FicDetailEvent.xaml.cs">
<DependentUpon>FicDetailEvent.xaml</DependentUpon>
</Compile>
<Compile Include="View\FicEncodePlat.xaml.cs"> <Compile Include="View\FicEncodePlat.xaml.cs">
<DependentUpon>FicEncodePlat.xaml</DependentUpon> <DependentUpon>FicEncodePlat.xaml</DependentUpon>
</Compile> </Compile>
@ -109,7 +126,7 @@
<Compile Include="Model\C_T_typeEvenement.cs" /> <Compile Include="Model\C_T_typeEvenement.cs" />
<Compile Include="Model\C_T_typePlat.cs" /> <Compile Include="Model\C_T_typePlat.cs" />
<Compile Include="Model\C_T_typeRepa.cs" /> <Compile Include="Model\C_T_typeRepa.cs" />
<Compile Include="Settings1.Designer.cs"> <Compile Include="Config\Settings1.Designer.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput> <DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings1.settings</DependentUpon> <DependentUpon>Settings1.settings</DependentUpon>
@ -142,7 +159,6 @@
<DependentUpon>Repa.xaml</DependentUpon> <DependentUpon>Repa.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="ViewModel\Base.cs" /> <Compile Include="ViewModel\Base.cs" />
<Compile Include="ViewModel\EvenementEncode.cs" />
<Compile Include="View\Accueil.xaml.cs"> <Compile Include="View\Accueil.xaml.cs">
<DependentUpon>Accueil.xaml</DependentUpon> <DependentUpon>Accueil.xaml</DependentUpon>
</Compile> </Compile>
@ -158,9 +174,22 @@
<Compile Include="View\FicEvenementEncode.xaml.cs"> <Compile Include="View\FicEvenementEncode.xaml.cs">
<DependentUpon>FicEvenementEncode.xaml</DependentUpon> <DependentUpon>FicEvenementEncode.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="View\FicNewEquipe.xaml.cs">
<DependentUpon>FicNewEquipe.xaml</DependentUpon>
</Compile>
<Compile Include="View\FicNewLieu.xaml.cs">
<DependentUpon>FicNewLieu.xaml</DependentUpon>
</Compile>
<Compile Include="View\FicNewtypeEvent.xaml.cs">
<DependentUpon>FicNewtypeEvent.xaml</DependentUpon>
</Compile>
<Compile Include="View\FicRepasEncode.xaml.cs"> <Compile Include="View\FicRepasEncode.xaml.cs">
<DependentUpon>FicRepasEncode.xaml</DependentUpon> <DependentUpon>FicRepasEncode.xaml</DependentUpon>
</Compile> </Compile>
<Page Include="View\FicDetailEvent.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\FicEncodePlat.xaml"> <Page Include="View\FicEncodePlat.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@ -213,6 +242,18 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="View\FicNewEquipe.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\FicNewLieu.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\FicNewtypeEvent.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="View\FicRepasEncode.xaml"> <Page Include="View\FicRepasEncode.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
@ -236,12 +277,16 @@
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
<None Include="Config\Settings2.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings2.Designer.cs</LastGenOutput>
</None>
<None Include="packages.config" /> <None Include="packages.config" />
<None Include="Properties\Settings.settings"> <None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None> </None>
<None Include="Settings1.settings"> <None Include="Config\Settings1.settings">
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings1.Designer.cs</LastGenOutput> <LastGenOutput>Settings1.Designer.cs</LastGenOutput>
</None> </None>

View File

@ -19,15 +19,39 @@ namespace ProjetTheAlone.UserControlDIY
/// <summary> /// <summary>
/// Interaction logic for Plat.xaml /// Interaction logic for Plat.xaml
/// </summary> /// </summary>
public partial class Plat : UserControl public partial class Plat : UserControl
{ {
public C_T_plat PlatV { get { return this.DataContext as C_T_plat; } }
public C_T_plat PlatV
{
get { return (C_T_plat)GetValue(PlatVProperty); }
set { SetValue(PlatVProperty, value); }
}
// Using a DependencyProperty as the backing store for Property1.
// This enables animation, styling, binding, etc...
public static readonly DependencyProperty PlatVProperty
= DependencyProperty.Register(
"PlatV",
typeof(C_T_plat),
typeof(Plat),
null
);
//public C_T_plat PlatV { get { return this.DataContext as C_T_plat; } }
public Plat() public Plat()
{ {
InitializeComponent(); InitializeComponent();
this.DataContextChanged += new DependencyPropertyChangedEventHandler(updateDataContext);
GridPrinc.DataContext = this ; GridPrinc.DataContext = this ;
} }
public void updateDataContext(object o, DependencyPropertyChangedEventArgs e)
{
GridPrinc.DataContext = this;
var a = this.DataContext;
//GridPrinc.DataContext = this.DataContext;
}
}
} }
}

View File

@ -4,6 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ProjetTheAlone.UserControlDIY" xmlns:local="clr-namespace:ProjetTheAlone.UserControlDIY"
xmlns:parent="clr-namespace:ProjetTheAlone.View"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" d:DesignHeight="450" d:DesignWidth="800"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
@ -21,10 +22,10 @@
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
<RowDefinition Height="*"/> <RowDefinition Height="*"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<TextBlock Text="{Binding Quand}" /> <TextBox Text="{Binding Quand}" />
<local:Plat x:Name="Plat1XML" Grid.Row="1"></local:Plat> <local:Plat x:Name="Plat1XML" Grid.Row="1" PlatV="{Binding Plat1}"></local:Plat>
<local:Plat x:Name="Plat2XML" Grid.Row="2"></local:Plat> <local:Plat x:Name="Plat2XML" Grid.Row="2" PlatV="{Binding Plat2}"></local:Plat>
<local:Plat x:Name="Plat3XML" Grid.Row="3"></local:Plat> <local:Plat x:Name="Plat3XML" Grid.Row="3" PlatV="{Binding Plat3}"></local:Plat>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@ -25,29 +25,19 @@ namespace ProjetTheAlone.UserControlDIY
public partial class Repa : UserControl public partial class Repa : UserControl
{ {
public RepaModel RM
{
get
{
return this.DataContext as RepaModel;
}
}
public C_T_plat Plat1 { get => ((RM==null)?new C_T_plat():RM.Plat1 ?? new C_T_plat()); }
public C_T_plat Plat2 { get => ((RM == null) ? new C_T_plat() : RM.Plat2 ?? new C_T_plat()); }
public C_T_plat Plat3 { get => ((RM == null) ? new C_T_plat() : RM.Plat3 ?? new C_T_plat()); }
public Repa() public Repa()
{ {
InitializeComponent(); InitializeComponent();
GridPrinc.DataContext = RM;
Plat1XML.DataContext = Plat1;
this.DataContextChanged += new DependencyPropertyChangedEventHandler(updateDataContext); this.DataContextChanged += new DependencyPropertyChangedEventHandler(updateDataContext);
} }
public void updateDataContext(object o, DependencyPropertyChangedEventArgs e) public void updateDataContext(object o, DependencyPropertyChangedEventArgs e)
{ {
GridPrinc.DataContext = RM; var a = this.DataContext;
Plat1XML.DataContext = Plat1; GridPrinc.DataContext = ((RepaModel) this.DataContext);
Plat2XML.DataContext = Plat2; /*Plat1XML.DataContext = ((RepaModel)this.DataContext).Plat1;
Plat3XML.DataContext = Plat3; Plat2XML.DataContext = ((RepaModel)this.DataContext).Plat2;
Plat3XML.DataContext = ((RepaModel)this.DataContext).Plat3;*/
} }
} }
} }

View File

@ -22,7 +22,7 @@ namespace ProjetTheAlone.View
public Accueil() public Accueil()
{ {
InitializeComponent(); InitializeComponent();
Settings1.Default.schCon = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True"; // Settings1.Default.schCon = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True";
} }
private static bool openaffichage = false; private static bool openaffichage = false;
private static bool openencodage = false; private static bool openencodage = false;

View File

@ -20,65 +20,106 @@
<Window.Resources> <Window.Resources>
<local:DebugDummyConverter x:Key="DebugDummyConverter" /> <local:DebugDummyConverter x:Key="DebugDummyConverter" />
</Window.Resources> </Window.Resources>
<Grid> <Grid x:Name="testQuand">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="5*" /> <RowDefinition Height="10*" />
<RowDefinition Height="5*" />
<RowDefinition Height="*" /> <RowDefinition Height="*" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<!--<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<TextBlock ></TextBlock>
<DockPanel>
<ListView x:Name="RepasMatin">
<ListView.ItemContainerStyle>
<Style TargetType="{x:Type ListViewItem}">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Height" Value="65"/>
</Style>
</ListView.ItemContainerStyle>
<ListView.ItemTemplate>
<DataTemplate DataType="classes:C_T_plat">
<control:Plat ></control:Plat>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</DockPanel>-->
<control:Repa x:Name="RepasMatin"></control:Repa>
<control:Repa Grid.Column="1" x:Name="RepasMidi"></control:Repa>
<control:Repa Grid.Column="2" x:Name="RepasSoir"></control:Repa>
<materialDesign:PackIcon Kind="Build" Grid.Column="2" HorizontalAlignment="Right" Cursor="Hand"/> <materialDesign:PackIcon Kind="Build" Grid.Column="2" HorizontalAlignment="Right" Cursor="Hand"/>
<Grid Grid.Column="0">
</Grid>
<Grid Grid.Row="1" >
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition /> <ColumnDefinition />
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions>
<DataGrid x:Name="dgEventPasse2" ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Height="auto">
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" />
<DataGridTextColumn Header="Avent Avent Hier" Binding="{Binding P_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
<DataGrid x:Name="dgEventPasse1" Grid.Column="1" ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Grid.Row="1" Height="auto">
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" />
<DataGridTextColumn Header="Avent Hier" Binding="{Binding P_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
<DataGrid x:Name="dgEventPasse0" Grid.Column="2" ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Grid.Row="1" Height="auto">
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" />
<DataGridTextColumn Header="Hier" Binding="{Binding P_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
</Grid>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
</Grid>
<Grid Grid.Column="1" >
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<control:EventPasse x:Name="EventPasse1" Classement="{Binding Classement}" ></control:EventPasse> <Grid.RowDefinitions>
<control:EventPasse x:Name="EventPasse2" Classement="{Binding Classement}" Grid.Column="1"></control:EventPasse> <RowDefinition Height="auto"/>
<control:EventFutur Grid.Column="2"></control:EventFutur> <RowDefinition/>
<control:EventFutur Grid.Column="3"></control:EventFutur> <RowDefinition/>
</Grid.RowDefinitions>
<TextBlock HorizontalAlignment="Center" Text="{Binding Plat1}"></TextBlock>
<TextBlock HorizontalAlignment="Center" Grid.Column="1">Demain</TextBlock>
<TextBlock HorizontalAlignment="Center" Grid.Column="2">Après demain</TextBlock>
<control:Repa Grid.Row="1" x:Name="RepasAjd" Loaded="RepasMatin_Loaded"></control:Repa>
<control:Repa Grid.Row="1" x:Name="RepasDemain" Grid.Column="1" ></control:Repa>
<control:Repa Grid.Row="1" x:Name="RepasApresDemain" Grid.Column="2" ></control:Repa>
<DataGrid Grid.Row="2" x:Name="dgEventFutur" ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Height="auto">
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" />
<DataGridTextColumn Header="Avent Avent Hier" Binding="{Binding P_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
<DataGrid Grid.Row="2" Grid.Column="1" x:Name="dgEventFutur2" ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Height="auto">
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" />
<DataGridTextColumn Header="Avent Avent Hier" Binding="{Binding P_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
<DataGrid Grid.Row="2" Grid.Column="2" x:Name="dgEventFutur3" ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Height="auto">
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" />
<DataGridTextColumn Header="Avent Avent Hier" Binding="{Binding P_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
<control:EventFutur Grid.Row="2" x:Name="EventFuture1" ></control:EventFutur>
<control:EventFutur Grid.Row="2" x:Name="EventFuture2" Grid.Column="1"></control:EventFutur>
<control:EventFutur Grid.Row="2" x:Name="EventFuture3" Grid.Column="2"></control:EventFutur>
</Grid> </Grid>
<Grid Grid.Row="2" Visibility="Visible"> <Grid Grid.Row="2" Visibility="Visible" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions> <Border >
<ColumnDefinition Width="356*"/>
<ColumnDefinition Width="147*"/>
</Grid.ColumnDefinitions>
<Border Grid.ColumnSpan="2">
<Border.Background> <Border.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="OrangeRed" Offset="0" /> <GradientStop Color="OrangeRed" Offset="0" />

View File

@ -55,23 +55,14 @@ namespace ProjetTheAlone.View
public DashBoard() public DashBoard()
{ {
InitializeComponent(); InitializeComponent();
Epm = new ProjetTheAlone.Model.EventPasseModel(Cl); //EventPasse2.DataContext = EventPasse1.DataContext = Epm;
EventPasse2.DataContext = EventPasse1.DataContext = Epm;
Epm.Classement = Cl;
FileStream fs = new System.IO.FileStream(@".\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("Entrée", result, null));
Rm.ListPlat.Add(new C_T_plat("Plat", result, null));
Rm.ListPlat.Add(new C_T_plat("Desert", result, null));
Rm.Quand = "Matin";
Console.WriteLine($"~~~~~~{Rm.ListPlat[0].P_nom}~~~~~~");
RepasMatin.DataContext = RepasMidi.DataContext = RepasSoir.DataContext = Rm;
testQuand.DataContext = RepasAjd.DataContext = new RepaModel(DateTime.Now);
RepasDemain.DataContext = new RepaModel(DateTime.Now.AddDays(1));
RepasApresDemain.DataContext = new RepaModel(DateTime.Now.AddDays(2));
var a = testQuand.DataContext;
} }
@ -79,6 +70,11 @@ namespace ProjetTheAlone.View
{ {
Accueil.Openaffichage = false; Accueil.Openaffichage = false;
} }
private void RepasMatin_Loaded(object sender, RoutedEventArgs e)
{
}
} }
public class DebugDummyConverter : IValueConverter public class DebugDummyConverter : IValueConverter
{ {

View File

@ -4,8 +4,12 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProjetTheAlone.View" xmlns:local="clr-namespace:ProjetTheAlone.View"
xmlns:convert="clr-namespace:ProjetTheAlone.Converter"
mc:Ignorable="d" mc:Ignorable="d"
Title="Bénéficiaire" Height="482.167" Width="955.5" WindowStartupLocation="CenterScreen" WindowStyle="None"> Title="Bénéficiaire" Height="482.167" Width="955.5" WindowStartupLocation="CenterScreen" WindowStyle="None">
<Window.Resources>
<convert:BinaryImageConverter x:Key="imgConverter" />
</Window.Resources>
<Grid Margin="0,-3,2,2"> <Grid Margin="0,-3,2,2">
<Grid.RowDefinitions> <Grid.RowDefinitions>
@ -35,10 +39,11 @@
<TextBlock x:Name="tImg" Text="Photo" Grid.Row="4" VerticalAlignment="Center" Margin="0,56,0,10" /> <TextBlock x:Name="tImg" Text="Photo" Grid.Row="4" VerticalAlignment="Center" Margin="0,56,0,10" />
<DockPanel Margin="10,10,10,10" Grid.Row="4" Grid.Column="1"> <DockPanel Margin="10,10,10,10" Grid.Row="4" Grid.Column="1">
<WrapPanel HorizontalAlignment="Right" DockPanel.Dock="Top" > <WrapPanel HorizontalAlignment="Right" DockPanel.Dock="Top" >
<Image x:Name="ImageFile" Height="40" HorizontalAlignment="Right" VerticalAlignment="Top" Width="90"/> <Image x:Name="ImageFile" Source="{Binding UnBeneficiaire.Img, Mode=TwoWay, Converter={StaticResource imgConverter}}" Height="40" HorizontalAlignment="Right" VerticalAlignment="Top" Width="90"/>
<Button x:Name="btnOpenFile" HorizontalAlignment="Right" Click="btnOpenFile_Click" Content="Open file"/> <Button x:Name="btnOpenFile" HorizontalAlignment="Right" Click="btnOpenFile_Click" Content="Open file"/>
</WrapPanel> </WrapPanel>
<TextBox x:Name="txtEditor" Text="{Binding UnBeneficiaire.Img, Mode=TwoWay}"/> <TextBox x:Name="txtEditor" />
<!-- Text="{Binding UnBeneficiaire.Img, Mode=TwoWay}" -->
</DockPanel> </DockPanel>
</Grid> </Grid>
@ -48,13 +53,13 @@
<Button x:Name="bAnnuler" Content="Annuler" Margin="3,16,3,17" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" <Button x:Name="bAnnuler" Content="Annuler" Margin="3,16,3,17" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}"
Command="{Binding cAnnuler}" /> Command="{Binding cAnnuler}" />
</StackPanel> </StackPanel>
<DataGrid ItemsSource="{Binding BcpBeneficiaire}" VerticalScrollBarVisibility="Visible" <DataGrid ItemsSource="{Binding BcpBeneficiaires}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}" IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding BeneficiaireSelectionnee, Mode=TwoWay}" Margin="88,82,566,149" > SelectedItem="{Binding BeneficiaireSelectionnee, Mode=TwoWay}" Margin="88,82,566,149" >
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID}" /> <DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_beneficiaire}" />
<DataGridTextColumn Header="Prénom" Binding="{Binding Pre}" Width="*" /> <DataGridTextColumn Header="Prénom" Binding="{Binding B_prenom}" Width="*" />
<DataGridTextColumn Header="Nom" Binding="{Binding Nom}" Width="*" /> <DataGridTextColumn Header="Nom" Binding="{Binding B_nom}" Width="*" />
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="88,331,576,46" Width="282"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="88,331,576,46" Width="282">

View File

@ -45,8 +45,11 @@ namespace ProjetTheAlone.View
//BinaryReader br = new BinaryReader(fs); //BinaryReader br = new BinaryReader(fs);
//byte[] result = br.ReadBytes((int)fs.Length); //byte[] result = br.ReadBytes((int)fs.Length);
ImageFile.Source = new BitmapImage(new Uri(@"" + FileName + "")); ImageFile.Source = new BitmapImage(new Uri(@"" + FileName + ""));
} }
} }
} }
} }

View File

@ -0,0 +1,45 @@
<Window x:Class="ProjetTheAlone.View.FicDetailEvent"
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"
mc:Ignorable="d"
Title="FicDetailEvent" Height="517.897" Width="638.259" WindowStartupLocation="CenterScreen" WindowStyle="None">
<Grid Margin="0,0,2,2">
<Label Content="Détails" HorizontalAlignment="Left" Margin="24,15,0,0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20" Width="74" Height="34"/>
<Button x:Name="btnQuitter"
Content="Quitter" Click="btnQuitter_Click" Height="41" Margin="485,442,37,25" RenderTransformOrigin="1.189,1.927"/>
<Grid HorizontalAlignment="Left" Height="237" Margin="90,54,0,0" VerticalAlignment="Top" Width="450">
<Label Content="Type d'événement" HorizontalAlignment="Left" Width="120" Margin="0,0,0,202"/>
<TextBox HorizontalAlignment="Left" Height="34" TextWrapping="Wrap" VerticalAlignment="Top" Width="331" Margin="120,0,0,0"/>
<Label Content="Lieu" HorizontalAlignment="Left" Width="120" Margin="0,34,0,167"/>
<TextBox HorizontalAlignment="Left" Height="34" TextWrapping="Wrap" VerticalAlignment="Top" Width="331" Margin="120,34,0,0"/>
<Label Content="Date" HorizontalAlignment="Left" Width="120" Margin="0,73,0,128"/>
<TextBox HorizontalAlignment="Left" Height="34" TextWrapping="Wrap" VerticalAlignment="Top" Width="331" Margin="120,73,0,0"/>
<Label Content="Durée" HorizontalAlignment="Left" Width="120" Margin="0,112,0,91"/>
<TextBox HorizontalAlignment="Left" Height="34" TextWrapping="Wrap" VerticalAlignment="Top" Width="331" Margin="120,112,0,0"/>
<Label Content="Description" HorizontalAlignment="Left" Width="120" Margin="0,151,0,53"/>
<TextBox HorizontalAlignment="Left" Height="34" TextWrapping="Wrap" VerticalAlignment="Top" Width="331" Margin="120,146,0,0"/>
</Grid>
<Button x:Name="btnClassement" Margin="468,310,24,150" Content="Classement" Height="Auto" RenderTransformOrigin="-0.1,0.534" />
<DataGrid x:Name="dgEquipes" ItemsSource="{Binding BcpEquipes}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False"
SelectedItem="{Binding EquipeSelectionnee, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="56,296,386,20" >
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_equipe}" />
<DataGridTextColumn Header="Nom d'équipe" Binding="{Binding E_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
<DataGrid x:Name="dgJoueur" ItemsSource="{Binding BcpJoueurs}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" SelectedItem="{Binding JoueurSelectionnee, Mode=TwoWay}"
Margin="269,296,195,20">
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_LP}" />
<DataGridTextColumn Header="ID du Joueur" Binding="{Binding ID_benificiaire}" Width="*" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</Window>

View File

@ -0,0 +1,33 @@
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.Shapes;
namespace ProjetTheAlone.View
{
/// <summary>
/// Logique d'interaction pour FicDetailEvent.xaml
/// </summary>
public partial class FicDetailEvent : Window
{
public FicDetailEvent()
{
InitializeComponent();
DataContext = new ViewModel.VM_Event();
}
private void btnQuitter_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}

View File

@ -4,20 +4,25 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProjetTheAlone" xmlns:local="clr-namespace:ProjetTheAlone"
xmlns:convert="clr-namespace:ProjetTheAlone.Converter"
mc:Ignorable="d" mc:Ignorable="d"
Title="Plats" Height="482.167" Width="955.5" WindowStartupLocation="CenterScreen" WindowStyle="None"> Title="Plats" Height="482.167" Width="955.5" WindowStartupLocation="CenterScreen" WindowStyle="None">
<Window.Resources>
<convert:BinaryImageConverter x:Key="imgConverter" />
</Window.Resources>
<Grid Margin="0,-3,2,2"> <Grid Margin="0,-3,2,2">
<Grid.RowDefinitions> <Grid.RowDefinitions>
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Label Content="Plats" HorizontalAlignment="Left" Margin="31,20,0,0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20"/> <Label Content="Plats" HorizontalAlignment="Left" Margin="31,20,0,0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20"/>
<Grid x:Name="UneFiche" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" Margin="515,82,139,258" > <Grid x:Name="UneFiche" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" Margin="515,82,139,243" >
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
@ -29,12 +34,19 @@
<TextBlock x:Name="tImg" Text="Photo" Grid.Row="4" VerticalAlignment="Center" Margin="0,56,0,10" /> <TextBlock x:Name="tImg" Text="Photo" Grid.Row="4" VerticalAlignment="Center" Margin="0,56,0,10" />
<DockPanel Margin="10,10,10,10" Grid.Row="4" Grid.Column="1"> <DockPanel Margin="10,10,10,10" Grid.Row="4" Grid.Column="1">
<WrapPanel HorizontalAlignment="Right" DockPanel.Dock="Top" > <WrapPanel HorizontalAlignment="Right" DockPanel.Dock="Top" >
<Image x:Name="ImageFile" Height="40" HorizontalAlignment="Right" VerticalAlignment="Top" Width="90"/> <Image x:Name="ImageFile" Source="{Binding UnPlat.Img, Mode=TwoWay, Converter={StaticResource imgConverter}}" Height="40" HorizontalAlignment="Right" VerticalAlignment="Top" Width="90"/>
<Button x:Name="btnOpenFile" HorizontalAlignment="Right" Click="btnOpenFile_Click" Content="Open file"/> <Button x:Name="btnOpenFile" HorizontalAlignment="Right" Click="btnOpenFile_Click" Content="Open file"/>
</WrapPanel> </WrapPanel>
<TextBox x:Name="txtEditor" Text="{Binding UnPlat.Img, Mode=TwoWay}"/> <TextBox x:Name="txtEditor" />
</DockPanel> </DockPanel>
<DockPanel Grid.Row="5" Grid.ColumnSpan="2">
<ComboBox x:Name="TypePlat" SelectionChanged="TypePlat_SelectionChanged">
<ComboBoxItem>Soupe</ComboBoxItem>
<ComboBoxItem IsSelected="True">Plat</ComboBoxItem>
<ComboBoxItem>Dessert</ComboBoxItem>
</ComboBox>
</DockPanel>
</Grid> </Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="678,237,78,140" Width="190"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="678,237,78,140" Width="190">
<Button x:Name="bConfirmer" Content="Confirmer" Margin="3" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" <Button x:Name="bConfirmer" Content="Confirmer" Margin="3" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}"
@ -42,12 +54,13 @@
<Button x:Name="bAnnuler" Content="Annuler" Margin="3,16,3,17" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" <Button x:Name="bAnnuler" Content="Annuler" Margin="3,16,3,17" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}"
Command="{Binding cAnnuler}" /> Command="{Binding cAnnuler}" />
</StackPanel> </StackPanel>
<DataGrid ItemsSource="{Binding BcpBeneficiaire}" VerticalScrollBarVisibility="Visible" <DataGrid ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}" IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding BeneficiaireSelectionnee, Mode=TwoWay}" Margin="126,86,605,140" > SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Margin="88,86,576,140" >
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID}" /> <DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" />
<DataGridTextColumn Header="Nom du plat" Binding="{Binding Nom}" Width="*" /> <DataGridTextColumn Header="Nom du plat" Binding="{Binding P_nom}" Width="150" />
<DataGridTextColumn Header="Type plat" Binding="{Binding ID_typePlat}" Width="*" />
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="88,331,576,46" Width="282"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="88,331,576,46" Width="282">

View File

@ -14,6 +14,7 @@ using System.Windows.Shapes;
using System.IO; using System.IO;
using Microsoft.Win32; using Microsoft.Win32;
using ProjetTheAlone.Classes;
namespace ProjetTheAlone namespace ProjetTheAlone
{ {
@ -51,6 +52,10 @@ namespace ProjetTheAlone
} }
} }
private void TypePlat_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (DataContext != null)
((ViewModel.VM_Plat)DataContext).UnPlat.TypePlat = (C_T_plat.TypePlat_E)Enum.Parse(typeof(C_T_plat.TypePlat_E), this.TypePlat.Text);
}
} }
} }

View File

@ -5,59 +5,51 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ProjetTheAlone.View" xmlns:local="clr-namespace:ProjetTheAlone.View"
mc:Ignorable="d" mc:Ignorable="d"
Title="FicEvenementEncode" Height="491.666" Width="1137.834" WindowStartupLocation="CenterScreen" WindowStyle="None"> Title="FicEvenementEncode" Height="552.418" Width="1221.191" WindowStartupLocation="CenterScreen" WindowStyle="None">
<Grid Margin="0,0,2,2"> <Grid Margin="0,0,2,2">
<ListView x:Name="lvEvenementtype" Margin="281,50,682,257"> <DataGrid x:Name="dgEvenementtype" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" ItemsSource="{Binding BcpTypeEvents}" VerticalScrollBarVisibility="Visible"
<ListView.View> IsReadOnly="True" AutoGenerateColumns="False" Margin="281,42,765,325" SelectedItem="{Binding TypeEventSelectionnee, Mode=TwoWay}" Grid.Column="0" SelectedIndex="{Binding UnEvent.ID_TypeEvent, Mode=TwoWay}">
<GridView> <DataGrid.Columns>
<GridViewColumn Width="160" Header="Type d'évenement" <DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_typeEvenement}" />
DisplayMemberBinding ="{Binding Pre}"/> <DataGridTextColumn Header="Type d'événement" Binding="{Binding TE_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
<DataGrid x:Name="dgLieu" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" ItemsSource="{Binding BcpLieux}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" SelectedItem="{Binding LieuSelectionnee, Mode=TwoWay}" Margin="480,95,606,317">
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_lieu}" />
<DataGridTextColumn Header="Type de Lieu" Binding="{Binding L_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
</GridView> <DataGrid x:Name="dgJoueur" ItemsSource="{Binding BcpJoueurs}" VerticalScrollBarVisibility="Visible"
</ListView.View> IsReadOnly="True" AutoGenerateColumns="False" SelectedItem="{Binding JoueurSelectionnee, Mode=TwoWay}"
</ListView> Margin="984,284,63,23">
<ListView x:Name="lvLieu" Margin="480,95,523,266"> <DataGrid.Columns>
<ListView.View> <DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_LP}" />
<GridView> <DataGridTextColumn Header="ID du Joueur" Binding="{Binding ID_benificiaire}" Width="*" />
<GridViewColumn Width="120" Header="Lieu" </DataGrid.Columns>
DisplayMemberBinding ="{Binding Pre}"/> </DataGrid>
</GridView> <DataGrid x:Name="dgEquipes" ItemsSource="{Binding BcpEquipes}" VerticalScrollBarVisibility="Visible"
</ListView.View> IsReadOnly="True" AutoGenerateColumns="False"
</ListView> SelectedItem="{Binding EquipeSelectionnee, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="744,284,281,23" >
<ListView x:Name="lvParticipantEvenement" Margin="431,258,520,103"> <DataGrid.Columns>
<ListView.View> <DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_equipe}" />
<GridView> <DataGridTextColumn Header="Nom d'équipe" Binding="{Binding E_nom}" Width="*" />
<GridViewColumn Width="190" Header="Participant à l'événement "/> </DataGrid.Columns>
</DataGrid>
</GridView> <DataGrid x:Name="dgParticipant" ItemsSource="{Binding BcpParticipants}" VerticalScrollBarVisibility="Visible"
</ListView.View> IsReadOnly="True" AutoGenerateColumns="False"
</ListView> SelectedItem="{Binding ParticipantSelectionnee, Mode=TwoWay}" Margin="310,284,693,23" >
<ListView x:Name="lvParticipantEquipe" Margin="951,258,20,62"> <DataGrid.Columns>
<ListView.View> <DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_beneficiaire}" />
<GridView> <DataGridTextColumn Header="Bénéficiaire" Binding="{Binding B_prenom}" Width="100" />
<GridViewColumn Width="170" Header="Participants à l'équipe "/> <DataGridTextColumn Binding="{Binding B_nom}" Width="*" />
</GridView> </DataGrid.Columns>
</ListView.View> </DataGrid>
</ListView> <Button x:Name="btnCreeEvent" Margin="778,43,275,457"
<ListView x:Name="lvEquipes" Margin="819,258,182,62"> Content="Créé l'événement" RenderTransformOrigin="0.017,0.519" Height="Auto" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}"
<ListView.View> Command="{Binding cConfirmer}">
<GridView>
<GridViewColumn Width="120" Header="Equipes"/>
</GridView>
</ListView.View>
</ListView>
<ListView x:Name="lvBénéficiaire" Margin="233,258,730,103">
<ListView.View>
<GridView>
<GridViewColumn Width="180" Header="Bénéficiaire"/>
</GridView>
</ListView.View>
</ListView>
<Button x:Name="btnBeneficiaire" Margin="233,405,713,28"
Content="Nouveau bénéficiaire" Click="btnBénéficiaire_Click" Height="Auto"/>
<Button x:Name="btnCreeEvent" Margin="802,44,168,396"
Content="Créé l'événement" RenderTransformOrigin="0.017,0.519" Height="Auto">
<Button.RenderTransform> <Button.RenderTransform>
<TransformGroup> <TransformGroup>
<ScaleTransform/> <ScaleTransform/>
@ -67,11 +59,9 @@
</TransformGroup> </TransformGroup>
</Button.RenderTransform> </Button.RenderTransform>
</Button> </Button>
<DatePicker HorizontalAlignment="Left" Margin="491,61,0,0" VerticalAlignment="Top"/> <DatePicker HorizontalAlignment="Left" SelectedDate="{Binding UnEvent.Date, Mode=TwoWay}" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" Margin="480,54,0,0" VerticalAlignment="Top" Width="111"/>
<TextBox HorizontalAlignment="Left" Height="125" Margin="635,91,0,0" TextWrapping="Wrap" Text="Description de L'événement" VerticalAlignment="Top" Width="271"/> <TextBox HorizontalAlignment="Left" Height="76" Margin="635,140,0,0" TextWrapping="Wrap" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" Text="{Binding UnEvent.Description, Mode=TwoWay}" VerticalAlignment="Top" Width="271"/>
<TextBox HorizontalAlignment="Left" Height="29" Margin="635,50,0,0" TextWrapping="Wrap" Text="Duréé : ex. 2h30" VerticalAlignment="Top" Width="109"/> <Button x:Name="btnNewTypeEvent" Margin="40,47,951,450"
<Button x:Name="btnParticipant" Margin="431,405,507,28" Content="Ajouter un participant" Height="Auto" />
<Button x:Name="btnNewTypeEvent" Margin="40,57,868,380"
Content="Nouveau type d'événement" RenderTransformOrigin="0.017,0.519" Height="Auto" Click="btnNewTypeEvent_Click"> Content="Nouveau type d'événement" RenderTransformOrigin="0.017,0.519" Height="Auto" Click="btnNewTypeEvent_Click">
<Button.RenderTransform> <Button.RenderTransform>
<TransformGroup> <TransformGroup>
@ -82,31 +72,22 @@
</TransformGroup> </TransformGroup>
</Button.RenderTransform> </Button.RenderTransform>
</Button> </Button>
<Button x:Name="btnNewLieu" Margin="40,117,869,323" <Button x:Name="btnNewLieu" Margin="40,99,952,401"
Content="Nouveau lieu" RenderTransformOrigin="0.017,0.519" Height="Auto" Click="btnNewLieu_Click"> Content="Nouveau lieu" RenderTransformOrigin="0.017,0.519" Height="Auto" Click="btnNewLieu_Click"/>
<Button.RenderTransform> <Button x:Name="btnAjoutEquipe" Margin="538,292,493,210" Content="Ajouter une Equipe" Height="Auto" Click="btnAjoutEquipe_Click" />
<TransformGroup> <Button x:Name="btnAjoutEquipier" Margin="538,357,493,148" Content="Ajouter un joueur" Height="Auto" Command="{Binding cAjouterJoueur}"/>
<ScaleTransform/> <Button x:Name="btnSuppEquipier" Margin="538,399,493,98" Content="Supprimer un joueur" Height="Auto" Command="{Binding cSupprimerJoueur}" />
<SkewTransform AngleY="0.661"/>
<RotateTransform Angle="0.162"/>
<TranslateTransform Y="0.031"/>
</TransformGroup>
</Button.RenderTransform>
</Button>
<Button x:Name="btnAjoutEquipe" Margin="635,258,314,184" Content="Ajouter une Equipe" Height="Auto" />
<Button x:Name="btnSuppEquipe" Margin="635,303,314,139" Content="Supprimer une Equipe" Height="Auto" />
<Button x:Name="btnAjoutEquipier" Margin="635,348,314,97" Content="Ajouter un joueur" Height="Auto" />
<Button x:Name="btnSuppEquipier" Margin="635,390,314,47" Content="Supprimer un joueur" Height="Auto" />
<ListView x:Name="lvEvenementEnCours" Margin="29,260,930,60">
<ListView.View>
<GridView>
<GridViewColumn Width="160" Header="Evénement en cours"/>
</GridView> <DataGrid x:Name="lvEvenementEnCours" ItemsSource="{Binding BcpEvents}" VerticalScrollBarVisibility="Visible"
</ListView.View> IsReadOnly="True" AutoGenerateColumns="False"
</ListView> SelectedItem="{Binding EventSelectionnee, Mode=TwoWay}" Margin="29,263,955,131" >
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_event}" />
<DataGridTextColumn Header="Evénements" Binding="{Binding E_description}" Width="*" />
</DataGrid.Columns>
</DataGrid>
<Label Content="Evénements" HorizontalAlignment="Left" Margin="29,10,0,0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20"/> <Label Content="Evénements" HorizontalAlignment="Left" Margin="29,10,0,0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20"/>
<Button x:Name="btnQuitter" Margin="971,181,30,260" <Button x:Name="btnQuitter" Margin="990,177,93,324"
Content="Quitter" RenderTransformOrigin="0.017,0.519" Click="btnQuitter_Click" Height="Auto"> Content="Quitter" RenderTransformOrigin="0.017,0.519" Click="btnQuitter_Click" Height="Auto">
<Button.RenderTransform> <Button.RenderTransform>
<TransformGroup> <TransformGroup>
@ -117,6 +98,37 @@
</TransformGroup> </TransformGroup>
</Button.RenderTransform> </Button.RenderTransform>
</Button> </Button>
<Button x:Name="btnSuppEvent" Margin="29,424,955,73" Command="{Binding cSupprimer}"
Content="Supprimer l'événement" Height="Auto"/>
<Button x:Name="btnDetail" Margin="29,216,1073,284"
Content="Détail" Height="Auto" RenderTransformOrigin="0.523,1.512" Click="btnDetail_Click"/>
<Button x:Name="btnNewEvent" Margin="39,148,953,352"
Content="Nouvel événement" RenderTransformOrigin="0.017,0.519" Height="Auto" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
Command="{Binding cAjouter}" >
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform AngleY="0.661"/>
<RotateTransform Angle="0.162"/>
<TranslateTransform Y="0.031"/>
</TransformGroup>
</Button.RenderTransform>
</Button>
<Button x:Name="btnAnnuler" Margin="779,92,274,409"
Content="Annuler" RenderTransformOrigin="0.017,0.519" Height="Auto" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}"
Command="{Binding cAnnuler}">
<Button.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform AngleY="0.047"/>
<RotateTransform Angle="0.162"/>
<TranslateTransform/>
</TransformGroup>
</Button.RenderTransform>
</Button>
<DatePicker HorizontalAlignment="Left" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" SelectedDate="{Binding UnEvent.Duree, Mode=TwoWay}" Margin="635,54,0,0" VerticalAlignment="Top" Width="111"/>
<Button x:Name="btnAjouterEquipe" Margin="29,474,955,23" Command="{Binding cAjouterEquipe}"
Content="Ajouter Equipe à l'événement" Height="Auto"/>
</Grid> </Grid>
</Window> </Window>

View File

@ -22,12 +22,8 @@ namespace ProjetTheAlone.View
public FicEvenementEncode() public FicEvenementEncode()
{ {
InitializeComponent(); InitializeComponent();
} DataContext = new ViewModel.VM_Event();
private void btnBénéficiaire_Click(object sender, RoutedEventArgs e)
{
FicBeneficiaireEncode w = new FicBeneficiaireEncode();
w.ShowDialog();
} }
private void btnQuitter_Click(object sender, RoutedEventArgs e) private void btnQuitter_Click(object sender, RoutedEventArgs e)
@ -37,12 +33,32 @@ namespace ProjetTheAlone.View
private void btnNewTypeEvent_Click(object sender, RoutedEventArgs e) private void btnNewTypeEvent_Click(object sender, RoutedEventArgs e)
{ {
FicNewtypeEvent w = new FicNewtypeEvent();
w.ShowDialog();
} }
private void btnNewLieu_Click(object sender, RoutedEventArgs e) private void btnNewLieu_Click(object sender, RoutedEventArgs e)
{ {
FicNewLieu w = new FicNewLieu();
w.ShowDialog();
}
private void btnAjoutEquipe_Click(object sender, RoutedEventArgs e)
{
FicNewEquipe w = new FicNewEquipe();
w.ShowDialog();
}
private void btnDetail_Click(object sender, RoutedEventArgs e)
{
FicDetailEvent w = new FicDetailEvent();
w.ShowDialog();
}
} }
} }
}

View File

@ -0,0 +1,53 @@
<Window x:Class="ProjetTheAlone.View.FicNewEquipe"
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"
mc:Ignorable="d"
Title="NewLieu" Height="477.667" Width="627" WindowStartupLocation="CenterScreen" WindowStyle="None">
<Grid Margin="0,-3,2,2">
<Grid.RowDefinitions>
</Grid.RowDefinitions>
<Label Content="Equipe" HorizontalAlignment="Left" Margin="24,34,0,0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20"/>
<Grid x:Name="UneFiche" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" Margin="384,120,31,307" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock x:Name="tNom" Text="Nom" Grid.Row="2" VerticalAlignment="Center" />
<TextBox x:Name="tbNom" Grid.Row="1" Grid.Column="1" Margin="3,3,0,22"
Text="{Binding UneEquipe.Nom, Mode=TwoWay}" HorizontalAlignment="Left" Width="163" />
</Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="396,178,31,195" Width="190">
<Button x:Name="bConfirmer" Content="Confirmer" Margin="3" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}"
Command="{Binding cConfirmer}" />
<Button x:Name="bAnnuler" Content="Annuler" Margin="3,16,3,17" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}"
Command="{Binding cAnnuler}" />
</StackPanel>
<DataGrid ItemsSource="{Binding BcpEquipes}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding EquipeSelectionnee, Mode=TwoWay}" Margin="118,100,283,123" >
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_equipe}" />
<DataGridTextColumn Header="Nom d'équipe" Binding="{Binding E_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="80,344,255,29" Width="282">
<Button x:Name="bAjouter" Content="Ajouter" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
Command="{Binding cAjouter}" />
<Button x:Name="bModifier" Content="Modifier" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
Command="{Binding cModifier}" />
<Button x:Name="bSupprimer" Content="Supprimer" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
Command="{Binding cSupprimer}" />
</StackPanel>
<Button x:Name="BtnQuitter" Content="Quitter" HorizontalAlignment="Left" Margin="494,380,0,0" VerticalAlignment="Top" Width="92" Click="BtnQuitter_Click" Height="26"/>
</Grid>
</Window>

View File

@ -0,0 +1,33 @@
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.Shapes;
namespace ProjetTheAlone.View
{
/// <summary>
/// Logique d'interaction pour FicNewEquipe.xaml
/// </summary>
public partial class FicNewEquipe : Window
{
public FicNewEquipe()
{
InitializeComponent();
DataContext = new ViewModel.VM_Equipe();
}
private void BtnQuitter_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}

View File

@ -0,0 +1,53 @@
<Window x:Class="ProjetTheAlone.View.FicNewLieu"
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"
mc:Ignorable="d"
Title="NewLieu" Height="477.667" Width="627" WindowStartupLocation="CenterScreen" WindowStyle="None">
<Grid Margin="0,-3,2,2">
<Grid.RowDefinitions>
</Grid.RowDefinitions>
<Label Content="Type de Lieu" HorizontalAlignment="Left" Margin="24,34,0,0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20"/>
<Grid x:Name="UneFiche" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" Margin="384,120,31,307" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock x:Name="tNom" Text="Nom" Grid.Row="2" VerticalAlignment="Center" />
<TextBox x:Name="tbNom" Grid.Row="1" Grid.Column="1" Margin="3,3,0,22"
Text="{Binding UnLieu.Nom, Mode=TwoWay}" HorizontalAlignment="Left" Width="163" />
</Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="396,178,31,195" Width="190">
<Button x:Name="bConfirmer" Content="Confirmer" Margin="3" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}"
Command="{Binding cConfirmer}" />
<Button x:Name="bAnnuler" Content="Annuler" Margin="3,16,3,17" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}"
Command="{Binding cAnnuler}" />
</StackPanel>
<DataGrid ItemsSource="{Binding BcpLieux}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding LieuSelectionnee, Mode=TwoWay}" Margin="118,100,283,123" >
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_lieu}" />
<DataGridTextColumn Header="Type de Lieu" Binding="{Binding L_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="80,344,255,29" Width="282">
<Button x:Name="bAjouter" Content="Ajouter" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
Command="{Binding cAjouter}" />
<Button x:Name="bModifier" Content="Modifier" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
Command="{Binding cModifier}" />
<Button x:Name="bSupprimer" Content="Supprimer" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
Command="{Binding cSupprimer}" />
</StackPanel>
<Button x:Name="BtnQuitter" Content="Quitter" HorizontalAlignment="Left" Margin="494,380,0,0" VerticalAlignment="Top" Width="92" Click="BtnQuitter_Click" Height="26"/>
</Grid>
</Window>

View File

@ -0,0 +1,33 @@
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.Shapes;
namespace ProjetTheAlone.View
{
/// <summary>
/// Logique d'interaction pour FicNewLieu.xaml
/// </summary>
public partial class FicNewLieu : Window
{
public FicNewLieu()
{
InitializeComponent();
DataContext = new ViewModel.VM_Lieu();
}
private void BtnQuitter_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}

View File

@ -0,0 +1,53 @@
<Window x:Class="ProjetTheAlone.View.FicNewtypeEvent"
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"
mc:Ignorable="d"
Title="NewTypeEvent" Height="477.667" Width="627" WindowStartupLocation="CenterScreen" WindowStyle="None">
<Grid Margin="0,-3,2,2">
<Grid.RowDefinitions>
</Grid.RowDefinitions>
<Label Content="Type d'evénement" HorizontalAlignment="Left" Margin="24,34,0,0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20"/>
<Grid x:Name="UneFiche" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}" Margin="384,120,31,307" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock x:Name="tNom" Text="Nom" Grid.Row="2" VerticalAlignment="Center" />
<TextBox x:Name="tbNom" Grid.Row="1" Grid.Column="1" Margin="3,3,0,22"
Text="{Binding UnTypeEvent.Nom, Mode=TwoWay}" HorizontalAlignment="Left" Width="163" />
</Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="396,178,31,195" Width="190">
<Button x:Name="bConfirmer" Content="Confirmer" Margin="3" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}"
Command="{Binding cConfirmer}" />
<Button x:Name="bAnnuler" Content="Annuler" Margin="3,16,3,17" IsEnabled="{Binding ActiverUneFiche, Mode=OneWay}"
Command="{Binding cAnnuler}" />
</StackPanel>
<DataGrid ItemsSource="{Binding BcpTypeEvents}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding TypeEventSelectionnee, Mode=TwoWay}" Margin="118,100,283,123" >
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_typeEvenement}" />
<DataGridTextColumn Header="Type d'événement" Binding="{Binding TE_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="80,344,255,29" Width="282">
<Button x:Name="bAjouter" Content="Ajouter" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
Command="{Binding cAjouter}" />
<Button x:Name="bModifier" Content="Modifier" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
Command="{Binding cModifier}" />
<Button x:Name="bSupprimer" Content="Supprimer" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
Command="{Binding cSupprimer}" />
</StackPanel>
<Button x:Name="BtnQuitter" Content="Quitter" HorizontalAlignment="Left" Margin="494,380,0,0" VerticalAlignment="Top" Width="92" Click="BtnQuitter_Click" Height="26"/>
</Grid>
</Window>

View File

@ -0,0 +1,33 @@
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.Shapes;
namespace ProjetTheAlone.View
{
/// <summary>
/// Logique d'interaction pour FicNewtypeEvent.xaml
/// </summary>
public partial class FicNewtypeEvent : Window
{
public FicNewtypeEvent()
{
InitializeComponent();
DataContext = new ViewModel.VM_TypeEvent();
}
private void BtnQuitter_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}

View File

@ -7,46 +7,58 @@
mc:Ignorable="d" mc:Ignorable="d"
Title="FicRepas" Height="491.666" Width="1137.834" WindowStartupLocation="CenterScreen" WindowStyle="None"> Title="FicRepas" Height="491.666" Width="1137.834" WindowStartupLocation="CenterScreen" WindowStyle="None">
<Grid> <Grid>
<Button x:Name="btnQuitter" Margin="974,414,29,25" <Grid.ColumnDefinitions>
Content="Quitter" RenderTransformOrigin="0.017,0.519" Click="btnQuitter_Click" Height="Auto"/> <ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<StackPanel Margin="574,117,414,202"> <ColumnDefinition Width="Auto"></ColumnDefinition>
<Label Content="Type de plat" FontFamily="Calibri" FontSize="16" Height="40"/> <ColumnDefinition Width="*"></ColumnDefinition>
<CheckBox Name="CheckSoupe" Content="Soupe" FontFamily="Calibri" FontSize="14" Height="40" Checked="CheckSoupe_Checked"/> </Grid.ColumnDefinitions>
<CheckBox Name="CheckPlatP" Content="Plat principal" FontFamily="Calibri" FontSize="14" Height="40" Checked="CheckPlatP_Checked"/>
<CheckBox Name="CheckDessert" Content="Dessert" FontFamily="Calibri" FontSize="14" Height="40" Checked="CheckDessert_Checked"/>
</StackPanel>
<Calendar HorizontalAlignment="Left" Margin="51,103,0,0" VerticalAlignment="Top"/>
<ListView x:Name="lvPlat" Margin="382,107,579,215">
<ListView.View>
<GridView>
<GridViewColumn Width="160" Header="Plats"/>
</GridView>
</ListView.View>
</ListView>
<Label Content="Repas" HorizontalAlignment="Left" Margin="51,30,0,0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20"/> <Label Content="Repas" HorizontalAlignment="Left" Margin="51,30,0,0" VerticalAlignment="Top" FontFamily="Calibri" FontSize="20"/>
<Button x:Name="btnPlat" Margin="382,309,566,126" <Button x:Name="btnQuitter"
Content="Nouveau Plat" Click="btnPlat_Click" Height="Auto"/> Content="Quitter" RenderTransformOrigin="0.017,0.519" Click="btnQuitter_Click" Grid.Column="0" Height="30" VerticalAlignment="Bottom" Width="100"/>
<ListView x:Name="lvRepas" Margin="734,107,29,126">
<ListView.View>
<GridView>
<GridViewColumn Width="120" Header="Soupe"/>
<GridViewColumn Width="120" Header="Plat"/>
<GridViewColumn Width="120" Header="Dessert"/>
</GridView> <Calendar x:Name="DateV" SelectedDate="{Binding DateSelection, Mode=TwoWay}"
</ListView.View> HorizontalAlignment="Left" Margin="10,64,0,0" VerticalAlignment="Top" Height="338" Width="284" Grid.Column="0"
</ListView> />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="687,304,29,82" Width="414"> <Grid Grid.Column="1">
<Button x:Name="bAjouter" Content="Ajouter Repas" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}" <Grid.RowDefinitions>
Command="{Binding cAjouter}" /> <RowDefinition Height="Auto"></RowDefinition>
<Button x:Name="bModifier" Content="Modifier Repas" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}" <RowDefinition Height="*"/>
Command="{Binding cModifier}" /> <RowDefinition Height="auto" />
<Button x:Name="bSupprimer" Content="Supprimer Repas" Margin="3" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}" </Grid.RowDefinitions>
Command="{Binding cSupprimer}" /> <TextBlock FontFamily="Calibri" FontSize="20" HorizontalAlignment="Center">Lisst des plats disponible</TextBlock>
</StackPanel> <DataGrid x:Name="dgPlat" ItemsSource="{Binding BcpPlats}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False" IsEnabled="{Binding ActiverBcpFiche, Mode=OneWay}"
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Grid.Row="1" Height="auto">
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" />
<DataGridTextColumn Header="Plat" Binding="{Binding P_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
<Button x:Name="btnPlat"
Content="Gestion Plat" Click="btnPlat_Click" Height="30" Grid.Column="1" VerticalAlignment="Bottom" Grid.Row="1"/>
</Grid>
<Button x:Name="btnAddPlat"
Content="->" Click="btnAddPlat_Click" Height="30" Width="100" VerticalAlignment="Center" Grid.Column="2"/>
<Button x:Name="retirerPlat" Click="retirerPlat_Click"
Content="-" Height="30" Width="100" VerticalAlignment="Center" Grid.Column="2" Margin="0,262,0,192"/>
<Grid Grid.Column="3">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<TextBlock FontFamily="Calibri" FontSize="20" HorizontalAlignment="Center">Lisst des plat selectionné</TextBlock>
<DataGrid x:Name="dgLPS" ItemsSource="{Binding BcpPLatJourSelectionne}" VerticalScrollBarVisibility="Visible"
IsReadOnly="True" AutoGenerateColumns="False"
SelectedItem="{Binding PlatSelectionnee, Mode=TwoWay}" Grid.Row="1" Height="auto">
<DataGrid.Columns>
<DataGridTextColumn Visibility="Hidden" Binding="{Binding ID_plat}" />
<DataGridTextColumn Header="Plat" Binding="{Binding P_nom}" Width="*" />
</DataGrid.Columns>
</DataGrid>
</Grid>
</Grid> </Grid>
</Window> </Window>

View File

@ -1,4 +1,5 @@
using System; using ProjetTheAlone.Classes;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -22,6 +23,7 @@ namespace ProjetTheAlone.View
public FicRepasEncode() public FicRepasEncode()
{ {
InitializeComponent(); InitializeComponent();
this.DataContext = new ViewModel.VM_Repa();
} }
private void btnQuitter_Click(object sender, RoutedEventArgs e) private void btnQuitter_Click(object sender, RoutedEventArgs e)
@ -31,26 +33,85 @@ namespace ProjetTheAlone.View
private void CheckSoupe_Checked(object sender, RoutedEventArgs e) private void CheckSoupe_Checked(object sender, RoutedEventArgs e)
{ {
CheckPlatP.IsChecked = false; //CheckPlatP.IsChecked = false;
CheckDessert.IsChecked = false; //CheckDessert.IsChecked = false;
} }
private void CheckPlatP_Checked(object sender, RoutedEventArgs e) private void CheckPlatP_Checked(object sender, RoutedEventArgs e)
{ {
CheckDessert.IsChecked = false; //CheckDessert.IsChecked = false;
CheckSoupe.IsChecked = false; //CheckSoupe.IsChecked = false;
} }
private void CheckDessert_Checked(object sender, RoutedEventArgs e) private void CheckDessert_Checked(object sender, RoutedEventArgs e)
{ {
CheckPlatP.IsChecked = false; //CheckPlatP.IsChecked = false;
CheckSoupe.IsChecked = false; //CheckSoupe.IsChecked = false;
} }
private void btnPlat_Click(object sender, RoutedEventArgs e) private void btnPlat_Click(object sender, RoutedEventArgs e)
{ {
FicEncodePlat w = new FicEncodePlat(); FicEncodePlat w = new FicEncodePlat();
w.ShowDialog(); w.ShowDialog();
dgPlat.DataContext = new ViewModel.VM_Plat();
}
private void btnAddPlat_Click(object sender, RoutedEventArgs e)
{
if (dgPlat.SelectedItems.Count > 0 && DateV.SelectedDate.HasValue)
{
for (int i = 0; i < dgPlat.SelectedItems.Count; i++)
{
C_T_plat plat= (C_T_plat)dgPlat.SelectedItems[i];
if(((ViewModel.VM_Repa)dgLPS.DataContext).BcpPLatJourSelectionne.Where(ii => ii.ID_plat == plat.ID_plat).ToList().Count == 0)
{
((ViewModel.VM_Repa)dgPlat.DataContext).BcpPLatJourSelectionne.Add(plat);
new Gestion.G_T_listPlat(Config.Settings1.Default.schCon).Ajouter(DateV.SelectedDate.Value, plat.ID_plat);
}
}
}
}
private void DateV_SelectedDatesChanged(object sender, SelectionChangedEventArgs e)
{
Console.Write("");
}
private void Button_Click(object sender, RoutedEventArgs e)
{
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
}
private void Button_Click_2(object sender, RoutedEventArgs e)
{
}
private void retirerPlat_Click(object sender, RoutedEventArgs e)
{
if (dgLPS.SelectedItems.Count > 0 && DateV.SelectedDate.HasValue)
{
//((ViewModel.VM_Plat)dgPlat.DataContext).BcpPlats.Add();
for (int i = 0; i < dgLPS.SelectedItems.Count; i++)
{
C_T_plat plat = (C_T_plat)dgLPS.SelectedItems[i];
((ViewModel.VM_Repa)dgLPS.DataContext).BcpPLatJourSelectionne.Remove(((ViewModel.VM_Repa)dgLPS.DataContext).BcpPLatJourSelectionne.Where(ii => ii.ID_plat == plat.ID_plat).First());
new Gestion.G_T_listPlat(Config.Settings1.Default.schCon).Supprimer(plat.ID_plat, DateV.SelectedDate.Value);
}
}
} }
} }
} }

View File

@ -7,13 +7,14 @@ using System.ComponentModel;
using ProjetTheAlone.Classes; using ProjetTheAlone.Classes;
using ProjetTheAlone.Gestion; using ProjetTheAlone.Gestion;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using ProjetTheAlone.Config;
namespace ProjetTheAlone.ViewModel namespace ProjetTheAlone.ViewModel
{ {
public class VM_Beneficiaire : BasePropriete public class VM_Beneficiaire : BasePropriete
{ {
#region Données Écran #region Données Écran
private string chConnexion = Settings1.Default.schCon /*@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True"*/; private string chConnexion = Settings2.Default.schCon /*@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True"*/;
private int nAjout; private int nAjout;
private bool _ActiverUneFiche; private bool _ActiverUneFiche;
public bool ActiverUneFiche public bool ActiverUneFiche
@ -105,6 +106,7 @@ namespace ProjetTheAlone.ViewModel
public void Ajouter() public void Ajouter()
{ {
UnBeneficiaire = new VM_UnBeneficiaire(); UnBeneficiaire = new VM_UnBeneficiaire();
UnBeneficiaire.Annif = DateTime.Now;
nAjout = -1; nAjout = -1;
ActiverUneFiche = true; ActiverUneFiche = true;
} }
@ -136,7 +138,8 @@ namespace ProjetTheAlone.ViewModel
public class VM_UnBeneficiaire : BasePropriete public class VM_UnBeneficiaire : BasePropriete
{ {
private int _ID; private int _ID;
private string _Nom, _Pre,_Img; private string _Nom, _Pre;
byte?[] _Img;
private DateTime _Annif; private DateTime _Annif;
public int ID public int ID
@ -160,10 +163,10 @@ namespace ProjetTheAlone.ViewModel
set { AssignerChamp<DateTime>(ref _Annif, value, System.Reflection.MethodBase.GetCurrentMethod().Name); } set { AssignerChamp<DateTime>(ref _Annif, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
} }
public string Img public byte?[] Img
{ {
get { return _Img; } get { return _Img; }
set { AssignerChamp<string>(ref _Img, value, System.Reflection.MethodBase.GetCurrentMethod().Name); } set { AssignerChamp<byte?[]>(ref _Img, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
} }
} }
} }

View File

@ -0,0 +1,169 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProjetTheAlone.Classes;
using ProjetTheAlone.Gestion;
using System.Collections.ObjectModel;
using System.IO;
using ProjetTheAlone.Config;
namespace ProjetTheAlone.ViewModel
{
public class VM_Equipe : BasePropriete
{
#region Données Écran
private string chConnexion = Settings2.Default.schCon /*@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True"*/;
private int nAjout;
private bool _ActiverUneFiche;
public bool ActiverUneFiche
{
get { return _ActiverUneFiche; }
set
{
AssignerChamp<bool>(ref _ActiverUneFiche, value, System.Reflection.MethodBase.GetCurrentMethod().Name);
ActiverBcpFiche = !ActiverUneFiche;
}
}
private bool _ActiverBcpFiche;
public bool ActiverBcpFiche
{
get { return _ActiverBcpFiche; }
set { AssignerChamp<bool>(ref _ActiverBcpFiche, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private C_T_equipe _EquipeSelectionnee;
public C_T_equipe EquipeSelectionnee
{
get { return _EquipeSelectionnee; }
set { AssignerChamp<C_T_equipe>(ref _EquipeSelectionnee, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
#endregion
#region Données extérieures
private VM_UneEquipe _UneEquipe;
public VM_UneEquipe UneEquipe
{
get { return _UneEquipe; }
set { AssignerChamp<VM_UneEquipe>(ref _UneEquipe, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private ObservableCollection<C_T_equipe> _BcpEquipes = new ObservableCollection<C_T_equipe>();
public ObservableCollection<C_T_equipe> BcpEquipes
{
get { return _BcpEquipes; }
set { _BcpEquipes = value; }
}
#endregion
public VM_Equipe()
{
UneEquipe = new VM_UneEquipe();
UneEquipe.ID = 0;
UneEquipe.Nom = "Nom de l'équipe";
BcpEquipes = ChargerPersonnes(chConnexion);
ActiverUneFiche = false;
cConfirmer = new BaseCommande(Confirmer);
cAnnuler = new BaseCommande(Annuler);
cAjouter = new BaseCommande(Ajouter);
cModifier = new BaseCommande(Modifier);
cSupprimer = new BaseCommande(Supprimer);
}
#region Commandes
public BaseCommande cConfirmer { get; set; }
public BaseCommande cAnnuler { get; set; }
public BaseCommande cAjouter { get; set; }
public BaseCommande cModifier { get; set; }
public BaseCommande cSupprimer { get; set; }
#endregion
private ObservableCollection<C_T_equipe> ChargerPersonnes(string chConn)
{
ObservableCollection<C_T_equipe> rep = new ObservableCollection<C_T_equipe>();
List<C_T_equipe> lTmp = new G_T_equipe(chConn).Lire("L_nom");
foreach (C_T_equipe Tmp in lTmp)
rep.Add(Tmp);
return rep;
}
public void Confirmer()
{
if (nAjout == -1)
{
UneEquipe.ID = new G_T_equipe(chConnexion).Ajouter(UneEquipe.Nom,0,null);
BcpEquipes.Add(new C_T_equipe(UneEquipe.ID, UneEquipe.Nom,0, null));
}
else
{
new G_T_equipe(chConnexion).Modifier(UneEquipe.ID, UneEquipe.Nom, 0, null);
BcpEquipes[nAjout] = new C_T_equipe(UneEquipe.ID, UneEquipe.Nom, 0, null);
}
ActiverUneFiche = false;
}
public void Annuler()
{ ActiverUneFiche = false; }
public void Ajouter()
{
UneEquipe = new VM_UneEquipe();
nAjout = -1;
ActiverUneFiche = true;
}
public void Modifier()
{
if (EquipeSelectionnee != null)
{
C_T_equipe Tmp = new G_T_equipe(chConnexion).Lire_ID(EquipeSelectionnee.ID_equipe);
UneEquipe = new VM_UneEquipe();
UneEquipe.ID = Tmp.ID_equipe;
UneEquipe.Nom = Tmp.E_nom;
UneEquipe.Point = Tmp.E_point;
UneEquipe.IDEvent = Tmp.ID_evenement.Value;
nAjout = BcpEquipes.IndexOf(EquipeSelectionnee);
ActiverUneFiche = true;
}
}
public void Supprimer()
{
if (EquipeSelectionnee != null)
{
new G_T_equipe(chConnexion).Supprimer(EquipeSelectionnee.ID_equipe);
BcpEquipes.Remove(EquipeSelectionnee);
}
}
}
public class VM_UneEquipe : BasePropriete
{
private int _ID,_Point;
private string _Nom;
private int _IDEvent;
public int ID
{
get { return _ID; }
set { AssignerChamp<int>(ref _ID, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public string Nom
{
get { return _Nom; }
set { AssignerChamp<string>(ref _Nom, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public int Point
{
get { return _Point; }
set { AssignerChamp<int>(ref _Point, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public int IDEvent
{
get { return _IDEvent; }
set { AssignerChamp<int>(ref _IDEvent, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
}
}

View File

@ -0,0 +1,420 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProjetTheAlone.Classes;
using ProjetTheAlone.Gestion;
using System.Collections.ObjectModel;
using System.IO;
using ProjetTheAlone.Config;
namespace ProjetTheAlone.ViewModel
{
public class VM_Event : BasePropriete
{
#region Données Écran
private string chConnexion = Settings2.Default.schCon /*@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True"*/;
private int nAjout;
private bool _ActiverUneFiche;
public bool ActiverUneFiche
{
get { return _ActiverUneFiche; }
set
{
AssignerChamp<bool>(ref _ActiverUneFiche, value, System.Reflection.MethodBase.GetCurrentMethod().Name);
ActiverBcpFiche = !ActiverUneFiche;
}
}
private bool _ActiverBcpFiche;
public bool ActiverBcpFiche
{
get { return _ActiverBcpFiche; }
set { AssignerChamp<bool>(ref _ActiverBcpFiche, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
#endregion
#region Données Sélectionnée
private C_T_event _EventSelectionnee;
public C_T_event EventSelectionnee
{
get { return _EventSelectionnee; }
set { AssignerChamp<C_T_event>(ref _EventSelectionnee, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private C_T_listParticipant _JoueurSelectionnee;
public C_T_listParticipant JoueurSelectionnee
{
get { return _JoueurSelectionnee; }
set { AssignerChamp<C_T_listParticipant>(ref _JoueurSelectionnee, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private C_T_equipe _EquipeSelectionnee;
public C_T_equipe EquipeSelectionnee
{
get { return _EquipeSelectionnee; }
set { AssignerChamp<C_T_equipe>(ref _EquipeSelectionnee, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private C_T_typeEvenement _TypeEventSelectionnee;
public C_T_typeEvenement TypeEventSelectionnee
{
get { return _TypeEventSelectionnee; }
set { AssignerChamp<C_T_typeEvenement>(ref _TypeEventSelectionnee, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private C_T_lieu _LieuSelectionnee;
public C_T_lieu LieuSelectionnee
{
get { return _LieuSelectionnee; }
set { AssignerChamp<C_T_lieu>(ref _LieuSelectionnee, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private C_T_beneficiaire _ParticipantSelectionnee;
public C_T_beneficiaire ParticipantSelectionnee
{
get { return _ParticipantSelectionnee; }
set { AssignerChamp<C_T_beneficiaire>(ref _ParticipantSelectionnee, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
#endregion
#region Données extérieures
private VM_UnEvent _UnEvent;
public VM_UnEvent UnEvent
{
get { return _UnEvent; }
set { AssignerChamp<VM_UnEvent>(ref _UnEvent, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private ObservableCollection<C_T_event> _BcpEvents = new ObservableCollection<C_T_event>();
public ObservableCollection<C_T_event> BcpEvents
{
get { return _BcpEvents; }
set { AssignerChamp<ObservableCollection<C_T_event>>(ref _BcpEvents, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private VM_UnLieu _UnLieu;
public VM_UnLieu UnLieu
{
get { return _UnLieu; }
set { AssignerChamp<VM_UnLieu>(ref _UnLieu, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private ObservableCollection<C_T_lieu> _BcpLieux = new ObservableCollection<C_T_lieu>();
public ObservableCollection<C_T_lieu> BcpLieux
{
get { return _BcpLieux; }
set { AssignerChamp<ObservableCollection<C_T_lieu>>(ref _BcpLieux, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private VM_UneEquipe _UneEquipe;
public VM_UneEquipe UneEquipe
{
get { return _UneEquipe; }
set { AssignerChamp<VM_UneEquipe>(ref _UneEquipe, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private ObservableCollection<C_T_equipe> _BcpEquipes = new ObservableCollection<C_T_equipe>();
public ObservableCollection<C_T_equipe> BcpEquipes
{
get { return _BcpEquipes; }
set { AssignerChamp<ObservableCollection<C_T_equipe>>(ref _BcpEquipes, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private VM_UnTypeEvent _UnTypeEvent;
public VM_UnTypeEvent UnTypeEvent
{
get { return _UnTypeEvent; }
set { AssignerChamp<VM_UnTypeEvent>(ref _UnTypeEvent, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private ObservableCollection<C_T_typeEvenement> _BcpTypeEvents = new ObservableCollection<C_T_typeEvenement>();
public ObservableCollection<C_T_typeEvenement> BcpTypeEvents
{
get { return _BcpTypeEvents; }
set { AssignerChamp<ObservableCollection<C_T_typeEvenement>>(ref _BcpTypeEvents, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private VM_UnBeneficiaire _UnParticipant;
public VM_UnBeneficiaire UnParticipant
{
get { return _UnParticipant; }
set { AssignerChamp<VM_UnBeneficiaire>(ref _UnParticipant, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private ObservableCollection<C_T_beneficiaire> _BcpParticipants = new ObservableCollection<C_T_beneficiaire>();
public ObservableCollection<C_T_beneficiaire> BcpParticipants
{
get { return _BcpParticipants; }
set { AssignerChamp<ObservableCollection<C_T_beneficiaire>>(ref _BcpParticipants, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private VM_UnJoueur _UnJoueur;
public VM_UnJoueur UnJoueur
{
get { return _UnJoueur; }
set { AssignerChamp<VM_UnJoueur>(ref _UnJoueur, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private ObservableCollection<C_T_listParticipant> _BcpJoueurs = new ObservableCollection<C_T_listParticipant>();
public ObservableCollection<C_T_listParticipant> BcpJoueurs
{
get { return _BcpJoueurs; }
set { AssignerChamp<ObservableCollection<C_T_listParticipant>>(ref _BcpJoueurs, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
#endregion
public VM_Event()
{
UnEvent = new VM_UnEvent();
UnEvent.ID = 0;
UnEvent.Date = DateTime.Now;
UnEvent.Description = "Description de l'événement";
UnEvent.Duree = DateTime.Now;
BcpEvents = ChargerEvents(chConnexion);
BcpLieux = ChargerLieux(chConnexion);
BcpTypeEvents = ChargerTypeEvent(chConnexion);
BcpEquipes = ChargerEquipes(chConnexion);
BcpParticipants = ChargerParticipant(chConnexion);
BcpJoueurs = ChargerJoueur(chConnexion);
ActiverUneFiche = false;
cConfirmer = new BaseCommande(Confirmer);
cAnnuler = new BaseCommande(Annuler);
cAjouter = new BaseCommande(Ajouter);
cAjouterJoueur = new BaseCommande(AjouterJoueur);
cModifier = new BaseCommande(Modifier);
cSupprimer = new BaseCommande(Supprimer);
cSupprimerJoueur = new BaseCommande(SupprimerJoueur);
cAjouterEquipe = new BaseCommande(AjouterEquipe);
}
#region Commandes
public BaseCommande cConfirmer { get; set; }
public BaseCommande cAnnuler { get; set; }
public BaseCommande cAjouter { get; set; }
public BaseCommande cAjouterJoueur { get; set; }
public BaseCommande cModifier { get; set; }
public BaseCommande cSupprimer { get; set; }
public BaseCommande cSupprimerJoueur { get; set; }
public BaseCommande cAjouterEquipe { get; set; }
#endregion
#region Chargement
private ObservableCollection<C_T_event> ChargerEvents(string chConn)
{
ObservableCollection<C_T_event> rep = new ObservableCollection<C_T_event>();
List<C_T_event> lTmp = new G_T_event(chConn).Lire("E_date");
foreach (C_T_event Tmp in lTmp)
rep.Add(Tmp);
return rep;
}
private ObservableCollection<C_T_lieu> ChargerLieux(string chConn)
{
ObservableCollection<C_T_lieu> rep = new ObservableCollection<C_T_lieu>();
List<C_T_lieu> lTmp = new G_T_lieu(chConn).Lire("L_nom");
foreach (C_T_lieu Tmp in lTmp)
rep.Add(Tmp);
return rep;
}
private ObservableCollection<C_T_typeEvenement> ChargerTypeEvent(string chConn)
{
ObservableCollection<C_T_typeEvenement> rep = new ObservableCollection<C_T_typeEvenement>();
List<C_T_typeEvenement> lTmp = new G_T_typeEvenement(chConn).Lire("TE_nom");
foreach (C_T_typeEvenement Tmp in lTmp)
rep.Add(Tmp);
return rep;
}
private ObservableCollection<C_T_equipe> ChargerEquipes(string chConn)
{
ObservableCollection<C_T_equipe> rep = new ObservableCollection<C_T_equipe>();
List<C_T_equipe> lTmp = new G_T_equipe(chConn).Lire("L_nom");
foreach (C_T_equipe Tmp in lTmp)
rep.Add(Tmp);
return rep;
}
private ObservableCollection<C_T_beneficiaire> ChargerParticipant(string chConn)
{
ObservableCollection<C_T_beneficiaire> rep = new ObservableCollection<C_T_beneficiaire>();
List<C_T_beneficiaire> lTmp = new G_T_beneficiaire(chConn).Lire("B_nom");
foreach (C_T_beneficiaire Tmp in lTmp)
rep.Add(Tmp);
return rep;
}
private ObservableCollection<C_T_listParticipant> ChargerJoueur (string chConn)
{
ObservableCollection<C_T_listParticipant> rep = new ObservableCollection<C_T_listParticipant>();
List< C_T_listParticipant> lTmp = new G_T_listParticipant(chConn).Lire("ID_benificiaire");
foreach (C_T_listParticipant Tmp in lTmp)
rep.Add(Tmp);
return rep;
}
#endregion
public void Confirmer()
{
if (TypeEventSelectionnee != null && LieuSelectionnee != null) {
if (nAjout == -1)
{
UnEvent.ID = new G_T_event(chConnexion).Ajouter(UnEvent.Date, UnEvent.Duree, TypeEventSelectionnee.ID_typeEvenement, UnEvent.Description, LieuSelectionnee.ID_lieu, null);
BcpEvents.Add(new C_T_event(UnEvent.ID, UnEvent.Date, UnEvent.Duree, TypeEventSelectionnee.ID_typeEvenement, UnEvent.Description, LieuSelectionnee.ID_lieu, null));
}
else
{
new G_T_event(chConnexion).Modifier(UnEvent.ID, UnEvent.Date, UnEvent.Duree, TypeEventSelectionnee.ID_typeEvenement, UnEvent.Description, LieuSelectionnee.ID_lieu, null);
BcpEvents[nAjout] = new C_T_event(UnEvent.ID, UnEvent.Date, UnEvent.Duree, TypeEventSelectionnee.ID_typeEvenement, UnEvent.Description, LieuSelectionnee.ID_lieu, null);
}
ActiverUneFiche = false;
}
}
public void Annuler()
{ ActiverUneFiche = false; }
public void Ajouter()
{
UnEvent = new VM_UnEvent();
UnEvent.Date = DateTime.Now ;
UnEvent.Description = "Description de l'événement" ;
UnEvent.Duree = DateTime.Now ;
nAjout = -1;
ActiverUneFiche = true;
}
public void AjouterJoueur()
{
if (ParticipantSelectionnee !=null && EquipeSelectionnee != null)
{
UnJoueur = new VM_UnJoueur();
UnJoueur.ID = new G_T_listParticipant(chConnexion).Ajouter(EquipeSelectionnee.ID_equipe, ParticipantSelectionnee.ID_beneficiaire);
BcpJoueurs.Add(new C_T_listParticipant(UnJoueur.ID, EquipeSelectionnee.ID_equipe, ParticipantSelectionnee.ID_beneficiaire));
}
}
public void AjouterEquipe()
{
if (EventSelectionnee != null && EquipeSelectionnee != null)
{
C_T_equipe Tmp = new G_T_equipe(chConnexion).Lire_ID(EquipeSelectionnee.ID_equipe);
UneEquipe = new VM_UneEquipe();
UneEquipe.ID = Tmp.ID_equipe;
UneEquipe.Nom = Tmp.E_nom;
UneEquipe.Point = Tmp.E_point;
new G_T_equipe(chConnexion).Modifier(UneEquipe.ID, UneEquipe.Nom, 0, EventSelectionnee.ID_event);
BcpEquipes[BcpEquipes.IndexOf(EquipeSelectionnee)] = new C_T_equipe(UneEquipe.ID, UneEquipe.Nom, 0, EventSelectionnee.ID_event);
}
}
public void Modifier()
{
if (EventSelectionnee != null)
{
C_T_event Tmp = new G_T_event(chConnexion).Lire_ID(EventSelectionnee.ID_event);
UnEvent = new VM_UnEvent();
UnEvent.ID = Tmp.ID_event;
UnEvent.Date = Tmp.E_date.Value;
UnEvent.Description = Tmp.E_description;
UnEvent.Duree = Tmp.E_duree.Value;
UnEvent.ID_TypeEvent = Tmp.ID_typeEvenement.Value;
UnEvent.ID_Lieu = Tmp.ID_lieu.Value;
UnEvent.Img = Tmp.E_Pic;
nAjout = BcpEvents.IndexOf(EventSelectionnee);
ActiverUneFiche = true;
}
}
public void Supprimer()
{
if (EventSelectionnee != null)
{
new G_T_event(chConnexion).Supprimer(EventSelectionnee.ID_event);
BcpEvents.Remove(EventSelectionnee);
}
}
public void SupprimerJoueur()
{
if (JoueurSelectionnee != null)
{
new G_T_listParticipant(chConnexion).Supprimer(JoueurSelectionnee.ID_LP);
BcpJoueurs.Remove(JoueurSelectionnee);
}
}
}
public class VM_UnEvent : BasePropriete
{
private int _ID,_ID_TypeEvent,_ID_Lieu;
private string _Description;
private DateTime _Duree, _Date;
private byte?[] _Img;
public int ID
{
get { return _ID; }
set { AssignerChamp<int>(ref _ID, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public string Description
{
get { return _Description; }
set { AssignerChamp<string>(ref _Description, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public int ID_Lieu
{
get { return _ID_Lieu; }
set { AssignerChamp<int>(ref _ID_Lieu, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public int ID_TypeEvent
{
get { return _ID_TypeEvent; }
set { AssignerChamp<int>(ref _ID_TypeEvent, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public byte?[] Img
{
get { return _Img; }
set { AssignerChamp<byte?[]>(ref _Img, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public DateTime Duree
{
get { return _Duree; }
set { AssignerChamp<DateTime>(ref _Duree, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public DateTime Date
{
get { return _Date; }
set { AssignerChamp<DateTime>(ref _Date, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
}
public class VM_UnJoueur : BasePropriete
{
private int _ID, _ID_Equipe, _ID_Beneficiaire;
public int ID
{
get { return _ID; }
set { AssignerChamp<int>(ref _ID, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public int ID_Equipe
{
get { return _ID_Equipe; }
set { AssignerChamp<int>(ref _ID_Equipe, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public int ID_Beneficiaire
{
get { return _ID_Beneficiaire; }
set { AssignerChamp<int>(ref _ID_Beneficiaire, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
}
}

View File

@ -0,0 +1,154 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProjetTheAlone.Classes;
using ProjetTheAlone.Gestion;
using System.Collections.ObjectModel;
using System.IO;
using ProjetTheAlone.Config;
namespace ProjetTheAlone.ViewModel
{
public class VM_Lieu : BasePropriete
{
#region Données Écran
private string chConnexion = Settings2.Default.schCon /*@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True"*/;
private int nAjout;
private bool _ActiverUneFiche;
public bool ActiverUneFiche
{
get { return _ActiverUneFiche; }
set
{
AssignerChamp<bool>(ref _ActiverUneFiche, value, System.Reflection.MethodBase.GetCurrentMethod().Name);
ActiverBcpFiche = !ActiverUneFiche;
}
}
private bool _ActiverBcpFiche;
public bool ActiverBcpFiche
{
get { return _ActiverBcpFiche; }
set { AssignerChamp<bool>(ref _ActiverBcpFiche, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private C_T_lieu _LieuSelectionnee;
public C_T_lieu LieuSelectionnee
{
get { return _LieuSelectionnee; }
set { AssignerChamp<C_T_lieu>(ref _LieuSelectionnee, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
#endregion
#region Données extérieures
private VM_UnLieu _UnLieu;
public VM_UnLieu UnLieu
{
get { return _UnLieu; }
set { AssignerChamp<VM_UnLieu>(ref _UnLieu, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private ObservableCollection<C_T_lieu> _BcpLieux = new ObservableCollection<C_T_lieu>();
public ObservableCollection<C_T_lieu> BcpLieux
{
get { return _BcpLieux; }
set { AssignerChamp <ObservableCollection<C_T_lieu>>(ref _BcpLieux, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
#endregion
public VM_Lieu()
{
UnLieu = new VM_UnLieu();
UnLieu.ID = 0;
UnLieu.Nom = "Nom du Lieu";
BcpLieux = ChargerPersonnes(chConnexion);
ActiverUneFiche = false;
cConfirmer = new BaseCommande(Confirmer);
cAnnuler = new BaseCommande(Annuler);
cAjouter = new BaseCommande(Ajouter);
cModifier = new BaseCommande(Modifier);
cSupprimer = new BaseCommande(Supprimer);
}
#region Commandes
public BaseCommande cConfirmer { get; set; }
public BaseCommande cAnnuler { get; set; }
public BaseCommande cAjouter { get; set; }
public BaseCommande cModifier { get; set; }
public BaseCommande cSupprimer { get; set; }
#endregion
public ObservableCollection<C_T_lieu> ChargerPersonnes(string chConn)
{
ObservableCollection<C_T_lieu> rep = new ObservableCollection<C_T_lieu>();
List<C_T_lieu> lTmp = new G_T_lieu(chConn).Lire("L_nom");
foreach (C_T_lieu Tmp in lTmp)
rep.Add(Tmp);
return rep;
}
public void Confirmer()
{
if (nAjout == -1)
{
UnLieu.ID = new G_T_lieu(chConnexion).Ajouter(UnLieu.Nom);
BcpLieux.Add(new C_T_lieu(UnLieu.ID, UnLieu.Nom));
}
else
{
new G_T_lieu(chConnexion).Modifier(UnLieu.ID, UnLieu.Nom);
BcpLieux[nAjout] = new C_T_lieu(UnLieu.ID, UnLieu.Nom);
}
ActiverUneFiche = false;
}
public void Annuler()
{ ActiverUneFiche = false; }
public void Ajouter()
{
UnLieu = new VM_UnLieu();
nAjout = -1;
ActiverUneFiche = true;
}
public void Modifier()
{
if (LieuSelectionnee != null)
{
C_T_lieu Tmp = new G_T_lieu(chConnexion).Lire_ID(LieuSelectionnee.ID_lieu);
UnLieu = new VM_UnLieu();
UnLieu.ID = Tmp.ID_lieu;
UnLieu.Nom = Tmp.L_nom;
nAjout = BcpLieux.IndexOf(LieuSelectionnee);
ActiverUneFiche = true;
}
}
public void Supprimer()
{
if (LieuSelectionnee != null)
{
new G_T_lieu(chConnexion).Supprimer(LieuSelectionnee.ID_lieu);
BcpLieux.Remove(LieuSelectionnee);
}
}
}
public class VM_UnLieu : BasePropriete
{
private int _ID;
private string _Nom;
public int ID
{
get { return _ID; }
set { AssignerChamp<int>(ref _ID, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public string Nom
{
get { return _Nom; }
set { AssignerChamp<string>(ref _Nom, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
}
}

View File

@ -7,6 +7,7 @@ using ProjetTheAlone.Classes;
using ProjetTheAlone.Gestion; using ProjetTheAlone.Gestion;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.IO; using System.IO;
using ProjetTheAlone.Config;
namespace ProjetTheAlone.ViewModel namespace ProjetTheAlone.ViewModel
{ {
@ -15,7 +16,7 @@ namespace ProjetTheAlone.ViewModel
{ {
#region Données Écran #region Données Écran
private string chConnexion = Settings1.Default.schCon /*@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True"*/; private string chConnexion = Settings2.Default.schCon /*@"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename='C:\Users\Hugues\Haute Ecole de la ville de Liège\Adrien VAN DAMME - ProjetTheAlone\ProjetTheAlone\ProjetThe.mdf';Integrated Security = True"*/;
private int nAjout; private int nAjout;
private int typeplat=0; private int typeplat=0;
private bool _ActiverUneFiche; private bool _ActiverUneFiche;
@ -81,7 +82,7 @@ namespace ProjetTheAlone.ViewModel
private ObservableCollection<C_T_plat> ChargerPersonnes(string chConn) private ObservableCollection<C_T_plat> ChargerPersonnes(string chConn)
{ {
ObservableCollection<C_T_plat> rep = new ObservableCollection<C_T_plat>(); ObservableCollection<C_T_plat> rep = new ObservableCollection<C_T_plat>();
List<C_T_plat> lTmp = new G_T_plat(chConn).Lire("B_nom"); List<C_T_plat> lTmp = new G_T_plat(chConn).Lire("P_nom");
foreach (C_T_plat Tmp in lTmp) foreach (C_T_plat Tmp in lTmp)
rep.Add(Tmp); rep.Add(Tmp);
return rep; return rep;
@ -91,13 +92,13 @@ namespace ProjetTheAlone.ViewModel
{ {
if (nAjout == -1) if (nAjout == -1)
{ {
UnPlat.ID = new G_T_plat(chConnexion).Ajouter(UnPlat.Nom, UnPlat.Img,typeplat); UnPlat.ID = new G_T_plat(chConnexion).Ajouter(UnPlat.Nom, UnPlat.Img,(int)UnPlat.TypePlat);
BcpPlats.Add(new C_T_plat(UnPlat.ID, UnPlat.Nom, UnPlat.Img,typeplat)); BcpPlats.Add(new C_T_plat(UnPlat.ID, UnPlat.Nom, UnPlat.Img, (int)UnPlat.TypePlat));
} }
else else
{ {
new G_T_plat(chConnexion).Modifier(UnPlat.ID, UnPlat.Nom, UnPlat.Img,typeplat); new G_T_plat(chConnexion).Modifier(UnPlat.ID, UnPlat.Nom, UnPlat.Img, (int)UnPlat.TypePlat);
BcpPlats[nAjout] = new C_T_plat(UnPlat.ID, UnPlat.Nom, UnPlat.Img, typeplat); BcpPlats[nAjout] = new C_T_plat(UnPlat.ID, UnPlat.Nom, UnPlat.Img, (int)UnPlat.TypePlat);
} }
ActiverUneFiche = false; ActiverUneFiche = false;
} }
@ -134,9 +135,10 @@ namespace ProjetTheAlone.ViewModel
} }
public class VM_UnPlat : BasePropriete public class VM_UnPlat : BasePropriete
{ {
private int _ID,_TypePlat; private int _ID;
Classes.C_T_plat.TypePlat_E _TypePlat;
private string _Nom; private string _Nom;
private byte[] _Img; private byte?[] _Img;
public int ID public int ID
{ {
@ -150,16 +152,16 @@ namespace ProjetTheAlone.ViewModel
set { AssignerChamp<string>(ref _Nom, value, System.Reflection.MethodBase.GetCurrentMethod().Name); } set { AssignerChamp<string>(ref _Nom, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
} }
public byte[] Img public byte?[] Img
{ {
get { return _Img; } get { return _Img; }
set { AssignerChamp<byte[]> (ref _Img, value, System.Reflection.MethodBase.GetCurrentMethod().Name); } set { AssignerChamp<byte?[]> (ref _Img, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
} }
public int TypePlat public Classes.C_T_plat.TypePlat_E TypePlat
{ {
get { return _TypePlat; } get { return _TypePlat; }
set { AssignerChamp<int>(ref _TypePlat, value, System.Reflection.MethodBase.GetCurrentMethod().Name); } set { AssignerChamp<Classes.C_T_plat.TypePlat_E>(ref _TypePlat, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
} }
} }
} }

Some files were not shown because too many files have changed in this diff Show More