Esempio n. 1
0
        public Test()
        {
            InitializeComponent();
            GenerationPerso gen = new GenerationPerso(1, 15, 500, 2);

            gen.GenerateAll();
            bdd = new GestionBDD();
            DataTable tPerso = bdd.GetPersos();

            DataRow[] persos = tPerso.Select();

            foreach (DataRow row in persos)
            {
                listBoxPerso1.Items.Add(row["id"].ToString() + ":" + row["Nom"].ToString());
                listBoxPerso2.Items.Add(row["id"].ToString() + ":" + row["Nom"].ToString());
            }
            DataTable tItem = bdd.GetItems();

            DataRow[] items = tItem.Select();

            foreach (DataRow row in items)
            {
                listBoxItem.Items.Add(row["id"].ToString() + ":" + row["Nom"].ToString());
            }
        }
Esempio n. 2
0
 public void initialiseIHM()
 {
     /*Perso perso = new Perso(4);
      * ResultatAttaque result = perso.AttaqueCac(perso);
      * int type;
      * Items obj = Items.GetItems(1,out type);
      * int test = perso.listStat[(int)Stat.stats.PointAction].GetValue();
      * int prix = obj.GetPrix();
      * int poid = obj.GetPoid();
      * Equipement epee = null;
      * obj = (Equipement)obj;
      * if(type == (int)Items.TypeObjet.Arme)
      * {
      *  epee = (Equipement)obj;
      * }
      * prix = epee.GetPrix();
      * poid = epee.GetPoid();
      */
     conn        = new GestionBDD();
     tRace       = conn.GetRaces();
     raceJouable = tRace.Select("jouable = TRUE");
     foreach (DataRow row in raceJouable)
     {
         cbRace.Items.Add(row["nom"].ToString());
     }
 }
Esempio n. 3
0
        public WindowAddViewModel()
        {
            //Chemin du fichier ImagesSerie
            _path = Path.Combine(Environment.CurrentDirectory, "ImagesSerie");

            chargerListSerie();
            ListPseudo = GestionBDD.returnToutUtilisateur();

            //Chargement de tous les enum 'Genre' dans la liste 'GenreSource' pour être affiché dans les listBox
            GenreSource = new List <string>();
            Array array = Enum.GetValues(typeof(Genre));

            foreach (object obj  in array)
            {
                GenreSource.Add(obj.ToString());
            }

            AjouterSerieCommand                 = new RelayCommand(OnAjouterSerie, CanexecuteAjouterSerie);
            ModifierSerieCommand                = new RelayCommand(OnModifierSerie, CanexecuteModifierSerie);
            SupprimerSerieCommand               = new RelayCommand(OnSupprmierSerie, CanexecuteSupprimerSerie);
            downAdminCommand                    = new RelayCommand(OnDownAdmin, CanexecuteDownAdmin);
            upAdminCommand                      = new RelayCommand(OnUpAdmin, CanexecuteUpAdmin);
            ParcourirImageAddCommand            = new RelayCommand(OnParcourirImageAdd, CanExecuteParcourirImageAdd);
            ParcourirImageUpdateCommand         = new RelayCommand(OnParcourirImageUpdate, CanExecuteParcourirImageUpdate);
            ParcourirImageBanniereAddCommand    = new RelayCommand(OnParcourirImageBanniereAdd, CanExecuteParcourirImageBanniereAdd);
            ParcourirImageBanniereUpdateCommand = new RelayCommand(OnParcourirImageBanniereUpdate, CanExecuteParcourirImageBanniereUpdate);
            QuitCommand = new RelayCommand(OnQuit, CanExecuteQuit);
        }
