def updateCity():

    if session['loginRole'] != 'admin':
        return redirect(url_for('login'))

    cityDAO = CityDAO()
    cityVO = CityVO()

    cityVO.cityName = request.form['cityName']
    cityVO.cityDescription = request.form['cityDescription']
    cityVO.city_StateId = request.form['stateId']
    cityVO.cityId = request.form['cityId']

    cityDAO.updateCity(cityVO)

    return redirect(url_for('viewCity'))
예제 #2
0
def adminUpdateCity():
    try:
        if adminLoginSession() == "admin":

            cityId = request.form['cityId']
            cityName = request.form['cityName']
            cityDescription = request.form['cityDescription']
            print(cityId, cityDescription, cityName)

            cityVO = CityVO()
            cityDAO = CityDAO()

            cityVO.cityId = cityId
            cityVO.cityName = cityName
            cityVO.cityDescription = cityDescription

            cityDAO.updateCity(cityVO)

            return redirect(url_for('adminViewCity'))
        else:
            return adminLogoutSession()
    except Exception as ex:
        print(ex)