Esempio n. 1
0
        public void aaaInsertScreeningRooms()
        {
            ScriptMaker sm = new ScriptMaker();
            List<int> cinemasWithoutRooms = per.GetCinemasWithOutRooms();

            string screeningRoomsScript = sm.MakeScreeningRooms(cinemasWithoutRooms);
            System.IO.File.WriteAllText(PATH + FILE_NAME, screeningRoomsScript);
            per.InsertScript(screeningRoomsScript);
        }
Esempio n. 2
0
        public void dddInsertScreening()
        {
            ScriptMaker sm = new ScriptMaker();
            int maxMovieId = per.CountRowsInTable("movies");
            int maxScreeningRoomId = per.CountRowsInTable("screening_rooms");

            List<string> screeningsScriptList = sm.MakeScreenings(maxScreeningRoomId, maxMovieId);
            System.IO.File.WriteAllLines(PATH + FILE_NAME, screeningsScriptList);
            per.InsertBatch(screeningsScriptList);
        }
Esempio n. 3
0
        public void cccInsertMovies()
        {
            int numberOf1000MoviesToInsert = 5;

            ScriptMaker sm = new ScriptMaker();
            int currentNumberOfMovies = per.CountRowsInTable("movies");

            List<string> scriptList = sm.MakeMoviesInThousands(numberOf1000MoviesToInsert, currentNumberOfMovies);
            System.IO.File.WriteAllLines(PATH + FILE_NAME, scriptList);
            per.InsertBatch(scriptList);
        }
Esempio n. 4
0
        public void bbbInsertSeatLocations()
        {
            ScriptMaker sm = new ScriptMaker();
            //int maxCinemaId = per.CountRowsInTable("screening_rooms");
            List<int> screeningRoomIds = per.GetScreeningRoomsWithoutSeatLocations();

            List<string> seatLocationsScriptList = sm.MakeSeatLocations(screeningRoomIds);
            System.IO.File.WriteAllLines(PATH + FILE_NAME, seatLocationsScriptList);

            per.InsertBatch(seatLocationsScriptList);
        }
Esempio n. 5
0
 public void xxxInsertMoreCinemas()
 {
     ScriptMaker sm = new ScriptMaker();
     string script = sm.MakeCinemas();
     System.IO.File.WriteAllText(PATH + FILE_NAME, script);
     per.InsertScript(script);
 }
Esempio n. 6
0
        public void fffInsertTickets()
        {
            int numberOfScreeningsToBook = 1000;//this is multiplied by up to 840
            List<string> scriptList = new List<string>(numberOfScreeningsToBook / 1000 + 1);
            ScriptMaker sm = new ScriptMaker();
            per = new Persistence();
            int currentMaxCustomerId = per.CountRowsInTable("customers");
            int currentMaxScreeningId = per.GetMaxScreenInTickets();
            List<int> nonExistingSeatLocationIds = per.GetNonExistingSeatLocations();

            for (int currentScreeningId = 1; currentScreeningId < numberOfScreeningsToBook+1; currentScreeningId++)
            {
                List<int[]> ids = per.GetSeatsFromScreeningid(currentMaxScreeningId + currentScreeningId);
                scriptList.Add(sm.MakeTickets(ids, currentMaxCustomerId));
            }

            System.IO.File.WriteAllLines(PATH + FILE_NAME, scriptList);
            per.InsertBatch(scriptList);
        }
Esempio n. 7
0
        public void eee2InsertHalfCustomers()
        {
            int numberOfhalfCustsIn1000s = 200;

            ScriptMaker sm = new ScriptMaker();
            int maxCustNumber = per.CountRowsInTable("customers");

            List<string> halfCustomersScript = sm.MakeHalfCustomersIn1000s(numberOfhalfCustsIn1000s, maxCustNumber);

            System.IO.File.WriteAllLines(PATH + FILE_NAME, halfCustomersScript);
            per.InsertBatch(halfCustomersScript);
        }
Esempio n. 8
0
        public void eee1InsertFullCustomers()
        {
            int numberOfFullCustsIn1000s = 200;

            ScriptMaker sm = new ScriptMaker();
            int maxCustNumber = per.CountRowsInTable("customers");

            List<string> fullCustomersScript = sm.MakeFullCustomersIn1000s(numberOfFullCustsIn1000s, maxCustNumber);
            int newMaxNumberOfcusts = maxCustNumber + numberOfFullCustsIn1000s * 1000;
            System.IO.File.WriteAllLines(PATH + FILE_NAME, fullCustomersScript);
            per.InsertBatch(fullCustomersScript);
        }