def adminEditCrossroad():
    try:
        if LoginSession() == 'admin':
            areaDAO = AreaDAO()
            areaVOList = areaDAO.viewArea()
            crossroadVO = CrossroadVO()

            crossroadDAO = CrossroadDAO()

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

            crossroadVO.CrossroadId = crossroadId

            crossroadVOList = crossroadDAO.editCrossroad(crossroadVO)

            print("=======crossroadVOList=======", crossroadVOList)

            print("=======type of crossroadVOList=======",
                  type(crossroadVOList))

            return render_template('Admin/AddCrossroad.html',
                                   crossroadVOList=crossroadVOList,
                                   areaVOList=areaVOList)
        else:
            return redirect(url_for('LogoutSession'))
    except Exception as ex:
        print(ex)
def AdminLoadCrossroad():
    try:
        if LoginSession() == 'admin':
            areaDAO = AreaDAO()
            areaVOList = areaDAO.viewArea()
            return render_template('Admin/AddCrossroad.html',
                                   areaVOList=areaVOList)
        else:
            return redirect(url_for('LogoutSession'))

    except Exception as ex:
        print(ex)
Ejemplo n.º 3
0
def adminViewArea():
    try:
        if LoginSession() == 'admin':
            areaDAO = AreaDAO()
            areaVOList = areaDAO.viewArea()
            print("__________________", areaVOList)
            return render_template('Admin/ViewArea.html',
                                   areaVOList=areaVOList)
        else:
            return redirect(url_for('LogoutSession'))
    except Exception as ex:
        print(ex)
Ejemplo n.º 4
0
def adminDeleteArea():
    try:
        if LoginSession() == 'admin':
            areaVO = AreaVO()

            areaDAO = AreaDAO()

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

            areaVO.AreaId = areaId

            areaDAO.deleteArea(areaVO)

            return redirect(url_for('adminViewArea'))
        else:
            return redirect(url_for('LogoutSession'))
    except Exception as ex:
        print(ex)
Ejemplo n.º 5
0
def adminInsertArea():
    try:
        if LoginSession() == 'admin':
            areaname = request.form['areaname']
            pincode = request.form['pincode']

            areaVO = AreaVO()
            areaDAO = AreaDAO()

            areaVO.AreaName = areaname
            areaVO.PinCode = pincode

            areaDAO.insertArea(areaVO)
            #        return render_template('User/login.html')
            return redirect(url_for('adminViewArea'))
        else:
            return redirect(url_for('LogoutSession'))
    except Exception as ex:
        print(ex)
Ejemplo n.º 6
0
def adminUpdateArea():
    try:
        if LoginSession() == 'admin':
            areaId = request.form['AreaId']
            areaname = request.form['areaname']
            pincode = request.form['pincode']

            areaVO = AreaVO()
            areaDAO = AreaDAO()

            areaVO.AreaId = areaId
            areaVO.AreaName = areaname
            areaVO.PinCode = pincode

            areaDAO.updateArea(areaVO)

            return redirect(url_for('adminViewArea'))
        else:
            return redirect(url_for('LogoutSession'))
    except Exception as ex:
        print(ex)
Ejemplo n.º 7
0
def adminEditArea():
    try:
        if LoginSession() == 'admin':
            print()
            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/AddArea.html', areaVOList=areaVOList)
        else:
            return redirect(url_for('LogoutSession'))
    except Exception as ex:
        print(ex)