def adminDeleteCropType(): try: if adminLoginSession() == 'admin': cropTypeVO = CropTypeVO() cropTypeDAO = CropTypeDAO() cropTypeId = request.args.get('cropTypeId') print(cropTypeId) cropTypeVO.cropTypeId = cropTypeId cropTypeDAO.deleteCropType(cropTypeVO) return redirect(url_for('adminViewCropType')) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminInsertCropType(): try: if adminLoginSession() == 'admin': cropTypeName = request.form['cropTypeName'] cropTypeDescription = request.form['cropTypeDescription'] cropTypeVO = CropTypeVO() cropTypeDAO = CropTypeDAO() cropTypeVO.cropTypeName = cropTypeName cropTypeVO.cropTypeDescription = cropTypeDescription cropTypeDAO.insertCropType(cropTypeVO) return redirect(url_for('adminViewCropType')) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminEditCropType(): try: if adminLoginSession() == 'admin': cropTypeVO = CropTypeVO() cropTypeDAO = CropTypeDAO() cropTypeId = request.args.get('cropTypeId') cropTypeVO.cropTypeId = cropTypeId cropTypeVOList = cropTypeDAO.editCropType(cropTypeVO) return render_template('admin/editCropType.html', cropTypeVOList=cropTypeVOList) else: return adminLogoutSession() except Exception as ex: print(ex)
def adminUpdateCropType(): try: if adminLoginSession() == 'admin': if request.method == 'POST': cropTypeId = request.form['cropTypeId'] cropTypeName = request.form['cropTypeName'] cropTypeDescription = request.form['cropTypeDescription'] cropTypeVO = CropTypeVO() cropTypeDAO = CropTypeDAO() cropTypeVO.cropTypeId = cropTypeId cropTypeVO.cropTypeName = cropTypeName cropTypeVO.cropTypeDescription = cropTypeDescription cropTypeDAO.updateCropType(cropTypeVO) return redirect(url_for('adminViewCropType')) else: return adminLogoutSession() except Exception as ex: print(ex)