Esempio n. 1
0
def addBooking(jsonParams):
    query = "select * from project1.bookRoom("
    query += jsonParams['roomId'] + ","
    query += jsonParams['guestId'] + ",'"
    query += jsonParams['startDate'] + "','"
    query += jsonParams['endDate'] + "','"
    query += jsonParams['extras'] + "');"
    return executeQuery(query)
Esempio n. 2
0
def changeBooking(jsonParams):
    query = "select * from project1.changeBooking("
    query += jsonParams['bookingId'] + ","
    query += jsonParams['roomId'] + ","
    query += "null," if jsonParams[
        'startDate'] == "null" else "'" + jsonParams['startDate'] + "',"
    query += "null," if jsonParams[
        'endDate'] == "null" else "'" + jsonParams['endDate'] + "',"
    query += "null," if jsonParams[
        'extras'] == "null" else "'" + jsonParams['extras'] + "',"
    query += jsonParams['userId'] + ");"
    return executeQuery(query)
Esempio n. 3
0
def registerGuest(jsonParams):
	try:
		query = "select * from project1.register('"
		query += jsonParams['firstName'] + "','"
		query += jsonParams['surname'] + "','"
		query += jsonParams['creditCard'] + "',"
		query += jsonParams['handicap'] + ",'"
		query += jsonParams['email'] + "','"
		query += jsonParams['phoneNumber'] + "');"
	except:
		with open("log.txt", "a") as myfile:
			myfile.write(query + "\n")
	return executeQuery(query)
Esempio n. 4
0
def getGetCountOfActiveBookingsWithExtras(jsonParams):
    return executeQuery(
        "select * from project1.countOfActiveBookingWithExtras(" +
        jsonParams['extrasId'] + ");")
Esempio n. 5
0
def checkOutBooking(jsonParams):
    return executeQuery("select * from project1.checkOutBooking(" +
                        jsonParams['bookingId'] + "," + jsonParams['userId'] +
                        ");")
Esempio n. 6
0
def showActualBookingsForCapacity(jsonParams):
    return executeQuery("select * from project1.roomCapacityActualBookings(" +
                        jsonParams['capacity'] + ");")
Esempio n. 7
0
def getBookingsForRoom(jsonParams):
    return executeQuery("select * from project1.roomBookings(" +
                        jsonParams['roomId'] + ");")
Esempio n. 8
0
def canGuestEnterCanteen(jsonParams):
	return executeQuery("select * from project1.canGuestEnterCanteen(" + jsonParams['guestId'] + ");")
Esempio n. 9
0
def getBookingInfo(jsonParams):
    return executeQuery("select * from project1.bookingInfo;")
Esempio n. 10
0
def getExtrasForBooking(jsonParams):
    return executeQuery(
        "select * from project1.extras_booking where bookingId =" +
        jsonParams['bookingId'] + ";")
Esempio n. 11
0
def getExtras(jsonParams):
	return executeQuery("select * from project1.extras;");
Esempio n. 12
0
def getRoomCategories(jsonParams):
	return executeQuery("select * from project1.roomCategory;")
Esempio n. 13
0
def roomInfo(jsonParams):
	return executeQuery("select * from project1.roomInfo;")
Esempio n. 14
0
def getGuestInfo(jsonParams):
	return executeQuery("select * from project1.guest;")
Esempio n. 15
0
def getTotalCostOfBooking(jsonParams):
    return executeQuery("select * from project1.getTotalCostOfBooking(" +
                        jsonParams['bookingId'] + ");")
Esempio n. 16
0
def showActualBookingsForCategory(jsonParams):
    return executeQuery("select * from project1.roomCategoryActualBookings('" +
                        jsonParams['categoryName'] + "');")
Esempio n. 17
0
def getBookingsForRoomInDateRange(jsonParams):
    return executeQuery("select * from project1.roomBookingsDateRange(" +
                        jsonParams['roomId'] + ",'" + jsonParams['startDate'] +
                        "','" + jsonParams['endDate'] + "');")
Esempio n. 18
0
def showActualBookingsForComfort(jsonParams):
    return executeQuery("select * from project1.roomComfortActualBookings(" +
                        jsonParams['comfort'] + ");")
Esempio n. 19
0
def getBookingInfoWithId(jsonParams):
    return executeQuery("select * from project1.booking where bookingId = " +
                        jsonParams['bookingId'] + ";")
Esempio n. 20
0
def showGuestBookings(jsonParams):
	return executeQuery("select * from project1.getAllBookingsForGuest(" + jsonParams['guestId'] + ");")