Esempio n. 4
0
        public Competence(int id)
        {
            this.id = id;


            bdd = new GestionBDD();

            DataTable tComp = bdd.GetCompById(id);

            DataRow[] drComp = tComp.Select();
            nom                = drComp[0]["nom"].ToString();
            definition         = drComp[0]["definition"].ToString();
            passif             = Boolean.Parse(drComp[0]["passif"].ToString());
            enLigne            = Boolean.Parse(drComp[0]["ligne_only"].ToString());
            type               = Int32.Parse(drComp[0]["type"].ToString());
            difficulte         = Int32.Parse(drComp[0]["difficulte"].ToString());
            cout               = Int32.Parse(drComp[0]["cout"].ToString());
            id_zonne           = Int32.Parse(drComp[0]["id_zoneeffect"].ToString());
            id_effet           = Int32.Parse(drComp[0]["id_effet"].ToString());
            porter_min         = Int32.Parse(drComp[0]["porter_min"].ToString());
            porter_max         = Int32.Parse(drComp[0]["porter_max"].ToString());
            id_stat_reussite   = Int32.Parse(drComp[0]["id_stat_reussite"].ToString());
            coef_stat_reussite = Int32.Parse(drComp[0]["coef_stat_reussite"].ToString());
            id_stat_esquive    = Int32.Parse(drComp[0]["id_stat_esquive"].ToString());
            coef_stat_esquive  = Int32.Parse(drComp[0]["coef_stat_esquive"].ToString());
        }
Esempio n. 5
0
        static void Main(string[] args)
        {
            Int32 refaire = 1;

            do
            {
                Console.WriteLine("*** Bienvenue dans la gestion d'utilisateur ***");
                Console.WriteLine("[I]nserer \n [A]fficher \n [S]upprimer \n [M]odifier\n ");
                string choix = Console.ReadLine();
                if (choix == "i")
                {
                    Console.WriteLine("Entrer votre nom");
                    string nom = Console.ReadLine();

                    Console.WriteLine("Entrer votre prenom");
                    string prenom = Console.ReadLine();

                    Console.WriteLine("Entrer votre date de Naissance ex : 04051985");
                    string dateNaissance = Console.ReadLine();

                    GestionBDD.AjoutUtilisateur(nom, prenom, dateNaissance);
                }
                else if (choix == "a")
                {
                    GestionBDD.AfficherListeEnBdd();
                }

                Console.WriteLine("Avez-vous encore des actions à effectuer Oui=1 Non=0?");
                refaire = Convert.ToInt32(Console.ReadLine());
            } while (refaire == 1);


            Console.ReadKey();
        }
Esempio n. 6
0
        public static int NewItem(String nom, String definition, int prix, int poid, int id_genre, int id_materiel, int id_qualité)
        {
            int        idItem = -1;
            GestionBDD conn   = new GestionBDD();
            // getStatRace
            DataTable tObjet = conn.GetItems();

            DataRow[] rowItems = tObjet.Select();
            String    idtmp    = rowItems[rowItems.Count() - 1]["id"].ToString();

            Int32.TryParse(idtmp, out idItem);
            idItem++;
            DataRow item = tObjet.NewRow();

            item["id"]          = idItem;
            item["nom"]         = nom;
            item["definition"]  = definition;
            item["poid"]        = poid;
            item["prix"]        = prix;
            item["id_genre"]    = id_genre;
            item["id_materiel"] = id_materiel;
            item["id_qualite"]  = id_qualité;
            tObjet.Rows.Add(item);
            conn.SubmitDataSetChanges("objet");

            return(idItem);
        }
Esempio n. 7
0
 public SelectClass(GestionBDD conn, DataRow race, DataRow sousRace)
 {
     this.conn     = conn;
     this.race     = race;
     this.sousRace = sousRace;
     InitializeComponent();
     initialiseIHM();
 }
