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

@@ -7,13 +7,14 @@ using System.ComponentModel;
using ProjetTheAlone.Classes;
using ProjetTheAlone.Gestion;
using System.Collections.ObjectModel;
using ProjetTheAlone.Config;
namespace ProjetTheAlone.ViewModel
{
public class VM_Beneficiaire : BasePropriete
{
#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 bool _ActiverUneFiche;
public bool ActiverUneFiche
@@ -105,6 +106,7 @@ namespace ProjetTheAlone.ViewModel
public void Ajouter()
{
UnBeneficiaire = new VM_UnBeneficiaire();
UnBeneficiaire.Annif = DateTime.Now;
nAjout = -1;
ActiverUneFiche = true;
}
@@ -136,7 +138,8 @@ namespace ProjetTheAlone.ViewModel
public class VM_UnBeneficiaire : BasePropriete
{
private int _ID;
private string _Nom, _Pre,_Img;
private string _Nom, _Pre;
byte?[] _Img;
private DateTime _Annif;
public int ID
@@ -160,10 +163,10 @@ namespace ProjetTheAlone.ViewModel
set { AssignerChamp<DateTime>(ref _Annif, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public string Img
public byte?[] 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 System.Collections.ObjectModel;
using System.IO;
using ProjetTheAlone.Config;
namespace ProjetTheAlone.ViewModel
{
@@ -15,7 +16,7 @@ namespace ProjetTheAlone.ViewModel
{
#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 typeplat=0;
private bool _ActiverUneFiche;
@@ -81,7 +82,7 @@ namespace ProjetTheAlone.ViewModel
private ObservableCollection<C_T_plat> ChargerPersonnes(string chConn)
{
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)
rep.Add(Tmp);
return rep;
@@ -91,13 +92,13 @@ namespace ProjetTheAlone.ViewModel
{
if (nAjout == -1)
{
UnPlat.ID = new G_T_plat(chConnexion).Ajouter(UnPlat.Nom, UnPlat.Img,typeplat);
BcpPlats.Add(new C_T_plat(UnPlat.ID, 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, (int)UnPlat.TypePlat));
}
else
{
new G_T_plat(chConnexion).Modifier(UnPlat.ID, UnPlat.Nom, UnPlat.Img,typeplat);
BcpPlats[nAjout] = new C_T_plat(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, (int)UnPlat.TypePlat);
}
ActiverUneFiche = false;
}
@@ -134,9 +135,10 @@ namespace ProjetTheAlone.ViewModel
}
public class VM_UnPlat : BasePropriete
{
private int _ID,_TypePlat;
private int _ID;
Classes.C_T_plat.TypePlat_E _TypePlat;
private string _Nom;
private byte[] _Img;
private byte?[] _Img;
public int ID
{
@@ -150,16 +152,16 @@ namespace ProjetTheAlone.ViewModel
set { AssignerChamp<string>(ref _Nom, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public byte[] Img
public byte?[] 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; }
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); }
}
}
}

View File

@@ -0,0 +1,110 @@
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;
using System.Windows.Controls;
namespace ProjetTheAlone.ViewModel
{
public class VM_Repa : 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"*/;
#endregion
#region Données extérieures
private DateTime dateSelection;
public DateTime DateSelection { get => dateSelection; set { AssignerChamp<DateTime>(ref dateSelection, value, System.Reflection.MethodBase.GetCurrentMethod().Name); } }
private ObservableCollection<C_T_plat> _BcpPlats = new ObservableCollection<C_T_plat>();
private ObservableCollection<C_T_plat> _BcpPLatJourSelectionne = new ObservableCollection<C_T_plat>();
public ObservableCollection<C_T_plat> BcpPlats
{
get { return _BcpPlats; }
set { _BcpPlats = value; }
}
public ObservableCollection<C_T_plat> BcpPLatJourSelectionne { get => _BcpPLatJourSelectionne; set => AssignerChamp< ObservableCollection<C_T_plat>>(ref _BcpPLatJourSelectionne, value, System.Reflection.MethodBase.GetCurrentMethod().Name) ; }
#endregion
public VM_Repa()
{
cConfirmer = new BaseCommande(Confirmer);
cSupprimer = new BaseCommande(Supprimer);
cSupprimer = new BaseCommande(calendar_SelectedDatesChanged);
DateSelection = DateTime.Now.AddDays(7);
BcpPlats = ChargerRepa(chConnexion);
BcpPLatJourSelectionne = ChargerRepa(chConnexion, DateSelection);
base.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(onPropertyChanged);
}
#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; }
public BaseCommande cCalendar_SelectedDatesChanged { get; set; }
#endregion
private ObservableCollection<C_T_plat> ChargerRepa(string chConn)
{
ObservableCollection<C_T_plat> rep = new ObservableCollection<C_T_plat>();
List<C_T_plat> lTmp = new G_T_plat(chConn).Lire("");
foreach (C_T_plat Tmp in lTmp)
rep.Add(Tmp);
return rep;
}
public ObservableCollection<C_T_plat> ChargerRepa(string chConn,DateTime dateV)
{
ObservableCollection<C_T_plat> rep = new ObservableCollection<C_T_plat>();
List<C_T_plat> lTmp = new Gestion.G_T_repa(Config.Settings1.Default.schCon).Lire(dateV) as List<C_T_plat>;
foreach (C_T_plat Tmp in lTmp)
rep.Add(Tmp);
return rep;
}
public void Confirmer()
{
//if (nAjout == -1)
//{
// 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, (int)UnPlat.TypePlat));
//}
//else
//{
// 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, (int)UnPlat.TypePlat);
//}
//ActiverUneFiche = false;
}
public void Supprimer()
{
}
public void calendar_SelectedDatesChanged()
{
Console.WriteLine($"SELECTED DATE TTTTT {DateSelection}");
}
private void onPropertyChanged(object o, System.ComponentModel.PropertyChangedEventArgs arg )
{
switch(arg.PropertyName)
{
case "DateSelection":
BcpPLatJourSelectionne = ChargerRepa(chConnexion, DateSelection);
break;
}
}
}
}

View File

@@ -0,0 +1,152 @@
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_TypeEvent : 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_typeEvenement _TypeEventSelectionnee;
public C_T_typeEvenement TypeEventSelectionnee
{
get { return _TypeEventSelectionnee; }
set { AssignerChamp<C_T_typeEvenement>(ref _TypeEventSelectionnee, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
#endregion
#region Données extérieures
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 { _BcpTypeEvents = value; }
}
#endregion
public VM_TypeEvent()
{
UnTypeEvent = new VM_UnTypeEvent();
UnTypeEvent.ID = 0;
UnTypeEvent.Nom = "Nom du type d'événement";
BcpTypeEvents = 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_typeEvenement> ChargerPersonnes(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;
}
public void Confirmer()
{
if (nAjout == -1)
{
UnTypeEvent.ID = new G_T_typeEvenement(chConnexion).Ajouter(UnTypeEvent.Nom);
BcpTypeEvents.Add(new C_T_typeEvenement(UnTypeEvent.ID, UnTypeEvent.Nom));
}
else
{
new G_T_typeEvenement(chConnexion).Modifier(UnTypeEvent.ID, UnTypeEvent.Nom);
BcpTypeEvents[nAjout] = new C_T_typeEvenement(UnTypeEvent.ID, UnTypeEvent.Nom);
}
ActiverUneFiche = false;
}
public void Annuler()
{ ActiverUneFiche = false; }
public void Ajouter()
{
UnTypeEvent = new VM_UnTypeEvent();
nAjout = -1;
ActiverUneFiche = true;
}
public void Modifier()
{
if (TypeEventSelectionnee != null)
{
C_T_typeEvenement Tmp = new G_T_typeEvenement(chConnexion).Lire_ID(TypeEventSelectionnee.ID_typeEvenement);
UnTypeEvent = new VM_UnTypeEvent();
UnTypeEvent.ID = Tmp.ID_typeEvenement;
UnTypeEvent.Nom = Tmp.TE_nom;
nAjout = BcpTypeEvents.IndexOf(TypeEventSelectionnee);
ActiverUneFiche = true;
}
}
public void Supprimer()
{
if (TypeEventSelectionnee != null)
{
new G_T_typeEvenement(chConnexion).Supprimer(TypeEventSelectionnee.ID_typeEvenement);
BcpTypeEvents.Remove(TypeEventSelectionnee);
}
}
}
public class VM_UnTypeEvent : 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

@@ -1,164 +0,0 @@
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;
namespace ProjetTheAlone.ViewModel
{
public class VM_Plat : BasePropriete
{
#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 int nAjout;
private int typeplat=0;
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_plat _PlatSelectionnee;
public C_T_plat PlatSelectionnee
{
get { return _PlatSelectionnee; }
set { AssignerChamp<C_T_plat>(ref _PlatSelectionnee, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
#endregion
#region Données extérieures
private VM_UnPlat _UnPlat;
public VM_UnPlat UnPlat
{
get { return _UnPlat; }
set { AssignerChamp<VM_UnPlat>(ref _UnPlat, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
private ObservableCollection<C_T_plat> _BcpPlats = new ObservableCollection<C_T_plat>();
public ObservableCollection<C_T_plat> BcpPlats
{
get { return _BcpPlats; }
set { _BcpPlats = value; }
}
#endregion
public VM_Plat()
{
UnPlat = new VM_UnPlat();
UnPlat.ID = 0;
UnPlat.Nom = "Nom du plat";
BcpPlats = 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_plat> ChargerPersonnes(string chConn)
{
ObservableCollection<C_T_plat> rep = new ObservableCollection<C_T_plat>();
List<C_T_plat> lTmp = new G_T_plat(chConn).Lire("B_nom");
foreach (C_T_plat Tmp in lTmp)
rep.Add(Tmp);
return rep;
}
public void Confirmer()
{
if (nAjout == -1)
{
UnPlat.ID = new G_T_plat(chConnexion).Ajouter(UnPlat.Nom, UnPlat.Img,typeplat);
BcpPlats.Add(new C_T_plat(UnPlat.ID, UnPlat.Nom, UnPlat.Img,typeplat));
}
else
{
new G_T_plat(chConnexion).Modifier(UnPlat.ID, UnPlat.Nom, UnPlat.Img,typeplat);
BcpPlats[nAjout] = new C_T_plat(UnPlat.ID, UnPlat.Nom, UnPlat.Img, typeplat);
}
ActiverUneFiche = false;
}
public void Annuler()
{ ActiverUneFiche = false; }
public void Ajouter()
{
UnPlat = new VM_UnPlat();
nAjout = -1;
ActiverUneFiche = true;
}
public void Modifier()
{
if (PlatSelectionnee != null)
{
C_T_plat Tmp = new G_T_plat(chConnexion).Lire_ID(PlatSelectionnee.ID_plat);
UnPlat = new VM_UnPlat();
UnPlat.ID = Tmp.ID_plat;
UnPlat.Nom = Tmp.P_nom;
UnPlat.Img = Tmp.P_img;
nAjout = BcpPlats.IndexOf(PlatSelectionnee);
ActiverUneFiche = true;
}
}
public void Supprimer()
{
if (PlatSelectionnee != null)
{
new G_T_plat(chConnexion).Supprimer(PlatSelectionnee.ID_plat);
BcpPlats.Remove(PlatSelectionnee);
}
}
}
public class VM_UnPlat : BasePropriete
{
private int _ID,_TypePlat;
private string _Nom;
private byte[] _Img;
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 byte[] Img
{
get { return _Img; }
set { AssignerChamp<byte[]> (ref _Img, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
public int TypePlat
{
get { return _TypePlat; }
set { AssignerChamp<int>(ref _TypePlat, value, System.Reflection.MethodBase.GetCurrentMethod().Name); }
}
}
}

View File

@@ -16,9 +16,10 @@ namespace ProjetTheAlone.ViewModel
private ObservableCollection<C_T_plat> listPlat = new ObservableCollection<C_T_plat>();
public ObservableCollection<C_T_plat> ListPlat { get => listPlat; set { listPlat = value; OnPropertyChanged("ListPlat"); OnPropertyChanged("Plat1"); OnPropertyChanged("Plat2"); OnPropertyChanged("Plat3"); } }
public C_T_plat Plat1 { get => ListPlat[0]; }
public C_T_plat Plat2 { get => ListPlat[1]; }
public C_T_plat Plat3 { get => ListPlat[2]; }
private C_T_plat plat1, plat2, plat3;
public C_T_plat Plat1 { get => plat1; set { plat1 = value; OnPropertyChanged("Plat1"); } }
public C_T_plat Plat2 { get => plat2; set { plat2 = value; OnPropertyChanged("Plat2"); } }
public C_T_plat Plat3 { get => plat3; set { plat3 = value; OnPropertyChanged("Plat3"); } }
public string Quand { get => quand; set { quand = value; OnPropertyChanged("Quand"); } }
public event PropertyChangedEventHandler PropertyChanged;
@@ -33,6 +34,14 @@ namespace ProjetTheAlone.ViewModel
public RepaModel()
{
}
public RepaModel(DateTime d)
{
ListPlat = new ObservableCollection<C_T_plat>(new Gestion.G_T_repa(Config.Settings1.Default.schCon).Lire(d) as List<C_T_plat>);
Plat1 = (ListPlat.Count > 0) ? ListPlat[0] : new C_T_plat("NULL", Outil.toNullableByteArray.Convert(Outil.picToByteArray.Convert(@".\desert.jpg")), null);
Plat2 = (ListPlat.Count > 1) ? ListPlat[1] : new C_T_plat("NULL", Outil.toNullableByteArray.Convert(Outil.picToByteArray.Convert(@".\desert.jpg")), null);
Plat3 = (ListPlat.Count > 2) ? ListPlat[2] : new C_T_plat("NULL", Outil.toNullableByteArray.Convert(Outil.picToByteArray.Convert(@".\desert.jpg")), null);
Quand = d.ToString();
}
public RepaModel(ObservableCollection<C_T_plat> ListPlat, string quand)
{

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace ProjetTheAlone.ViewModel
{
class EvenementEncode
class VM_DashBoard
{
}
}