示例#1
0
	def generateBarcode(self, cTypeID, cSizeID, contNum, cLab):
		
		db = self.db
		cursor = self.cursor	# for easy access
		
		# Get the lab code that corresponds to lab ID
		lHandler = LabHandler(db, cursor)
		labCode = lHandler.findLabCode(cLab)
		
		ltHandler = LocationTypeHandler(db, cursor)
		
		# Find the container size
		contSize = ltHandler.findNumContainerSamples(cSizeID)
		
		# Find the container group code
		contTypeCode = ltHandler.findContainerTypeCode(cTypeID)

		# Produce a string barcode
		barcode = labCode + `contSize` + contTypeCode + `contNum`
		
		return barcode