def adminInsertArea():
    try:
        areaName = request.form['areaName']
        areaPincode = request.form['areaPincode']

        areaVO = AreaVO()
        areaDAO = AreaDAO()

        areaVO.areaName = areaName
        areaVO.areaPincode = areaPincode

        areaDAO.insertArea(areaVO)

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

            areaVO = AreaVO()
            areaDAO = AreaDAO()

            areaVO.areaName = areaName
            areaVO.areaPincode = areaPincode

            areaDAO.insertArea(areaVO)

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