Example #1
0
 public Rollercoaster(bool besoinSpecifique, TimeSpan dureeMaintenance, List <Monstre> equipe, int identifiant, bool maintenance, string natureMaintenance, int nbMinMonstre, string nom, bool ouvert, string typeDeBesoin, int ageMinimum, TypeCategorie categorie, float tailleMinimum) :
     base(besoinSpecifique, dureeMaintenance, equipe, identifiant, maintenance, natureMaintenance, nbMinMonstre, nom, ouvert, typeDeBesoin)
 {
     this.categorie     = categorie;
     this.ageMinimum    = ageMinimum;
     this.tailleMinimum = tailleMinimum;
 }
Example #2
0
 /*public Rollercoaster(bool besoinSpecifique, TimeSpan dureeMaintenance, List<Monstre> equipe, int identifiant, bool maintenance, string natureMaintenance, int nbMinMonstre, string nom, bool ouvert, string typeDeBesoin, int ageMinimum, TypeCategorie categorie, float tailleMinimum) :
  *  base(besoinSpecifique, dureeMaintenance, equipe, identifiant, maintenance, natureMaintenance, nbMinMonstre, nom, ouvert, typeDeBesoin)
  * {
  *  this.categorie = categorie;
  *  this.ageMinimum = ageMinimum;
  *  this.tailleMinimum = tailleMinimum;
  * }*/
 public Rollercoaster(int identifiant, string nom, int nb_Min_Monstre, bool besoinSpecifique, string typeDeBesoin, TypeCategorie categorie, int age_Min, float taille_Min)
     : base(identifiant, nom, nb_Min_Monstre, besoinSpecifique, typeDeBesoin)
 {
     this.categorie  = categorie;
     this.age_Min    = age_Min;
     this.taille_Min = taille_Min;
 }
