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)
def adminUpdatePurchase(): try: if adminLoginSession() == 'admin': purchaseDate = date.today() purchaseTime = datetime.now().strftime("%H:%M:%S") purchase_loginId = session['session_LoginId'] packageId = request.form['packageId'] purchaseId = request.form['purchaseId'] purchaseVO = PurchaseVO() purchaseDAO = PurchaseDAO() purchaseVO.purchaseId = purchaseId purchaseVO.purchaseDate = purchaseDate purchaseVO.purchaseTime = purchaseTime purchaseVO.purchase_loginId = purchase_loginId purchaseVO.purchase_packageId = packageId purchaseDAO.insertPurchase(purchaseVO) purchaseDAO.updatePurchase(purchaseVO) return redirect(url_for('adminViewPurchase')) else: adminLogoutSession() except Exception as ex: print(ex)
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 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)