Exemple #1
0
        //surcharge s'il n'y a que la piece de choisie
        public static List <Show> GetFilterShows(int idPiece)
        {
            List <Show> lesRepresentationsFiltrees = new List <Show>();

            lesRepresentationsFiltrees = RepresentationsDAO.GetFilterShowsTheaterPiece(idPiece);


            return(lesRepresentationsFiltrees);
        }
Exemple #2
0
        //surcharge si il n'y a que les dates de choisies
        public static List <Show> GetFilterShows(DateTime dateDeb, DateTime dateFin)
        {
            List <Show> lesRepresentationsFiltrees = new List <Show>();

            lesRepresentationsFiltrees = RepresentationsDAO.GetFilterShowsDate(dateDeb, dateFin);


            return(lesRepresentationsFiltrees);
        }
Exemple #3
0
        //- une méthode qui renvoie le nombre de représentations SUR UNE PERIODE pour une pièce    *GetNbShows(TheaterPiece laPiece, DateTime dateDebut, DateTime dateFin) *
        //  Appel de la requête SQL GetFilterShowsDate(), puis tris de la liste pour en construire une avec seulement les shows concernés par la pièce passée en param et renvoie cette nouvelle liste
        public static int GetNbShows(TheaterPiece laPiece, DateTime dateDebut, DateTime dateFin)
        {
            List <Show> shows   = RepresentationsDAO.GetFilterShows(laPiece.TheaterPiece_id, dateDebut, dateFin);
            int         nbShows = 0;

            foreach (Show unshow in shows)
            {
                if (unshow.Show_theaterPiece.TheaterPiece_id == laPiece.TheaterPiece_id)
                {
                    nbShows++;
                }
            }
            return(nbShows);
        }
Exemple #4
0
        //- une méthode qui renvoie le nombre de représentations pour une pièce* GetNbShows(TheaterPiece laPiece) *
        //  Appel de la requête SQL GetShows(), puis tris de la liste pour en construire une avec seulement les shows concernés par la pièce passée en param et renvoie cette nouvelle liste
        public static int GetNbShows(TheaterPiece laPiece)
        {
            List <Show> shows   = RepresentationsDAO.GetShows();
            int         nbShows = 0;

            foreach (Show unshow in shows)
            {
                if (unshow.Show_theaterPiece.TheaterPiece_id == laPiece.TheaterPiece_id)
                {
                    nbShows++;
                }
            }
            return(nbShows);
        }
Exemple #5
0
        //- une méthode qui renvoie le nombre total de spectateur SUR UNE PERIODE pour une pièce* GetNbSpectators(TheaterPiece laPiece, DateTime dateDebut, DateTime dateFin)*
        //  Appel de la requête SQL GetSpectators() et appel de la requête SQL GetFilterShowsDate(), on compte le nombre de spectateurs(addition de tous les seatsBooked) qui sont concernés par ces show et on renvoie ce nombre.
        public static int GetNbSpectators(TheaterPiece laPiece, DateTime dateDebut, DateTime dateFin)
        {
            List <Spectator> spectators = ReservationsDAO.GetSpectators();                                                //liste spectateurs
            List <Show>      shows      = RepresentationsDAO.GetFilterShows(laPiece.TheaterPiece_id, dateDebut, dateFin); //listes des shows à une date donnée
            int nbSpectators            = 0;

            foreach (Show unShow in shows)
            {
                foreach (Spectator unSpectateur in spectators)
                {
                    if (laPiece.TheaterPiece_id == unSpectateur.Spectator_show.Show_theaterPiece.TheaterPiece_id && laPiece.TheaterPiece_id == unShow.Show_theaterPiece.TheaterPiece_id)
                    {
                        nbSpectators = nbSpectators + unSpectateur.Spectator_seatsBooked;
                    }
                }
            }
            return(nbSpectators);
        }
Exemple #6
0
        //- une méthode qui renvoie le CA total réalisé SUR UNE PERIODE pour une pièce   *GetCaTotal(TheaterPiece laPiece, DateTime dateDebut, DateTime dateFin) *
        //  Appel de la requête SQL GetSpectators() et appel de la requête SQL GetFilterShowsDate(), pour chaque spectator concerné par un des shows de la période, on calcule le prix qu'il a payé et on l'ajoute à une variable qui récupère le total. On renvoi ce total.
        public static float GetCaTotal(TheaterPiece laPiece, DateTime dateDebut, DateTime dateFin)
        {
            List <Spectator> spectators = ReservationsDAO.GetSpectators();                                                //liste spectateurs
            List <Show>      shows      = RepresentationsDAO.GetFilterShows(laPiece.TheaterPiece_id, dateDebut, dateFin); //listes des shows à une date donnée
            float            prixTotal  = 0;

            foreach (Show unShow in shows)
            {
                foreach (Spectator unSpectateur in spectators)
                {
                    if (laPiece.TheaterPiece_id == unSpectateur.Spectator_show.Show_theaterPiece.TheaterPiece_id && laPiece.TheaterPiece_id == unShow.Show_theaterPiece.TheaterPiece_id)
                    {
                        float prixaPayer = unSpectateur.Spectator_seatsBooked * (laPiece.TheaterPiece_seatsPrice + laPiece.TheaterPiece_seatsPrice * unSpectateur.Spectator_show.Show_priceRate.PriceRate_rate);
                        prixTotal = prixTotal + prixaPayer;
                    }
                }
            }
            return(prixTotal);
        }
Exemple #7
0
        //renvoie la liste des taux
        public static List <PriceRate> GetPriceRate()
        {
            List <PriceRate> priceRate = RepresentationsDAO.GetPriceRateWeeksDays();

            return(priceRate);
        }
Exemple #8
0
 // Récupère la liste des représentations de la DAO, renvoie la liste
 // GetShows()
 public static List <Show> GetShows()
 {
     return(RepresentationsDAO.GetShows());
 }
Exemple #9
0
 //modification d'un représentation
 public static int EditShow(Show show)
 {
     return(RepresentationsDAO.ModifShow(show));
 }
Exemple #10
0
 //suppression d'une représentation
 public static int DeleteShow(int idShow)
 {
     ReservationsDAO.RemoveSpectators(idShow);
     return(RepresentationsDAO.DelShow(idShow));
 }
Exemple #11
0
 // création d'une nouvelle représentation
 public static int CreateShow(Show show)
 {
     return(RepresentationsDAO.AddShow(show));
 }
Exemple #12
0
        // Renvoie le nombre de places restante pour une pièce
        public static int GetRemainingSeats(Show laRepres)
        {
            int nbRestant = RepresentationsDAO.GetSeatsBooked(laRepres.Show_id, laRepres.Show_seats);

            return(nbRestant);
        }
 // Suppression d'une pièce de théatre
 public static void RemoveTheaterPiece(TheaterPiece unePiece)
 {
     ReservationsDAO.RemoveSpectators(unePiece);
     RepresentationsDAO.RemoveShows(unePiece);
     PiecesTheatreDAO.RemoveTheaterPiece(unePiece);
 }