示例#1
0
    def delete(serialNumber, type):

        if (type == "DESKTOP"):
            DesktopIDTDG.delete(serialNumber)

        elif (type == "LAPTOP"):
            LaptopIDTDG.delete(serialNumber)

        elif (type == "MONITOR"):
            MonitorDisplayIDTDG.delete(serialNumber)

        elif (type == "TABLET"):
            TabletIDTDG.delete(serialNumber)
示例#2
0
    def update(itemID):
        if (type(itemID.spec) is Desktop):
            result = DesktopIDTDG.update(itemID)

        elif (type(itemID.spec) is Laptop):
            result = LaptopIDTDG.update(itemID)

        elif (type(itemID.spec) is MonitorDisplay):
            result = MonitorDisplayIDTDG.update(itemID)

        elif (type(itemID.spec) is Tablet):
            result = TabletIDTDG.update(itemID)
示例#3
0
    def unlock(type, uow):
        if (type == "DESKTOP"):
            result = DesktopIDTDG.unlock(uow)

        elif (type == "LAPTOP"):
            result = LaptopIDTDG.unlock(uow)

        elif (type == "MONITOR"):
            result = MonitorDisplayIDTDG.unlock(uow)

        elif (type == "TABLET"):
            result = TabletIDTDG.unlock(uow)

        return result
示例#4
0
    def insert(itemID):

        if (type(itemID.spec) is Desktop):
            result = DesktopIDTDG.insert(itemID)

        elif (type(itemID.spec) is Laptop):
            result = LaptopIDTDG.insert(itemID)

        elif (type(itemID.spec) is MonitorDisplay):
            result = MonitorDisplayIDTDG.insert(itemID)

        elif (type(itemID.spec) is Tablet):
            result = TabletIDTDG.insert(itemID)

        return result
示例#5
0
    def findBySerialNumber(serialNumber, itemSpecification):
        if (itemSpecification.type == "DESKTOP"):
            result = DesktopIDTDG.findBySerialNumber(serialNumber)

        elif (itemSpecification.type == "LAPTOP"):
            result = LaptopIDTDG.findBySerialNumber(serialNumber)

        elif (itemSpecification.type == "MONITOR"):
            result = MonitorDisplayIDTDG.findBySerialNumber(serialNumber)

        elif (itemSpecification.type == "TABLET"):
            result = TabletIDTDG.findBySerialNumber(serialNumber)

        return ItemID(result.get('serialNum'),
                      True if result.get('isLocked') == 1 else False,
                      itemSpecification)
示例#6
0
    def find(itemSpecification):

        itemIDList = list()
        result = []
        if (itemSpecification.type == "DESKTOP"):
            result = DesktopIDTDG.findBySpec(itemSpecification)

        elif (itemSpecification.type == "LAPTOP"):
            result = LaptopIDTDG.findBySpec(itemSpecification)

        elif (itemSpecification.type == "MONITOR"):
            result = MonitorDisplayIDTDG.findBySpec(itemSpecification)

        elif (itemSpecification.type == "TABLET"):
            result = TabletIDTDG.findBySpec(itemSpecification)

        for row in result:
            newItemID = ItemID(row.get('serialNum'),
                               True if row.get('isLocked') == 1 else False,
                               itemSpecification)
            itemIDList.append(newItemID)

        return itemIDList