Ejemplo n.º 1
0
def userInsertPurchase():
    try:
        if adminLoginSession() == 'user':
            purchase_LoginId = session.get('session_loginId')
            purchase_PackageId = request.args.get('packageId')

            purchaseDate = date.today()
            print(purchaseDate)

            purchaseTime = datetime.now().strftime("%H:%M:%S")
            print(purchaseTime)

            purchaseVO = PurchaseVO()
            purchaseDAO = PurchaseDAO()

            purchaseVO.purchaseDate = purchaseDate
            purchaseVO.purchaseTime = purchaseTime
            purchaseVO.purchase_LoginId = purchase_LoginId
            purchaseVO.purchase_PackageId = purchase_PackageId

            purchaseDAO.insertPurchase(purchaseVO)

            return redirect(url_for('userViewPurchase'))
        else:
            return redirect(url_for('adminLogoutSession'))
    except Exception as ex:
        print(ex)
Ejemplo n.º 2
0
def userinsertPurchase():
    try:
        if adminLoginSession() == 'user':

            purchaseVO = PurchaseVO()
            purchaseDAO = PurchaseDAO()

            purchase_LoginId = session['session_loginId']
            purchaseDate = datetime.date(datetime.now())
            purchaseTime = datetime.time(datetime.now())
            purchase_PackageId = request.args.get('purchase_PackageId')

            purchaseVO.purchase_LoginId = purchase_LoginId
            purchaseVO.purchaseDate = purchaseDate
            purchaseVO.purchaseTime = purchaseTime
            purchaseVO.purchase_PackageId = purchase_PackageId

            purchaseDAO.insertPurchase(purchaseVO)

            return redirect(url_for('userViewPurchase'))

        else:
            return adminLogoutSession()

    except Exception as ex:
        print(ex)
def userViewPurchase():
    try:
        purchaseDAO = PurchaseDAO()
        purchaseVO = PurchaseVO()

        purchaseVO.purchase_LoginId = session['session_loginId']
        purchaseVOList = purchaseDAO.viewUserPurchase(purchaseVO)
        print("__________________", purchaseVOList)
        return render_template('user/viewPurchase.html',
                               purchaseVOList=purchaseVOList)

    except Exception as ex:
        print(ex)
Ejemplo n.º 4
0
def userViewPurchase():
    try:
        if adminLoginSession() == 'user':
            purchaseDAO = PurchaseDAO()
            purchaseVO = PurchaseVO()

            purchase_LoginId = session.get('session_loginId')

            purchaseVO.purchase_LoginId = purchase_LoginId

            purchaseVOList = purchaseDAO.userViewPurchase(purchaseVO)

            return render_template('user/viewPurchase.html', purchaseVOList=purchaseVOList)
        else:
            return adminLogoutSession()
    except Exception as ex:
        print(ex)
Ejemplo n.º 5
0
def adminViewPurchase():
    try:
        if adminLoginSession() == 'admin':
            purchaseDAO = PurchaseDAO()
            purchaseVO = PurchaseVO()
            loginVO = LoginVO()

            purchase_LoginId = session['session_loginId']
            purchaseVO.purchase_LoginId = purchase_LoginId

            purchaseVOList = purchaseDAO.viewPurchase_Admin()
            return render_template('admin/viewPurchase.html', purchaseVOList=purchaseVOList)

        else:
            return adminLogoutSession()

    except Exception as ex:
        print(ex)
Ejemplo n.º 6
0
def userViewPurchase():
    try:
        if adminLoginSession() == 'user':
            purchaseDAO = PurchaseDAO()
            purchaseVO = PurchaseVO()

            purchase_PackageId = request.args.get('purchase_PackageId')
            purchaseVO.purchase_PackageId = purchase_PackageId
            purchase_LoginId = session['session_loginId']
            purchaseVO.purchase_LoginId = purchase_LoginId

            purchaseVOList = purchaseDAO.viewPurchase_User()
            return render_template('user/viewPurchase.html', purchaseVOList=purchaseVOList)

        else:
            return adminLogoutSession()

    except Exception as ex:
        print(ex)
def userInsertpurchase():
    try:
        print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
        packageVO = PackageVO()
        purchaseDate = date.today()
        purchaseTime = datetime.now().strftime("%H:%M:%S")

        packageId = request.form['packageId']
        print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", packageId)
        purchaseVO = PurchaseVO()
        purchaseDAO = PurchaseDAO()

        purchaseVO.purchaseDate = purchaseDate
        purchaseVO.purchaseTime = purchaseTime
        purchaseVO.purchase_PackageId = packageId
        purchaseVO.purchase_LoginId = session['session_loginId']

        purchaseDAO.insertPurchase(purchaseVO)

        return redirect(url_for('userViewPurchase'))
    except Exception as ex:
        print(ex)