Example #1
0
def userAjaxAreaUser():
    try:
        areaVO = AreaVO()

        areaDAO = AreaDAO()

        area_CityId = request.args.get('user_CityId')
        print('area_CityId::', area_CityId)

        areaVO.area_CityId = area_CityId

        ajaxUserAreaList = areaDAO.ajaxArea(areaVO)
        print('ajaxUserAreaList::', ajaxUserAreaList)

        ajaxUserAreaJson = [i.as_dict() for i in ajaxUserAreaList]
        print('ajaxUserAreaJson::', ajaxUserAreaJson)

        return jsonify(ajaxUserAreaJson)

    except Exception as ex:
        print(ex)
Example #2
0
def adminUpdateArea():
    try:
        if adminLoginSession() == 'admin':
            areaId = request.form['areaId']
            areaName = request.form['areaName']
            areaPincode = request.form['areaPincode']

            areaVO = AreaVO()
            areaDAO = AreaDAO()

            areaVO.areaId = areaId
            areaVO.areaName = areaName
            areaVO.areaPincode = areaPincode

            areaDAO.updateArea(areaVO)

            return redirect(url_for('adminViewArea'))
        else:
            adminLogoutSession()
    except Exception as ex:
        print(ex)
Example #3
0
def adminInsertArea():
    try:
        if adminLoginSession() == "admin":
            areaName = request.form['areaName']
            areaPincode = request.form['areaPincode']

            area_CityId = request.form['area_CityId']

            areaVO = AreaVO()
            areaDAO = AreaDAO()

            areaVO.areaName = areaName
            areaVO.areaPincode = areaPincode
            areaVO.area_CityId = area_CityId

            areaDAO.insertArea(areaVO)

            return redirect(url_for('adminViewArea'))
        else:
            return adminLogoutSession()
    except Exception as ex:
        print(ex)
Example #4
0
def adminEditArea():
    try:
        if adminLoginSession() == 'admin':

            areaVO = AreaVO()
            areaDAO = AreaDAO()

            areaId = request.args.get('areaId')

            areaVO.areaId = areaId

            areaVOList = areaDAO.editArea(areaVO)

            # print("=======areaVOList=======", areaVOList)

            # print("=======type of areaVOList=======", type(areaVOList))

            return render_template('admin/editArea.html',
                                   areaVOList=areaVOList)
        else:
            return adminLogoutSession()
    except Exception as ex:
        print(ex)
Example #5
0
def adminEditCrossroad():
    try:
        if adminLoginSession() == 'admin':

            crossroadVO = CrossroadVO()

            crossroadDAO = CrossroadDAO()

            areaDAO = AreaDAO()

            crossroadId = request.args.get('crossroadId')

            crossroadVO.crossroadId = crossroadId

            crossroadVOList = crossroadDAO.editCrossroad(crossroadVO)

            areaVOList = areaDAO.viewArea()

            return render_template('admin/editCrossroad.html', crossroadVOList=crossroadVOList, areaVOList=areaVOList)
        else:
            adminLogoutSession()
    except Exception as ex:
        print(ex)
Example #6
0
def adminEditArea():
    try:
        if adminLoginSession() == "admin":
            areaVO = AreaVO()

            areaDAO = AreaDAO()

            cityDAO = CityDAO()

            areaId = request.args.get('areaId')

            areaVO.areaId = areaId

            areaVOList = areaDAO.editArea(areaVO)

            cityVOList = cityDAO.viewCity()

            return render_template('admin/editArea.html',
                                   cityVOList=cityVOList,
                                   areaVOList=areaVOList)
        else:
            return adminLogoutSession()
    except Exception as ex:
        print(ex)