private static void bookSeats(int booking_id, List <SeatBookingClass> SeatsToBookList) { int showing_Id = SeatsToBookList[0].getShowing_Id(); for (int i = 0; i < SeatsToBookList.Count; i++) { string section = SeatsToBookList[i].getSection(); string row = SeatsToBookList[i].getRow(); int number = SeatsToBookList[i].getNumber(); SeatsClass.bookSeat(section, row, number, showing_Id, booking_id); } }
public static void addShowing(int pPlay_Id, string pDate, double pUpperCirclepricePrice, double pDressCirclePrice, double pStallsPrice) { queryString = "INSERT INTO Showings(Play_Id, Date, UpperCirclePrice, DressCirclePrice, StallsPrice) VALUES(@play_Id, @date, @upperCirclePrice, @dressCirclePrice, @stallsPrice)"; SQLiteConnection connection = new SQLiteConnection(SqlClassBase.getConnectionString()); SQLiteCommand command = new SQLiteCommand(queryString, connection); connection.Open(); command.Parameters.AddWithValue("@play_Id", pPlay_Id); command.Parameters.AddWithValue("@date", pDate); command.Parameters.AddWithValue("@upperCirclePrice", pUpperCirclepricePrice); command.Parameters.AddWithValue("@dressCirclePrice", pDressCirclePrice); command.Parameters.AddWithValue("@stallsPrice", pStallsPrice); command.ExecuteNonQuery(); connection.Close(); SeatsClass.generateSeats(getLastShowingId()); }