def adminDeleteArea():
    try:
        areaVO = AreaVO()

        areaDAO = AreaDAO()

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

        areaVO.areaId = areaId

        areaDAO.deleteArea(areaVO)

        return redirect(url_for('adminViewArea'))
    except Exception as ex:
        print(ex)
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)
Beispiel #3
0
def userAjaxAreaAppointment():
    try:
        areaVO = AreaVO()
        areaDAO = AreaDAO()

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

        areaVO.area_CityId = area_CityId

        ajaxBloodBankAreaList = areaDAO.ajaxArea(areaVO)

        ajaxBloodBankAreaJson = [i.as_dict() for i in ajaxBloodBankAreaList]

        return jsonify(ajaxBloodBankAreaJson)

    except Exception as ex:
        print(ex)
Beispiel #4
0
def adminDeleteArea():
    try:
        if adminLoginSession() == 'admin':

            areaVO = AreaVO()
            areaDAO = AreaDAO()

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

            areaVO.areaId = areaId

            areaDAO.deleteArea(areaVO)

            return redirect(url_for('adminViewArea'))
        else:
            return adminLogoutSession()
    except Exception as ex:
        print(ex)
Beispiel #5
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)
def adminEditArea():
    try:
        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)
    except Exception as ex:
        print(ex)
Beispiel #7
0
def adminEditArea():
    try:
        if adminLoginSession() == 'admin':
            areaVO = AreaVO()

            areaDAO = AreaDAO()

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

            areaVO.areaId = areaId

            areaVOList = areaDAO.editArea(areaVO)

            return render_template('admin/editArea.html',
                                   areaVOList=areaVOList)
        else:
            adminLogoutSession()

    except Exception as ex:
        print(ex)
Beispiel #8
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)
Beispiel #9
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)
Beispiel #10
0
def adminUpdateArea():
    try:
        if adminLoginSession() == "admin":
            areaName = request.form['areaName']
            areaPincode = request.form['areaPincode']
            area_CityId = request.form['area_CityId']
            areaId = request.form['areaId']

            areaVO = AreaVO()
            areaDAO = AreaDAO()

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

            areaDAO.updateArea(areaVO)

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