Example #3
0
 public CRollerCoaster(string identifiantStr, string nomStr, string nbMinimumStr, string besoinStr, string typeStr, string categorieStr, string ageStr, string tailleMinStr) : base(identifiantStr, nomStr, nbMinimumStr, besoinStr, typeStr)
 {
     try
     {
         int ageInt = Int32.Parse(ageStr);
         if (ageInt > 0)
         {
             float tailleInt = float.Parse(tailleMinStr);
             if (tailleInt > 0)
             {
                 m_tailleMinimumFloat = tailleInt;
                 m_ageMinimumInt      = ageInt;
                 m_categorie          = ConvertStringToTypeCategorie(categorieStr);
                 m_typeAttractionStr  = "RollerCoaster";
             }
             else
             {
                 throw new Exception("La taille minimum ne peut pas etre negative");
             }
         }
         else
         {
             throw new Exception("L'age minimum ne peut pas etre negatif");
         }
     }
     catch (Exception e)
     {
         Console.WriteLine("ERREUR CONSTRUCTEUR ROLLERCOASTER : " + e.Message);
     }
 }
        public async Task <IActionResult> PutTypeCategorie(int id, TypeCategorie typeCategorie)
        {
            if (id != typeCategorie.Id)
            {
                return(BadRequest());
            }

            _context.Entry(typeCategorie).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TypeCategorieExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public async Task <ActionResult <TypeCategorie> > PostTypeCategorie(TypeCategorie typeCategorie)
        {
            _context.Types.Add(typeCategorie);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetTypeCategorie", new { id = typeCategorie.Id }, typeCategorie));
        }
Example #6
0
        static TypeCategorie ConvertStringToTypeCategorie(string chaineStr)
        {
            TypeCategorie valueReturned = new TypeCategorie();

            if (chaineStr != null)
            {
                try
                {
                    if (chaineStr == "assise")
                    {
                        valueReturned = TypeCategorie.assise;
                    }
                    else if (chaineStr == "bobsleigh")
                    {
                        valueReturned = TypeCategorie.bobsleigh;
                    }
                    else if (chaineStr == "inversee")
                    {
                        valueReturned = TypeCategorie.inversee;
                    }
                    else
                    {
                        throw new Exception("!!! ATTENTION !!! il y a eu une erreur, le typeCatégorie n'est pas initialisé !!");
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("ERREUR DANS CONVERTSTRINGTOGRADE : " + e.Message);
                }
            }
            return(valueReturned);
        }
Example #7
0
 public RollerCoaster(bool besoinS, int id, int nbMinMonstre, string nom, string typeBesoin, int ageMini, TypeCategorie categ, float tailleMini)
     : base(besoinS, id, nbMinMonstre, nom, typeBesoin)
 {
     this.ageMini       = ageMini;
     this.categorie     = categ;
     this.tailleMinimum = tailleMini;
 }
Example #8
0
 public RollerCoaster(bool besoinS, TimeSpan dureeMaintenance, List <Monstre> eq, int id, bool maint, string natureM, int nbMinMonstre, string nom,
                      bool ouvert, string typeBesoin, int ageMinimum, TypeCategorie categ, float tailleMini)
     : base(besoinS, dureeMaintenance, eq, id, maint, natureM, nbMinMonstre, nom, ouvert, typeBesoin)
 {
     this.ageMini       = ageMinimum;
     this.categorie     = categ;
     this.tailleMinimum = tailleMini;
 }
        public void AjoutRollerCoaster()
        {
            int           ageMinimum    = Convert.ToInt32(AgeMin.Text);
            var           radios        = RollerCoasterSP.Children.OfType <RadioButton>();
            RadioButton   checkedRadio  = radios.FirstOrDefault(rb => rb.GroupName == "GradeRadioButton" && rb.IsChecked == true);
            TypeCategorie categorie     = (TypeCategorie)Enum.Parse(typeof(TypeCategorie), Convert.ToString(checkedRadio.Content).ToLower());
            int           tailleMinimum = Convert.ToInt32(taillemin.Text);

            ZombilleniumMenu.Administration.AjouterAttraction(new RollerCoaster(ageMinimum, categorie, tailleMinimum, besoinSpecifique, dureeMaintenance, equipe, identifiant, maintenance, natureMaintenance, nbMinMonstre, nom, ouvert, typeDeBesoin));
        }
Example #10
0
        public RollerCoaster(int ageMinimum, TypeCategorie categorie, float tailleMinimum, bool besoinSpecifique, List <Monstre> equipe, int identifiant, int nbMinMonstre, string nom, string typeDeBesoin) : base(besoinSpecifique, equipe, identifiant, nbMinMonstre, nom, typeDeBesoin)
        {
            this.besoinSpecifique = besoinSpecifique;
            this.equipe           = equipe;
            this.identifiant      = identifiant;

            this.nbMinMonstre = nbMinMonstre;
            this.nom          = nom;

            this.typeDeBesoin  = typeDeBesoin;
            this.ageMinimum    = ageMinimum;
            this.categorie     = categorie;
            this.tailleMinimum = tailleMinimum;
        }
Example #11
0
 public RollerCoaster(int ageMinimum, TypeCategorie categorie, float tailleMinimum, bool besoinSpecifique, TimeSpan dureeMaintenance, List <Monstre> equipe, int identifiant, bool maintenance, string natureMaintenance, int nbMinMonstre, string nom, bool ouvert, string typeDeBesoin) : base(besoinSpecifique, dureeMaintenance, equipe, identifiant, maintenance, natureMaintenance, nbMinMonstre, nom, ouvert, typeDeBesoin)
 {
     this.besoinSpecifique = besoinSpecifique;
     this.equipe           = equipe;
     this.identifiant      = identifiant;
     this.dureeMaintenance = dureeMaintenance;
     this.nbMinMonstre     = nbMinMonstre;
     this.nom               = nom;
     this.maintenance       = maintenance;
     this.natureMaintenance = natureMaintenance;
     this.typeDeBesoin      = typeDeBesoin;
     this.ageMinimum        = ageMinimum;
     this.categorie         = categorie;
     this.tailleMinimum     = tailleMinimum;
     this.ouvert            = ouvert;
 }
Example #12
0
        public void AjouterRollercoaster(int ageMinimum, TypeCategorie categorie, int tailleMinimum, bool besoinSpecifique, int identifiant, int nbMinMonstre, string nom, string typedeBesoin)
        {
            bool flag = true; //Utilisé pour savoir si le matricule existe déjà.

            foreach (Attraction a in listeAttractions)
            {
                if (identifiant == a.identifiant)
                {
                    flag = false;
                }
            }
            if (flag)
            {
                List <Monstre> equipe = new List <Monstre>();
                RollerCoaster  r      = new RollerCoaster(ageMinimum, categorie, tailleMinimum, besoinSpecifique, equipe, identifiant, nbMinMonstre, nom, typedeBesoin);
                listeAttractions.Add(r); //Création de la nouvelle attraction et ajout à la liste
            }
        }
Example #13
0
 public RollerCoaster(string besoinSpe, TimeSpan dureeMaint, List <Monstre> equipe, int id, bool maint, string natureMaint, int nbMinMonstre, string nom, bool ouvert, string typeDeBesoin, int ageMin, TypeCategorie categorie, float tailleMin) : base(besoinSpe, dureeMaint, equipe, id, maint, natureMaint, nbMinMonstre, nom, ouvert, typeDeBesoin)
 {
     this.ageMinimum    = ageMin;
     this.categorie     = categorie;
     this.tailleMinimum = tailleMin;
 }
Example #14
0
        static public void LireFichierAttraction(StreamReader fichier, Administration admin, TextBlock text)
        {
            string ligne = fichier.ReadLine();

            while (ligne != null)
            {
                string[] temp = ligne.Split(';');
                if (temp[0] == "Boutique")
                {
                    try
                    {
                        string test = temp[6];
                        string identifiantBoutique  = temp[1];
                        string nomBoutique          = temp[2];
                        int    nbMinMonstreBoutique = 0;
                        try
                        {
                            nbMinMonstreBoutique = Convert.ToInt32(temp[3]);
                        }
                        catch (Exception ex)
                        {
                        }
                        bool besoinSpecifiqueBoutique = false;
                        try
                        {
                            besoinSpecifiqueBoutique = Convert.ToBoolean(temp[4]);
                        }
                        catch (Exception ex)
                        {
                        }
                        string       typeDeBesoinBoutique = temp[5];
                        TypeBoutique type = TypeBoutique.souvenir;
                        if (temp[6] == "barbeAPapa")
                        {
                            type = TypeBoutique.barbeAPapa;
                        }
                        if (temp[6] == "nourriture")
                        {
                            type = TypeBoutique.nourriture;
                        }
                        List <Monstre> EquipeBoutique            = new List <Monstre>();
                        TimeSpan       dureeMaintenanceBoutique  = new TimeSpan(0, 0, 0, 0);
                        bool           maintenanceBoutique       = false;
                        string         natureMaintenanceBoutique = "";
                        bool           ouvertBoutique            = true;
                        Boutique       boutique = new Boutique(type, besoinSpecifiqueBoutique, dureeMaintenanceBoutique, EquipeBoutique, identifiantBoutique, maintenanceBoutique, natureMaintenanceBoutique, nbMinMonstreBoutique, nomBoutique, ouvertBoutique, typeDeBesoinBoutique);
                        admin.AjouterBoutique(boutique);
                        text.Text = text.Text + "\n" + ligne;
                    }
                    catch (Exception ex)
                    {
                    }
                }
                if (temp[0] == "DarkRide")
                {
                    try
                    {
                        string test = temp[7];
                        string identifiantDarkRide  = temp[1];
                        string nomDarkRide          = temp[2];
                        int    nbMinMonstreDarkRide = 0;
                        try
                        {
                            nbMinMonstreDarkRide = Convert.ToInt32(temp[3]);
                        }
                        catch (Exception ex)
                        {
                        }
                        bool besoinSpecifiqueDarkRide = false;
                        try
                        {
                            besoinSpecifiqueDarkRide = Convert.ToBoolean(temp[4]);
                        }
                        catch (Exception ex)
                        {
                        }
                        string   typeDeBesoinDarkRide = temp[5];
                        TimeSpan dureeDarkRide        = new TimeSpan(0, 0, Convert.ToInt32(temp[6]), 0);
                        bool     vehiculeDarkRide     = false;
                        try
                        {
                            vehiculeDarkRide = Convert.ToBoolean(temp[7]);
                        }
                        catch (Exception ex)
                        {
                        }
                        List <Monstre> EquipeDarkRide            = new List <Monstre>();
                        TimeSpan       dureeMaintenanceDarkRide  = new TimeSpan(0, 0, 0, 0);
                        bool           maintenanceDarkRide       = false;
                        string         natureMaintenanceDarkRide = "";
                        bool           ouvertDarkRide            = true;
                        DarkRide       darkRide = new DarkRide(dureeDarkRide, vehiculeDarkRide, besoinSpecifiqueDarkRide, dureeMaintenanceDarkRide, EquipeDarkRide, identifiantDarkRide, maintenanceDarkRide, natureMaintenanceDarkRide, nbMinMonstreDarkRide, nomDarkRide, ouvertDarkRide, typeDeBesoinDarkRide);
                        admin.AjouterDarkRide(darkRide);
                        text.Text = text.Text + "\n" + ligne;
                    }
                    catch (Exception ex)
                    {
                    }
                }
                if (temp[0] == "RollerCoaster")
                {
                    try
                    {
                        string test = temp[8];
                        string identifiantRollerCoaster  = temp[1];
                        string nomRollerCoaster          = temp[2];
                        int    nbMinMonstreRollerCoaster = 0;
                        try
                        {
                            nbMinMonstreRollerCoaster = Convert.ToInt32(temp[3]);
                        }
                        catch (Exception ex)
                        {
                        }
                        bool besoinSpecifiqueRollerCoaster = false;
                        try
                        {
                            besoinSpecifiqueRollerCoaster = Convert.ToBoolean(temp[4]);
                        }
                        catch (Exception ex)
                        {
                        }
                        string        typeDeBesoinRollerCoaster = temp[5];
                        TypeCategorie categorieRollerCoaster    = TypeCategorie.assise;
                        if (temp[6] == "bobsleigh")
                        {
                            categorieRollerCoaster = TypeCategorie.bobsleigh;
                        }
                        if (temp[6] == "inversee")
                        {
                            categorieRollerCoaster = TypeCategorie.inversee;
                        }
                        int ageMinimumRollerCoaster = 0;
                        try
                        {
                            ageMinimumRollerCoaster = Convert.ToInt32(temp[7]);
                        }
                        catch (Exception ex)
                        {
                        }
                        double tailleMinimumRollerCoaster = 0;
                        try
                        {
                            tailleMinimumRollerCoaster = Convert.ToDouble(temp[8]);
                        }
                        catch (Exception ex)
                        {
                        }
                        List <Monstre> EquipeRollerCoaster            = new List <Monstre>();
                        TimeSpan       dureeMaintenanceRollerCoaster  = new TimeSpan(0, 0, 0, 0);
                        bool           maintenanceRollerCoaster       = false;
                        string         natureMaintenanceRollerCoaster = "";
                        bool           ouvertRollerCoaster            = true;
                        RollerCoaster  rollerCoaster = new RollerCoaster(ageMinimumRollerCoaster, categorieRollerCoaster, tailleMinimumRollerCoaster, besoinSpecifiqueRollerCoaster, dureeMaintenanceRollerCoaster, EquipeRollerCoaster, identifiantRollerCoaster, maintenanceRollerCoaster, natureMaintenanceRollerCoaster, nbMinMonstreRollerCoaster, nomRollerCoaster, ouvertRollerCoaster, typeDeBesoinRollerCoaster);
                        admin.AjouterRollerCoaster(rollerCoaster);
                        text.Text = text.Text + "\n" + ligne;
                    }
                    catch (Exception ex)
                    {
                    }
                }
                if (temp[0] == "Spectacle")
                {
                    try
                    {
                        string test = temp[8];
                        string identifiantSpectacle  = temp[1];
                        string nomSpectacle          = temp[2];
                        int    nbMinMonstreSpectacle = 0;
                        try
                        {
                            nbMinMonstreSpectacle = Convert.ToInt32(temp[3]);
                        }
                        catch (Exception ex)
                        {
                        }
                        bool besoinSpecifiqueSpectacle = false;
                        try
                        {
                            besoinSpecifiqueSpectacle = Convert.ToBoolean(temp[4]);
                        }
                        catch (Exception ex)
                        {
                        }
                        string typeDeBesoinSpectacle = temp[5];
                        string nomSalleSpectacle     = temp[6];
                        int    nbPlaceSpectacle      = 0;
                        try
                        {
                            nbPlaceSpectacle = Convert.ToInt32(temp[7]);
                        }
                        catch (Exception ex)
                        {
                        }
                        List <DateTime> horaireSpectacle = new List <DateTime>();
                        string[]        tempDate         = temp[8].Split(' ');
                        foreach (string elt in tempDate)
                        {
                            horaireSpectacle.Add(Convert.ToDateTime(elt));
                        }
                        List <Monstre> EquipeSpectacle            = new List <Monstre>();
                        TimeSpan       dureeMaintenanceSpectacle  = new TimeSpan(0, 0, 0, 0);
                        bool           maintenanceSpectacle       = false;
                        string         natureMaintenanceSpectacle = "";
                        bool           ouvertSpectacle            = true;
                        Spectacles     spectacle = new Spectacles(horaireSpectacle, nbPlaceSpectacle, nomSalleSpectacle, besoinSpecifiqueSpectacle, dureeMaintenanceSpectacle, EquipeSpectacle, identifiantSpectacle, maintenanceSpectacle, natureMaintenanceSpectacle, nbMinMonstreSpectacle, nomSpectacle, ouvertSpectacle, typeDeBesoinSpectacle);
                        admin.AjouterSpectacle(spectacle);
                        text.Text = text.Text + "\n" + ligne;
                    }
                    catch (Exception ex)
                    {
                    }
                }
                ligne = fichier.ReadLine();
            }
            fichier.Close();
        }
Example #15
0
        static void RecuperationInfoPersonnel(string nomFichier)
        {
            List <Personnel>     maListe              = new List <Personnel>();
            List <Sorcier>       maListeSorcier       = new List <Sorcier>();
            List <Monstre>       maListeMonstre       = new List <Monstre>();
            List <Demon>         maListeDemon         = new List <Demon>();
            List <Fantome>       maListeFantome       = new List <Fantome>();
            List <LoupGarou>     maListeLoup          = new List <LoupGarou>();
            List <Vampire>       maListeVampire       = new List <Vampire>();
            List <Zombie>        maListeZombie        = new List <Zombie>();
            List <Attraction>    maListeAttraction    = new List <Attraction>();
            List <Boutique>      maListeBoutique      = new List <Boutique>();
            List <DarkRide>      maListeDarkRide      = new List <DarkRide>();
            List <RollerCoaster> maListeRollerCoaster = new List <RollerCoaster>();
            List <Spectacle>     maListeSpectacle     = new List <Spectacle>();

            //copier/coller du fichier disponible sur moodle
            StreamReader monStreamReader = new StreamReader(nomFichier); //ouvrir un fichier en flux d'entrée
            string       ligne           = monStreamReader.ReadLine();   //lire la première ligne du fichier


            while (ligne != null)                 //tant que la ligne lue n'est pas null --> encore des données
            {
                string[] temp = ligne.Split(';'); //Découper selon le séparateur ';' --> on obtient un tableau de chaine

                //MONSTRE
                TypeSexe sex = TypeSexe.male;               //par default male
                Enum.TryParse <TypeSexe>(temp[4], out sex); //car 4ieme indice du tab csv et modifie valeur sex par default

                //SORCIER
                Grade grade = Grade.novice;                //par default novice
                Enum.TryParse <Grade>(temp[6], out grade); //6ieme indice et modifie val grade par default

                //ZOMBIE
                couleurZ couleur = couleurZ.bleuatre;           //par default bleuatre
                Enum.TryParse <couleurZ>(temp[8], out couleur); //8ieme indice et modifie val grade par default

                //BOUTIQUE
                TypeBoutique typeb = TypeBoutique.souvenir;
                Enum.TryParse <TypeBoutique>(temp[6], out typeb);

                //ROLLERCOASTER
                TypeCategorie categorie = TypeCategorie.bobsleigh;
                Enum.TryParse <TypeCategorie>(temp[6], out categorie);

                //DATETIME
                //DateTime myDate;
                //DateTime.TryParse(temp[8], out myDate);

                string[] tempL = ligne.Split('-');//Découper selon le séparateur '-' pour recuperer les pouvoirs dans une liste

                //Liste Horaires
                string[] tempH = ligne.Split(' ');//Découper selon le séparateur ' ' pour recuperer les horaires dans une liste
                tempH.ToList();
                // List<DateTime> time = tempH.Select(date => DateTime.Parse(date)).ToList();

                switch (temp[0])
                {
                case "Sorcier":
                    Console.WriteLine();
                    foreach (string val in temp)
                    {
                        Console.Write("  " + val);
                    }
                    Sorcier sor = new Sorcier(temp[5], Convert.ToInt32(temp[1]), temp[2], temp[3], sex, grade, tempL.ToList());      //aller chercher la case 5 / .ToList transforme en liste
                                                                                                                                     //alimenter la liste de téléphone
                    maListe.Add(sor);
                    maListeSorcier.Add(sor);
                    break;

                case "Monstre":
                    Console.WriteLine();
                    foreach (string val in temp)
                    {
                        Console.Write(" " + val);
                    }

                    Monstre mon = new Monstre(temp[5], Int32.Parse(temp[1]), temp[2], temp[3], sex, Int32.Parse(temp[6]), temp[7]);    //trouver fonction qui trouve lattraction grace a l'identifiant
                                                                                                                                       //alimenter la liste de monstre
                    maListe.Add(mon);
                    maListeMonstre.Add(mon);
                    break;


                case "Demon":
                    Console.WriteLine();
                    foreach (string val in temp)
                    {
                        Console.Write(" " + val);
                    }

                    Demon dem = new Demon(temp[5], Int32.Parse(temp[1]), temp[2], temp[3], sex, Int32.Parse(temp[6]), temp[7], Int32.Parse(temp[8]), false);
                    maListe.Add(dem);
                    maListeDemon.Add(dem); break;

                case "Fantome":
                    Console.WriteLine();
                    foreach (string val in temp)
                    {
                        Console.Write(" " + val);
                    }

                    Fantome fant = new Fantome(temp[5], Int32.Parse(temp[1]), temp[2], temp[3], sex, Int32.Parse(temp[6]), temp[7]);
                    maListe.Add(fant);
                    maListeFantome.Add(fant); break;

                case "LoupGarou":
                    Console.WriteLine();
                    foreach (string val in temp)
                    {
                        Console.Write(" " + val);
                    }

                    LoupGarou lou = new LoupGarou(temp[5], Int32.Parse(temp[1]), temp[2], temp[3], sex, Int32.Parse(temp[6]), temp[7], Double.Parse(temp[8]));
                    maListe.Add(lou);
                    maListeLoup.Add(lou); break;

                case "Vampire":
                    Console.WriteLine();
                    foreach (string val in temp)
                    {
                        Console.Write(" " + val);
                    }

                    Vampire vam = new Vampire(temp[5], Int32.Parse(temp[1]), temp[2], temp[3], sex, Int32.Parse(temp[6]), temp[7], Double.Parse(temp[8]));
                    maListe.Add(vam);
                    maListeVampire.Add(vam); break;

                case "Zombie":
                    Console.WriteLine();
                    foreach (string val in temp)
                    {
                        Console.Write("  " + val);
                    }

                    Zombie zom = new Zombie(temp[5], Int32.Parse(temp[1]), temp[2], temp[3], sex, Int32.Parse(temp[6]), temp[7], Int32.Parse(temp[9]), couleur, false);
                    maListe.Add(zom);
                    maListeZombie.Add(zom); break;

                case "Boutique":
                    Console.WriteLine();
                    foreach (string val in temp)
                    {
                        Console.Write(" " + val);
                    }

                    Boutique bou = new Boutique(temp[4], TimeSpan.Zero, null, Int32.Parse(temp[1]), false, temp[5], Int32.Parse(temp[3]), temp[2], true, temp[5], typeb);
                    maListeAttraction.Add(bou);
                    maListeBoutique.Add(bou); break;

                case "DarkRide":
                    Console.WriteLine();
                    foreach (string val in temp)
                    {
                        Console.Write(" " + val);
                    }

                    DarkRide dark = new DarkRide(temp[4], TimeSpan.Zero, null, Int32.Parse(temp[1]), false, temp[5], Int32.Parse(temp[3]), temp[2], true, temp[5], TimeSpan.Zero, true);
                    maListeAttraction.Add(dark);
                    maListeDarkRide.Add(dark); break;

                case "RollerCoaster":
                    Console.WriteLine();
                    foreach (string val in temp)
                    {
                        Console.Write(" " + val);
                    }

                    RollerCoaster roll = new RollerCoaster(temp[4], TimeSpan.Zero, null, Int32.Parse(temp[1]), false, temp[5], Int32.Parse(temp[3]), temp[2], true, temp[5], Int32.Parse(temp[7]), categorie, float.Parse(temp[8]));
                    maListeAttraction.Add(roll);
                    maListeRollerCoaster.Add(roll); break;

                case "Spectacle":
                    Console.WriteLine();
                    foreach (string val in temp)
                    {
                        Console.Write(" " + val);
                    }
                    Spectacle spec = new Spectacle(temp[4], TimeSpan.Zero, null, Int32.Parse(temp[1]), false, "try", Int32.Parse(temp[3]), temp[2], true, temp[5], "00:00", Int32.Parse(temp[7]), temp[6]);
                    maListeAttraction.Add(spec);
                    maListeSpectacle.Add(spec); break;
                }
                ligne = monStreamReader.ReadLine();
            }
            monStreamReader.Close();
        }
Example #16
0
        private void EnvoiClick(object sender, RoutedEventArgs e)
        {
            bool flagID = true;

            for (int i = 0; i < Administration.listeAttractions.Count; i++)
            {
                if (id.Text == Convert.ToString(Administration.listeAttractions[i].Identifiant))
                {
                    flagID = false;
                }
            }

            if (flagID)
            {
                if (id.Text != null && nom.Text != null)
                {
                    if (ouvertOUI.IsChecked == true ^ ouvertNON.IsChecked == true)
                    {
                        if (exactitude.IsChecked == true)
                        {
                            if (maintenanceOUI.IsChecked == true ^ maintenanceNON.IsChecked == true)
                            {
                                if (maintenanceOUI.IsChecked == true)
                                {
                                    if (dureeMaintenance.Text != null && natureMaintenance.Text != null)
                                    {
                                        try
                                        {
                                            string stringBesoinSpecifique;
                                            if (besoinSpeOUI.IsChecked == true)
                                            {
                                                stringBesoinSpecifique = "1";
                                            }
                                            else
                                            {
                                                stringBesoinSpecifique = "0";
                                            }
                                            string stringDureeMaintenance = dureeMaintenance.Text;
                                            string stringID = id.Text;
                                            //string stringMaintenance;
                                            string stringNatureMaintenance = natureMaintenance.Text;
                                            string stringNbMinMonstre      = Convert.ToString(nbSlider.Value);
                                            string stringNom = nom.Text;
                                            string stringOuvert;
                                            if (ouvertOUI.IsChecked == true)
                                            {
                                                stringOuvert = "1";
                                            }
                                            else
                                            {
                                                stringOuvert = "0";
                                            }
                                            string          stringTypeDeBesoin = typeBesoin.Text;
                                            string          connectionString   = "SERVER=35.195.241.250; PORT=3306; DATABASE=zombillenium; UID=root; PASSWORD=abcd1234;";
                                            MySqlConnection connection         = new MySqlConnection(connectionString);
                                            connection.Open();
                                            MySqlCommand command = connection.CreateCommand();
                                            command.CommandText = "INSERT INTO zombillenium.attraction (besoinSpecifique, dureeMaintenance, ID, maintenance, natureMaintenance, nbMinMonstre, nom, ouvert, typeDeBesoin) VALUES ('" + stringBesoinSpecifique + "','" + stringDureeMaintenance + "','" + stringID + "','" + "0" + "','" + stringNatureMaintenance + "','" + stringNbMinMonstre + "','" + stringNom + "','" + stringOuvert + "','" + stringTypeDeBesoin + "');";

                                            MySqlDataReader reader;
                                            reader = command.ExecuteReader();



                                            bool boolBesoinSpecifique;
                                            if (besoinSpeOUI.IsChecked == true)
                                            {
                                                boolBesoinSpecifique = true;
                                            }
                                            else
                                            {
                                                boolBesoinSpecifique = false;
                                            }
                                            bool boolOuvert;
                                            if (ouvertOUI.IsChecked == true)
                                            {
                                                boolOuvert = true;
                                            }
                                            else
                                            {
                                                boolOuvert = false;
                                            }
                                            TimeSpan          dureeMaint      = TimeSpan.FromHours(Convert.ToInt32(dureeMaintenance.Text));
                                            List <Monstre>    temp            = new List <Monstre>();
                                            int               idClass         = Convert.ToInt32(id.Text);
                                            int               minMonstreClass = Convert.ToInt32(stringNbMinMonstre);
                                            List <Attraction> list1           = new List <Attraction>();
                                            TimeSpan          dureeClass      = TimeSpan.FromMinutes(Convert.ToInt32(duree.Text));
                                            bool              vehicule;
                                            if (vehiculeOUI.IsChecked == true)
                                            {
                                                vehicule = true;
                                            }
                                            else
                                            {
                                                vehicule = false;
                                            }
                                            TypeBoutique    typebouti  = (TypeBoutique)typeBout.SelectedItem;
                                            int             ageMini    = Convert.ToInt32(ageMin.Text);
                                            TypeCategorie   typeCat    = (TypeCategorie)catRoll.SelectedItem;
                                            float           tailleMini = float.Parse(tailleMin.Text);
                                            List <DateTime> horaires   = new List <DateTime>();
                                            int             places     = Convert.ToInt32(nbPlaces.Text);

                                            if (typeAttraction.Text == "DarkRide")
                                            {
                                                DarkRide attract1 = new DarkRide(dureeClass, vehicule, boolBesoinSpecifique, dureeMaint, temp, idClass, true, stringNatureMaintenance, minMonstreClass, stringNom, boolOuvert, stringTypeDeBesoin);
                                                list1.Add(attract1);
                                                Console.WriteLine(attract1);
                                            }
                                            else if (typeAttraction.Text == "Boutique")
                                            {
                                                Boutique attract1 = new Boutique(typebouti, boolBesoinSpecifique, dureeMaint, temp, idClass, true, stringNatureMaintenance, minMonstreClass, stringNom, boolOuvert, stringTypeDeBesoin);
                                                list1.Add(attract1);
                                            }
                                            else if (typeAttraction.Text == "RollerCoaster")
                                            {
                                                RollerCoaster attract1 = new RollerCoaster(ageMini, typeCat, tailleMini, boolBesoinSpecifique, temp, idClass, minMonstreClass, stringNom, boolOuvert, stringTypeDeBesoin);
                                                list1.Add(attract1);
                                            }
                                            else
                                            {
                                                Spectacle attract1 = new Spectacle(horaires, places, nomSalle.Text, boolBesoinSpecifique, dureeMaint, temp, idClass, true, stringNatureMaintenance, minMonstreClass, stringNom, boolOuvert, stringTypeDeBesoin);
                                                list1.Add(attract1);
                                            }

                                            //Attraction attract1 = new Attraction(boolBesoinSpecifique, dureeMaint, temp, idClass, true,
                                            //    stringNatureMaintenance, minMonstreClass, stringNom, boolOuvert, stringTypeDeBesoin);
                                            Administration.listeAttractions.Add(list1[0]);
                                            //Administration.listeAttractions.ForEach(Console.WriteLine);

                                            if (reader.Read())
                                            {
                                                affichage.Text = reader.GetString(0);
                                            }
                                            else
                                            {
                                                affichage.Text = "Attraction ajoutée";
                                            }


                                            connection.Close();
                                        }
                                        catch
                                        {
                                            MessageBoxResult result = MessageBox.Show("Type de valeur d'entrée incorrect: vérifier le matricule (entier) et le sexe (M, F ou A)", "Erreur", MessageBoxButton.OK, MessageBoxImage.Error);
                                            //label1.Content = "Type de valeur d'entrée incorrect: vérifier le matricule (entier) et le sexe (M, F ou A)";
                                        }
                                    }
                                    else
                                    {
                                        affichage.Text = "Informations manquantes. Merci de remplir la durée de maintenance et sa nature.";
                                    }
                                }
                                else
                                {
                                    try
                                    {
                                        string stringBesoinSpecifique;
                                        if (besoinSpeOUI.IsChecked == true)
                                        {
                                            stringBesoinSpecifique = "1";
                                        }
                                        else
                                        {
                                            stringBesoinSpecifique = "0";
                                        }
                                        //string stringDureeMaintenance = dureeMaintenance.Text;
                                        string stringID = id.Text;
                                        //string stringMaintenance;
                                        //string stringNatureMaintenance = natureMaintenance.Text;
                                        string stringNbMinMonstre = Convert.ToString(nbSlider.Value);
                                        string stringNom          = nom.Text;
                                        string stringOuvert;
                                        if (ouvertOUI.IsChecked == true)
                                        {
                                            stringOuvert = "1";
                                        }
                                        else
                                        {
                                            stringOuvert = "0";
                                        }
                                        string stringTypeDeBesoin = typeBesoin.Text;

                                        try
                                        {
                                            string          connectionString = "SERVER=35.195.241.250; PORT=3306; DATABASE=zombillenium; UID=root; PASSWORD=abcd1234;";
                                            MySqlConnection connection       = new MySqlConnection(connectionString);
                                            connection.Open();
                                            MySqlCommand command = connection.CreateCommand();
                                            command.CommandText = "INSERT INTO zombillenium.attraction (besoinSpecifique, ID, maintenance, nbMinMonstre, nom, ouvert, typeDeBesoin) VALUES ('" + stringBesoinSpecifique + "','" + stringID + "','" + "0" + "','" + stringNbMinMonstre + "','" + stringNom + "','" + stringOuvert + "','" + stringTypeDeBesoin + "');";

                                            MySqlDataReader reader;
                                            reader = command.ExecuteReader();

                                            if (reader.Read())
                                            {
                                                affichage.Text = reader.GetString(0);
                                            }
                                            else
                                            {
                                                affichage.Text = "Attraction ajoutée";
                                            }


                                            connection.Close();
                                        }
                                        catch
                                        {
                                            affichage.Text = "Attraction non ajoutée à la base de données.";
                                        }


                                        bool boolBesoinSpecifique;
                                        if (besoinSpeOUI.IsChecked == true)
                                        {
                                            boolBesoinSpecifique = true;
                                        }
                                        else
                                        {
                                            boolBesoinSpecifique = false;
                                        }
                                        bool boolOuvert;
                                        if (ouvertOUI.IsChecked == true)
                                        {
                                            boolOuvert = true;
                                        }
                                        else
                                        {
                                            boolOuvert = false;
                                        }
                                        //TimeSpan dureeMaint = TimeSpan.FromHours(Convert.ToInt32(dureeMaintenance.Text));
                                        List <Monstre>    temp            = new List <Monstre>();
                                        int               idClass         = Convert.ToInt32(id.Text);
                                        int               minMonstreClass = Convert.ToInt32(stringNbMinMonstre);
                                        List <Attraction> list1           = new List <Attraction>();
                                        TimeSpan          dureeClass      = TimeSpan.FromMinutes(Convert.ToInt32(duree.Text));
                                        bool              vehicule;
                                        if (vehiculeOUI.IsChecked == true)
                                        {
                                            vehicule = true;
                                        }
                                        else
                                        {
                                            vehicule = false;
                                        }
                                        TypeBoutique    typebouti  = (TypeBoutique)typeBout.SelectedItem;
                                        int             ageMini    = Convert.ToInt32(ageMin.Text);
                                        TypeCategorie   typeCat    = (TypeCategorie)catRoll.SelectedItem;
                                        float           tailleMini = float.Parse(tailleMin.Text);
                                        List <DateTime> horaires   = new List <DateTime>();
                                        int             places     = Convert.ToInt32(nbPlaces.Text);

                                        if (typeAttraction.Text == "DarkRide")
                                        {
                                            DarkRide attract1 = new DarkRide(dureeClass, vehicule, boolBesoinSpecifique, temp, idClass, minMonstreClass, stringNom, boolOuvert, stringTypeDeBesoin);
                                            list1.Add(attract1);
                                            Console.WriteLine(attract1);
                                        }
                                        else if (typeAttraction.Text == "Boutique")
                                        {
                                            Boutique attract1 = new Boutique(typebouti, boolBesoinSpecifique, temp, idClass, minMonstreClass, stringNom, boolOuvert, stringTypeDeBesoin);
                                            list1.Add(attract1);
                                        }
                                        else if (typeAttraction.Text == "RollerCoaster")
                                        {
                                            RollerCoaster attract1 = new RollerCoaster(ageMini, typeCat, tailleMini, boolBesoinSpecifique, temp, idClass, minMonstreClass, stringNom, boolOuvert, stringTypeDeBesoin);
                                            list1.Add(attract1);
                                        }
                                        else
                                        {
                                            Spectacle attract1 = new Spectacle(horaires, places, nomSalle.Text, boolBesoinSpecifique, temp, idClass, minMonstreClass, stringNom, boolOuvert, stringTypeDeBesoin);
                                            list1.Add(attract1);
                                        }

                                        //Attraction attract1 = new Attraction(boolBesoinSpecifique, dureeMaint, temp, idClass, true,
                                        //    stringNatureMaintenance, minMonstreClass, stringNom, boolOuvert, stringTypeDeBesoin);
                                        Administration.listeAttractions.Add(list1[0]);

                                        if (affichage.Text != "Attraction non ajoutée à la base de données.")
                                        {
                                            affichage.Text = "Attraction ajoutée.";
                                        }
                                        else
                                        {
                                            affichage.Text = "Attraction ajoutée au programme, mais pas à la base de données MySQL.";
                                        }
                                    }
                                    catch
                                    {
                                        MessageBoxResult result = MessageBox.Show("Type de valeur d'entrée incorrect: vérifier le matricule (entier) et le sexe (M, F ou A)", "Erreur", MessageBoxButton.OK, MessageBoxImage.Error);
                                        //label1.Content = "Type de valeur d'entrée incorrect: vérifier le matricule (entier) et le sexe (M, F ou A)";
                                    }
                                }
                            }
                            else
                            {
                                affichage.Text = "Merci d'indiquer si l'attraction est en maintenance.";
                            }
                        }
                        else
                        {
                            affichage.Text = "Merci de confirmer l'exactitude des informations en cochant la case.";
                        }
                    }
                }
                else
                {
                }
            }
            else
            {
                affichage.Text = "Matricule déjà existant. Merci de le changer.";
            }
        }
Example #17
0
 public void EvolutionCategorie(TypeCategorie newcategorie)
 {
     categorie = newcategorie;
 }
Example #18
0
        public RollerCoaster(string nom, string typeDeBesoin, int identifiant, int nbMonstreMini, int ageMini, float tailleMini, TypeCategorie typeCategorie)
        {
            this.Nom           = nom;
            this.TypeDeBesoin  = typeDeBesoin;
            this.Identifiant   = identifiant;
            this.NbMonstreMini = nbMonstreMini;

            this.Equipe    = new List <Monstre>();
            this.EnService = false;

            this.AgeMini       = ageMini;
            this.TailleMini    = tailleMini;
            this.TypeCategorie = typeCategorie;
        }
Example #19
0
 public Rollercoaster(float tailleMin, int ageMin, TypeCategorie categorie, int identifiant, string nom, int nbMinMonstre, bool ouvert, string spec) : base(identifiant, nom, nbMinMonstre, ouvert, spec)
 {
     this.tailleMin = tailleMin;
     this.ageMin    = ageMin;
     this.categorie = categorie;
 }
Example #20
0
 public Rollercoaster(string[] ligne) : base(ligne)
 {
     categorie = (TypeCategorie)Enum.Parse(typeof(TypeCategorie), ligne[6]);
     tailleMin = float.Parse(ligne[8]);
     ageMin    = int.Parse(ligne[7]);
 }
Example #21
0
        private void BoutonConfirme_Click(object sender, RoutedEventArgs e)
        {
            ComboBoxItem typeItem = (ComboBoxItem)Choix.SelectedItem;
            string       choix    = typeItem.Content.ToString();

            if (choix == "Sorcier")
            {
                int           mat           = Convert.ToInt32(Texte1.Text);
                string        nom           = Texte2.Text;
                string        prenom        = Texte3.Text;
                string        fonction      = Texte4.Text;
                List <string> listePouvoirs = new List <string>();
                string        temp          = "";
                foreach (char elt in Texte5.Text)
                {
                    if (elt != '-')
                    {
                        temp = temp + elt;
                    }
                    else
                    {
                        listePouvoirs.Add(temp);
                        temp = "";
                    }
                }
                listePouvoirs.Add(temp);
                string   sexeSelection  = (string)Liste8.SelectionBoxItem;
                typesexe sexe           = RecupererSexe(sexeSelection);
                string   gradeSelection = (string)Liste9.SelectionBoxItem;
                Grade    grade          = Grade.novice;
                switch (gradeSelection)
                {
                case ("Strata"):
                {
                    grade = Grade.strata;
                    break;
                }

                case ("Mega"):
                {
                    grade = Grade.mega;
                    break;
                }

                case ("Giga"):
                {
                    grade = Grade.giga;
                    break;
                }
                }
                Sorcier sorcier = new Sorcier(listePouvoirs, grade, fonction, mat, nom, prenom, sexe);
                admin.AjouterSorcier(sorcier);
                MessageBox.Show("Sorcier ajouté.");
            }
            if (choix == "Monstre")
            {
                int        mat        = Convert.ToInt32(Texte1.Text);
                string     nom        = Texte2.Text;
                string     prenom     = Texte3.Text;
                string     fonction   = Texte4.Text;
                int        cagnotte   = Convert.ToInt32(Texte5.Text);
                Attraction attraction = new Attraction();
                typesexe   sexe       = RecupererSexe((string)Liste8.SelectionBoxItem);
                Monstre    monstre    = new Monstre(attraction, cagnotte, fonction, mat, nom, prenom, sexe);
                admin.AjouterMonstre(monstre);
                MessageBox.Show("Monstre ajouté.");
            }
            if (choix == "Démon")
            {
                int        mat        = Convert.ToInt32(Texte1.Text);
                string     nom        = Texte2.Text;
                string     prenom     = Texte3.Text;
                string     fonction   = Texte4.Text;
                int        cagnotte   = Convert.ToInt32(Texte5.Text);
                int        force      = Convert.ToInt32(Texte7.Text);
                Attraction attraction = new Attraction();
                typesexe   sexe       = RecupererSexe((string)Liste8.SelectionBoxItem);
                Demon      demon      = new Demon(force, attraction, cagnotte, fonction, mat, nom, prenom, sexe);
                admin.AjouterDemon(demon);
                MessageBox.Show("Démon ajouté.");
            }
            if (choix == "Fantôme")
            {
                int        mat        = Convert.ToInt32(Texte1.Text);
                string     nom        = Texte2.Text;
                string     prenom     = Texte3.Text;
                string     fonction   = Texte4.Text;
                int        cagnotte   = Convert.ToInt32(Texte5.Text);
                Attraction attraction = new Attraction();
                typesexe   sexe       = RecupererSexe((string)Liste8.SelectionBoxItem);
                Fantome    fantome    = new Fantome(attraction, cagnotte, fonction, mat, nom, prenom, sexe);
                admin.AjouterFantome(fantome);
                MessageBox.Show("Fantôme ajouté");
            }
            if (choix == "Loup Garou")
            {
                int        mat           = Convert.ToInt32(Texte1.Text);
                string     nom           = Texte2.Text;
                string     prenom        = Texte3.Text;
                string     fonction      = Texte4.Text;
                int        cagnotte      = Convert.ToInt32(Texte5.Text);
                double     indiceCruaute = Convert.ToDouble(Texte7.Text);
                Attraction attraction    = new Attraction();
                typesexe   sexe          = RecupererSexe((string)Liste8.SelectionBoxItem);
                LoupGarou  loupGarou     = new LoupGarou(indiceCruaute, attraction, cagnotte, fonction, mat, nom, prenom, sexe);
                admin.AjouterLoupGarou(loupGarou);
                MessageBox.Show("Loup garou ajouté.");
            }
            if (choix == "Vampire")
            {
                int        mat              = Convert.ToInt32(Texte1.Text);
                string     nom              = Texte2.Text;
                string     prenom           = Texte3.Text;
                string     fonction         = Texte4.Text;
                int        cagnotte         = Convert.ToInt32(Texte5.Text);
                double     indiceLuminosite = Convert.ToDouble(Texte7.Text);
                Attraction attraction       = new Attraction();
                typesexe   sexe             = RecupererSexe((string)Liste8.SelectionBoxItem);
                Vampire    vampire          = new Vampire(indiceLuminosite, attraction, cagnotte, fonction, mat, nom, prenom, sexe);
                admin.AjouterVampire(vampire);
                MessageBox.Show("Vampire ajouté.");
            }
            if (choix == "Zombie")
            {
                int        mat                = Convert.ToInt32(Texte1.Text);
                string     nom                = Texte2.Text;
                string     prenom             = Texte3.Text;
                string     fonction           = Texte4.Text;
                int        cagnotte           = Convert.ToInt32(Texte5.Text);
                int        degreDecomposition = Convert.ToInt32(Texte7.Text);
                Attraction attraction         = new Attraction();
                typesexe   sexe               = RecupererSexe((string)Liste8.SelectionBoxItem);
                CouleurZ   couleur            = CouleurZ.bleuatre;
                if ((string)Liste9.SelectionBoxItem == "grisatre")
                {
                    couleur = CouleurZ.grisatre;
                }
                Zombie zombie = new Zombie(degreDecomposition, couleur, attraction, cagnotte, fonction, mat, nom, prenom, sexe);
                admin.AjouterZombie(zombie);
                MessageBox.Show("Zombie ajouté.");
            }
            if (choix == "Boutique")
            {
                string       id               = Texte1.Text;
                string       nom              = Texte2.Text;
                int          nbMin            = Convert.ToInt32(Texte3.Text);
                string       typeBesoin       = Texte4.Text;
                bool         besoinSpecifique = RecupererBool((string)Liste8.SelectionBoxItem);
                TypeBoutique typeBoutique     = TypeBoutique.barbeAPapa;
                switch ((string)Liste9.SelectionBoxItem)
                {
                case ("Souvenir"):
                {
                    typeBoutique = TypeBoutique.souvenir;
                    break;
                }

                case ("Nourriture"):
                {
                    typeBoutique = TypeBoutique.nourriture;
                    break;
                }
                }
                List <Monstre> equipe   = new List <Monstre>();
                TimeSpan       time     = new TimeSpan(0);
                Boutique       boutique = new Boutique(typeBoutique, besoinSpecifique, time, equipe, id, false, "", nbMin, nom, true, typeBesoin);
                MessageBox.Show("Boutique ajoutée.");
            }
            if (choix == "DarkRide")
            {
                string         id               = Texte1.Text;
                string         nom              = Texte2.Text;
                int            nbMin            = Convert.ToInt32(Texte3.Text);
                string         typeBesoin       = Texte4.Text;
                TimeSpan       time             = new TimeSpan(0, Convert.ToInt32(Texte5.Text), 0);
                bool           besoinSpecifique = RecupererBool((string)Liste8.SelectionBoxItem);
                bool           vehicule         = RecupererBool((string)Liste9.SelectionBoxItem);
                TimeSpan       dureeMaintenance = new TimeSpan(0);
                List <Monstre> equipe           = new List <Monstre>();
                DarkRide       darkRide         = new DarkRide(time, vehicule, besoinSpecifique, dureeMaintenance, equipe, id, false, "", nbMin, nom, true, typeBesoin);
                admin.AjouterDarkRide(darkRide);
                MessageBox.Show("DarkRide ajouté.");
            }
            if (choix == "RollerCoaster")
            {
                string        id               = Texte1.Text;
                string        nom              = Texte2.Text;
                int           nbMin            = Convert.ToInt32(Texte3.Text);
                string        typeBesoin       = Texte4.Text;
                int           ageMin           = Convert.ToInt32(Texte5.Text);
                int           tailleMin        = Convert.ToInt32(Texte6.Text);
                bool          besoinSpecifique = RecupererBool((string)Liste8.SelectionBoxItem);
                TypeCategorie typeCategorie    = TypeCategorie.assise;
                switch ((string)Liste9.SelectionBoxItem)
                {
                case ("Bobsleigh"):
                {
                    typeCategorie = TypeCategorie.bobsleigh;
                    break;
                }

                case ("Inversée"):
                {
                    typeCategorie = TypeCategorie.inversee;
                    break;
                }
                }
                TimeSpan       dureeMaintenance = new TimeSpan(0);
                List <Monstre> equipe           = new List <Monstre>();
                RollerCoaster  roller           = new RollerCoaster(ageMin, typeCategorie, tailleMin, besoinSpecifique, dureeMaintenance, equipe, id, false, "", nbMin, nom, true, typeBesoin);
                admin.AjouterRollerCoaster(roller);
                MessageBox.Show("RollerCoaster ajouté.");
            }
            if (choix == "Spectacle")
            {
                string          id           = Texte1.Text;
                string          nom          = Texte2.Text;
                int             nbMin        = Convert.ToInt32(Texte3.Text);
                string          typeBesoin   = Texte4.Text;
                string          nomSalle     = Texte5.Text;
                int             nbPlaces     = Convert.ToInt32(Texte6.Text);
                List <DateTime> listeHoraire = new List <DateTime>();
                string[]        lHoraire     = Texte7.Text.Split(' ');
                foreach (string elt in lHoraire)
                {
                    listeHoraire.Add(Convert.ToDateTime(elt));
                }
                bool           besoinSpecifique = RecupererBool((string)Liste8.SelectionBoxItem);
                TimeSpan       dureeMaintenance = new TimeSpan(0);
                List <Monstre> equipe           = new List <Monstre>();
                Spectacles     spectacles       = new Spectacles(listeHoraire, nbPlaces, nomSalle, besoinSpecifique, dureeMaintenance, equipe, id, false, "", nbMin, nom, true, typeBesoin);
                admin.AjouterSpectacle(spectacles);
                MessageBox.Show("Spectacle ajouté.");
            }
        }
Example #22
0
 public CRollerCoaster(int identifiant, string nom, int nbMinMonstre, bool besoinSpecifique, string typeDeBesoin, TypeCategorie categorie, int ageMinimum, float tailleMinimum) : base(identifiant, nom, nbMinMonstre, besoinSpecifique, typeDeBesoin)
 {
     m_ageMinimumInt      = ageMinimum;
     m_categorie          = categorie;
     m_tailleMinimumFloat = tailleMinimum;
 }
Example #23
0
 public RollerCoaster(bool besoinSpecifique, int identifiant, int nbMinMonstre, string nom, string typeDeBesoin, int ageMin, TypeCategorie categorie, double tailleMin) : base(besoinSpecifique, identifiant, nbMinMonstre, nom, typeDeBesoin)
 {
     this.categorie = categorie;
     this.tailleMin = tailleMin;
     this.ageMin    = ageMin;
 }