示例#1
0
def viewState():

    stateDAO = StateDAO()

    stateDict = stateDAO.searchState()

    return render_template('admin/viewState.html', stateDict=stateDict)
示例#2
0
def editState():

    stateDAO = StateDAO()
    stateVO = StateVO()

    stateVO.stateId = request.args.get('stateId')

    stateDict = stateDAO.editState(stateVO)

    return render_template('admin/editState.html', stateDict=stateDict)
示例#3
0
def deleteState():

    stateDAO = StateDAO()
    stateVO = StateVO()
    stateVO.stateId = request.args.get('stateId')
    stateVO.stateActiveStatus = 'deactive'

    stateDAO.deleteState(stateVO)

    return redirect(url_for('viewState'))
def loadCity():
    try:
        if session['loginRole'] != 'admin':
            return redirect(url_for('loadLogin'))
    except:
        return redirect(url_for('loadLogin'))

    stateDAO = StateDAO()
    stateDict = stateDAO.searchState()

    return render_template('admin/addCity.html', stateDict=stateDict)
示例#5
0
def updateState():

    stateVO = StateVO()
    stateDAO = StateDAO()

    stateVO.stateName = request.form['stateName']
    stateVO.stateDescription = request.form['stateDescription']
    stateVO.stateId = request.form['stateId']

    stateDAO.updateState(stateVO)

    return redirect(url_for('viewState'))
示例#6
0
def insertState():

    stateVO = StateVO()
    stateDAO = StateDAO()

    stateVO.stateName = request.form['stateName']
    stateVO.stateDescription = request.form['stateDescription']
    stateVO.stateActiveStatus = "active"

    stateDAO.insertState(stateVO)

    return redirect(url_for('loadState'))
def loadPropertyAddress():
    if session['loginRole']!= 'user':
        return redirect(url_for('login'))

    stateDAO = StateDAO()
    cityDAO = CityDAO()
    propertyBasicDetailsDAO = PropertyBasicDetailsDAO()

    stateDict = stateDAO.searchState()
    cityDict = cityDAO.searchCity()
    propertyDict = propertyBasicDetailsDAO.getMaxId()

    return render_template('user/propertyAddress.html',cityDict=cityDict,stateDict=stateDict,propertyDict=propertyDict)
def editCity():

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

    cityDAO = CityDAO()
    stateDAO = StateDAO()

    cityVO = CityVO()
    cityVO.cityId = request.args.get('cityId')
    cityDict = cityDAO.editCity(cityVO)
    stateDict = stateDAO.searchState()

    print(cityDict)

    return render_template('admin/editCity.html',
                           cityDict=cityDict,
                           stateDict=stateDict)