コード例 #1
0
def adminViewPackage():
    try:
        if adminLoginSession() == 'admin':
            packageDAO = PackageDAO()
            packageVOList = packageDAO.viewPackage()
            print("__________________", packageVOList)
            return render_template('admin/viewPackage.html',
                                   packageVOList=packageVOList)
        else:
            return adminLogoutSession()
    except Exception as ex:
        print(ex)
コード例 #2
0
def userLoadPurchase():
    try:

        if adminLoginSession() == 'user':
            packageDAO = PackageDAO()
            packageVOList = packageDAO.viewPackage()
            return render_template('user/addPurchase.html',
                                   packageVOList=packageVOList)

        else:
            adminLogoutSession()
    except Exception as ex:
        print(ex)
コード例 #3
0
def adminDeletePackage():
    try:
        if adminLoginSession() == 'admin':
            packageVO = PackageVO()

            packageDAO = PackageDAO()

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

            packageVO.packageId = packageId

            packageDAO.deletePackage(packageVO)

            return redirect(url_for('adminViewPackage'))
        else:
            adminLogoutSession()
    except Exception as ex:
        print(ex)
コード例 #4
0
def adminEditPackage():
    try:
        if adminLoginSession() == 'admin':

            packageVO = PackageVO()

            packageDAO = PackageDAO()

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

            packageVO.packageId = packageId

            packageVOList = packageDAO.editPackage(packageVO)
            return render_template('admin/editPackage.html',
                                   packageVOList=packageVOList)
        else:
            adminLogoutSession()
    except Exception as ex:
        print(ex)
コード例 #5
0
def adminInsertpackage():
    try:
        if adminLoginSession() == 'admin':
            packageName = request.form['packageName']
            packagePrice = request.form['packagePrice']
            packageDuration = request.form['packageDuration']

            packageVO = PackageVO()
            packageDAO = PackageDAO()

            packageVO.packageName = packageName
            packageVO.packagePrice = packagePrice
            packageVO.packageDuration = packageDuration

            packageDAO.insertPackage(packageVO)

            return redirect(url_for('adminViewPackage'))
        else:
            adminLogoutSession()
    except Exception as ex:
        print(ex)
コード例 #6
0
def userViewPurchase():
    try:
        if adminLoginSession() == 'user':
            purchaseDAO = PurchaseDAO()
            purchaseVO = PurchaseVO()
            packageVO = PackageVO()
            packageDAO = PackageDAO()
            purchaseVO.purchase_loginId = session['session_LoginId']
            purchaseVOList = purchaseDAO.viewUserPurchase(purchaseVO)
            print("__________________", purchaseVOList)
            purchaseDictList = [i.as_dict() for i in purchaseVOList]
            print(purchaseDictList)
            packageVO.packageId = purchaseDictList[0]['purchase_packageId']
            packageVOList = packageDAO.viewUserPackage(packageVO)
            print("__________________", packageVOList)
            return render_template('user/viewPurchase.html',
                                   purchaseVOList=purchaseVOList,
                                   packageVOList=packageVOList)
        else:
            adminLogoutSession()
    except Exception as ex:
        print(ex)