def bloodBankEditProfile(): try: if adminLoginSession() == "bloodbank": cityDAO = CityDAO() cityVOList = cityDAO.viewCity() print(cityVOList) areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() loginId = session['session_loginId'] bloodBankDAO = BloodBankDAO() bloodBankVOList = bloodBankDAO.getBloodbankData(loginId) bloodBankVOAllList = bloodBankDAO.getBloodBank(loginId) return render_template('bloodbank/editProfile.html', areaVOList=areaVOList, cityVOList=cityVOList, bloodBankVOList=bloodBankVOList, bloodBankVOAllList=bloodBankVOAllList) else: return adminLogoutSession() except Exception as ex: print(ex)
def userLoadAppointment(): try: if adminLoginSession() == "user": cityDAO = CityDAO() cityVOList = cityDAO.viewCity() areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() bloodBankDAO = BloodBankDAO() bloodBankVOList = bloodBankDAO.viewAdminBloodBank() bloodGroupDAO = BloodGroupDAO() bloodGroupVOList = bloodGroupDAO.viewBloodGroup() timeSlotDAO = TimeSlotDAO() timeSlotVOList = timeSlotDAO.viewTimeSlot() return render_template('user/addAppointment.html', cityVOList=cityVOList, areaVOList=areaVOList, bloodBankVOList=bloodBankVOList, bloodGroupVOList=bloodGroupVOList, timeSlotVOList=timeSlotVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def userEditProfile(): try: if adminLoginSession() == "user": areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() print(areaVOList) cityDAO = CityDAO() cityVOList = cityDAO.viewCity() print(cityVOList) bloodGroupDAO = BloodGroupDAO() bloodGroupVOList = bloodGroupDAO.viewBloodGroup() print(bloodGroupVOList) userDAO = UserDAO() loginId = session['session_loginId'] userVOList = userDAO.getUserData(loginId) userVOAllList = userDAO.getUserAllData(loginId) print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") print(userVOList) return render_template('user/editProfile.html', userVOList=userVOList, userVOAllList=userVOAllList, areaVOList=areaVOList, cityVOList=cityVOList, bloodGroupVOList=bloodGroupVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def viewCity(): if session['loginRole'] != 'admin': return render_template('admin/login.html') cityDAO = CityDAO() cityDict = cityDAO.searchCity() return render_template('admin/viewCity.html', cityDict=cityDict)
def adminLoadArea(): try: if adminLoginSession() == "admin": cityDAO = CityDAO() cityVOList = cityDAO.viewCity() return render_template('admin/addArea.html', cityVOList=cityVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
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 bloodbankLoadBloodBank(): try: cityDAO = CityDAO() cityVOList = cityDAO.viewCity() print(cityVOList) areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() return render_template('bloodbank/register.html', areaVOList=areaVOList, cityVOList=cityVOList) except Exception as ex: print(ex)
def updateCity(): if session['loginRole'] != 'admin': return redirect(url_for('login')) cityDAO = CityDAO() cityVO = CityVO() cityVO.cityName = request.form['cityName'] cityVO.cityDescription = request.form['cityDescription'] cityVO.city_StateId = request.form['stateId'] cityVO.cityId = request.form['cityId'] cityDAO.updateCity(cityVO) return redirect(url_for('viewCity'))
def insertCity(): if session['loginRole'] != 'admin': return redirect(url_for('login')) cityDAO = CityDAO() cityVO = CityVO() cityVO.cityName = request.form['cityName'] cityVO.cityDescription = request.form['cityDescription'] cityVO.city_StateId = request.form['stateId'] cityVO.cityActiveStatus = 'active' cityDAO.insertCity(cityVO) return redirect(url_for('loadCity'))
def adminDeleteCity(): try: if adminLoginSession() == "admin": cityVO = CityVO() cityDAO = CityDAO() cityId = request.args.get('cityId') cityVO.cityId = cityId cityDAO.deleteCity(cityVO) return redirect(url_for('adminViewCity')) else: return adminLogoutSession() except Exception as ex: print(ex)
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)
def adminInsertCity(): try: if adminLoginSession() == "admin": cityName = request.form['cityName'] cityDescription = request.form['cityDescription'] cityVO = CityVO() cityDAO = CityDAO() cityVO.cityName = cityName cityVO.cityDescription = cityDescription cityDAO.insertCity(cityVO) return redirect(url_for('adminViewCity')) else: return adminLogoutSession() except Exception as ex: print(ex)
def userLoadUser(): try: areaDAO = AreaDAO() areaVOList = areaDAO.viewArea() print(areaVOList) cityDAO = CityDAO() cityVOList = cityDAO.viewCity() print(cityVOList) bloodGroupDAO = BloodGroupDAO() bloodGroupVOList = bloodGroupDAO.viewBloodGroup() print(bloodGroupVOList) return render_template('user/register.html', areaVOList=areaVOList, cityVOList=cityVOList, bloodGroupVOList=bloodGroupVOList) except Exception as ex: print(ex)
def adminEditCity(): try: if adminLoginSession() == "admin": cityVO = CityVO() cityDAO = CityDAO() cityId = request.args.get('cityId') cityVO.cityId = cityId cityVOList = cityDAO.editCity(cityVO) print("=======cityVOList=======", cityVOList) print("=======type of cityVOList=======", type(cityVOList)) return render_template('admin/editCity.html', cityVOList=cityVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
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)