Esempio n. 8
0
 public SelectHistoire(GestionBDD conn, DataRow race, DataRow sousRace, DataRow classe)
 {
     this.conn     = conn;
     this.race     = race;
     this.sousRace = sousRace;
     this.classe   = classe;
     InitializeComponent();
 }
 private void OnSupprimerCommentaire(object obj)
 {
     if (SelectedCommentaire != null)
     {
         GestionBDD.supprimerCommentaire(SelectedCommentaire);
         ListCommentaireSerie.Remove(SelectedCommentaire);
         MessageBox.Show("Commentaire supprimé !", "Information", MessageBoxButton.OK, MessageBoxImage.Information);
     }
 }
        /// <summary>
        /// Créer un nouveau commentaire et l'ajoute à la BDD et à la liste de commentaire de la série
        /// </summary>
        /// <param name="obj"></param>
        private void OnEnvoyerCommentaire(object obj)
        {
            Commentaire com = new Commentaire(CommentaireSerie, _user.Pseudo, serieglobal.nom);

            serieglobal.commentaire.Add(com);
            GestionBDD.ajouterCommentaireSerie(com);
            ListCommentaireSerie.Add(com);
            MessageBox.Show("Commentaire enregistré !");
            CommentaireSerie = null;
        }
Esempio n. 11
0
 public GenerationPerso(int id_Race, int lvl, int valEquip, int nbMonstre, int id_SousRace = -1)
 {
     this.id_SousRace = id_SousRace;
     this.id_Race     = id_Race;
     this.lvlMoyen    = lvl;
     this.valEquip    = valEquip;
     this.nbMonstre   = nbMonstre;
     id_Monstre       = new List <int>();
     bdd = new GestionBDD();
 }
 private bool CanExecuteEnvoyerCommentaire(object obj)
 {
     if (CommentaireSerie != null && !GestionBDD.checkSiSerieAjouter(_user.Pseudo, serieglobal.nom))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 13
0
        public int CreatNewPerso(int idRace, int idClasse, int idSousRace, int lvl, String nom, String prenom, String description)
        {
            int        idPerso = -1;
            GestionBDD conn    = new GestionBDD();
            // getStatRace
            DataTable tStatRace = conn.GetStatRaceByID(idRace);

            DataRow[] statsRace = tStatRace.Select();
            DicoInt   stats     = RandDicePerso(statsRace);

            DataTable tPerso = conn.GetPersos();

            DataRow[] rowPerso = tPerso.Select();
            String    idtmp    = rowPerso[rowPerso.Count() - 1]["id"].ToString();

            Int32.TryParse(idtmp, out idPerso);
            idPerso++;
            DataRow perso = tPerso.NewRow();

            perso["id"]         = idPerso;
            perso["race"]       = idRace;
            perso["sousrace"]   = idSousRace;
            perso["classe"]     = idClasse;
            perso["vivant"]     = true;
            perso["armedefaut"] = 0;
            perso["niveau"]     = lvl;
            perso["nom"]        = nom;
            perso["prenom"]     = prenom;
            perso["definition"] = description;
            tPerso.Rows.Add(perso);


            conn.SubmitDataSetChanges("perso");

            DataTable tStatPerso = conn.GetStatPersoByID(idPerso);

            DataRow[] rowStatPerso = tStatPerso.Select();
            foreach (DataRow row in rowStatPerso)
            {
                row.Delete();
            }
            foreach (int idStat in stats.Keys)
            {
                DataRow newStat = tStatPerso.NewRow();
                newStat["id_stat"]  = idStat;
                newStat["id_perso"] = idPerso;
                newStat["valeur"]   = stats[idStat];
                tStatPerso.Rows.Add(newStat);
            }

            conn.SubmitDataSetChanges("statperso");

            return(idPerso);
        }
Esempio n. 14
0
 /// <summary>
 /// Retire une série des favoris d'un utilisateur
 /// </summary>
 /// <param name="obj"></param>
 private void OnEnleverSerie(object obj)
 {
     if (SelectedSerie != null)
     {
         _user_courant.Serieadd.Remove(SelectedSerie);
         GestionBDD.removeSerieUtilisateur(_user_courant.Pseudo, SelectedSerie.nom);
         MessageBox.Show("Série enlevée des favoris !", "", MessageBoxButton.OK, MessageBoxImage.Information);
         SerieUtilisateur.Remove(SelectedSerie);
         updateMessage();
     }
 }
Esempio n. 15
0
 public void remplirSerieModif()
 {
     _seriemodif              = GestionBDD.remplirSerie(SelectSerie);
     Descriptionseriemodif    = _seriemodif.description;
     Producteurseriemodif     = _seriemodif.producteur;
     Dureemoyenneseriemodif   = _seriemodif.dureeMoy.ToString();
     Selectgenremodif         = _seriemodif.genre.ToString();
     NbSaisonModif            = _seriemodif.nbSaison.ToString();
     SourceImageModif         = _seriemodif.ImageSerie.ToString();
     SourceImageModifBanniere = _seriemodif.Banniereserie.ToString();
     NbEpisodeModif           = _seriemodif.nbEpisode.ToString();
 }
 private bool CanExecuteNoterSerie(object obj)
 {
     updateBarreNote();
     if (GestionBDD.checkSiSerieAjouter(_user.Pseudo, serieglobal.nom))
     {
         return(false);
     }
     else
     {
         return(true);
     }
 }
Esempio n. 17
0
        public StatCalculé(int id, int valeur, string nom, string description, Perso perso) : base(id, valeur, nom, description, perso)
        {
            statUtile = new Dictionary <int, int>();
            GestionBDD bdd           = new GestionBDD();
            DataTable  tStatCalculer = bdd.GetStatCalculer(id);

            DataRow[] drStatCalculer = tStatCalculer.Select();
            foreach (DataRow statcalculer in drStatCalculer)
            {
                statUtile.Add(Int32.Parse(statcalculer[1].ToString()), Int32.Parse(statcalculer[2].ToString()));
            }
        }
 /// <summary>
 /// Ajoute une note d'un utilisateur à une série, si celui-ci à déjà voté pour cette série la note est modifié
 /// </summary>
 /// <param name="obj"></param>
 private void OnNoterSerie(object obj)
 {
     if (GestionBDD.checkSiDejaNoter(serieglobal.nom, _user.Pseudo))
     {
         GestionBDD.ajouterNoteSerie(serieglobal.nom, Note, _user.Pseudo);
         GestionBDD.updateNoteSerie(serieglobal.nom);
     }
     else
     {
         GestionBDD.updateNote(serieglobal.nom, Note, _user.Pseudo);
         GestionBDD.updateNoteSerie(serieglobal.nom);
     }
 }
Esempio n. 19
0
        public CreationEquipement(int prixMoyen, int variance, Genre.typeEquipementBase typeEquip, int nbMain, CreationEquipement.typeCible typeCible)
        {
            this.prixMoyen = prixMoyen;
            this.variance  = variance;
            this.typeEquip = typeEquip;
            this.nbMain    = nbMain;
            this.type      = typeCible;
            this.bdd       = new GestionBDD();
            int varPrix = (prixMoyen * variance) / 100;

            this.prixMin = prixMoyen - varPrix;
            this.prixMax = prixMoyen + varPrix;
        }
Esempio n. 20
0
        public Items(int id, int type, String nom, String definition, int prix, int poid, Genre genre, Materiel materiel, Qualite qualité)
        {
            bdd = new GestionBDD();

            this.id         = id;
            this.nom        = nom;
            this.definition = definition;
            this.prix       = prix;
            this.poid       = poid;
            this.genre      = genre;
            this.materiel   = materiel;
            this.qualité    = qualité;
        }
Esempio n. 21
0
 /// <summary>
 /// Promouvois un utilisateur au poste de modérateur
 /// </summary>
 /// <param name="obj"></param>
 private void OnUpAdmin(object obj)
 {
     if (MessageBox.Show($"Voulez vous promouvoir {Selectpseudo} au poste de modérateur ?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
     {
         if (GestionBDD.upModo(Selectpseudo))
         {
             MessageBox.Show("Modérateur ajouté");
         }
         else
         {
             MessageBox.Show("Cet utilisateur est déjà modérateur", "Erreur", MessageBoxButton.OK, MessageBoxImage.Warning);
         }
     }
 }
Esempio n. 22
0
            public static void AjoutUtilisateur(string nom, string prenom, string dateNaissance)
            {
                GestionBDD.Connection();
                SqlCommand Inserer                = new SqlCommand("INSERT INTO Utilisateur (nom, prenom, dateNaissance) Values (@nom, @prenom, @dateNaissance)", GestionBDD.BddConnect);
                var        nomParameter           = new SqlParameter("@nom", nom);
                var        prenomParamater        = new SqlParameter("@prenom", prenom);
                var        dateNaissanceParameter = new SqlParameter("@dateNaissance", dateNaissance);

                Inserer.Parameters.Add(nomParameter);
                Inserer.Parameters.Add(prenomParamater);
                Inserer.Parameters.Add(dateNaissanceParameter);
                Inserer.ExecuteNonQuery();
                GestionBDD.Deconnection();
            }
Esempio n. 23
0
 /// <summary>
 /// Dégrade un utilisateur du poste de modérateur
 /// </summary>
 /// <param name="obj"></param>
 private void OnDownAdmin(object obj)
 {
     if (MessageBox.Show($"Voulez vous désister {Selectpseudo} du poste de modérateur ?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
     {
         if (GestionBDD.downModo(Selectpseudo))
         {
             MessageBox.Show("Modérateur supprimé");
         }
         else
         {
             MessageBox.Show("Cet utilisateur n'est pas modérateur", "Erreur", MessageBoxButton.OK, MessageBoxImage.Warning);
         }
     }
 }
 /// <summary>
 /// Ajoute une série selectionné dans la BDD et dans la liste de série de l'utilisateur
 /// </summary>
 /// <param name="obj"></param>
 private void OnAjouterSerie(object obj)
 {
     if (SelectedSerie != null)
     {
         if (GestionBDD.checkSiSerieAjouter(_user_courant.Pseudo, SelectedSerie.nom))
         {
             _user_courant.Serieadd.Add(SelectedSerie);
             GestionBDD.addSerieUtilisateur(_user_courant.Pseudo, SelectedSerie.nom);
         }
         else
         {
             MessageBox.Show("Série déjà ajoutée en favoris !", "Déjà ajouté !", MessageBoxButton.OK, MessageBoxImage.Information);
         }
     }
 }
Esempio n. 25
0
        public Genre(int id)
        {
            bdd = new GestionBDD();

            DataTable tGenre = bdd.GetGenreById(id);

            DataRow[] drGenre = tGenre.Select();
            this.poid           = Int32.Parse(drGenre[0]["poid"].ToString());
            this.prix           = Int32.Parse(drGenre[0]["prix"].ToString());
            this.typeEquipement = Int32.Parse(drGenre[0]["typequip"].ToString());
            this.typeObjet      = Int32.Parse(drGenre[0]["type"].ToString());
            this.nom            = drGenre[0]["nom"].ToString();
            this.definition     = drGenre[0]["definition"].ToString();
            this.damage         = Int32.Parse(drGenre[0]["dommage"].ToString());
            this.armureBase     = Int32.Parse(drGenre[0]["armurebase"].ToString());
            this.rmBase         = Int32.Parse(drGenre[0]["rmbase"].ToString());
            this.armureBonus    = Int32.Parse(drGenre[0]["armurebonus"].ToString());
            this.rmBonus        = Int32.Parse(drGenre[0]["rmbonus"].ToString());
            this.loot           = Boolean.Parse(drGenre[0]["loot"].ToString());
            this.degatcrit      = Int32.Parse(drGenre[0]["dcrit"].ToString());
            this.pSort          = Int32.Parse(drGenre[0]["psort"].ToString());
            this.nbMains        = Int32.Parse(drGenre[0]["nbmains"].ToString());
            this.pMin           = Int32.Parse(drGenre[0]["portermin"].ToString());
            this.pMax           = Int32.Parse(drGenre[0]["portermax"].ToString());
            this.chancecrit     = Int32.Parse(drGenre[0]["chanccrit"].ToString());
            DataTable tStatGenre = bdd.GetStatGenreByID(id);

            DataRow[] statsGenre = tStatGenre.Select();
            stat = new DicoInt();

            foreach (DataRow row in statsGenre)
            {
                int idstat = Int32.Parse(row["id_stat"].ToString());
                int valeur = Int32.Parse(row["valeur"].ToString());
                stat.Add(idstat, valeur);
            }


            DataTable tEffetGenre = bdd.GetEffetGenreByID(id);

            DataRow[] drEffetGenre = tEffetGenre.Select();
            effets = new List <Effet>();

            foreach (DataRow row in drEffetGenre)
            {
                effets.Add(new Effet(Int32.Parse(row["id_effet"].ToString())));
            }
        }
Esempio n. 26
0
        public WindowAccViewModel()
        {
            PersoProfilCommand    = new RelayCommand(OnPersoProfil, CanExecutePersoProfil);
            AdministrationCommand = new RelayCommand(OnAdministration, CanExecuteAdministration);
            OuvrirAcceuilCommand  = new RelayCommand(OnOuvrirAcceuil, CanExecuteOuvrirAcceuil);
            OuvrirProfilCommand   = new RelayCommand(OnOuvrirProfil, CanExecuteOuvrirProfil);
            QuitCommand           = new RelayCommand(OnQuit, CanExecuteQuit);
            RechercherCommand     = new RelayCommand(OnRechercher, CanExecuteRechercher);

            SelectedViewModel = new ViewAccueilViewModel();
            OpenInfoSerieEvent.GetInstance().Handler += OnOpenInfoSerie;

            _user.Serieadd = GestionBDD.returnSerieUtilisateurFull(_user.Pseudo);

            Pseudo = _user.Pseudo;
        }
Esempio n. 27
0
        public int coef_stat_reduc;          // le % de la stat prise en compte chez le déffenseur pour réduire l'effect

        public Effet(int id)
        {
            bdd     = new GestionBDD();
            this.id = id;
            DataTable tEffet = bdd.GetEffetbyId(id);

            DataRow[] drEffet = tEffet.Select();
            if (drEffet.Count() > 0)
            {
                nom                      = drEffet[0]["nom"].ToString();
                definition               = drEffet[0]["definition"].ToString();
                id_nexteffet             = Int32.Parse(drEffet[0]["id_nexteffet"].ToString());
                waitbeforenexteffet      = Int32.Parse(drEffet[0]["waitbeforenexteffet"].ToString());
                chance_nexteffet         = Int32.Parse(drEffet[0]["chance_nexteffet"].ToString());
                id_stat_resist_nexteffet = Int32.Parse(drEffet[0]["id_stat_resist_nexteffet"].ToString());
                chance_resist_nexteffet  = Int32.Parse(drEffet[0]["chance_resist_nexteffet"].ToString());
                min_hit                  = Int32.Parse(drEffet[0]["min_hit"].ToString());
                max_hit                  = Int32.Parse(drEffet[0]["max_hit"].ToString());
                durer_min                = Int32.Parse(drEffet[0]["durer_min"].ToString());
                durer_max                = Int32.Parse(drEffet[0]["durer_max"].ToString());
                drain                    = Int32.Parse(drEffet[0]["drain"].ToString());
                typedee                  = Int32.Parse(drEffet[0]["typedee"].ToString());
                nbdee                    = Int32.Parse(drEffet[0]["nbdee"].ToString());
                basevaleur               = Int32.Parse(drEffet[0]["basevaleur"].ToString());
                chance_crit              = Int32.Parse(drEffet[0]["chance_crit"].ToString());
                bonus_crit               = Int32.Parse(drEffet[0]["bonus_crit"].ToString());
                positif                  = Boolean.Parse(drEffet[0]["positif"].ToString());
                id_stat                  = Int32.Parse(drEffet[0]["id_stat"].ToString());
                id_zoneeffect            = Int32.Parse(drEffet[0]["id_zoneeffect"].ToString());
                id_type                  = Int32.Parse(drEffet[0]["id_type"].ToString());
                is_magique               = Boolean.Parse(drEffet[0]["is_magique"].ToString());
                id_stat_reduc            = Int32.Parse(drEffet[0]["id_stat_reduction"].ToString());
                coef_stat_reduc          = Int32.Parse(drEffet[0]["coef_stat_reduction"].ToString());


                DataTable tStatEffet   = bdd.GetStatEffetByID(id);
                DataRow[] drStatsEffet = tStatEffet.Select();
                ratio = new Dictionary <int, int>();

                foreach (DataRow row in drStatsEffet)
                {
                    int idstat = Int32.Parse(row["id_stat"].ToString());
                    int valeur = Int32.Parse(row["valeur"].ToString());
                    ratio.Add(idstat, valeur);
                }
            }
        }
Esempio n. 28
0
 /// <summary>
 /// Supprime la série selectionné
 /// </summary>
 /// <param name="obj"></param>
 private void OnSupprmierSerie(object obj)
 {
     if (MessageBox.Show($"Voulez vous vraiment supprimer la série : {Selectseriesuppr} ?", "Confirmation", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
     {
         GestionBDD.supprSerie(Selectseriesuppr);
         for (int i = Listserie.Count - 1; i >= 0; i--)
         {
             if (Listserie[i].Contains(Selectseriesuppr))
             {
                 Listserie.RemoveAt(i);
             }
         }
         RefreshEvent.GetInstance().OnRefreshAcceuilHandler(EventArgs.Empty);
         chargerListSerie();
         MessageBox.Show("Série supprimé");
     }
 }
Esempio n. 29
0
        /// <summary>
        /// Fonction appelé dès que l'utilisateur entre une lettre dans la combobox de recherche, et compare la liste des série avec ce qu'a écris l'utilisateur et ouvre la viewRecherche et affiche les série correspondante ou non
        /// </summary>
        /// <param name="obj"></param>
        private void OnRechercher(object obj)
        {
            if (Recherche == "")
            {
                SelectedViewModel = new ViewAccueilViewModel();
                OpenInfoSerieEvent.GetInstance().Handler += OnOpenInfoSerie;
            }
            else
            {
                List <Serie> listSerie = GestionBDD.returnTouteSerieFull();

                var resRecherche = listSerie.Where(h => h.nom.ToLower().StartsWith(Recherche.ToLower()));

                SelectedViewModel = new ViewRechercheViewModel(resRecherche, Recherche);
                RetourWindowAccueilEvent.GetInstance().Handler += OnRetourAccueil;
                OpenInfoSerieEvent.GetInstance().Handler       += OnOpenInfoSerie;
            }
        }
        /// <summary>
        /// Vérifie les identifiants rentrés par l'utilisateur, si ils sont correct, la classe UserCourant est instancié et le fenêtre WindowAcc est ouverte
        /// </summary>
        /// <param name="obj"></param>
        private void OnLogin(object obj)
        {
            if (GestionBDD.verifLoginMdp(Identifiant, Password))
            {
                WindowAccClosedEvent.GetInstance().Handler += OnCloseWindowAcceuil;
                UserCourant.SetNull();
                GestionBDD.remplirUserCourant(Identifiant);

                _wAcceuil   = new WindowAcc();
                Identifiant = null;
                Password    = null;
                _wAcceuil.ShowDialog();
            }
            else
            {
                MessageBox.Show("Les informations transmises n'ont pas permis de vous authentifier", "Erreur d'identification", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }