def populateFootwearSelectionDetails():

	print(sys._getframe().f_code.co_name + ": ")

	dao = FootwearSelectionDAO(gc_connector)


	selection = "Selection"

	for i in range(1, 12+1):
		entry = (i,
				 selection+str(i),
				 None)
		dao.createAnEntry(entry)

	print(dao.selectAllEntries())

	print("===================================================")
	print("Testing populateFootwearSelectionDetails-------------------complete\n\n\n")
Example #2
0
	def getSecondPageInfo(self, selection):

		dbConnect = DbConnect(FootwearSelectionDAO.getDbDir())
		connector = dbConnect.getConnection()

		footwearSelectionDAO = FootwearSelectionDAO(connector)
		footwearSelectionPriKeys = footwearSelectionDAO.getPriKeys("Selection", selection)

		retVal = list()

		barcodeDAO = BarcodeDAO(connector)
		for footwearSelectionPriKey in footwearSelectionPriKeys:
			entries = barcodeDAO.selectEntries("FootwearSelectionDetailsFk", footwearSelectionPriKey)

			barcodePriKey = entries[0]

			inventoryDAO = InventoryDAO(connector)
			inventories = inventoryDAO.getPriKeys("BarcodeDetailsFk", barcodePriKey)

			for entry in entries:
				retVal.append((entry[1], entry[3], entry[4], entry[5], entry[6], len(inventories) ) )

		return retVal
Example #3
0
	def getFirstPageInfo(self):

		dbConnect = DbConnect(FootwearSelectionDAO.getDbDir())
		connector = dbConnect.getConnection()

		footwearSelectionDAO = FootwearSelectionDAO(connector)

		selections = footwearSelectionDAO.selectDistinct("Selection")

		queryResult = list()
		for selection in selections:

			footwearDesigns = list()

			for entry in footwearSelectionDAO.selectEntries("Selection", selection):
				footwearDesigns.append(entry[1])

			for footwearDesign in footwearDesigns:
				footwearDesignDAO = FootwearDesignDAO(connector)
				entry = footwearDesignDAO.selectAnEntry(footwearDesign)

				queryResult.append((selection, entry[1], entry[2], entry[3], entry[4]))

		return queryResult
Example #4
0
	def numItemsAvailable(self, barcode):
		dbConnect = DbConnect(FootwearSelectionDAO.getDbDir())
		connector = dbConnect.getConnection()

		return self.__numItemsAvailable(connector, barcode)